@askrjs/cli 0.0.8 → 0.0.10
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 +1 -1
- package/dist/{planner-DsUWndjl.js → planner-BDfYDKnI.js} +6 -2
- package/dist/skills/askr-ssr-ssg/SKILL.md +1 -1
- package/dist/{skills-B7CbWur9.js → skills-C2KzfTl9.js} +0 -1
- package/dist/skills.js +1 -1
- package/dist/ssg.d.ts +0 -1
- package/dist/ssg.js +4 -5
- package/dist/templates/spa/README.md +2 -2
- package/dist/templates/spa/src/main.tsx +2 -3
- package/dist/templates/spa/src/pages/_routes.tsx +2 -2
- package/dist/templates/startkit/src/routes/auth.ts +2 -1
- package/dist/templates/startkit/src/routes/public.ts +2 -1
- package/dist/templates/startkit/src/routes/workspace/accounts.ts +2 -1
- package/dist/templates/startkit/src/routes/workspace/index.ts +3 -2
- package/dist/update.js +1 -1
- package/package.json +2 -2
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-
|
|
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) =>
|
|
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 ??
|
|
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
|
-
|
|
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-
|
|
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
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
|
-
|
|
462
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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 {
|
|
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
|
-
|
|
8
|
+
registry: pageRegistry,
|
|
10
9
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fallback, group
|
|
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
|
-
|
|
11
|
+
export const pageRegistry = createRouteRegistry(() => {
|
|
12
12
|
group({ layout: RootLayout }, () => {
|
|
13
13
|
group({ layout: PublicLayout }, () => {
|
|
14
14
|
registerPublicRoutes();
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { lazy, route } from '@askrjs/askr/router';
|
|
2
|
+
import { accountsRoute } from '../../lib/routes';
|
|
2
3
|
|
|
3
4
|
export function registerAccountRoutes(): void {
|
|
4
5
|
route(
|
|
5
|
-
|
|
6
|
+
accountsRoute.href,
|
|
6
7
|
lazy(() => import('../../pages/workspace/accounts'))
|
|
7
8
|
);
|
|
8
9
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { lazy, route } from '@askrjs/askr/router';
|
|
2
|
+
import { dashboardRoute, settingsRoute } from '../../lib/routes';
|
|
2
3
|
import { registerAccountRoutes } from './accounts';
|
|
3
4
|
|
|
4
5
|
export function registerWorkspaceRoutes(): void {
|
|
5
6
|
route(
|
|
6
|
-
|
|
7
|
+
dashboardRoute.href,
|
|
7
8
|
lazy(() => import('../../pages/workspace/dashboard'))
|
|
8
9
|
);
|
|
9
10
|
registerAccountRoutes();
|
|
10
11
|
route(
|
|
11
|
-
|
|
12
|
+
settingsRoute.href,
|
|
12
13
|
lazy(() => import('../../pages/workspace/settings'))
|
|
13
14
|
);
|
|
14
15
|
}
|
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-
|
|
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.
|
|
3
|
+
"version": "0.0.10",
|
|
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": "
|
|
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",
|