Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Gulp to copy files instead of cpy #4560

Merged
merged 4 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 0 additions & 192 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions packages/govuk-frontend-review/tasks/watch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export const watch = (options) =>
*/
task.name('lint:scss watch', () =>
gulp.watch(
[join(options.srcPath, '**/*.scss')],
'**/*.scss',
{ cwd: options.srcPath },

// Run Stylelint checks
npm.script('lint:scss:cli', [
Expand All @@ -36,10 +37,8 @@ export const watch = (options) =>
*/
task.name('compile:scss watch', () =>
gulp.watch(
[
join(options.srcPath, '**/*.scss'),
join(paths.package, 'dist/govuk/all.scss')
],
['**/*.scss', join(paths.package, 'dist/govuk/all.scss')],
{ cwd: options.srcPath },

// Run Sass compile
styles(options)
Expand All @@ -51,8 +50,8 @@ export const watch = (options) =>
*/
task.name('lint:js watch', () =>
gulp.watch(
join(options.srcPath, '**/*.{cjs,js,mjs}'),
{ ignored: ['**/*.test.*'] },
'**/*.{cjs,js,mjs}',
{ cwd: options.srcPath, ignored: ['**/*.test.*'] },
gulp.parallel(
// Run TypeScript compiler
npm.script('build:types', ['--incremental', '--pretty'], options),
Expand All @@ -70,7 +69,8 @@ export const watch = (options) =>
*/
task.name('compile:js watch', () =>
gulp.watch(
[join(options.srcPath, 'javascripts/**/*.mjs')],
'javascripts/**/*.mjs',
{ cwd: options.srcPath },

// Run JavaScripts compile
scripts(options)
Expand Down
14 changes: 7 additions & 7 deletions packages/govuk-frontend/tasks/assets.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { join } from 'path'

import { files, task } from '@govuk-frontend/tasks'
import { task } from '@govuk-frontend/tasks'
import gulp from 'gulp'

/**
Expand All @@ -11,9 +9,11 @@ import gulp from 'gulp'
export const assets = (options) =>
gulp.series(
task.name('copy:assets', () =>
files.copy('**/*', {
srcPath: join(options.srcPath, 'govuk/assets'),
destPath: join(options.destPath, 'govuk/assets')
})
gulp
.src('govuk/assets/**/*', {
base: options.srcPath,
cwd: options.srcPath
})
.pipe(gulp.dest(options.destPath))
)
)
14 changes: 7 additions & 7 deletions packages/govuk-frontend/tasks/build/package.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { join } from 'path'

import { paths } from '@govuk-frontend/config'
import { files, npm, task } from '@govuk-frontend/tasks'
import { npm, task } from '@govuk-frontend/tasks'
import gulp from 'gulp'

import { assets, fixtures, scripts, styles, templates } from '../index.mjs'
Expand All @@ -25,9 +23,11 @@ export default (options) =>

// Copy GOV.UK Prototype Kit JavaScript
task.name("copy:files 'govuk-prototype-kit'", () =>
files.copy('**/*.js', {
srcPath: join(options.srcPath, 'govuk-prototype-kit'),
destPath: join(options.destPath, 'govuk-prototype-kit')
})
gulp
.src('govuk-prototype-kit/**/*.js', {
base: options.srcPath,
cwd: options.srcPath
})
.pipe(gulp.dest(options.destPath))
)
)
10 changes: 6 additions & 4 deletions packages/govuk-frontend/tasks/build/release.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ export default (options) =>

// Copy GOV.UK Frontend static assets
task.name('copy:assets', () =>
files.copy('**/*', {
srcPath: join(options.srcPath, 'govuk/assets'),
destPath: join(options.destPath, 'assets')
})
gulp
.src('govuk/assets/**/*', {
base: join(options.srcPath, 'govuk'),
cwd: options.srcPath
})
.pipe(gulp.dest(options.destPath))
),

// Compile GOV.UK Frontend JavaScript
Expand Down
14 changes: 7 additions & 7 deletions packages/govuk-frontend/tasks/templates.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { join } from 'path'

import { files, task } from '@govuk-frontend/tasks'
import { task } from '@govuk-frontend/tasks'
import gulp from 'gulp'

/**
Expand All @@ -11,9 +9,11 @@ import gulp from 'gulp'
export const templates = (options) =>
gulp.series(
task.name('copy:templates', () =>
files.copy('**/*.{md,njk}', {
srcPath: join(options.srcPath, 'govuk'),
destPath: join(options.destPath, 'govuk')
})
gulp
.src('govuk/**/*.{md,njk}', {
base: options.srcPath,
cwd: options.srcPath
})
.pipe(gulp.dest(options.destPath))
)
)
Loading