@askrjs/cli 0.0.8 → 0.0.9

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/dist/create.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { t as isDirectExecution } from "./is-direct-execution-Cdlr-ZUl.js";
3
- import { t as installBundledSkills } from "./skills-B7CbWur9.js";
3
+ import { t as installBundledSkills } from "./skills-C2KzfTl9.js";
4
4
  import { n as publishStagedDirectory, t as createSiblingStage } from "./directory-swap-DWoHtx7C.js";
5
5
  import fs from "node:fs/promises";
6
6
  import path from "node:path";
@@ -294,7 +294,11 @@ function solveWorkspace(workspace, selectedOccurrences, context, packuments, tag
294
294
  return;
295
295
  }
296
296
  const next = remaining.map((name) => [name, pruned.get(name)]).sort(([leftName, left], [rightName, right]) => left.length - right.length || leftName.localeCompare(rightName))[0];
297
- const signature = component.map((name) => `${name}=${assigned.get(name) ?? (pruned.get(name) ?? []).join(",")}`).join("|");
297
+ const signature = component.map((name) => {
298
+ const assignedVersion = assigned.get(name);
299
+ if (assignedVersion !== void 0) return `${name}=assigned:${assignedVersion}`;
300
+ return `${name}=domain:${(pruned.get(name) ?? []).join(",")}`;
301
+ }).join("|");
298
302
  if (memo.has(signature)) return;
299
303
  memo.add(signature);
300
304
  for (const version of next[1]) {
@@ -348,7 +352,7 @@ function summarize(decisions) {
348
352
  function planUpdates(options) {
349
353
  const failures = options.failures ?? /* @__PURE__ */ new Map();
350
354
  const tags = options.tags ?? {};
351
- const mode = options.mode ?? (options.force ? "upgrade" : "update");
355
+ const mode = options.mode ?? "update";
352
356
  const context = options.contextOccurrences ?? options.occurrences;
353
357
  const workspaceSolutions = /* @__PURE__ */ new Map();
354
358
  if (mode !== "force") for (const workspace of new Set(options.occurrences.map((entry) => entry.workspace))) workspaceSolutions.set(workspace, solveWorkspace(workspace, options.occurrences.filter((entry) => entry.workspace === workspace), context, options.packuments, tags, options.cliTag, options.localVersions ?? /* @__PURE__ */ new Map(), mode));
@@ -34,7 +34,7 @@ Use this when the app renders outside the browser or produces static output. The
34
34
  ## Copy This Shape
35
35
 
36
36
  ```ts
37
- registerRoutes(() => {
37
+ const registry = createRouteRegistry(() => {
38
38
  page("/docs/{slug}", DocsPage, {
39
39
  entries: async () => [{ slug: "getting-started" }, { slug: "routing" }],
40
40
  });
@@ -303,7 +303,6 @@ const REVIEW_PROMPTS = [
303
303
  re("local Sidebar", String.raw`export\s+(?:default\s+)?function\s+Sidebar\b`)
304
304
  ]),
305
305
  requireAny("Keeps Askr-native route or state primitives in use.", [
306
- re("registerRoutes", String.raw`\bregisterRoutes\s*\(`),
307
306
  re("createRouteRegistry", String.raw`\bcreateRouteRegistry\s*\(`),
308
307
  re("state()", String.raw`\bstate\s*\(`),
309
308
  re("resource()", String.raw`\bresource\s*\(`)
package/dist/skills.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { n as runSkillsCli, r as syncBundledSkills, t as installBundledSkills } from "./skills-B7CbWur9.js";
2
+ import { n as runSkillsCli, r as syncBundledSkills, t as installBundledSkills } from "./skills-C2KzfTl9.js";
3
3
  export { installBundledSkills, runSkillsCli, syncBundledSkills };
package/dist/ssg.d.ts CHANGED
@@ -38,7 +38,6 @@ interface SsgDeps {
38
38
  existsSync?: typeof existsSync;
39
39
  importConfig?: (filePath: string) => Promise<unknown>;
40
40
  createStaticGen?: (options: {
41
- routes?: unknown[];
42
41
  registry?: unknown;
43
42
  outputDir: string;
44
43
  seed?: unknown;
package/dist/ssg.js CHANGED
@@ -458,9 +458,8 @@ async function runSsgCli(args = process.argv.slice(2), deps = {}, io = console)
458
458
  }
459
459
  const configModule = imported;
460
460
  const candidate = configModule.default ?? configModule.staticConfig ?? configModule;
461
- const hasRoutes = Array.isArray(candidate.routes);
462
- if (hasRoutes === (candidate.registry !== void 0)) {
463
- io.error("Error: Config must provide exactly one route source: routes or registry");
461
+ if (!(candidate.registry !== void 0) || Object.prototype.hasOwnProperty.call(candidate, "routes")) {
462
+ io.error("Error: Config must provide a route registry and no raw routes array");
464
463
  return 1;
465
464
  }
466
465
  const config = candidate;
@@ -468,7 +467,7 @@ async function runSsgCli(args = process.argv.slice(2), deps = {}, io = console)
468
467
  io.error("Error: Config must provide siteUrl to generate sitemap.xml, or set sitemap: false");
469
468
  return 1;
470
469
  }
471
- io.log(hasRoutes ? `Generating ${config.routes?.length ?? 0} routes...` : "Generating registered routes...");
470
+ io.log("Generating registered routes...");
472
471
  const createStaticGen = typeof resolvedDeps.createStaticGen === "function" ? resolvedDeps.createStaticGen : await loadCreateStaticGen();
473
472
  cliStagingDir = await createSiblingStage(resolvedOutputDir, "askr-ssg");
474
473
  if (parsed.incremental && !parsed.forceFull && await pathExists(resolvedOutputDir)) await fs$1.cp(resolvedOutputDir, cliStagingDir, {
@@ -477,7 +476,7 @@ async function runSsgCli(args = process.argv.slice(2), deps = {}, io = console)
477
476
  });
478
477
  const generationOutputDir = cliStagingDir;
479
478
  const ssg = createStaticGen({
480
- ...hasRoutes ? { routes: config.routes } : { registry: config.registry },
479
+ registry: config.registry,
481
480
  outputDir: generationOutputDir,
482
481
  seed: config.seed,
483
482
  dataOverrides: config.dataOverrides,
@@ -38,7 +38,7 @@ code lives in `src/adapters`.
38
38
 
39
39
  ```tsx
40
40
  // src/pages/_routes.tsx
41
- import { fallback, group, registerRoutes } from '@askrjs/askr/router';
41
+ import { createRouteRegistry, fallback, group } from '@askrjs/askr/router';
42
42
  import RootLayout from './_layout';
43
43
  import NotFoundPage from './not-found';
44
44
  import AuthLayout from './auth/_layout';
@@ -48,7 +48,7 @@ import { registerAppRoutes } from './app/_routes';
48
48
  import PublicLayout from './public/_layout';
49
49
  import { registerPublicRoutes } from './public/_routes';
50
50
 
51
- registerRoutes(() => {
51
+ export const pageRegistry = createRouteRegistry(() => {
52
52
  group({ layout: RootLayout }, () => {
53
53
  group({ layout: PublicLayout }, () => {
54
54
  registerPublicRoutes();
@@ -1,10 +1,9 @@
1
1
  import { createSPA } from '@askrjs/askr/boot';
2
- import { getManifest } from '@askrjs/askr/router';
2
+ import { pageRegistry } from './pages/_routes';
3
3
 
4
4
  import './styles.css';
5
- import './pages/_routes';
6
5
 
7
6
  await createSPA({
8
7
  root: document.getElementById('app')!,
9
- manifest: getManifest(),
8
+ registry: pageRegistry,
10
9
  });
@@ -1,4 +1,4 @@
1
- import { fallback, group, registerRoutes } from '@askrjs/askr/router';
1
+ import { createRouteRegistry, fallback, group } from '@askrjs/askr/router';
2
2
  import RootLayout from './_layout';
3
3
  import AuthLayout from './auth/_layout';
4
4
  import { registerAuthRoutes } from './auth/_routes';
@@ -8,7 +8,7 @@ import NotFoundPage from './not-found';
8
8
  import { registerPublicRoutes } from './public/_routes';
9
9
  import PublicLayout from './public/_layout';
10
10
 
11
- registerRoutes(() => {
11
+ export const pageRegistry = createRouteRegistry(() => {
12
12
  group({ layout: RootLayout }, () => {
13
13
  group({ layout: PublicLayout }, () => {
14
14
  registerPublicRoutes();
package/dist/update.js CHANGED
@@ -217,7 +217,7 @@ async function runDependencyCli(command, args, io = console, runtime = {}) {
217
217
  let root = null;
218
218
  let selectedWorkspaces = [];
219
219
  try {
220
- const [{ discoverProject }, { planUpdates }] = await Promise.all([import("./discovery-BX-lnFRK.js"), import("./planner-DsUWndjl.js")]);
220
+ const [{ discoverProject }, { planUpdates }] = await Promise.all([import("./discovery-BX-lnFRK.js"), import("./planner-BDfYDKnI.js")]);
221
221
  const project = await discoverProject({
222
222
  cwd: parsed.cwd,
223
223
  packagePatterns: parsed.packagePatterns,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askrjs/cli",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Unified CLI for the Askr platform",
5
5
  "homepage": "https://github.com/askrjs/askr-cli#readme",
6
6
  "bugs": {
@@ -59,7 +59,7 @@
59
59
  "tsx": "^4.23.1"
60
60
  },
61
61
  "devDependencies": {
62
- "@askrjs/askr": ">=0.0.53 <0.1.0",
62
+ "@askrjs/askr": "^0.0.66",
63
63
  "@askrjs/charts": ">=0.1.0 <0.2.0",
64
64
  "@askrjs/logos": ">=0.0.3 <0.1.0",
65
65
  "@askrjs/lucide": ">=0.0.3 <0.1.0",