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

NPM publishing #44

Merged
merged 5 commits into from
Apr 18, 2024
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
20 changes: 20 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -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}}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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**
13 changes: 7 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 */
Expand All @@ -71,7 +72,7 @@ const bundle = gulp.series([
compileCSS,
minifyCSS,
copyAssets,
copyNunjucks
copySource
])

export { clean, bundle, compileCSS }
11 changes: 6 additions & 5 deletions package-lock.json

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

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
}
}
File renamed without changes.