@solidactions/cli 2.0.1 → 3.0.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/README.md +53 -6
- package/dist/commands/ai-examples.js +12 -3
- package/dist/commands/dev.js +11 -2
- package/dist/commands/init.js +5 -1
- package/dist/commands/{oauth-actions-list.js → oauth-action-list.js} +4 -4
- package/dist/commands/{oauth-actions-platforms.js → oauth-action-platforms.js} +2 -2
- package/dist/commands/{oauth-actions-search.js → oauth-action-search.js} +4 -4
- package/dist/commands/{oauth-actions-show.js → oauth-action-view.js} +2 -2
- package/dist/index.js +15 -15
- package/dist/utils/examples-ref.js +34 -0
- package/dist/utils/skills.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -307,12 +307,31 @@ first three in one command.
|
|
|
307
307
|
|
|
308
308
|
1. **Build** — `npm run build` (must be clean; `tsc` errors block the release).
|
|
309
309
|
2. **Unit tests** — `npm test`. Covers config resolution, command wiring, and
|
|
310
|
-
the `oauth-
|
|
310
|
+
the `oauth-action view` snippet renderer (the highest-risk regression
|
|
311
311
|
surface — array query-param serialization and the proxy-managed header
|
|
312
312
|
filter both have fixture-backed tests under `tests/fixtures/`).
|
|
313
313
|
3. **Init smoke** — `npm run smoke:init` scaffolds a project end to end.
|
|
314
|
-
|
|
315
|
-
|
|
314
|
+
|
|
315
|
+
It serves template content from local `solidactions-examples` /
|
|
316
|
+
`solidactions-ts-sdk` checkouts, discovered beside your `solidactions-cli`
|
|
317
|
+
checkout (override with `SOLIDACTIONS_EXAMPLES_DIR` /
|
|
318
|
+
`SOLIDACTIONS_SDK_DIR`). Files are read from git **at the ref the CLI pins
|
|
319
|
+
to**, not from the checkout's working tree, so the branch a sibling happens
|
|
320
|
+
to be parked on does not affect the result; a pinned ref the checkout lacks
|
|
321
|
+
is fetched on demand.
|
|
322
|
+
|
|
323
|
+
**If a checkout is missing, the smoke SKIPs with a notice and exits 0** so a
|
|
324
|
+
clean clone can still run `check:release`. That means a local green does not
|
|
325
|
+
by itself prove the smoke ran. Set `SOLIDACTIONS_SMOKE_REQUIRE_SOURCES=1` to
|
|
326
|
+
turn a missing checkout back into a hard failure — CI's `release-candidate`
|
|
327
|
+
job sets it, so the release gate can never be skipped silently. Use it
|
|
328
|
+
locally too when you are verifying a release:
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
SOLIDACTIONS_SMOKE_REQUIRE_SOURCES=1 npm run check:release
|
|
332
|
+
```
|
|
333
|
+
4. **oauth-action smoke** — `bash scripts/smoke.sh` exercises
|
|
334
|
+
`oauth-action list|search|view` (plus the 404 path) against a real local
|
|
316
335
|
stub server, so it needs no credentials:
|
|
317
336
|
|
|
318
337
|
```bash
|
|
@@ -335,9 +354,37 @@ first three in one command.
|
|
|
335
354
|
`src/utils/sdk-version.ts`), so bumping that dependency moves the docs ref
|
|
336
355
|
with it — nothing to update by hand. `tests/sdk-docs-ref.test.ts` fails if
|
|
337
356
|
the declared range has no explicit minimum version to derive from.
|
|
338
|
-
6. **
|
|
339
|
-
|
|
340
|
-
|
|
357
|
+
6. **Examples pin** — every `solidactions-examples` fetch (`init`'s project
|
|
358
|
+
template, the installed skills, the `CLAUDE.md`/`AGENTS.md` helper content,
|
|
359
|
+
and `ai examples`) goes through `EXAMPLES_REF` in
|
|
360
|
+
`src/utils/examples-ref.ts`, so a scaffold never drifts with that repo's
|
|
361
|
+
`main`. Unlike the SDK pin above this is **not** derived — the examples repo
|
|
362
|
+
does not tag in step with the SDK — so it is a commit SHA that must be
|
|
363
|
+
bumped by hand when you want a newer template. To bump: set the constant to
|
|
364
|
+
the new commit and run `SOLIDACTIONS_SMOKE_REQUIRE_SOURCES=1 npm run
|
|
365
|
+
check:release`, which serves content at exactly that ref and so fails on a
|
|
366
|
+
bad or unreachable pin. `tests/examples-ref.test.ts` fails if any call site
|
|
367
|
+
stops passing the ref.
|
|
368
|
+
7. **Version** — the GitHub release **tag** is the single source of truth for
|
|
369
|
+
the published npm version. The publish flow from #78 has landed:
|
|
370
|
+
`.github/workflows/publish.yml` asserts the tag is a literal semver, then
|
|
371
|
+
derives the version from it with `npm version --no-git-tag-version`
|
|
372
|
+
immediately before publishing — deliberately *not* relying on a
|
|
373
|
+
`package.json` bump commit, so a release whose `package.json` was never
|
|
374
|
+
bumped can no longer collide with the registry and fail `npm publish`
|
|
375
|
+
silently (#77).
|
|
376
|
+
|
|
377
|
+
Consequences worth knowing before you cut a release:
|
|
378
|
+
|
|
379
|
+
- **`package.json`'s version is not the source of truth** and has drifted
|
|
380
|
+
from the published one. Read the registry (`npm view @solidactions/cli
|
|
381
|
+
version`) or the tag list, not the file.
|
|
382
|
+
- **Feature PRs do not bump it** — see PR #81, the `docs` → `doc` breaking
|
|
383
|
+
rename, which shipped without touching `package.json`.
|
|
384
|
+
- **A breaking change ships as a major tag.** Nothing in `check:release`
|
|
385
|
+
enforces this — the release destination is recorded in the PR and its
|
|
386
|
+
issue, and the releaser applies it when tagging. There is no changelog
|
|
387
|
+
file in this repo.
|
|
341
388
|
|
|
342
389
|
## License
|
|
343
390
|
|
|
@@ -10,14 +10,23 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
10
10
|
const prompts_1 = __importDefault(require("prompts"));
|
|
11
11
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
12
12
|
const github_1 = require("../utils/github");
|
|
13
|
+
const examples_ref_1 = require("../utils/examples-ref");
|
|
13
14
|
const markers_1 = require("../utils/markers");
|
|
15
|
+
/**
|
|
16
|
+
* Recursively download a directory from the examples repo.
|
|
17
|
+
*
|
|
18
|
+
* Every listing and fetch is pinned to EXAMPLES_REF (#86) so `ai examples`
|
|
19
|
+
* installs a consistent snapshot rather than whatever is on that repo's default
|
|
20
|
+
* branch mid-walk. Only ever called against solidactions-examples; the
|
|
21
|
+
* owner/repo parameters are structural, not a second supported source.
|
|
22
|
+
*/
|
|
14
23
|
async function downloadDirectory(owner, repo, remotePath, localPath) {
|
|
15
|
-
const contents = await (0, github_1.listRepoContents)(owner, repo, remotePath);
|
|
24
|
+
const contents = await (0, github_1.listRepoContents)(owner, repo, remotePath, examples_ref_1.EXAMPLES_REF);
|
|
16
25
|
fs_extra_1.default.ensureDirSync(localPath);
|
|
17
26
|
for (const item of contents) {
|
|
18
27
|
const localItemPath = path_1.default.join(localPath, item.name);
|
|
19
28
|
if (item.type === 'file') {
|
|
20
|
-
const content = await (0, github_1.fetchRawFile)(owner, repo, `${remotePath}/${item.name}
|
|
29
|
+
const content = await (0, github_1.fetchRawFile)(owner, repo, `${remotePath}/${item.name}`, examples_ref_1.EXAMPLES_REF);
|
|
21
30
|
fs_1.default.writeFileSync(localItemPath, content, 'utf8');
|
|
22
31
|
}
|
|
23
32
|
else if (item.type === 'dir') {
|
|
@@ -29,7 +38,7 @@ async function aiExamples(names, options = {}) {
|
|
|
29
38
|
try {
|
|
30
39
|
console.log(chalk_1.default.blue('Discovering available examples...'));
|
|
31
40
|
// Discover available examples
|
|
32
|
-
const repoContents = await (0, github_1.listRepoContents)('SolidActions', 'solidactions-examples');
|
|
41
|
+
const repoContents = await (0, github_1.listRepoContents)('SolidActions', 'solidactions-examples', '', examples_ref_1.EXAMPLES_REF);
|
|
33
42
|
const availableExamples = repoContents.filter((item) => item.type === 'dir' && !item.name.startsWith('.'));
|
|
34
43
|
if (availableExamples.length === 0) {
|
|
35
44
|
console.log(chalk_1.default.yellow('No examples found in the repository.'));
|
package/dist/commands/dev.js
CHANGED
|
@@ -667,7 +667,13 @@ function hasTsLoader() {
|
|
|
667
667
|
function reexecUnderTsx(file, env, input, projectDir) {
|
|
668
668
|
// dist/src/commands/dev.js → CLI entry is dist/index.js (two dirs up).
|
|
669
669
|
const cliEntry = path_1.default.resolve(__dirname, '..', 'index.js');
|
|
670
|
-
|
|
670
|
+
// This function sets the child's cwd to projectDir, so the entry MUST be
|
|
671
|
+
// absolute by the time it is forwarded — a relative path would resolve
|
|
672
|
+
// against the parent's cwd here and the child's cwd there, yielding a
|
|
673
|
+
// doubled path when the run started outside the project root (#85).
|
|
674
|
+
// Resolved against the caller's cwd, which is still current.
|
|
675
|
+
const entry = path_1.default.resolve(file);
|
|
676
|
+
const args = ['tsx', cliEntry, 'dev', entry, '--input', input];
|
|
671
677
|
if (env) {
|
|
672
678
|
args.push('--env', env);
|
|
673
679
|
}
|
|
@@ -728,7 +734,10 @@ async function dev(file, options) {
|
|
|
728
734
|
process.exit(1);
|
|
729
735
|
}
|
|
730
736
|
}
|
|
731
|
-
|
|
737
|
+
// Forward the RESOLVED path, not the original argument: the child's cwd
|
|
738
|
+
// is projectDir, so a relative arg would be resolved a second time
|
|
739
|
+
// against a different directory (#85).
|
|
740
|
+
process.exit(reexecUnderTsx(filePath, env, input, projectDir));
|
|
732
741
|
}
|
|
733
742
|
// In-process path (already under a TS loader, or a .js/.mjs entry).
|
|
734
743
|
let result;
|
package/dist/commands/init.js
CHANGED
|
@@ -10,6 +10,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
10
10
|
const chalk_1 = __importDefault(require("chalk"));
|
|
11
11
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
12
12
|
const github_1 = require("../utils/github");
|
|
13
|
+
const examples_ref_1 = require("../utils/examples-ref");
|
|
13
14
|
const ai_init_1 = require("./ai-init");
|
|
14
15
|
const EXAMPLES_OWNER = 'SolidActions';
|
|
15
16
|
const EXAMPLES_REPO = 'solidactions-examples';
|
|
@@ -68,7 +69,10 @@ async function init(directory, options = {}) {
|
|
|
68
69
|
console.log(chalk_1.default.blue(`Scaffolding "${projectName}" in ${targetDir}...`));
|
|
69
70
|
for (const [remoteSuffix, localSuffix] of exports.TEMPLATE_FILES) {
|
|
70
71
|
const remotePath = `${TEMPLATE_PREFIX}/${remoteSuffix}`;
|
|
71
|
-
|
|
72
|
+
// Pinned to EXAMPLES_REF: unpinned, this loop scaffolded whatever
|
|
73
|
+
// was on the examples repo's default branch — including the
|
|
74
|
+
// @solidactions/sdk version the new project declares (#86).
|
|
75
|
+
let content = await (0, github_1.fetchRawFile)(EXAMPLES_OWNER, EXAMPLES_REPO, remotePath, examples_ref_1.EXAMPLES_REF);
|
|
72
76
|
content = content.replace(/__PROJECT_NAME__/g, projectName);
|
|
73
77
|
const outPath = path_1.default.join(targetDir, localSuffix);
|
|
74
78
|
fs_extra_1.default.ensureDirSync(path_1.default.dirname(outPath));
|
|
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.oauthActionList = oauthActionList;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const api_1 = require("../utils/api");
|
|
10
|
-
async function
|
|
10
|
+
async function oauthActionList(platform, options) {
|
|
11
11
|
const config = await (0, api_1.requireConfigWithWorkspace)();
|
|
12
12
|
try {
|
|
13
13
|
const params = { platform };
|
|
@@ -31,11 +31,11 @@ async function oauthActionsList(platform, options) {
|
|
|
31
31
|
console.log(`${chalk_1.default.cyan(method)} ${chalk_1.default.white(a.path.padEnd(50))} ${chalk_1.default.gray('— ' + (a.title || ''))}`);
|
|
32
32
|
}
|
|
33
33
|
console.log('');
|
|
34
|
-
console.log(chalk_1.default.gray(`${actions.length} action(s) — use "solidactions oauth-
|
|
34
|
+
console.log(chalk_1.default.gray(`${actions.length} action(s) — use "solidactions oauth-action search ${platform} <query>" to narrow, or "oauth-action view ${platform} <action_id>" for detail.`));
|
|
35
35
|
}
|
|
36
36
|
catch (error) {
|
|
37
37
|
if (error.response?.status === 404 && error.response.data?.code === 'platform_unknown') {
|
|
38
|
-
console.error(chalk_1.default.red(`Unknown platform "${platform}". Run \`solidactions oauth-
|
|
38
|
+
console.error(chalk_1.default.red(`Unknown platform "${platform}". Run \`solidactions oauth-action platforms\` to see available platforms.`));
|
|
39
39
|
}
|
|
40
40
|
else if (error.response?.status === 401) {
|
|
41
41
|
console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global".'));
|
|
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.oauthActionPlatforms = oauthActionPlatforms;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const api_1 = require("../utils/api");
|
|
10
|
-
async function
|
|
10
|
+
async function oauthActionPlatforms(options) {
|
|
11
11
|
const config = await (0, api_1.requireConfigWithWorkspace)();
|
|
12
12
|
try {
|
|
13
13
|
const response = await axios_1.default.get(`${config.host}/api/v1/oauth-actions/platforms`, {
|
|
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.oauthActionSearch = oauthActionSearch;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const api_1 = require("../utils/api");
|
|
10
|
-
async function
|
|
10
|
+
async function oauthActionSearch(platform, query, options) {
|
|
11
11
|
const config = await (0, api_1.requireConfigWithWorkspace)();
|
|
12
12
|
try {
|
|
13
13
|
const params = { platform };
|
|
@@ -42,11 +42,11 @@ async function oauthActionsSearch(platform, query, options) {
|
|
|
42
42
|
console.log('');
|
|
43
43
|
}
|
|
44
44
|
console.log(chalk_1.default.gray(`${actions.length} action(s) found.`));
|
|
45
|
-
console.log(chalk_1.default.gray(`Run 'solidactions oauth-
|
|
45
|
+
console.log(chalk_1.default.gray(`Run 'solidactions oauth-action view ${platform} <action_id>' for full schema + paste-ready snippet.`));
|
|
46
46
|
}
|
|
47
47
|
catch (error) {
|
|
48
48
|
if (error.response?.status === 404 && error.response.data?.code === 'platform_unknown') {
|
|
49
|
-
console.error(chalk_1.default.red(`Unknown platform "${platform}". Run \`solidactions oauth-
|
|
49
|
+
console.error(chalk_1.default.red(`Unknown platform "${platform}". Run \`solidactions oauth-action platforms\` to see available platforms.`));
|
|
50
50
|
}
|
|
51
51
|
else if (error.response?.status === 401) {
|
|
52
52
|
console.error(chalk_1.default.red('Authentication failed. Run "solidactions login --global" to re-configure.'));
|
|
@@ -3,12 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.oauthActionView = oauthActionView;
|
|
7
7
|
exports.buildSnippet = buildSnippet;
|
|
8
8
|
const axios_1 = __importDefault(require("axios"));
|
|
9
9
|
const chalk_1 = __importDefault(require("chalk"));
|
|
10
10
|
const api_1 = require("../utils/api");
|
|
11
|
-
async function
|
|
11
|
+
async function oauthActionView(platform, actionId, options) {
|
|
12
12
|
const config = await (0, api_1.requireConfigWithWorkspace)();
|
|
13
13
|
try {
|
|
14
14
|
const response = await axios_1.default.get(`${config.host}/api/v1/oauth-actions/${platform}/${encodeURIComponent(actionId)}`, {
|
package/dist/index.js
CHANGED
|
@@ -63,10 +63,10 @@ const webhook_secret_1 = require("./commands/webhook-secret");
|
|
|
63
63
|
const dev_1 = require("./commands/dev");
|
|
64
64
|
const ai_init_1 = require("./commands/ai-init");
|
|
65
65
|
const ai_examples_1 = require("./commands/ai-examples");
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const
|
|
66
|
+
const oauth_action_search_1 = require("./commands/oauth-action-search");
|
|
67
|
+
const oauth_action_list_1 = require("./commands/oauth-action-list");
|
|
68
|
+
const oauth_action_view_1 = require("./commands/oauth-action-view");
|
|
69
|
+
const oauth_action_platforms_1 = require("./commands/oauth-action-platforms");
|
|
70
70
|
const workspaces_1 = require("./commands/workspaces");
|
|
71
71
|
const skill_push_1 = require("./commands/skill-push");
|
|
72
72
|
const skill_publish_1 = require("./commands/skill-publish");
|
|
@@ -499,41 +499,41 @@ Where the pin is saved (--local / --global):
|
|
|
499
499
|
await (0, workspaces_1.workspaceSet)(input, opts);
|
|
500
500
|
});
|
|
501
501
|
// =============================================================================
|
|
502
|
-
// oauth-
|
|
502
|
+
// oauth-action <subcommand>
|
|
503
503
|
// =============================================================================
|
|
504
|
-
const
|
|
505
|
-
|
|
504
|
+
const oauthActionCmd = program.command('oauth-action').description('Discover OAuth-backed API operations callable via the SA proxy');
|
|
505
|
+
oauthActionCmd
|
|
506
506
|
.command('search <platform> [query]')
|
|
507
507
|
.description('Search available actions for a connected platform')
|
|
508
508
|
.option('--method <method>', 'Filter by HTTP method (GET, POST, etc.)')
|
|
509
509
|
.option('--limit <n>', 'Maximum results to return', (v) => parseInt(v, 10))
|
|
510
510
|
.option('--json', 'Emit raw JSON for AI/script consumption')
|
|
511
511
|
.action((platform, query, options) => {
|
|
512
|
-
(0,
|
|
512
|
+
(0, oauth_action_search_1.oauthActionSearch)(platform, query, options);
|
|
513
513
|
});
|
|
514
|
-
|
|
514
|
+
oauthActionCmd
|
|
515
515
|
.command('list <platform>')
|
|
516
516
|
.description('List actions for a connected platform')
|
|
517
517
|
.option('--limit <n>', 'Maximum results to return', (v) => parseInt(v, 10))
|
|
518
518
|
.option('--json', 'Emit raw JSON for AI/script consumption')
|
|
519
519
|
.action((platform, options) => {
|
|
520
|
-
(0,
|
|
520
|
+
(0, oauth_action_list_1.oauthActionList)(platform, options);
|
|
521
521
|
});
|
|
522
|
-
|
|
523
|
-
.command('
|
|
522
|
+
oauthActionCmd
|
|
523
|
+
.command('view <platform> <action-id>')
|
|
524
524
|
.description('Show full schema, example body, and a paste-ready fetch snippet for one action')
|
|
525
525
|
.option('--json', 'Emit raw JSON for AI/script consumption')
|
|
526
526
|
.option('--var <NAME>', 'ctx.vars variable name for the connection (default: YOUR_CONNECTION)')
|
|
527
527
|
.option('--legacy-env', 'Emit the deprecated process.env-based snippet (will be removed in a future release)')
|
|
528
528
|
.action((platform, actionId, options) => {
|
|
529
|
-
(0,
|
|
529
|
+
(0, oauth_action_view_1.oauthActionView)(platform, actionId, options);
|
|
530
530
|
});
|
|
531
|
-
|
|
531
|
+
oauthActionCmd
|
|
532
532
|
.command('platforms')
|
|
533
533
|
.description('List available OAuth-backed platforms')
|
|
534
534
|
.option('--json', 'Emit raw JSON for AI/script consumption')
|
|
535
535
|
.action((options) => {
|
|
536
|
-
(0,
|
|
536
|
+
(0, oauth_action_platforms_1.oauthActionPlatforms)(options);
|
|
537
537
|
});
|
|
538
538
|
// =============================================================================
|
|
539
539
|
// ai <subcommand>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EXAMPLES_REF = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The git ref used for every fetch from the solidactions-examples repo:
|
|
6
|
+
* `init`'s project template (TEMPLATE_FILES) and the AI skills / helper content
|
|
7
|
+
* installed alongside it.
|
|
8
|
+
*
|
|
9
|
+
* These fetches previously defaulted to `main`, so the scaffold a user got —
|
|
10
|
+
* including the `@solidactions/sdk` version their new project depends on — was
|
|
11
|
+
* whatever happened to be on that repo's default branch at that moment. That is
|
|
12
|
+
* the same unpinned-fetch class as the SDK docs fetch fixed in #39; see
|
|
13
|
+
* {@link ./sdk-version.ts}.
|
|
14
|
+
*
|
|
15
|
+
* WHY A COMMIT SHA AND NOT A TAG: the SDK pin derives its ref from this CLI's
|
|
16
|
+
* declared `@solidactions/sdk` range, because the SDK repo tags `vX.Y.Z` in step
|
|
17
|
+
* with the package it publishes. solidactions-examples does NOT version in
|
|
18
|
+
* lockstep with the SDK — its newest tag (v0.7.0) predates the current template
|
|
19
|
+
* by a wide margin: it declares `@solidactions/sdk` ^0.6.0 (this CLI declares
|
|
20
|
+
* ^0.7.3) and lacks skills/solidactions-crew-skills.md entirely. Pinning to that
|
|
21
|
+
* tag would regress every new scaffold, so the same derived-version scheme cannot
|
|
22
|
+
* apply here. A commit SHA is immutable and gives the property that actually
|
|
23
|
+
* matters — the scaffold no longer moves under us.
|
|
24
|
+
*
|
|
25
|
+
* TO UPDATE: point this at the new solidactions-examples commit and re-run
|
|
26
|
+
* `npm run check:release`; smoke:init serves template content at exactly this
|
|
27
|
+
* ref, so a bad or unreachable SHA fails the release check rather than reaching
|
|
28
|
+
* users. If solidactions-examples ever starts publishing tags in step with the
|
|
29
|
+
* SDK, replace this with a derivation the way sdk-version.ts does.
|
|
30
|
+
*
|
|
31
|
+
* Currently: solidactions-examples main @ 3ca5fd4 "docs: publish examples and AI
|
|
32
|
+
* skill guidance (#23)".
|
|
33
|
+
*/
|
|
34
|
+
exports.EXAMPLES_REF = '3ca5fd4d3107659b27889775791f6691cf173303';
|
package/dist/utils/skills.js
CHANGED
|
@@ -12,6 +12,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
12
12
|
const path_1 = __importDefault(require("path"));
|
|
13
13
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
14
14
|
const github_1 = require("./github");
|
|
15
|
+
const examples_ref_1 = require("./examples-ref");
|
|
15
16
|
exports.SOLIDACTIONS_SKILL_NAMES = [
|
|
16
17
|
'solidactions-getting-started',
|
|
17
18
|
'solidactions-workflow-coding',
|
|
@@ -47,7 +48,7 @@ async function installSkills(targetDir) {
|
|
|
47
48
|
fs_extra_1.default.ensureDirSync(targetDir);
|
|
48
49
|
for (const skillName of exports.SOLIDACTIONS_SKILL_NAMES) {
|
|
49
50
|
const remotePath = `${SKILLS_PATH_PREFIX}/${skillName}.md`;
|
|
50
|
-
const content = await (0, github_1.fetchRawFile)(EXAMPLES_OWNER, EXAMPLES_REPO, remotePath);
|
|
51
|
+
const content = await (0, github_1.fetchRawFile)(EXAMPLES_OWNER, EXAMPLES_REPO, remotePath, examples_ref_1.EXAMPLES_REF);
|
|
51
52
|
const filePath = path_1.default.join(targetDir, `${skillName}.md`);
|
|
52
53
|
fs_1.default.writeFileSync(filePath, content, 'utf8');
|
|
53
54
|
written.push(filePath);
|
|
@@ -59,7 +60,7 @@ async function installSkills(targetDir) {
|
|
|
59
60
|
* repo. Single source per target — no legacy fallback.
|
|
60
61
|
*/
|
|
61
62
|
async function fetchAiHelperContent(targetFile) {
|
|
62
|
-
return (0, github_1.fetchRawFile)(EXAMPLES_OWNER, EXAMPLES_REPO, targetFile);
|
|
63
|
+
return (0, github_1.fetchRawFile)(EXAMPLES_OWNER, EXAMPLES_REPO, targetFile, examples_ref_1.EXAMPLES_REF);
|
|
63
64
|
}
|
|
64
65
|
/**
|
|
65
66
|
* True when the project dir already has SolidActions skill files installed
|