@sharpee/devkit 1.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.
Files changed (73) hide show
  1. package/cli.d.ts +3 -0
  2. package/cli.d.ts.map +1 -0
  3. package/cli.js +219 -0
  4. package/cli.js.map +1 -0
  5. package/commands/browser.d.ts +10 -0
  6. package/commands/browser.d.ts.map +1 -0
  7. package/commands/browser.js +107 -0
  8. package/commands/browser.js.map +1 -0
  9. package/commands/build.d.ts +38 -0
  10. package/commands/build.d.ts.map +1 -0
  11. package/commands/build.js +165 -0
  12. package/commands/build.js.map +1 -0
  13. package/commands/bundle.d.ts +9 -0
  14. package/commands/bundle.d.ts.map +1 -0
  15. package/commands/bundle.js +46 -0
  16. package/commands/bundle.js.map +1 -0
  17. package/commands/clean.d.ts +7 -0
  18. package/commands/clean.d.ts.map +1 -0
  19. package/commands/clean.js +31 -0
  20. package/commands/clean.js.map +1 -0
  21. package/commands/register.d.ts +5 -0
  22. package/commands/register.d.ts.map +1 -0
  23. package/commands/register.js +45 -0
  24. package/commands/register.js.map +1 -0
  25. package/commands/test-npm.d.ts +34 -0
  26. package/commands/test-npm.d.ts.map +1 -0
  27. package/commands/test-npm.js +155 -0
  28. package/commands/test-npm.js.map +1 -0
  29. package/commands/verify.d.ts +7 -0
  30. package/commands/verify.d.ts.map +1 -0
  31. package/commands/verify.js +27 -0
  32. package/commands/verify.js.map +1 -0
  33. package/commands/zifmia.d.ts +10 -0
  34. package/commands/zifmia.d.ts.map +1 -0
  35. package/commands/zifmia.js +56 -0
  36. package/commands/zifmia.js.map +1 -0
  37. package/consumer-gen.d.ts +49 -0
  38. package/consumer-gen.d.ts.map +1 -0
  39. package/consumer-gen.js +137 -0
  40. package/consumer-gen.js.map +1 -0
  41. package/index.d.ts +29 -0
  42. package/index.d.ts.map +1 -0
  43. package/index.js +55 -0
  44. package/index.js.map +1 -0
  45. package/package.json +42 -0
  46. package/registry.d.ts +33 -0
  47. package/registry.d.ts.map +1 -0
  48. package/registry.js +81 -0
  49. package/registry.js.map +1 -0
  50. package/repo.d.ts +64 -0
  51. package/repo.d.ts.map +1 -0
  52. package/repo.js +185 -0
  53. package/repo.js.map +1 -0
  54. package/standalone/build-browser.d.ts +10 -0
  55. package/standalone/build-browser.d.ts.map +1 -0
  56. package/standalone/build-browser.js +208 -0
  57. package/standalone/build-browser.js.map +1 -0
  58. package/standalone/build.d.ts +8 -0
  59. package/standalone/build.d.ts.map +1 -0
  60. package/standalone/build.js +319 -0
  61. package/standalone/build.js.map +1 -0
  62. package/standalone/ifid.d.ts +2 -0
  63. package/standalone/ifid.d.ts.map +1 -0
  64. package/standalone/ifid.js +71 -0
  65. package/standalone/ifid.js.map +1 -0
  66. package/standalone/init-browser.d.ts +10 -0
  67. package/standalone/init-browser.d.ts.map +1 -0
  68. package/standalone/init-browser.js +194 -0
  69. package/standalone/init-browser.js.map +1 -0
  70. package/standalone/init.d.ts +10 -0
  71. package/standalone/init.d.ts.map +1 -0
  72. package/standalone/init.js +183 -0
  73. package/standalone/init.js.map +1 -0
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scanStaging = scanStaging;
4
+ exports.readSharpeeSeed = readSharpeeSeed;
5
+ exports.computeClosure = computeClosure;
6
+ exports.stagingDepsOf = stagingDepsOf;
7
+ exports.generateConsumer = generateConsumer;
8
+ /**
9
+ * consumer-gen.ts — generate a consumer `package.json` that installs a story's
10
+ * `@sharpee/*` closure either from the local `tsf build --npm` staging (tarballs)
11
+ * or from the registry (version refs).
12
+ *
13
+ * Owner context: @sharpee/devkit `test:npm` command (ADR-180 Phase 2). This is the
14
+ * single, drift-free replacement for the hand-listed dep arrays in npm-test/ and
15
+ * npm-test-dungeo/ and the standalone gen-consumer.mjs in npm-test-familyzoo/.
16
+ *
17
+ * Public interface:
18
+ * scanStaging(stagingDir) -> name->dir map of @sharpee packages
19
+ * readSharpeeSeed(storyPkgPath) -> story's direct @sharpee deps
20
+ * computeClosure(seed, depsOf) -> full transitive @sharpee set (pure)
21
+ * generateConsumer(opts) -> writes package.json (+ tarballs for local)
22
+ */
23
+ const node_child_process_1 = require("node:child_process");
24
+ const node_fs_1 = require("node:fs");
25
+ const node_path_1 = require("node:path");
26
+ const SHARPEE = '@sharpee/';
27
+ /** transcript-tester supplies the `transcript-test` bin (dev-only). */
28
+ const TT = '@sharpee/transcript-tester';
29
+ /**
30
+ * Map `@sharpee/<x>` package name -> its staging subdirectory. The directory name
31
+ * is not assumed to equal the short package name, so each package.json is read.
32
+ * @throws if stagingDir does not exist.
33
+ */
34
+ function scanStaging(stagingDir) {
35
+ if (!(0, node_fs_1.existsSync)(stagingDir)) {
36
+ throw new Error(`local npm staging not found at ${stagingDir} — run \`tsf build --npm\` first`);
37
+ }
38
+ const map = {};
39
+ for (const d of (0, node_fs_1.readdirSync)(stagingDir, { withFileTypes: true })) {
40
+ if (!d.isDirectory())
41
+ continue;
42
+ const pj = (0, node_path_1.join)(stagingDir, d.name, 'package.json');
43
+ if (!(0, node_fs_1.existsSync)(pj))
44
+ continue;
45
+ const p = JSON.parse((0, node_fs_1.readFileSync)(pj, 'utf8'));
46
+ if (typeof p.name === 'string' && p.name.startsWith(SHARPEE))
47
+ map[p.name] = d.name;
48
+ }
49
+ return map;
50
+ }
51
+ /** The story's directly-declared `@sharpee/*` dependencies (the closure seed). */
52
+ function readSharpeeSeed(storyPkgPath) {
53
+ const pkg = JSON.parse((0, node_fs_1.readFileSync)(storyPkgPath, 'utf8'));
54
+ return Object.keys(pkg.dependencies || {}).filter((n) => n.startsWith(SHARPEE));
55
+ }
56
+ /**
57
+ * Transitive closure over `@sharpee/*` deps. Pure: `depsOf(name)` returns the
58
+ * `@sharpee/*` deps of `name`. Returns every reachable package including the seed.
59
+ */
60
+ function computeClosure(seed, depsOf) {
61
+ const closure = new Set();
62
+ const stack = [...seed];
63
+ while (stack.length) {
64
+ const n = stack.pop();
65
+ if (closure.has(n))
66
+ continue;
67
+ closure.add(n);
68
+ for (const d of depsOf(n))
69
+ if (!closure.has(d))
70
+ stack.push(d);
71
+ }
72
+ return closure;
73
+ }
74
+ /** `depsOf` backed by the staging map — only deps present in staging are followed. */
75
+ function stagingDepsOf(stagingDir, staging, name) {
76
+ const dir = staging[name];
77
+ if (!dir)
78
+ return [];
79
+ const p = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(stagingDir, dir, 'package.json'), 'utf8'));
80
+ return Object.keys(p.dependencies || {}).filter((n) => n.startsWith(SHARPEE) && staging[n]);
81
+ }
82
+ /**
83
+ * Generate the consumer package.json.
84
+ *
85
+ * Local mode packs the story's **full transitive `@sharpee` closure** into tarballs
86
+ * and `file:`-refs them — required because `file:` deps do not resolve their own
87
+ * `@sharpee` deps from anywhere. Registry mode declares only the story's **seed**
88
+ * `@sharpee` deps and lets npm resolve transitive deps from the registry, exactly
89
+ * as a real consumer install would (avoids staging-vs-registry graph divergence).
90
+ *
91
+ * @throws (local mode) if any seed dep is absent from the local staging.
92
+ */
93
+ function generateConsumer(opts) {
94
+ const { mode, storyPkgPath, vendorDir, outPkgPath } = opts;
95
+ const seed = readSharpeeSeed(storyPkgPath);
96
+ const dependencies = {};
97
+ const devDependencies = { typescript: '^5.0.0' };
98
+ let written;
99
+ let haveTT;
100
+ if (mode === 'local') {
101
+ const staging = scanStaging(opts.stagingDir);
102
+ const missing = seed.filter((n) => !staging[n]);
103
+ if (missing.length) {
104
+ throw new Error(`story deps absent from local staging: ${missing.join(', ')} — run \`tsf build --npm\` first`);
105
+ }
106
+ const pack = (name) => {
107
+ const dir = (0, node_path_1.join)(opts.stagingDir, staging[name]);
108
+ const out = (0, node_child_process_1.execFileSync)('npm', ['pack', dir, '--pack-destination', vendorDir, '--ignore-scripts', '--json'], { encoding: 'utf8' });
109
+ return JSON.parse(out)[0].filename;
110
+ };
111
+ written = [...computeClosure(seed, (n) => stagingDepsOf(opts.stagingDir, staging, n))].sort();
112
+ for (const n of written)
113
+ dependencies[n] = `file:vendor/${pack(n)}`;
114
+ haveTT = Boolean(staging[TT]);
115
+ if (haveTT)
116
+ devDependencies[TT] = `file:vendor/${pack(TT)}`;
117
+ }
118
+ else {
119
+ const version = opts.registryVersion || 'latest';
120
+ written = [...seed].sort();
121
+ for (const n of written)
122
+ dependencies[n] = version;
123
+ haveTT = true; // transcript-tester is published; npm resolves it from the registry
124
+ devDependencies[TT] = version;
125
+ }
126
+ (0, node_fs_1.writeFileSync)(outPkgPath, JSON.stringify({
127
+ name: 'sharpee-devkit-consumer',
128
+ version: '1.0.0',
129
+ private: true,
130
+ description: `devkit test:npm consumer (${mode})`,
131
+ main: 'dist/index.js',
132
+ dependencies,
133
+ devDependencies,
134
+ }, null, 2) + '\n');
135
+ return { closure: written, haveTranscriptTester: haveTT };
136
+ }
137
+ //# sourceMappingURL=consumer-gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consumer-gen.js","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/devkit/src/consumer-gen.ts"],"names":[],"mappings":";;AA8BA,kCAaC;AAGD,0CAGC;AAMD,wCAUC;AAGD,sCAKC;AAmCD,4CAwDC;AApKD;;;;;;;;;;;;;;GAcG;AACH,2DAAkD;AAClD,qCAA+E;AAC/E,yCAAiC;AAEjC,MAAM,OAAO,GAAG,WAAW,CAAC;AAC5B,uEAAuE;AACvE,MAAM,EAAE,GAAG,4BAA4B,CAAC;AAIxC;;;;GAIG;AACH,SAAgB,WAAW,CAAC,UAAkB;IAC5C,IAAI,CAAC,IAAA,oBAAU,EAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,kCAAkC,UAAU,kCAAkC,CAAC,CAAC;IAClG,CAAC;IACD,MAAM,GAAG,GAAe,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,IAAA,qBAAW,EAAC,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QACjE,IA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O,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3B,KAAK,MAAM,CAAC,IAAI,OAAO;YAAE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;QACnD,MAAM,GAAG,IAAI,CAAC,CAAC,oEAAoE;QACnF,eAAe,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC;IAChC,CAAC;IAED,IAAA,uBAAa,EACX,UAAU,EACV,IAAI,CAAC,SAAS,CACZ;QACE,IAAI,EAAE,yBAAyB;QAC/B,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,6BAA6B,IAAI,GAAG;QACjD,IAAI,EAAE,eAAe;QACrB,YAAY;QACZ,eAAe;KAChB,EACD,IAAI,EACJ,CAAC,CACF,GAAG,IAAI,CACT,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,CAAC;AAC5D,CAAC"}
package/index.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @sharpee/devkit — Sharpee build/test/verify orchestration (ADR-180).
3
+ *
4
+ * Owner context: published authoring devtool. devkit orchestrates; tsf compiles.
5
+ * Public interface: the `devkit` CLI bin (see cli.ts) plus the programmatic
6
+ * surfaces below for embedding/testing.
7
+ */
8
+ export { runTestNpm } from './commands/test-npm';
9
+ export type { TestNpmOptions, TestNpmResult } from './commands/test-npm';
10
+ export { DEFAULT_STAGING } from './commands/test-npm';
11
+ export { runBuild, stampVersions, buildPlatform, generateGenaiApi, buildStory } from './commands/build';
12
+ export type { BuildOptions } from './commands/build';
13
+ export { runBundle } from './commands/bundle';
14
+ export type { BundleOptions } from './commands/bundle';
15
+ export { buildBrowserClient } from './commands/browser';
16
+ export type { BrowserBuildOptions } from './commands/browser';
17
+ export { buildZifmiaServer } from './commands/zifmia';
18
+ export type { ZifmiaBuildOptions } from './commands/zifmia';
19
+ export { runClean } from './commands/clean';
20
+ export type { CleanOptions } from './commands/clean';
21
+ export { runRegister, runList } from './commands/register';
22
+ export { registryPath, readRegistry, registerStory, listStories, lookupStory } from './registry';
23
+ export type { Registry, RegistryEntry } from './registry';
24
+ export { runVerify } from './commands/verify';
25
+ export type { VerifyOptions } from './commands/verify';
26
+ export { findRepoRoot, resolveStoryDir, resolveStory, findMonorepoRoot, detectMode, PLATFORM_PACKAGES, BUNDLE_ALIASES, BUNDLE_DTS, } from './repo';
27
+ export { generateConsumer, scanStaging, readSharpeeSeed, computeClosure, stagingDepsOf, } from './consumer-gen';
28
+ export type { StagingMap, GenerateConsumerOptions, GenerateConsumerResult, } from './consumer-gen';
29
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/devkit/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACxG,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjG,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,UAAU,GACX,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,cAAc,EACd,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,UAAU,EACV,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC"}
package/index.js ADDED
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stagingDepsOf = exports.computeClosure = exports.readSharpeeSeed = exports.scanStaging = exports.generateConsumer = exports.BUNDLE_DTS = exports.BUNDLE_ALIASES = exports.PLATFORM_PACKAGES = exports.detectMode = exports.findMonorepoRoot = exports.resolveStory = exports.resolveStoryDir = exports.findRepoRoot = exports.runVerify = exports.lookupStory = exports.listStories = exports.registerStory = exports.readRegistry = exports.registryPath = exports.runList = exports.runRegister = exports.runClean = exports.buildZifmiaServer = exports.buildBrowserClient = exports.runBundle = exports.buildStory = exports.generateGenaiApi = exports.buildPlatform = exports.stampVersions = exports.runBuild = exports.DEFAULT_STAGING = exports.runTestNpm = void 0;
4
+ /**
5
+ * @sharpee/devkit — Sharpee build/test/verify orchestration (ADR-180).
6
+ *
7
+ * Owner context: published authoring devtool. devkit orchestrates; tsf compiles.
8
+ * Public interface: the `devkit` CLI bin (see cli.ts) plus the programmatic
9
+ * surfaces below for embedding/testing.
10
+ */
11
+ var test_npm_1 = require("./commands/test-npm");
12
+ Object.defineProperty(exports, "runTestNpm", { enumerable: true, get: function () { return test_npm_1.runTestNpm; } });
13
+ var test_npm_2 = require("./commands/test-npm");
14
+ Object.defineProperty(exports, "DEFAULT_STAGING", { enumerable: true, get: function () { return test_npm_2.DEFAULT_STAGING; } });
15
+ var build_1 = require("./commands/build");
16
+ Object.defineProperty(exports, "runBuild", { enumerable: true, get: function () { return build_1.runBuild; } });
17
+ Object.defineProperty(exports, "stampVersions", { enumerable: true, get: function () { return build_1.stampVersions; } });
18
+ Object.defineProperty(exports, "buildPlatform", { enumerable: true, get: function () { return build_1.buildPlatform; } });
19
+ Object.defineProperty(exports, "generateGenaiApi", { enumerable: true, get: function () { return build_1.generateGenaiApi; } });
20
+ Object.defineProperty(exports, "buildStory", { enumerable: true, get: function () { return build_1.buildStory; } });
21
+ var bundle_1 = require("./commands/bundle");
22
+ Object.defineProperty(exports, "runBundle", { enumerable: true, get: function () { return bundle_1.runBundle; } });
23
+ var browser_1 = require("./commands/browser");
24
+ Object.defineProperty(exports, "buildBrowserClient", { enumerable: true, get: function () { return browser_1.buildBrowserClient; } });
25
+ var zifmia_1 = require("./commands/zifmia");
26
+ Object.defineProperty(exports, "buildZifmiaServer", { enumerable: true, get: function () { return zifmia_1.buildZifmiaServer; } });
27
+ var clean_1 = require("./commands/clean");
28
+ Object.defineProperty(exports, "runClean", { enumerable: true, get: function () { return clean_1.runClean; } });
29
+ var register_1 = require("./commands/register");
30
+ Object.defineProperty(exports, "runRegister", { enumerable: true, get: function () { return register_1.runRegister; } });
31
+ Object.defineProperty(exports, "runList", { enumerable: true, get: function () { return register_1.runList; } });
32
+ var registry_1 = require("./registry");
33
+ Object.defineProperty(exports, "registryPath", { enumerable: true, get: function () { return registry_1.registryPath; } });
34
+ Object.defineProperty(exports, "readRegistry", { enumerable: true, get: function () { return registry_1.readRegistry; } });
35
+ Object.defineProperty(exports, "registerStory", { enumerable: true, get: function () { return registry_1.registerStory; } });
36
+ Object.defineProperty(exports, "listStories", { enumerable: true, get: function () { return registry_1.listStories; } });
37
+ Object.defineProperty(exports, "lookupStory", { enumerable: true, get: function () { return registry_1.lookupStory; } });
38
+ var verify_1 = require("./commands/verify");
39
+ Object.defineProperty(exports, "runVerify", { enumerable: true, get: function () { return verify_1.runVerify; } });
40
+ var repo_1 = require("./repo");
41
+ Object.defineProperty(exports, "findRepoRoot", { enumerable: true, get: function () { return repo_1.findRepoRoot; } });
42
+ Object.defineProperty(exports, "resolveStoryDir", { enumerable: true, get: function () { return repo_1.resolveStoryDir; } });
43
+ Object.defineProperty(exports, "resolveStory", { enumerable: true, get: function () { return repo_1.resolveStory; } });
44
+ Object.defineProperty(exports, "findMonorepoRoot", { enumerable: true, get: function () { return repo_1.findMonorepoRoot; } });
45
+ Object.defineProperty(exports, "detectMode", { enumerable: true, get: function () { return repo_1.detectMode; } });
46
+ Object.defineProperty(exports, "PLATFORM_PACKAGES", { enumerable: true, get: function () { return repo_1.PLATFORM_PACKAGES; } });
47
+ Object.defineProperty(exports, "BUNDLE_ALIASES", { enumerable: true, get: function () { return repo_1.BUNDLE_ALIASES; } });
48
+ Object.defineProperty(exports, "BUNDLE_DTS", { enumerable: true, get: function () { return repo_1.BUNDLE_DTS; } });
49
+ var consumer_gen_1 = require("./consumer-gen");
50
+ Object.defineProperty(exports, "generateConsumer", { enumerable: true, get: function () { return consumer_gen_1.generateConsumer; } });
51
+ Object.defineProperty(exports, "scanStaging", { enumerable: true, get: function () { return consumer_gen_1.scanStaging; } });
52
+ Object.defineProperty(exports, "readSharpeeSeed", { enumerable: true, get: function () { return consumer_gen_1.readSharpeeSeed; } });
53
+ Object.defineProperty(exports, "computeClosure", { enumerable: true, get: function () { return consumer_gen_1.computeClosure; } });
54
+ Object.defineProperty(exports, "stagingDepsOf", { enumerable: true, get: function () { return consumer_gen_1.stagingDepsOf; } });
55
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/devkit/src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,gDAAiD;AAAxC,sGAAA,UAAU,OAAA;AAEnB,gDAAsD;AAA7C,2GAAA,eAAe,OAAA;AACxB,0CAAwG;AAA/F,iGAAA,QAAQ,OAAA;AAAE,sGAAA,aAAa,OAAA;AAAE,sGAAA,aAAa,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAAE,mGAAA,UAAU,OAAA;AAE7E,4CAA8C;AAArC,mGAAA,SAAS,OAAA;AAElB,8CAAwD;AAA/C,6GAAA,kBAAkB,OAAA;AAE3B,4CAAsD;AAA7C,2GAAA,iBAAiB,OAAA;AAE1B,0CAA4C;AAAnC,iGAAA,QAAQ,OAAA;AAEjB,gDAA2D;AAAlD,uGAAA,WAAW,OAAA;AAAE,mGAAA,OAAO,OAAA;AAC7B,uCAAiG;AAAxF,wGAAA,YAAY,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAE,uGAAA,WAAW,OAAA;AAAE,uGAAA,WAAW,OAAA;AAE5E,4CAA8C;AAArC,mGAAA,SAAS,OAAA;AAElB,+BASgB;AARd,oGAAA,YAAY,OAAA;AACZ,uGAAA,eAAe,OAAA;AACf,oGAAA,YAAY,OAAA;AACZ,wGAAA,gBAAgB,OAAA;AAChB,kGAAA,UAAU,OAAA;AACV,yGAAA,iBAAiB,OAAA;AACjB,sGAAA,cAAc,OAAA;AACd,kGAAA,UAAU,OAAA;AAEZ,+CAMwB;AALtB,gHAAA,gBAAgB,OAAA;AAChB,2GAAA,WAAW,OAAA;AACX,+GAAA,eAAe,OAAA;AACf,8GAAA,cAAc,OAAA;AACd,6GAAA,aAAa,OAAA"}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@sharpee/devkit",
3
+ "version": "1.0.0",
4
+ "description": "The Sharpee CLI engine — build/test/verify/scaffold orchestration (ADR-180). Provides the `sharpee` command; orchestrates, tsf compiles.",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "bin": {
8
+ "sharpee": "./cli.js"
9
+ },
10
+ "dependencies": {
11
+ "@sharpee/core": "^1.0.0",
12
+ "@sharpee/transcript-tester": "^1.0.0",
13
+ "fflate": "^0.8.2"
14
+ },
15
+ "keywords": [
16
+ "interactive-fiction",
17
+ "if",
18
+ "sharpee",
19
+ "devkit",
20
+ "build-tool"
21
+ ],
22
+ "author": "Sharpee Team",
23
+ "license": "MIT",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/ChicagoDave/sharpee.git",
27
+ "directory": "packages/devkit"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "engines": {
33
+ "node": ">=18.0.0"
34
+ },
35
+ "exports": {
36
+ ".": {
37
+ "types": "./index.d.ts",
38
+ "require": "./index.js",
39
+ "default": "./index.js"
40
+ }
41
+ }
42
+ }
package/registry.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ export interface Registry {
2
+ stories: Record<string, {
3
+ path: string;
4
+ }>;
5
+ }
6
+ export interface RegistryEntry {
7
+ name: string;
8
+ path: string;
9
+ /** true if the registered path no longer exists. */
10
+ stale: boolean;
11
+ }
12
+ /** The registry file path (`~/.sharpee/devkit`; overridable via SHARPEE_DEVKIT_REGISTRY). */
13
+ export declare function registryPath(): string;
14
+ /** Read the registry, or an empty one if absent/unparseable. */
15
+ export declare function readRegistry(): Registry;
16
+ /**
17
+ * Upsert a name→path mapping. Resolves `location` to an absolute path; the default
18
+ * name is its basename. Returns the stored entry.
19
+ * @throws if the location does not exist.
20
+ */
21
+ export declare function registerStory(location: string, name?: string): {
22
+ name: string;
23
+ path: string;
24
+ };
25
+ /** All registered stories, each flagged stale if its path no longer exists. */
26
+ export declare function listStories(): RegistryEntry[];
27
+ /**
28
+ * Resolve a registered name to its absolute path.
29
+ * @throws if the name is registered but its path no longer exists (stale, never silently skipped).
30
+ * @returns the path, or null if the name is not registered.
31
+ */
32
+ export declare function lookupStory(name: string): string | null;
33
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/devkit/src/registry.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,6FAA6F;AAC7F,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,gEAAgE;AAChE,wBAAgB,YAAY,IAAI,QAAQ,CASvC;AAQD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAQ7F;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,IAAI,aAAa,EAAE,CAK7C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOvD"}
package/registry.js ADDED
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registryPath = registryPath;
4
+ exports.readRegistry = readRegistry;
5
+ exports.registerStory = registerStory;
6
+ exports.listStories = listStories;
7
+ exports.lookupStory = lookupStory;
8
+ /**
9
+ * registry.ts — the user-level story location registry at `~/.sharpee/devkit`
10
+ * (ADR-180 Decision 4, amended: the verb is `register`, not `init`).
11
+ *
12
+ * A story is always referable by raw location; this registry is pure convenience —
13
+ * it maps a name → an absolute path so a story (anywhere, incl. other repos) can be
14
+ * referenced by name. Machine-level, git-ignored, rebuildable by re-running `register`.
15
+ *
16
+ * Format: { "stories": { "<name>": { "path": "<absolute path>" } } }
17
+ *
18
+ * Public interface: registryPath, readRegistry, registerStory, listStories, lookupStory.
19
+ */
20
+ const node_fs_1 = require("node:fs");
21
+ const node_os_1 = require("node:os");
22
+ const node_path_1 = require("node:path");
23
+ /** The registry file path (`~/.sharpee/devkit`; overridable via SHARPEE_DEVKIT_REGISTRY). */
24
+ function registryPath() {
25
+ return process.env.SHARPEE_DEVKIT_REGISTRY || (0, node_path_1.resolve)((0, node_os_1.homedir)(), '.sharpee', 'devkit');
26
+ }
27
+ /** Read the registry, or an empty one if absent/unparseable. */
28
+ function readRegistry() {
29
+ const p = registryPath();
30
+ if (!(0, node_fs_1.existsSync)(p))
31
+ return { stories: {} };
32
+ try {
33
+ const parsed = JSON.parse((0, node_fs_1.readFileSync)(p, 'utf8'));
34
+ return parsed && typeof parsed === 'object' && parsed.stories ? parsed : { stories: {} };
35
+ }
36
+ catch {
37
+ return { stories: {} };
38
+ }
39
+ }
40
+ function writeRegistry(reg) {
41
+ const p = registryPath();
42
+ (0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(p), { recursive: true });
43
+ (0, node_fs_1.writeFileSync)(p, JSON.stringify(reg, null, 2) + '\n');
44
+ }
45
+ /**
46
+ * Upsert a name→path mapping. Resolves `location` to an absolute path; the default
47
+ * name is its basename. Returns the stored entry.
48
+ * @throws if the location does not exist.
49
+ */
50
+ function registerStory(location, name) {
51
+ const abs = (0, node_path_1.resolve)(location);
52
+ if (!(0, node_fs_1.existsSync)(abs))
53
+ throw new Error(`cannot register: path does not exist: ${abs}`);
54
+ const storyName = name || (0, node_path_1.basename)(abs);
55
+ const reg = readRegistry();
56
+ reg.stories[storyName] = { path: abs };
57
+ writeRegistry(reg);
58
+ return { name: storyName, path: abs };
59
+ }
60
+ /** All registered stories, each flagged stale if its path no longer exists. */
61
+ function listStories() {
62
+ const reg = readRegistry();
63
+ return Object.entries(reg.stories)
64
+ .map(([name, { path }]) => ({ name, path, stale: !(0, node_fs_1.existsSync)(path) }))
65
+ .sort((a, b) => a.name.localeCompare(b.name));
66
+ }
67
+ /**
68
+ * Resolve a registered name to its absolute path.
69
+ * @throws if the name is registered but its path no longer exists (stale, never silently skipped).
70
+ * @returns the path, or null if the name is not registered.
71
+ */
72
+ function lookupStory(name) {
73
+ const entry = readRegistry().stories[name];
74
+ if (!entry)
75
+ return null;
76
+ if (!(0, node_fs_1.existsSync)(entry.path)) {
77
+ throw new Error(`registered story '${name}' points at a missing path: ${entry.path} (re-run \`sharpee register\`)`);
78
+ }
79
+ return entry.path;
80
+ }
81
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/devkit/src/registry.ts"],"names":[],"mappings":";;AA4BA,oCAEC;AAGD,oCASC;AAaD,sCAQC;AAGD,kCAKC;AAOD,kCAOC;AArFD;;;;;;;;;;;GAWG;AACH,qCAA6E;AAC7E,qCAAkC;AAClC,yCAAuD;AAavD,6FAA6F;AAC7F,SAAgB,YAAY;IAC1B,OAAO,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,IAAA,mBAAO,EAAC,IAAA,iBAAO,GAAE,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AACzF,CAAC;AAED,gEAAgE;AAChE,SAAgB,YAAY;IAC1B,MAAM,CAAC,GAAG,YAAY,EAAE,CAAC;IACzB,IAAI,CAAC,IAAA,oBAAU,EAAC,CAAC,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC3C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,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,YAAY,EAAE,CAAC;IAC3B,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;SAC/B,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAA,oBAAU,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACrE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CAAC,IAAY;IACtC,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,IAAI,CAAC,IAAA,oBAAU,EAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,+BAA+B,KAAK,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACtH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC"}
package/repo.d.ts ADDED
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Ordered platform build list (build.sh PACKAGES, 479-507): `[pkgName, dirUnderPackages]`.
3
+ * Order is dependency order — do not re-sort.
4
+ */
5
+ export declare const PLATFORM_PACKAGES: ReadonlyArray<readonly [string, string]>;
6
+ /**
7
+ * esbuild `--alias:` entries for the CLI bundle (build.sh build_bundle, 587-604).
8
+ * Order matches build.sh so the esbuild command is byte-identical.
9
+ */
10
+ export declare const BUNDLE_ALIASES: ReadonlyArray<readonly [string, string]>;
11
+ /** Hand-written CLI bundle declarations (build.sh build_bundle, 607-619) — verbatim. */
12
+ export declare const BUNDLE_DTS = "// Auto-generated Sharpee type declarations\nexport * from '../packages/core/dist/index';\nexport * from '../packages/if-domain/dist/index';\nexport * from '../packages/world-model/dist/index';\nexport * from '../packages/stdlib/dist/index';\nexport * from '../packages/engine/dist/index';\nexport * from '../packages/parser-en-us/dist/index';\nexport * from '../packages/lang-en-us/dist/index';\nexport * from '../packages/event-processor/dist/index';\nexport * from '../packages/text-blocks/dist/index';\nexport * from '../packages/channel-service/dist/index';\n";
13
+ /**
14
+ * Walk up from `start` to the Sharpee monorepo root (the dir holding
15
+ * pnpm-workspace.yaml AND packages/core — the monorepo signature, so an author's
16
+ * coincidental pnpm workspace is not mistaken for it). Returns null if not found.
17
+ */
18
+ export declare function findMonorepoRoot(start?: string): string | null;
19
+ /**
20
+ * The monorepo root, or throw. Use when an operation is monorepo-only.
21
+ * @throws if not inside the Sharpee monorepo.
22
+ */
23
+ export declare function findRepoRoot(start?: string): string;
24
+ /**
25
+ * 'monorepo' when run inside the Sharpee monorepo (build platform + bundle + in-repo
26
+ * stories); 'standalone' when run in an author's own project (build their story via its
27
+ * own toolchain). The location-aware split behind `sharpee build` (ADR-180 unify).
28
+ */
29
+ export declare function detectMode(start?: string): 'monorepo' | 'standalone';
30
+ /**
31
+ * Resolve the `tsf` executable. Prefers the workspace-local `node_modules/.bin/tsf`
32
+ * (a bare `tsf` fails when tsf is only a shell alias / not on a non-interactive PATH);
33
+ * falls back to `tsf` on PATH. Produces identical compiler output either way.
34
+ */
35
+ export declare function tsfBin(root: string): string;
36
+ /**
37
+ * Resolve a story name to its directory (build.sh resolve_story_dir, 39-48):
38
+ * `stories/<name>` then `tutorials/<name>`. Returns absolute path or null.
39
+ */
40
+ export declare function resolveStoryDir(root: string, name: string): string | null;
41
+ /** The story version.ts path build.sh stamps (stories/<name> only — tutorials are NOT stamped). */
42
+ export declare function storyVersionFile(root: string, name: string): string;
43
+ export interface ResolvedStory {
44
+ /** Story slug (directory basename). */
45
+ name: string;
46
+ /** Absolute story directory. */
47
+ dir: string;
48
+ /** Workspace package name if the story is an in-repo workspace story; else null. */
49
+ pkg: string | null;
50
+ /** True iff dir is a direct child of <root>/stories or <root>/tutorials. */
51
+ inRepo: boolean;
52
+ /** True iff dir is under <root>/stories (build.sh stamps version.ts only for these). */
53
+ underStories: boolean;
54
+ }
55
+ /**
56
+ * Resolve a story given either a **path** (a directory with a package.json, tried
57
+ * relative to cwd then to root) or a bare **name** (stories/<name> then tutorials/<name>).
58
+ * Returns null if neither resolves. This is the single resolver `build` + `stampVersions`
59
+ * share, so path and name forms behave identically (ADR-180 Decision 4: a story is a location).
60
+ */
61
+ export declare function resolveStory(root: string, nameOrPath: string): ResolvedStory | null;
62
+ /** Read a package.json's `version` field. */
63
+ export declare function readVersion(pkgJsonPath: string): string;
64
+ //# sourceMappingURL=repo.d.ts.map
package/repo.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../../../../repos/sharpee/packages/devkit/src/repo.ts"],"names":[],"mappings":"AAaA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CA4BtE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAmBnE,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,UAAU,yjBAWtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,GAAE,MAAsB,GAAG,MAAM,GAAG,IAAI,CAU7E;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,GAAE,MAAsB,GAAG,MAAM,CAIlE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,GAAE,MAAsB,GAAG,UAAU,GAAG,YAAY,CAEnF;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG3C;AAED;;;GAGG;AACH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