diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..63c7d8e --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,20 @@ +name: Publish to NPM + +on: + release: + types: + - published + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - run: npm ci + - run: npm publish ${IS_PRERELEASE:+--tag=prerelease} + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} + IS_PRERELEASE: ${{github.event.release.prerelease}} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..323507e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# NHS App Frontend Changelog + +## 0.1.0-alpha.0 (Prerelease) - 18 April 2024 + +:tada: **Initial release of the NHS App Frontend** diff --git a/gulpfile.js b/gulpfile.js index 5b656e0..7ca7cdf 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -17,13 +17,14 @@ function clean() { /* Build the CSS from source */ function compileCSS() { return gulp - .src(['src/nhsapp.scss']) + .src(['src/all.scss']) .pipe(sass()) .on('error', (err) => { console.log(err) throw new Error(err) }) - .pipe(gulp.dest('dist/')) + .pipe(rename('nhsapp.css')) + .pipe(gulp.dest('dist')) } /* Minify CSS and add a min.css suffix */ @@ -50,10 +51,10 @@ function copyAssets() { } /** - * Copy nunjucks templates into a namespaced folder + * Copy nunjucks and source scss files into a namespaced directory */ -function copyNunjucks() { - return gulp.src('src/**/*.njk').pipe(gulp.dest('dist/nhsapp')) +function copySource() { + return gulp.src('src/**/*').pipe(gulp.dest('dist/nhsapp')) } /* Recompile CSS when there are any changes */ @@ -71,7 +72,7 @@ const bundle = gulp.series([ compileCSS, minifyCSS, copyAssets, - copyNunjucks + copySource ]) export { clean, bundle, compileCSS } diff --git a/package-lock.json b/package-lock.json index 8789c37..e23e30d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,16 @@ { "name": "nhsapp-frontend", - "version": "0.0.2", + "version": "0.1.0-alpha.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nhsapp-frontend", - "version": "0.0.2", + "version": "0.1.0-alpha.0", "license": "MIT", + "dependencies": { + "nhsuk-frontend": "^8.1.1" + }, "devDependencies": { "@11ty/eleventy": "3.0.0-alpha.6", "concurrently": "^8.2.2", @@ -20,7 +23,6 @@ "gulp-rename": "^2.0.0", "gulp-sass": "^5.1.0", "gulp-uglify": "^3.0.2", - "nhsuk-frontend": "^8.1.1", "nunjucks": "^3.2.4", "prettier": "^3.2.5", "sass": "^1.74.1" @@ -3264,8 +3266,7 @@ "node_modules/nhsuk-frontend": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/nhsuk-frontend/-/nhsuk-frontend-8.1.1.tgz", - "integrity": "sha512-w+2ovXA8kQgR8YImqufx+cgqkmDjFUcW+VhHhgfBWBRjSPbAghUjlpIbkh6L7KCX0NI4xafOtSRV0+hL7viG6g==", - "dev": true + "integrity": "sha512-w+2ovXA8kQgR8YImqufx+cgqkmDjFUcW+VhHhgfBWBRjSPbAghUjlpIbkh6L7KCX0NI4xafOtSRV0+hL7viG6g==" }, "node_modules/node-retrieve-globals": { "version": "5.0.0", diff --git a/package.json b/package.json index b8a7cfc..b0c9386 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,11 @@ { "name": "nhsapp-frontend", - "version": "0.0.2", + "version": "0.1.0-alpha.0", "description": "A CSS library built on top of nhsuk-frontend providing styles for the NHS App.", "main": "index.js", "type": "module", "files": [ - "dist", - "src" + "dist" ], "scripts": { "prepack": "gulp bundle", @@ -40,9 +39,11 @@ "gulp-rename": "^2.0.0", "gulp-sass": "^5.1.0", "gulp-uglify": "^3.0.2", - "nhsuk-frontend": "^8.1.1", "nunjucks": "^3.2.4", "prettier": "^3.2.5", "sass": "^1.74.1" + }, + "dependencies": { + "nhsuk-frontend": "^8.1.1" } } diff --git a/src/nhsapp.scss b/src/all.scss similarity index 100% rename from src/nhsapp.scss rename to src/all.scss