@astryxdesign/cli 0.6.3-canary.02d93e4 → 0.6.3-canary.0550afd
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.
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
import {describe, expect, it} from 'vitest';
|
|
4
|
+
import * as fs from 'node:fs';
|
|
5
|
+
import * as path from 'node:path';
|
|
6
|
+
import {CLI_ROOT} from '../fs/paths.mjs';
|
|
7
|
+
import {semverCompare} from '../env/semver.mjs';
|
|
4
8
|
import {
|
|
5
9
|
DOCS_TREE_CLI,
|
|
6
10
|
lowestAdmitted,
|
|
@@ -51,34 +55,55 @@ describe('docsTreeCliProblem', () => {
|
|
|
51
55
|
|
|
52
56
|
it('declares the peer as optional, and keeps what the package says of it', () => {
|
|
53
57
|
const declared = withDocsTreeCli({name: '@acme/kit'});
|
|
54
|
-
expect(declared.peerDependencies).toEqual({
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
-
expect(declared.peerDependenciesMeta).toEqual({
|
|
58
|
-
'@astryxdesign/cli': {optional: true},
|
|
59
|
-
});
|
|
58
|
+
expect(declared.peerDependencies).toEqual({'@astryxdesign/cli': `>=${DOCS_TREE_CLI}`});
|
|
59
|
+
expect(declared.peerDependenciesMeta).toEqual({'@astryxdesign/cli': {optional: true}});
|
|
60
60
|
expect(docsTreeCliProblem(declared)).toBeNull();
|
|
61
61
|
const required = withDocsTreeCli({
|
|
62
62
|
peerDependencies: {react: '^19.0.0', '@astryxdesign/cli': '^0.6.0'},
|
|
63
63
|
peerDependenciesMeta: {'@astryxdesign/cli': {optional: false}},
|
|
64
64
|
});
|
|
65
65
|
expect(required.peerDependencies.react).toBe('^19.0.0');
|
|
66
|
-
expect(required.peerDependenciesMeta['@astryxdesign/cli']).toEqual({
|
|
67
|
-
optional: false,
|
|
68
|
-
});
|
|
66
|
+
expect(required.peerDependenciesMeta['@astryxdesign/cli']).toEqual({optional: false});
|
|
69
67
|
});
|
|
70
68
|
});
|
|
71
69
|
|
|
72
70
|
describe('replacesCliProblem', () => {
|
|
73
71
|
it('asks a package that sets replaces for a CLI that reads the field', () => {
|
|
74
|
-
expect(replacesCliProblem({name: '@acme/kit'})).toContain(
|
|
75
|
-
|
|
72
|
+
expect(replacesCliProblem({name: '@acme/kit'})).toContain('sets `replaces`');
|
|
73
|
+
expect(replacesCliProblem({peerDependencies: {'@astryxdesign/cli': '^0.6.0'}})).toContain(
|
|
74
|
+
'admits a CLI older than',
|
|
76
75
|
);
|
|
77
|
-
expect(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
expect(replacesCliProblem({peerDependencies: {'@astryxdesign/cli': '>=0.7.0'}})).toBeNull();
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
describe('DOCS_TREE_CLI', () => {
|
|
81
|
+
it('is no later than the release the pending changesets make', () => {
|
|
82
|
+
const {version} = JSON.parse(
|
|
83
|
+
fs.readFileSync(path.join(CLI_ROOT, 'package.json'), 'utf-8'),
|
|
84
|
+
);
|
|
85
|
+
const dir = path.join(CLI_ROOT, '..', '..', '.changeset');
|
|
86
|
+
/** @type {Record<string, number>} */
|
|
87
|
+
const rank = {patch: 1, minor: 2, major: 3};
|
|
88
|
+
let bump = 0;
|
|
89
|
+
for (const file of fs.readdirSync(dir)) {
|
|
90
|
+
if (!file.endsWith('.md') || file === 'README.md') continue;
|
|
91
|
+
const head = fs.readFileSync(path.join(dir, file), 'utf-8').split('---')[1] ?? '';
|
|
92
|
+
const m = /['"]@astryxdesign\/cli['"]\s*:\s*(patch|minor|major)/.exec(head);
|
|
93
|
+
if (m) bump = Math.max(bump, rank[m[1]]);
|
|
94
|
+
}
|
|
95
|
+
const [major, minor, patch] = version.split('-')[0].split('.').map(Number);
|
|
96
|
+
const next =
|
|
97
|
+
bump === 3
|
|
98
|
+
? `${major + 1}.0.0`
|
|
99
|
+
: bump === 2
|
|
100
|
+
? `${major}.${minor + 1}.0`
|
|
101
|
+
: bump === 1
|
|
102
|
+
? `${major}.${minor}.${patch + 1}`
|
|
103
|
+
: version;
|
|
104
|
+
// The first release that reads namespace docs is this one or an earlier
|
|
105
|
+
// one; a later constant would make every author wait for a CLI that does
|
|
106
|
+
// not exist yet.
|
|
107
|
+
expect(semverCompare(DOCS_TREE_CLI, next)).toBeLessThanOrEqual(0);
|
|
83
108
|
});
|
|
84
109
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.6.3-canary.
|
|
3
|
+
"version": "0.6.3-canary.0550afd",
|
|
4
4
|
"displayName": "CLI",
|
|
5
5
|
"description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
"zod": "^4.4.3"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
|
-
"@astryxdesign/charts": "0.6.3-canary.
|
|
105
|
-
"@astryxdesign/core": "0.6.3-canary.
|
|
106
|
-
"@astryxdesign/lab": "0.6.3-canary.
|
|
107
|
-
"@astryxdesign/theme-neutral": "0.6.3-canary.
|
|
104
|
+
"@astryxdesign/charts": "0.6.3-canary.0550afd",
|
|
105
|
+
"@astryxdesign/core": "0.6.3-canary.0550afd",
|
|
106
|
+
"@astryxdesign/lab": "0.6.3-canary.0550afd",
|
|
107
|
+
"@astryxdesign/theme-neutral": "0.6.3-canary.0550afd"
|
|
108
108
|
},
|
|
109
109
|
"peerDependenciesMeta": {
|
|
110
110
|
"@astryxdesign/charts": {
|
|
@@ -121,10 +121,10 @@
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
|
-
"@astryxdesign/charts": "0.6.3-canary.
|
|
125
|
-
"@astryxdesign/core": "0.6.3-canary.
|
|
126
|
-
"@astryxdesign/lab": "0.6.3-canary.
|
|
127
|
-
"@astryxdesign/theme-neutral": "0.6.3-canary.
|
|
124
|
+
"@astryxdesign/charts": "0.6.3-canary.0550afd",
|
|
125
|
+
"@astryxdesign/core": "0.6.3-canary.0550afd",
|
|
126
|
+
"@astryxdesign/lab": "0.6.3-canary.0550afd",
|
|
127
|
+
"@astryxdesign/theme-neutral": "0.6.3-canary.0550afd",
|
|
128
128
|
"@heroicons/react": "^2.2.0",
|
|
129
129
|
"@stylexjs/stylex": "^0.19.0",
|
|
130
130
|
"@types/babel__core": "^7.20.5",
|