Publish: fix Docker build failing because of Playwright, and make a convenience npm task for it

This commit is contained in:
Ronan Jouchet 2022-05-02 00:27:58 -04:00
parent 8bbc7cacbd
commit 334cbe28a5
4 changed files with 10 additions and 7 deletions

View File

@ -75,4 +75,4 @@ jobs:
- env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: npm ci --no-fund # Will also (via `prepare` hook): 1. install ./app, 2. build
- run: npm run test -- --testPathIgnorePatterns ".*playwright.*"
- run: npm run test:noplaywright

View File

@ -26,7 +26,7 @@ jobs:
node-version: '18' # Align the version of Node here with ci.yml.
registry-url: 'https://registry.npmjs.org'
- run: npm ci --no-fund # Will also (via `prepare` hook): 1. install ./app, 2. build
- run: npm run test -- --testPathIgnorePatterns ".*playwright.*"
- run: npm run test:noplaywright
- run: npm run lint
- run: npm publish
env:

View File

@ -32,7 +32,7 @@ RUN find ./icon-scripts ./src ./app -type f -print0 | xargs -0 dos2unix
# Cleanup leftover files in this step to not waste Docker layer space
# Make sure nativefier is executable
RUN npm link \
&& npm test \
&& npm run test:noplaywright \
&& rm -rf /tmp/nativefier* ~/.npm/_cacache ~/.cache/electron \
&& chmod +x $NPM_PACKAGES/bin/nativefier

View File

@ -1,6 +1,6 @@
{
"name": "nativefier",
"version": "47.1.1",
"version": "47.0.0",
"description": "Wrap web apps natively",
"license": "MIT",
"author": "Goh Jia Hao",
@ -43,10 +43,13 @@
"lint": "eslint shared app src --ext .ts",
"list-outdated-deps": "npm out; cd app && npm out; true",
"prepare": "cd app && npm ci && cd .. && npm run build",
"relock": "rm -rf ./node_modules/ ./app/node_modules/ ./npm-shrinkwrap.json ./app/npm-shrinkwrap.json && npm install --ignore-scripts --package-lock && mv package-lock.json npm-shrinkwrap.json && npm out; cd app && npm install --ignore-scripts --package-lock && mv package-lock.json npm-shrinkwrap.json && npm out",
"relock:cli": "rm -rf ./node_modules/ ./npm-shrinkwrap.json && npm install --ignore-scripts --package-lock && mv package-lock.json npm-shrinkwrap.json && npm out",
"relock:app": "rm -rf ./app/node_modules/ ./app/npm-shrinkwrap.json && cd app && npm install --ignore-scripts --package-lock && mv package-lock.json npm-shrinkwrap.json && npm out",
"relock": "npm run relock:cli; npm run relock:app",
"test:integration": "jest --testRegex '.*integration-test.js'",
"test:manual": "npm run build && bash .github/manual-test",
"test:playwright": "jest --detectOpenHandles --testRegex '.*playwright-test.js'",
"test:noplaywright": "jest --testRegex '[-.]test\\.js$' --testPathIgnorePatterns '.*playwright.*'",
"test:unit": "jest",
"test:watch": "echo 'Remember to run npm run build:watch for the test watcher to work!' && jest --watchAll --collectCoverage=false",
"test:withlog": "LOGLEVEL=trace npm run test",
@ -69,10 +72,10 @@
"yargs": "^17.1.1"
},
"devDependencies": {
"@jest/types": "^28.0.2",
"@types/debug": "^4.1.6",
"@types/fs-extra": "^9.0.13",
"@types/hasbin": "^1.2.0",
"@types/jest": "^27.0.1",
"@types/ncp": "^2.0.5",
"@types/node": "14.14.20",
"@types/page-icon": "^0.3.4",
@ -83,7 +86,7 @@
"eslint": "^8.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^27.0.6",
"jest": "^28.0.3",
"playwright": "^1.21.1",
"prettier": "^2.3.2",
"rimraf": "^3.0.2",