artifact-graph 1.0.0 → 1.1.0
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/.github/workflows/ci.yml +77 -10
- package/CHANGELOG.md +16 -0
- package/CONTRIBUTING.md +7 -19
- package/package.json +1 -1
package/.github/workflows/ci.yml
CHANGED
|
@@ -5,19 +5,86 @@ on:
|
|
|
5
5
|
push:
|
|
6
6
|
branches: [main]
|
|
7
7
|
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
8
11
|
jobs:
|
|
9
|
-
|
|
12
|
+
distribution:
|
|
10
13
|
runs-on: ubuntu-latest
|
|
11
14
|
steps:
|
|
12
15
|
- uses: actions/checkout@v4
|
|
13
|
-
- uses: pnpm/action-setup@v4
|
|
14
|
-
with:
|
|
15
|
-
version: 10.17.1
|
|
16
16
|
- uses: actions/setup-node@v4
|
|
17
17
|
with:
|
|
18
|
-
node-version: 22
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
node-version: 22.22.2
|
|
19
|
+
- name: Verify distributed package
|
|
20
|
+
shell: bash
|
|
21
|
+
run: |
|
|
22
|
+
set -euo pipefail
|
|
23
|
+
export EXPECTED_PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
24
|
+
export EXPECTED_PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
25
|
+
case "$EXPECTED_PACKAGE_NAME" in
|
|
26
|
+
artifact-chain-assistant)
|
|
27
|
+
node scripts/generate-canonical-json-protocol.mjs --check
|
|
28
|
+
node scripts/generate-schema-validators.mjs --check
|
|
29
|
+
node scripts/sync-skills.mjs --check
|
|
30
|
+
node scripts/build-adapters.mjs --check
|
|
31
|
+
node scripts/build-runtime-bundles.mjs --check
|
|
32
|
+
node scripts/check-templates.mjs
|
|
33
|
+
node scripts/check-compatibility.mjs
|
|
34
|
+
node scripts/check-family-api.mjs
|
|
35
|
+
;;
|
|
36
|
+
artifact-graph) ;;
|
|
37
|
+
*) exit 1 ;;
|
|
38
|
+
esac
|
|
39
|
+
distribution_tmp=$(mktemp -d)
|
|
40
|
+
trap 'rm -rf "$distribution_tmp"' EXIT
|
|
41
|
+
mkdir "$distribution_tmp/pack" "$distribution_tmp/consumer"
|
|
42
|
+
npm pack --ignore-scripts --json --pack-destination "$distribution_tmp/pack" > "$distribution_tmp/pack.json"
|
|
43
|
+
tarball=$(node -e "const p=require(process.argv[1]); if(p.length!==1)process.exit(1); console.log(p[0].filename)" "$distribution_tmp/pack.json")
|
|
44
|
+
node -e "const p=require(process.argv[1])[0]; console.log(JSON.stringify({name:p.name,version:p.version,shasum:p.shasum,integrity:p.integrity}))" "$distribution_tmp/pack.json"
|
|
45
|
+
cd "$distribution_tmp/consumer"
|
|
46
|
+
printf '{"private":true,"type":"module"}\n' > package.json
|
|
47
|
+
npm install --no-audit --no-fund --no-package-lock --registry=https://registry.npmjs.org --cache "$distribution_tmp/cache" "$distribution_tmp/pack/$tarball"
|
|
48
|
+
if [ "$EXPECTED_PACKAGE_NAME" = artifact-chain-assistant ]; then
|
|
49
|
+
runtime_spec=$(node -p "require('./node_modules/artifact-chain-assistant/compatibility.json').artifactGraph.installSpec")
|
|
50
|
+
npm install --no-audit --no-fund --no-package-lock --registry=https://registry.npmjs.org --cache "$distribution_tmp/cache" "$runtime_spec"
|
|
51
|
+
fi
|
|
52
|
+
export PATH="$PWD/node_modules/.bin:$PATH"
|
|
53
|
+
node --input-type=module <<'NODE'
|
|
54
|
+
import assert from 'node:assert/strict';
|
|
55
|
+
import {readFile,access} from 'node:fs/promises';
|
|
56
|
+
import {join} from 'node:path';
|
|
57
|
+
import {createRequire} from 'node:module';
|
|
58
|
+
const require=createRequire(import.meta.url);
|
|
59
|
+
const root=join(process.cwd(),'node_modules',process.env.EXPECTED_PACKAGE_NAME);
|
|
60
|
+
const pkg=JSON.parse(await readFile(join(root,'package.json'),'utf8'));
|
|
61
|
+
assert.equal(pkg.name,process.env.EXPECTED_PACKAGE_NAME);
|
|
62
|
+
assert.equal(pkg.version,process.env.EXPECTED_PACKAGE_VERSION);
|
|
63
|
+
const paths=value=>typeof value==='string'?[value]:value&&typeof value==='object'?Object.values(value).flatMap(paths):[];
|
|
64
|
+
for(const path of [...paths(pkg.bin),...paths(pkg.exports),...paths(pkg.main),...paths(pkg.types)]) await access(join(root,path));
|
|
65
|
+
const esm=await import('artifact-graph');
|
|
66
|
+
const cjs=require('artifact-graph');
|
|
67
|
+
assert.equal(typeof esm.scanArtifacts,'function');
|
|
68
|
+
assert.equal(typeof cjs.scanArtifacts,'function');
|
|
69
|
+
assert.equal(require('artifact-graph/project-artifact-profiles').schema_version,'1.0');
|
|
70
|
+
assert.equal(require('artifact-graph/schemas/review-result.schema.json').type,'object');
|
|
71
|
+
if(pkg.name==='artifact-chain-assistant') {
|
|
72
|
+
const policy=JSON.parse(await readFile(join(root,'compatibility.json'),'utf8'));
|
|
73
|
+
const graph=JSON.parse(await readFile('node_modules/artifact-graph/package.json','utf8'));
|
|
74
|
+
assert.equal(graph.name+'@'+graph.version,policy.artifactGraph.installSpec);
|
|
75
|
+
assert.equal(graph.version,policy.artifactGraph.verifiedVersion);
|
|
76
|
+
}
|
|
77
|
+
NODE
|
|
78
|
+
artifact-graph --help
|
|
79
|
+
npx --no-install artifact-graph --help
|
|
80
|
+
artifact-graph init --root project
|
|
81
|
+
artifact-graph scan --root project
|
|
82
|
+
artifact-graph validate --root project --format json
|
|
83
|
+
artifact-graph contract list --format json > contracts.json
|
|
84
|
+
node -e "const p=require('./contracts.json'); if(p.ok!==true||!Array.isArray(p.data?.contracts)||!p.data.contracts.length)process.exit(1)"
|
|
85
|
+
if [ "$EXPECTED_PACKAGE_NAME" = artifact-chain-assistant ]; then
|
|
86
|
+
node node_modules/artifact-chain-assistant/scripts/doctor.mjs --root project --format json > doctor.json
|
|
87
|
+
else
|
|
88
|
+
artifact-graph doctor --root project --format json > doctor.json
|
|
89
|
+
fi
|
|
90
|
+
node -e "const p=require('./doctor.json'); for(const k of ['cli','config','lock','supportedCommands'])if(!(k in p))process.exit(1)"
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 1.1.0
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Released in lockstep with artifact-chain-assistant 1.1.0 for its long-SPEC progressive disclosure capability. Graph runtime, CLI, API, and contract semantics are unchanged from 1.0.1.
|
|
10
|
+
|
|
11
|
+
## 1.0.1
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- Public CI now verifies the actual distributed package without requiring source code, tests, or a lockfile absent from the release snapshot. It packs the checkout and installs that tarball in a clean consumer environment with native dependency lifecycle scripts enabled, and validates CLI entry points, ESM/CJS imports, public resources, and graph operations. Full source checks remain in the parent workspace.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Ships in lockstep with artifact-chain-assistant 1.0.1. Graph runtime, CLI, API, and contract semantics are unchanged from 1.0.0.
|
|
20
|
+
|
|
5
21
|
## 1.0.0
|
|
6
22
|
|
|
7
23
|
### Changed
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,29 +1,17 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Thank you for helping improve this project.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
> NOTICE) and shared files are rendered from a private workspace. Direct pull requests
|
|
7
|
-
> against these files will be overwritten by the next render — please open an issue
|
|
8
|
-
> instead, and the maintainers will make the change at the source.
|
|
5
|
+
## Propose a change
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
This repository provides a published release snapshot. Changes are made in the source workspace by maintainers, and this repository is regenerated from that source. If you encounter a bug, have a feature request, or notice a documentation issue, open an issue here. Include the observed behavior and a minimal, reproducible example. Direct edits to generated files in this repository may be overwritten in the next release. Opening an issue does not require access to the source workspace.
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
## Verify the distributed package
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
pnpm install
|
|
16
|
-
pnpm build
|
|
17
|
-
pnpm test
|
|
18
|
-
```
|
|
11
|
+
Public CI runs on Node.js `22.22.2`, within the supported range `>=22.22.2 <23`. It validates the distributed files by checking for drift in generated content and ensuring all published resources are intact. After packaging, it installs the tarball built from this checkout in a clean consumer environment and exercises the package's public entry points and resources. Verification includes CLI command execution, ESM and CJS imports, and checks of public schema resources. The assistant checks its generated resources and runs its consumer doctor against the declared compatible Graph version. Native dependencies are installed using their standard scripts.
|
|
19
12
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- Keep changes focused.
|
|
23
|
-
- Documentation changes should be proposed as issues (see above); code changes should update tests when behavior changes.
|
|
24
|
-
- Run the package validation commands before opening a pull request.
|
|
25
|
-
- Do not include private parent-repository artifacts or local machine paths.
|
|
13
|
+
This snapshot does not include full development sources, tests, or the dependency lockfile. Do not run `pnpm build`, `pnpm test`, or `pnpm typecheck` in this repository. These checks are performed in the source workspace. Public CI does not rebuild or repair distributed files before validation.
|
|
26
14
|
|
|
27
15
|
## License
|
|
28
16
|
|
|
29
|
-
By contributing, you agree that your contribution is licensed under Apache-2.0.
|
|
17
|
+
Keep proposed changes focused. By contributing, you agree that your contribution is licensed under the Apache-2.0 license.
|