From a2f2acf8982e1e8833070dfe36ceddab54222886 Mon Sep 17 00:00:00 2001 From: Ryan Block Date: Mon, 29 Apr 2024 10:53:28 -0700 Subject: [PATCH 1/4] Update PR template --- .github/pull_request_template.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f10341d..70103c1 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,7 +4,7 @@ To maintain a high standard of quality in our releases, before merging every pull request we ask that you've completed the following: -- [ ] Forked the repo and created your branch from `master` +- [ ] Forked the repo and created your branch from `main` - [ ] Made sure tests pass (run `npm it` from the repo root) - [ ] Expanded test coverage related to your changes: - [ ] Added and/or updated unit tests (if appropriate) @@ -15,7 +15,7 @@ To maintain a high standard of quality in our releases, before merging every pul - [ ] Summarized your changes in `changelog.md` - [ ] Linked to any related issues, PRs, etc. below that may relate to, consume, or necessitate these changes -Please also be sure to completed the CLA (if you haven't already). +Please also be sure to completed the CLA. If you haven't already, you'll be prompted to do so after submitting your PR. Learn more about [contributing to Architect here](https://arc.codes/intro/community). From 67389fcca4b54f2c99bd32b3f46175286b0b5172 Mon Sep 17 00:00:00 2001 From: Ryan Block Date: Mon, 29 Apr 2024 10:56:44 -0700 Subject: [PATCH 2/4] Update deps and changelog, upgrade to ESLint v9 --- .eslintignore | 3 --- changelog.md | 8 ++++++++ eslint.config.js | 12 ++++++++++++ package.json | 10 +++++----- 4 files changed, 25 insertions(+), 8 deletions(-) delete mode 100644 .eslintignore create mode 100644 eslint.config.js diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index f380a22..0000000 --- a/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -coverage -node_modules -test/mock/src diff --git a/changelog.md b/changelog.md index 79d473f..fff1dc1 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,14 @@ --- +## [4.0.5] 2024-03-25 + +### Changed + +- Updated dependencies + +--- + ## [4.0.4] 2024-03-25 ### Changed diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..8fcd103 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,12 @@ +const arc = require('@architect/eslint-config') + +module.exports = [ + ...arc, + { + ignores: [ + 'coverage', + 'node_modules', + 'test/mock/src', + ], + }, +] diff --git a/package.json b/package.json index 2215b40..f804074 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,9 @@ "author": "Brian LeRoux ", "license": "Apache-2.0", "dependencies": { - "@aws-lite/client": "^0.20.0", + "@aws-lite/client": "^0.21.1", "chalk": "4.1.2", - "glob": "~10.3.10", + "glob": "~10.3.12", "path-sort": "~0.1.0", "restore-cursor": "3.1.0", "run-series": "~1.1.9", @@ -30,10 +30,10 @@ "sha": "~3.0.0" }, "devDependencies": { - "@architect/eslint-config": "~2.1.2", - "@architect/inventory": "~4.0.3", + "@architect/eslint-config": "~3.0.0", + "@architect/inventory": "~4.0.4", "cross-env": "~7.0.3", - "eslint": "~8.57.0", + "eslint": "~9.1.1", "proxyquire": "~2.1.3", "sinon": "~17.0.1", "tap-arc": "1.1.0", From 663d38512101b6129b83cd36f6848279bc6efbfd Mon Sep 17 00:00:00 2001 From: Ryan Block Date: Mon, 29 Apr 2024 10:57:58 -0700 Subject: [PATCH 3/4] Update CI --- .github/workflows/build.yml | 15 +++++++++++---- chars/index.js | 2 +- package.json | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30ce786..bc16cf0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,10 +21,10 @@ jobs: # Go steps: - name: Check out repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} @@ -40,7 +40,14 @@ jobs: - name: Install run: npm install + - name: Test (Node.js <= 16.x) + if: matrix.node-version <= '16.x' + run: npm run test:nolint + env: + CI: true + - name: Test + if: matrix.node-version > '16.x' run: npm test env: CI: true @@ -67,10 +74,10 @@ jobs: # Go steps: - name: Check out repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: lts/* registry-url: https://registry.npmjs.org/ diff --git a/chars/index.js b/chars/index.js index 6d88f92..7f49163 100644 --- a/chars/index.js +++ b/chars/index.js @@ -29,5 +29,5 @@ module.exports = { start, done, warn, - err + err, } diff --git a/package.json b/package.json index f804074..2c21ea6 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "url": "git+https://github.com/architect/utils.git" }, "scripts": { + "test:nolint": "npm run test:unit:updater && npm run test:unit", "test": "npm run lint && npm run test:unit:updater && npm run test:unit", "test:unit": "cross-env tape 'test/**/*-test.js' | tap-arc", "test:unit:updater": "cross-env tape test/updater/test.js | tap-arc", From 9dc9a8f775c93136d6dabf071f7402d58bc08225 Mon Sep 17 00:00:00 2001 From: Ryan Block Date: Mon, 29 Apr 2024 10:58:25 -0700 Subject: [PATCH 4/4] Lint --- check-creds/index.js | 1 - fingerprint/index.js | 2 +- test/fingerprint/index-test.js | 4 ++-- updater/lib.js | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/check-creds/index.js b/check-creds/index.js index 126b435..f06e7af 100644 --- a/check-creds/index.js +++ b/check-creds/index.js @@ -5,7 +5,6 @@ * - Thus, sometimes it's ok to use dummy creds, but sometimes we need to halt (via this util) */ module.exports = function checkAwsCredentials (params, callback) { - // eslint-disable-next-line let awsLite = require('@aws-lite/client') let { inventory } = params diff --git a/fingerprint/index.js b/fingerprint/index.js index ef7a74b..e172244 100644 --- a/fingerprint/index.js +++ b/fingerprint/index.js @@ -43,7 +43,7 @@ module.exports = function fingerprint (params, callback) { try { fs.rmSync(staticJson, { force: true }) } - catch (err) { + catch { let msg = `Error removing ${filename} file, please remove it manually or static asset calls may be broken` update.warn(msg) } diff --git a/test/fingerprint/index-test.js b/test/fingerprint/index-test.js index 22ffd09..f67e7e3 100644 --- a/test/fingerprint/index-test.js +++ b/test/fingerprint/index-test.js @@ -12,7 +12,7 @@ let globStub = sinon.stub().callsFake(() => []) let glob = { globSync: globStub } let shaStub = sinon.stub(sha, 'get').callsFake((file, callback) => callback(null, 'df330f3f12')) // Fake hash let fingerprint = proxyquire('../../fingerprint', { - 'glob': glob + 'glob': glob, }) let params = () => ({ @@ -165,7 +165,7 @@ test('fingerprint does does not generate static.json when set to external', t => // Globbing globStub.resetBehavior() globStub.callsFake(() => [ - pathToUnix(join(process.cwd(), 'public', 'index.html')) + pathToUnix(join(process.cwd(), 'public', 'index.html')), ]) // Static manifest let fsStub = sinon.stub(fs, 'writeFile').callsFake((dest, data, callback) => { diff --git a/updater/lib.js b/updater/lib.js index 6623f1e..23bb3a7 100644 --- a/updater/lib.js +++ b/updater/lib.js @@ -14,7 +14,7 @@ let printer = { }, // Write to console, add single extra line to buffer while running restoreCursor: () => restore(), - write: t => out.write(t + '\033[1A' + '\n') + write: t => out.write(t + '\033[1A' + '\n'), } printer.hideCursor = () => printer.write('\u001B[?25l') @@ -31,5 +31,5 @@ let spinner = { frames, timing } module.exports = { printer, - spinner + spinner, }