aeoptimize 0.6.0 → 0.6.2
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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +16 -0
- package/README.md +2 -2
- package/ROADMAP.md +1 -1
- package/dist/cli/index.js +1 -1
- package/docs/release-v0.6.md +23 -28
- package/examples/github-action-sample/.github/workflows/aeoptimize.yml +1 -1
- package/examples/github-action-sample/README.md +1 -1
- package/fixtures/v0.6/rule-corpus.ts +14 -2
- package/package.json +5 -2
- package/scripts/verify-publish-source.sh +25 -0
- package/scripts/verify-release-candidate.sh +86 -0
- package/scripts/verify-release-v0.6.sh +13 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable user-visible changes will be documented here. The project follows Semantic Versioning after the v0.6 evidence baseline is released.
|
|
4
4
|
|
|
5
|
+
## 0.6.2
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Added a fail-closed publish source gate that requires `HEAD` to match the fetched `origin/main` commit before npm publication.
|
|
10
|
+
- Prepared a corrective release after npm 0.6.1 exposed the pre-squash PR commit as `gitHead`; the verified package contents were correct, but the release provenance did not match the merged commit.
|
|
11
|
+
- Kept scoring rules, output contracts, and runtime behavior unchanged.
|
|
12
|
+
|
|
13
|
+
## 0.6.1
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Bound public CLI verification to the downloaded tarball that passed SHA-256 verification.
|
|
18
|
+
- Added an executable clean-worktree release candidate gate and cross-Node package reproducibility check.
|
|
19
|
+
- Exercised the public rule corpus across the HTML parser boundary and strengthened release verifier failure tests.
|
|
20
|
+
|
|
5
21
|
## 0.6.0
|
|
6
22
|
|
|
7
23
|
### Changed
|
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ node -e "const r=require('./aeoptimize-report.json'); process.exit(r.overall.tot
|
|
|
64
64
|
The v0.6 GitHub Action is advisory by default. It reports findings without blocking the workflow:
|
|
65
65
|
|
|
66
66
|
```yaml
|
|
67
|
-
- uses: cucuwang/aeoptimize@v0.6.
|
|
67
|
+
- uses: cucuwang/aeoptimize@v0.6.2
|
|
68
68
|
with:
|
|
69
69
|
path: dist
|
|
70
70
|
```
|
|
@@ -72,7 +72,7 @@ The v0.6 GitHub Action is advisory by default. It reports findings without block
|
|
|
72
72
|
Projects can explicitly choose blocking mode after accepting a baseline:
|
|
73
73
|
|
|
74
74
|
```yaml
|
|
75
|
-
- uses: cucuwang/aeoptimize@v0.6.
|
|
75
|
+
- uses: cucuwang/aeoptimize@v0.6.2
|
|
76
76
|
with:
|
|
77
77
|
path: dist
|
|
78
78
|
fail-on-low-score: 'true'
|
package/ROADMAP.md
CHANGED
|
@@ -14,7 +14,7 @@ Release gates:
|
|
|
14
14
|
- root GitHub Action metadata and an end-to-end sample repository;
|
|
15
15
|
- stable JSON output, changelog, release notes, and rollback instructions.
|
|
16
16
|
|
|
17
|
-
The
|
|
17
|
+
The code-level gates are enforced by `npm run release:check`, `src/core/__tests__/release-contract.test.ts`, the versioned corpus in `fixtures/v0.6/`, and the local composite Action contract. CI compares real Node.js 22 and 24 package manifests and hashes. Repository rulesets and the release runbook remain separate maintainer controls.
|
|
18
18
|
|
|
19
19
|
## Product validation after v0.6
|
|
20
20
|
|
package/dist/cli/index.js
CHANGED
|
@@ -13,7 +13,7 @@ const program = new Command();
|
|
|
13
13
|
program
|
|
14
14
|
.name('aeoptimize')
|
|
15
15
|
.description('Deterministic content-readiness lint for websites and documentation')
|
|
16
|
-
.version('0.6.
|
|
16
|
+
.version('0.6.2');
|
|
17
17
|
// ── scan command ───────────────────────────────────────────────────
|
|
18
18
|
program
|
|
19
19
|
.command('scan <target>')
|
package/docs/release-v0.6.md
CHANGED
|
@@ -1,39 +1,34 @@
|
|
|
1
1
|
# v0.6 release and rollback guide
|
|
2
2
|
|
|
3
|
-
Version 0.6.
|
|
3
|
+
Version 0.6.2 is the provenance-corrective release for the v0.6 evidence-bounded scoring, packaging, and GitHub Action contracts. npm 0.6.1 contained the verified candidate bytes but exposed the pre-squash PR commit as `gitHead`, so no v0.6.1 Git tag or GitHub Release was created. Version 0.6.2 is not released until npm, the Git tag, and the GitHub Release are each created and read back independently.
|
|
4
4
|
|
|
5
5
|
## Release acceptance
|
|
6
6
|
|
|
7
|
-
Before publication,
|
|
7
|
+
Before publication, run `npm ci` and `npm run release:check` from the intended release commit. The candidate gate verifies all of the following:
|
|
8
8
|
|
|
9
|
-
1. `npm
|
|
9
|
+
1. `npm run check`, `npm audit --audit-level=high`, and `bash action/test-contract.sh` pass.
|
|
10
10
|
2. The public v0.6 rule corpus covers the positive, negative, and false-positive boundary for every scored rule.
|
|
11
|
-
3. `npm pack`
|
|
11
|
+
3. An actual `npm pack` candidate contains the required public files, its SHA-256 is recorded, and a clean consumer can invoke `aeoptimize`, `aeo`, and `aeo-cli` from that exact tarball.
|
|
12
12
|
4. CI succeeds on Node.js 22 and 24 for the release commit.
|
|
13
13
|
5. The JSON automation contract and Action sample tests pass.
|
|
14
|
-
6. The npm account is verified immediately before publishing.
|
|
14
|
+
6. The npm account is verified immediately before publishing, and the publish source gate confirms that `HEAD` is the exact fetched `origin/main` commit.
|
|
15
|
+
|
|
16
|
+
CI runs the same candidate gate on Node.js 22 and 24 and compares version, filename, SHA-256, file count, and unpacked size. `prepublishOnly` invokes the candidate gate again, refuses a dirty worktree, and refuses publication unless `HEAD` matches `origin/main` exactly. Run `git fetch origin main` immediately before the authorized publish so the remote-tracking ref is current.
|
|
15
17
|
|
|
16
18
|
Publishing, tagging, creating a GitHub Release, changing npm dist-tags, and deprecating a version are separate external mutations and require separate maintainer authorization.
|
|
17
19
|
|
|
18
20
|
## Release notes
|
|
19
21
|
|
|
20
|
-
###
|
|
21
|
-
|
|
22
|
-
- Reframe the score as deterministic content readiness rather than a prediction of ranking or AI citation.
|
|
23
|
-
- Treat FAQ structure and `llms.txt` as optional, zero-point signals.
|
|
24
|
-
- Remove exact-one-H1 and fixed meta-description-length assumptions.
|
|
25
|
-
- Flag unsourced quantitative claims instead of rewarding more numbers.
|
|
26
|
-
- Publish a versioned fixture corpus with positive, negative, and false-positive boundaries for every scored rule.
|
|
27
|
-
|
|
28
|
-
### Reproducible automation
|
|
22
|
+
### Artifact-bound release verification
|
|
29
23
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
24
|
+
- Build the candidate from a clean worktree and install all three CLI aliases from the exact tarball whose SHA-256 is recorded.
|
|
25
|
+
- Require byte-identical candidate manifests from Node.js 22 and 24 before the release can proceed.
|
|
26
|
+
- Bind the public verifier's CLI smoke checks to the downloaded, hash-verified npm tarball.
|
|
27
|
+
- Fail closed when a CLI alias, tag target, repository identity, or GitHub Release state does not match.
|
|
28
|
+
- Fail closed before publication when the checked-out commit differs from the fetched `origin/main` commit.
|
|
29
|
+
- Exercise every v0.6 rule fixture through the real HTML parser boundary.
|
|
35
30
|
|
|
36
|
-
No ranking, traffic, indexing, rich-result, AI Overview, or citation outcome is claimed by this release.
|
|
31
|
+
No scoring rule, rule weight, JSON field, Action input, or Action output changes in this patch. No ranking, traffic, indexing, rich-result, AI Overview, or citation outcome is claimed by this release.
|
|
37
32
|
|
|
38
33
|
## Publication readback
|
|
39
34
|
|
|
@@ -41,16 +36,16 @@ After an authorized npm publication:
|
|
|
41
36
|
|
|
42
37
|
```bash
|
|
43
38
|
npm view aeoptimize version dist-tags --json
|
|
44
|
-
npm view aeoptimize@0.6.
|
|
45
|
-
consumer_root=$(mktemp -d "${TMPDIR:-/tmp}/aeoptimize-v0.6-consumer.XXXXXX")
|
|
46
|
-
npm install --prefix "$consumer_root" aeoptimize@0.6.
|
|
39
|
+
npm view aeoptimize@0.6.2 version gitHead repository homepage bugs dist --json
|
|
40
|
+
consumer_root=$(mktemp -d "${TMPDIR:-/tmp}/aeoptimize-v0.6.2-consumer.XXXXXX")
|
|
41
|
+
npm install --prefix "$consumer_root" aeoptimize@0.6.2
|
|
47
42
|
"$consumer_root/node_modules/.bin/aeoptimize" --version
|
|
48
43
|
"$consumer_root/node_modules/.bin/aeo" --version
|
|
49
44
|
"$consumer_root/node_modules/.bin/aeo-cli" --version
|
|
50
45
|
rm -rf -- "$consumer_root"
|
|
51
46
|
```
|
|
52
47
|
|
|
53
|
-
After separately authorized tag and GitHub Release creation, verify that `v0.6.
|
|
48
|
+
After separately authorized tag and GitHub Release creation, verify that `v0.6.2` points to the tested release commit and that the Release is published rather than draft or prerelease.
|
|
54
49
|
|
|
55
50
|
The fail-closed public verifier checks npm `latest`, the exact version, public repository identity, the downloaded tarball SHA-256, all three installed CLI aliases, the tag target, and the published GitHub Release. The tarball hash is the required artifact-identity gate. If npm exposes `gitHead`, it must match the expected release commit; absence is reported as informational because npm's publish contract guarantees tarball integrity but does not guarantee that metadata field.
|
|
56
51
|
|
|
@@ -62,11 +57,11 @@ bash scripts/verify-release-v0.6.sh <verified-release-commit> <verified-package-
|
|
|
62
57
|
|
|
63
58
|
An npm dist-tag rollback changes what `npm install aeoptimize` selects; it does not remove exact-version installs. Never silently move an existing Git tag to different code.
|
|
64
59
|
|
|
65
|
-
If npm 0.6.
|
|
60
|
+
If npm 0.6.2 is unsuitable, request separate authorization for each mutation and restore `latest` to the last fully released version rather than the provenance-mismatched 0.6.1 artifact:
|
|
66
61
|
|
|
67
62
|
```bash
|
|
68
|
-
npm dist-tag add aeoptimize@0.
|
|
69
|
-
npm deprecate aeoptimize@0.6.
|
|
63
|
+
npm dist-tag add aeoptimize@0.6.0 latest
|
|
64
|
+
npm deprecate aeoptimize@0.6.2 "Use 0.6.0 until the corrective release is available."
|
|
70
65
|
```
|
|
71
66
|
|
|
72
|
-
Mark the GitHub Release with the same warning.
|
|
67
|
+
Mark the GitHub Release with the same warning. Never create or retarget `v0.6.1` merely to mask its npm `gitHead` mismatch. Preserve immutable versions as evidence, fix forward in 0.6.3, rerun the complete release acceptance suite, and only then move npm `latest` to the corrective version.
|
|
@@ -6,4 +6,4 @@ This directory is a copyable end-to-end sample for the v0.6 Action contract.
|
|
|
6
6
|
- `site/index.html` is a deterministic public input.
|
|
7
7
|
- The Action is advisory by default. The sample does not block a pull request on an unreviewed score threshold.
|
|
8
8
|
|
|
9
|
-
The workflow becomes reproducible only after both `aeoptimize@0.6.
|
|
9
|
+
The workflow becomes reproducible only after both `aeoptimize@0.6.2` exists on npm and the immutable `v0.6.2` Git tag points to the matching release commit. Until both artifacts exist, use the local CLI or the release-candidate package during controlled verification.
|
|
@@ -126,14 +126,26 @@ export const ruleFixtureCorpus: Record<string, RuleFixtureSet> = {
|
|
|
126
126
|
negative: {
|
|
127
127
|
purpose: 'A majority of dangling pronoun or transition openings triggers a review finding.',
|
|
128
128
|
document: {
|
|
129
|
-
paragraphs: [
|
|
129
|
+
paragraphs: [
|
|
130
|
+
'This is important for the release.',
|
|
131
|
+
'They require additional context.',
|
|
132
|
+
'However, it varies by project.',
|
|
133
|
+
'The release is versioned for users.',
|
|
134
|
+
'The report is publicly available.',
|
|
135
|
+
],
|
|
130
136
|
},
|
|
131
137
|
expected: { score: 3, issues: 1, suggestions: 1 },
|
|
132
138
|
},
|
|
133
139
|
boundary: {
|
|
134
140
|
purpose: 'Exactly twenty percent dangling openings is the non-penalized ratio boundary.',
|
|
135
141
|
document: {
|
|
136
|
-
paragraphs: [
|
|
142
|
+
paragraphs: [
|
|
143
|
+
'This needs context for the reader.',
|
|
144
|
+
'The package is explicitly versioned.',
|
|
145
|
+
'The Action is advisory by default.',
|
|
146
|
+
'The report remains stable for automation.',
|
|
147
|
+
'The fixture is publicly reviewable.',
|
|
148
|
+
],
|
|
137
149
|
},
|
|
138
150
|
expected: { score: 8, issues: 0, suggestions: 1 },
|
|
139
151
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aeoptimize",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Deterministic content-readiness lint for static websites and documentation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/core/index.js",
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
"agents/",
|
|
21
21
|
"fixtures/",
|
|
22
22
|
"examples/github-action-sample/",
|
|
23
|
+
"scripts/verify-release-candidate.sh",
|
|
24
|
+
"scripts/verify-publish-source.sh",
|
|
23
25
|
"scripts/verify-release-v0.6.sh",
|
|
24
26
|
".claude-plugin/",
|
|
25
27
|
"docs/methodology.md",
|
|
@@ -34,10 +36,11 @@
|
|
|
34
36
|
"scripts": {
|
|
35
37
|
"build": "tsc",
|
|
36
38
|
"check": "npm test && npm run build",
|
|
39
|
+
"release:check": "bash scripts/verify-release-candidate.sh",
|
|
37
40
|
"dev": "tsc --watch",
|
|
38
41
|
"test": "vitest run",
|
|
39
42
|
"test:watch": "vitest",
|
|
40
|
-
"prepublishOnly": "npm run check"
|
|
43
|
+
"prepublishOnly": "npm run release:check && bash scripts/verify-publish-source.sh"
|
|
41
44
|
},
|
|
42
45
|
"keywords": [
|
|
43
46
|
"aeo",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -u
|
|
3
|
+
|
|
4
|
+
if ! command -v git >/dev/null 2>&1; then
|
|
5
|
+
echo "missing required command: git" >&2
|
|
6
|
+
exit 2
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
if ! head_commit=$(git rev-parse --verify HEAD 2>/dev/null); then
|
|
10
|
+
echo "publish source gate: HEAD is unavailable" >&2
|
|
11
|
+
exit 1
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
if ! main_commit=$(git rev-parse --verify refs/remotes/origin/main 2>/dev/null); then
|
|
15
|
+
echo "publish source gate: origin/main is unavailable; run git fetch origin main" >&2
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
if [ "$head_commit" != "$main_commit" ]; then
|
|
20
|
+
echo "publish source gate: HEAD is $head_commit; expected origin/main $main_commit" >&2
|
|
21
|
+
echo "fetch origin/main and publish from its exact commit" >&2
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
echo "Publish source gate passed: HEAD matches origin/main at $head_commit."
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
REPO_ROOT=$(cd "$(dirname "$0")/.." && pwd)
|
|
5
|
+
cd "$REPO_ROOT"
|
|
6
|
+
|
|
7
|
+
for command_name in git jq mktemp node npm; do
|
|
8
|
+
if ! command -v "$command_name" >/dev/null 2>&1; then
|
|
9
|
+
echo "missing required command: $command_name" >&2
|
|
10
|
+
exit 2
|
|
11
|
+
fi
|
|
12
|
+
done
|
|
13
|
+
|
|
14
|
+
if [ "${ALLOW_DIRTY_RELEASE_CHECK:-0}" != "1" ] && [ -n "$(git status --porcelain)" ]; then
|
|
15
|
+
echo "release candidate must be built from a clean worktree" >&2
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
VERIFY_BASE=${TMPDIR:-/tmp}
|
|
20
|
+
VERIFY_BASE=${VERIFY_BASE%/}
|
|
21
|
+
VERIFY_ROOT=$(mktemp -d "$VERIFY_BASE/aeoptimize-release-candidate.XXXXXX")
|
|
22
|
+
PACK_ROOT="$VERIFY_ROOT/pack"
|
|
23
|
+
CONSUMER_ROOT="$VERIFY_ROOT/consumer"
|
|
24
|
+
PACK_JSON="$VERIFY_ROOT/pack.json"
|
|
25
|
+
|
|
26
|
+
cleanup() {
|
|
27
|
+
case "$VERIFY_ROOT" in
|
|
28
|
+
"$VERIFY_BASE"/aeoptimize-release-candidate.*)
|
|
29
|
+
rm -rf -- "$VERIFY_ROOT"
|
|
30
|
+
;;
|
|
31
|
+
*)
|
|
32
|
+
echo "Refusing to remove unexpected verification path: $VERIFY_ROOT" >&2
|
|
33
|
+
;;
|
|
34
|
+
esac
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
trap cleanup EXIT
|
|
38
|
+
mkdir -p "$PACK_ROOT"
|
|
39
|
+
|
|
40
|
+
npm run check
|
|
41
|
+
bash action/test-contract.sh
|
|
42
|
+
npm --cache "$VERIFY_ROOT/npm-cache" audit --audit-level=high
|
|
43
|
+
npm_config_dry_run=false npm --cache "$VERIFY_ROOT/npm-cache" \
|
|
44
|
+
pack --json --pack-destination "$PACK_ROOT" > "$PACK_JSON"
|
|
45
|
+
|
|
46
|
+
PACKAGE_FILENAME=$(jq -er '.[0].filename' "$PACK_JSON")
|
|
47
|
+
PACKAGE_VERSION=$(jq -er '.[0].version' "$PACK_JSON")
|
|
48
|
+
PACKAGE_FILE_COUNT=$(jq -er '.[0].files | length' "$PACK_JSON")
|
|
49
|
+
PACKAGE_UNPACKED_SIZE=$(jq -er '.[0].unpackedSize' "$PACK_JSON")
|
|
50
|
+
PACKAGE_TARBALL="$PACK_ROOT/$PACKAGE_FILENAME"
|
|
51
|
+
PACKAGE_SHA256=$(node -e "const crypto=require('node:crypto');const fs=require('node:fs');console.log(crypto.createHash('sha256').update(fs.readFileSync(process.argv[1])).digest('hex'))" "$PACKAGE_TARBALL")
|
|
52
|
+
|
|
53
|
+
jq -e '
|
|
54
|
+
(.[0].files | map(.path) | index("dist/cli/index.js")) != null and
|
|
55
|
+
(.[0].files | map(.path) | index("fixtures/v0.6/rule-corpus.ts")) != null and
|
|
56
|
+
(.[0].files | map(.path) | index("examples/github-action-sample/.github/workflows/aeoptimize.yml")) != null and
|
|
57
|
+
(.[0].files | map(.path) | index("scripts/verify-release-candidate.sh")) != null and
|
|
58
|
+
(.[0].files | map(.path) | index("scripts/verify-release-v0.6.sh")) != null
|
|
59
|
+
' "$PACK_JSON" >/dev/null
|
|
60
|
+
|
|
61
|
+
npm_config_dry_run=false npm --cache "$VERIFY_ROOT/npm-cache" install \
|
|
62
|
+
--ignore-scripts --no-audit --no-fund \
|
|
63
|
+
--prefix "$CONSUMER_ROOT" "$PACKAGE_TARBALL" >/dev/null
|
|
64
|
+
|
|
65
|
+
for binary in aeoptimize aeo aeo-cli; do
|
|
66
|
+
BINARY_VERSION=$("$CONSUMER_ROOT/node_modules/.bin/$binary" --version)
|
|
67
|
+
if [ "$BINARY_VERSION" != "$PACKAGE_VERSION" ]; then
|
|
68
|
+
echo "$binary returned $BINARY_VERSION; expected $PACKAGE_VERSION" >&2
|
|
69
|
+
exit 1
|
|
70
|
+
fi
|
|
71
|
+
done
|
|
72
|
+
|
|
73
|
+
MANIFEST=$(jq -n \
|
|
74
|
+
--arg version "$PACKAGE_VERSION" \
|
|
75
|
+
--arg filename "$PACKAGE_FILENAME" \
|
|
76
|
+
--arg sha256 "$PACKAGE_SHA256" \
|
|
77
|
+
--argjson fileCount "$PACKAGE_FILE_COUNT" \
|
|
78
|
+
--argjson unpackedSize "$PACKAGE_UNPACKED_SIZE" \
|
|
79
|
+
'{version: $version, filename: $filename, sha256: $sha256, fileCount: $fileCount, unpackedSize: $unpackedSize}')
|
|
80
|
+
|
|
81
|
+
if [ -n "${RELEASE_MANIFEST_OUT:-}" ]; then
|
|
82
|
+
printf '%s\n' "$MANIFEST" > "$RELEASE_MANIFEST_OUT"
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
printf '%s\n' "$MANIFEST"
|
|
86
|
+
echo "Release candidate checks passed."
|
|
@@ -2,14 +2,22 @@
|
|
|
2
2
|
set -u
|
|
3
3
|
|
|
4
4
|
PACKAGE_NAME=aeoptimize
|
|
5
|
-
EXPECTED_VERSION=0.6.0
|
|
6
|
-
EXPECTED_TAG=v0.6.0
|
|
7
5
|
REPOSITORY=cucuwang/aeoptimize
|
|
8
6
|
EXPECTED_COMMIT=${1:-}
|
|
9
7
|
EXPECTED_PACKAGE_SHA256=${2:-}
|
|
10
8
|
EXPECTED_REPOSITORY_URL=git+https://github.com/cucuwang/aeoptimize.git
|
|
11
9
|
EXPECTED_HOMEPAGE=https://github.com/cucuwang/aeoptimize
|
|
12
10
|
EXPECTED_BUGS_URL=https://github.com/cucuwang/aeoptimize/issues
|
|
11
|
+
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
|
|
12
|
+
PACKAGE_JSON="$SCRIPT_DIR/../package.json"
|
|
13
|
+
|
|
14
|
+
if ! command -v node >/dev/null 2>&1; then
|
|
15
|
+
echo "missing required command: node" >&2
|
|
16
|
+
exit 2
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
EXPECTED_VERSION=$(node -e "const fs=require('node:fs');const packageJson=JSON.parse(fs.readFileSync(process.argv[1],'utf8'));process.stdout.write(packageJson.version)" "$PACKAGE_JSON")
|
|
20
|
+
EXPECTED_TAG="v$EXPECTED_VERSION"
|
|
13
21
|
|
|
14
22
|
if [ -z "$EXPECTED_COMMIT" ] || [ -z "$EXPECTED_PACKAGE_SHA256" ]; then
|
|
15
23
|
echo "usage: $0 <expected-release-commit> <expected-package-sha256>" >&2
|
|
@@ -26,7 +34,7 @@ if ! [[ "$EXPECTED_PACKAGE_SHA256" =~ ^[0-9a-f]{64}$ ]]; then
|
|
|
26
34
|
exit 2
|
|
27
35
|
fi
|
|
28
36
|
|
|
29
|
-
for command_name in awk curl jq npm git mktemp
|
|
37
|
+
for command_name in awk curl jq npm git mktemp; do
|
|
30
38
|
if ! command -v "$command_name" >/dev/null 2>&1; then
|
|
31
39
|
echo "missing required command: $command_name" >&2
|
|
32
40
|
exit 2
|
|
@@ -119,7 +127,7 @@ if curl -fsS "https://registry.npmjs.org/$PACKAGE_NAME" > "$REGISTRY_JSON"; then
|
|
|
119
127
|
|
|
120
128
|
if npm --cache "$VERIFY_ROOT/npm-cache" install \
|
|
121
129
|
--ignore-scripts --no-audit --no-fund \
|
|
122
|
-
--prefix "$CONSUMER_ROOT" "$
|
|
130
|
+
--prefix "$CONSUMER_ROOT" "$PACKAGE_TARBALL" >/dev/null; then
|
|
123
131
|
for binary in aeoptimize aeo aeo-cli; do
|
|
124
132
|
binary_version=$("$CONSUMER_ROOT/node_modules/.bin/$binary" --version 2>/dev/null || true)
|
|
125
133
|
if [ "$binary_version" = "$EXPECTED_VERSION" ]; then
|
|
@@ -129,7 +137,7 @@ if curl -fsS "https://registry.npmjs.org/$PACKAGE_NAME" > "$REGISTRY_JSON"; then
|
|
|
129
137
|
fi
|
|
130
138
|
done
|
|
131
139
|
else
|
|
132
|
-
fail "clean consumer installation failed for
|
|
140
|
+
fail "clean consumer installation failed for the verified package tarball"
|
|
133
141
|
fi
|
|
134
142
|
else
|
|
135
143
|
fail "npm does not contain exact version $EXPECTED_VERSION"
|