@zairakai/js-dev-tools 3.7.0 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -393,6 +393,9 @@ js:publish:
|
|
|
393
393
|
id_tokens:
|
|
394
394
|
NPM_ID_TOKEN:
|
|
395
395
|
aud: "npm:registry.npmjs.org"
|
|
396
|
+
# Lets npm sign the provenance: the package page shows it was built on GitLab from this project.
|
|
397
|
+
SIGSTORE_ID_TOKEN:
|
|
398
|
+
aud: sigstore
|
|
396
399
|
rules:
|
|
397
400
|
- if: $UPDATE_DEPENDENCIES == "true"
|
|
398
401
|
when: never
|
|
@@ -406,7 +409,7 @@ js:publish:
|
|
|
406
409
|
fi
|
|
407
410
|
echo "Publishing ${NPM_PACKAGE_NAME}@${CI_COMMIT_TAG} to npm (tag ${npm_tag})..."
|
|
408
411
|
npm version "${CI_COMMIT_TAG}" --no-git-tag-version --allow-same-version
|
|
409
|
-
npm publish --access public --tag "${npm_tag}"
|
|
412
|
+
npm publish --provenance --access public --tag "${npm_tag}"
|
|
410
413
|
environment:
|
|
411
414
|
name: production
|
|
412
415
|
url: https://www.npmjs.com/package/${NPM_PACKAGE_NAME}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zairakai/js-dev-tools",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.1",
|
|
4
4
|
"description": "The unified and centralized development toolkit for JavaScript/TypeScript projects - ESLint, Prettier, Stylelint, Knip, Vitest, Git Hooks, and GitLab CI pipeline templates",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dev-tools",
|
|
@@ -26,6 +26,7 @@ import { existsSync, readFileSync } from 'node:fs'
|
|
|
26
26
|
import { pathToFileURL } from 'node:url'
|
|
27
27
|
|
|
28
28
|
const CONFIG_FILE = '.dependency-update.json'
|
|
29
|
+
const PIPELINE_FILE = '.gitlab-ci.yml'
|
|
29
30
|
const COMMIT_SUBJECT = 'chore(deps): update the dependencies'
|
|
30
31
|
const BRANCH_PREFIX = 'chore/update-dependencies'
|
|
31
32
|
|
|
@@ -152,6 +153,16 @@ export function planTag({ config, last, commits, before, after, sections = RUNTI
|
|
|
152
153
|
return { version: nextVersion(last, config.tag.level), reason: 'a published range changed' }
|
|
153
154
|
}
|
|
154
155
|
|
|
156
|
+
/**
|
|
157
|
+
* True when a diff changes one `ref:` line and nothing else. The install of the tools moves the `ref:` of the shared
|
|
158
|
+
* pipeline to the installed version: that is the only change of the pipeline file an update may commit.
|
|
159
|
+
*/
|
|
160
|
+
export function isRefOnlyChange(diff) {
|
|
161
|
+
const changed = diff.split('\n').filter((line) => /^[+-]/.test(line) && !/^(\+\+\+|---)/.test(line))
|
|
162
|
+
|
|
163
|
+
return 2 === changed.length && changed.every((line) => /^[+-]\s*ref:\s*\S+\s*$/.test(line))
|
|
164
|
+
}
|
|
165
|
+
|
|
155
166
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
156
167
|
|
|
157
168
|
const log = (message) => console.info(message)
|
|
@@ -336,6 +347,11 @@ async function update(config) {
|
|
|
336
347
|
// Only the manifest and the lock file: the postinstall of the tools can rewrite other files of the project in CI.
|
|
337
348
|
const files = [ecosystem.file, ...['package-lock.json', 'composer.lock'].filter((file) => existsSync(file))]
|
|
338
349
|
|
|
350
|
+
// The one exception: the `ref:` of the shared pipeline follows the installed version of the tools.
|
|
351
|
+
if (existsSync(PIPELINE_FILE) && isRefOnlyChange(run('git', ['diff', '-U0', '--', PIPELINE_FILE]))) {
|
|
352
|
+
files.push(PIPELINE_FILE)
|
|
353
|
+
}
|
|
354
|
+
|
|
339
355
|
if ('' === run('git', ['status', '--porcelain', '--', ...files])) {
|
|
340
356
|
log('Everything is up to date.')
|
|
341
357
|
return
|