@owlmeans/create-app 0.1.18-rc.56 → 0.1.18-rc.57
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 +1 -1
- package/build/args.d.ts +1 -26
- package/build/args.d.ts.map +1 -1
- package/build/args.js +3 -28
- package/build/args.js.map +1 -1
- package/build/bin.js +0 -0
- package/build/consts.d.ts +6 -0
- package/build/consts.d.ts.map +1 -0
- package/build/consts.js +6 -0
- package/build/consts.js.map +1 -0
- package/build/consts.local.d.ts +12 -0
- package/build/consts.local.d.ts.map +1 -0
- package/build/consts.local.js +50 -0
- package/build/consts.local.js.map +1 -0
- package/build/index.d.ts +5 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/naming.d.ts +0 -5
- package/build/naming.d.ts.map +1 -1
- package/build/naming.js +1 -5
- package/build/naming.js.map +1 -1
- package/build/run.d.ts +1 -1
- package/build/run.d.ts.map +1 -1
- package/build/run.js +2 -2
- package/build/scaffold.d.ts +1 -14
- package/build/scaffold.d.ts.map +1 -1
- package/build/scaffold.js +2 -1
- package/build/scaffold.js.map +1 -1
- package/build/template.d.ts +1 -20
- package/build/template.d.ts.map +1 -1
- package/build/template.js +1 -20
- package/build/template.js.map +1 -1
- package/build/types.d.ts +61 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/package.json +3 -3
- package/template/AGENTS.md +8 -1
- package/template/README.bare.md +1 -1
- package/template/_agents/skills/owlmeans-code-structure/SKILL.md +129 -0
- package/template/_agents/skills/reuse-code/SKILL.md +3 -2
- package/template/_agents/skills/skill-authoring/SKILL.md +1 -1
- package/template/_claude/settings.json +11 -0
- package/template/_owlmeans-structure.json +12 -0
- package/template/package.json +4 -2
- package/template/sources/api/package.json +4 -4
- package/template/sources/common/package.json +7 -7
- package/template/sources/web/package.json +32 -32
- package/template/sources/web/src/consts.ts +11 -0
- package/template/sources/web/src/context.ts +1 -3
- package/template/sources/web/src/layout/main.tsx +2 -1
- package/template/sources/web/src/nav.ts +1 -8
- package/template/sources/web/src/screens/session.tsx +2 -1
- package/template/sources/web/vite.config.ts +3 -2
package/README.md
CHANGED
package/build/args.d.ts
CHANGED
|
@@ -1,29 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export interface CreateArgs {
|
|
3
|
-
/** Target directory (positional). `null` means it must be prompted/derived. */
|
|
4
|
-
dir: string | null;
|
|
5
|
-
/** Human-readable app name. Defaults to the directory slug. */
|
|
6
|
-
name: string | null;
|
|
7
|
-
/** Explicit package slug. `null` derives it from the target directory. */
|
|
8
|
-
slug: string | null;
|
|
9
|
-
/** BCP-47-ish language of the generated UI text and `<html lang>`. */
|
|
10
|
-
lang: string;
|
|
11
|
-
/** One-line project description for the README, AGENTS.md and the index.html meta tags. */
|
|
12
|
-
description: string | null;
|
|
13
|
-
/** Scaffold the shell without the example/demo code. */
|
|
14
|
-
bare: boolean;
|
|
15
|
-
/** Package manager used to install deps and (for `bun`) run the project. */
|
|
16
|
-
pm: PackageManager;
|
|
17
|
-
/** Install dependencies after copying the template. */
|
|
18
|
-
install: boolean;
|
|
19
|
-
/** Deploy agent skills via @owlmeans/agent-skills after install. */
|
|
20
|
-
skills: boolean;
|
|
21
|
-
/** Run `git init` in the new project. */
|
|
22
|
-
git: boolean;
|
|
23
|
-
/** Skip confirmations / proceed into a non-empty directory. */
|
|
24
|
-
yes: boolean;
|
|
25
|
-
help: boolean;
|
|
26
|
-
}
|
|
1
|
+
import type { CreateArgs } from './types.js';
|
|
27
2
|
export declare const parseArgs: (argv: string[]) => CreateArgs | null;
|
|
28
3
|
export declare const printHelp: () => void;
|
|
29
4
|
//# sourceMappingURL=args.d.ts.map
|
package/build/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,YAAY,CAAA;AAE5D,eAAO,MAAM,SAAS,SAAU,MAAM,EAAE,KAAG,UAAU,GAAG,IAqHvD,CAAA;AAED,eAAO,MAAM,SAAS,QAAO,IAE5B,CAAA"}
|
package/build/args.js
CHANGED
|
@@ -1,31 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Usage:
|
|
5
|
-
npm create @owlmeans/app@latest <dir> [options]
|
|
6
|
-
bun create @owlmeans/app <dir> [options]
|
|
7
|
-
yarn create @owlmeans/app <dir> [options]
|
|
8
|
-
npx @owlmeans/create-app@^0.1.18-rc.56 <dir> [options]
|
|
9
|
-
|
|
10
|
-
Generates three workspaces (common + api + web) with shadcn UI navigation and
|
|
11
|
-
layout, no authentication, and a session-scoped in-memory resource on the
|
|
12
|
-
backend. With --bare the demo is left out and only the working shell remains.
|
|
13
|
-
Agent skills are deployed into the project by default.
|
|
14
|
-
|
|
15
|
-
Options:
|
|
16
|
-
--name <name> human-readable app name (default: derived from <dir>)
|
|
17
|
-
--slug <slug> package slug (default: derived from <dir>)
|
|
18
|
-
--lang <code> language of the generated UI text (default: ${DEFAULT_LANG})
|
|
19
|
-
--description <t> one-line project description for the generated docs
|
|
20
|
-
--bare scaffold the shell only — no example/demo code
|
|
21
|
-
--pm <bun|npm|yarn> package manager (default: bun)
|
|
22
|
-
--no-install do not install dependencies
|
|
23
|
-
--no-skills do not deploy agent skills via @owlmeans/agent-skills
|
|
24
|
-
--no-git do not run "git init"
|
|
25
|
-
--yes, -y proceed without prompts / into a non-empty directory
|
|
26
|
-
--help, -h show this help
|
|
27
|
-
`;
|
|
28
|
-
const PMS = ['bun', 'npm', 'yarn'];
|
|
1
|
+
import { isValidLang, isValidSlug } from './naming.js';
|
|
2
|
+
import { DEFAULT_LANG, SLUG_PATTERN } from './consts.js';
|
|
3
|
+
import { HELP, PMS } from './consts.local.js';
|
|
29
4
|
export const parseArgs = (argv) => {
|
|
30
5
|
const args = argv.slice(2);
|
|
31
6
|
const result = {
|
package/build/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAG7C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAc,EAAqB,EAAE;IAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC1B,MAAM,MAAM,GAAe;QACzB,GAAG,EAAE,IAAI;QACT,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,IAAI;QACjB,IAAI,EAAE,KAAK;QACX,EAAE,EAAE,KAAK;QACT,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;QACZ,GAAG,EAAE,IAAI;QACT,GAAG,EAAE,KAAK;QACV,IAAI,EAAE,KAAK;KACZ,CAAA;IAED,sFAAsF;IACtF,sEAAsE;IACtE,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,IAAY,EAAE,IAAI,GAAG,KAAK,EAAiB,EAAE;QACrE,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QACrB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC9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,CAAA;gBACb,CAAC;gBACD,MAAM,CAAC,EAAE,GAAG,CAAC,CAAA;gBACb,CAAC,EAAE,CAAA;gBACH,MAAK;YACP,CAAC;YACD;gBACE,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;oBACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAA;oBAClD,OAAO,IAAI,CAAA;gBACb,CAAC;gBACD,IAAI,MAAM,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;oBACvB,MAAM,CAAC,GAAG,GAAG,CAAC,CAAA;gBAChB,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,CAAC,IAAI,CAAC,CAAA;oBACzD,OAAO,IAAI,CAAA;gBACb,CAAC;QACL,CAAC;QACD,CAAC,EAAE,CAAA;IACL,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,GAAS,EAAE;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAC5B,CAAC,CAAA"}
|
package/build/bin.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** npm-safe package slug: lowercase alphanumerics and inner dashes, 1–32 chars. */
|
|
2
|
+
export declare const SLUG_PATTERN: RegExp;
|
|
3
|
+
/** Loose BCP-47 shape — enough to keep junk out of `<html lang>` without shipping a registry. */
|
|
4
|
+
export declare const LANG_PATTERN: RegExp;
|
|
5
|
+
export declare const DEFAULT_LANG = "en";
|
|
6
|
+
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,eAAO,MAAM,YAAY,QAA2C,CAAA;AAEpE,iGAAiG;AACjG,eAAO,MAAM,YAAY,QAA0C,CAAA;AAEnE,eAAO,MAAM,YAAY,OAAO,CAAA"}
|
package/build/consts.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** npm-safe package slug: lowercase alphanumerics and inner dashes, 1–32 chars. */
|
|
2
|
+
export const SLUG_PATTERN = /^[a-z0-9](?:[a-z0-9-]{0,30}[a-z0-9])?$/;
|
|
3
|
+
/** Loose BCP-47 shape — enough to keep junk out of `<html lang>` without shipping a registry. */
|
|
4
|
+
export const LANG_PATTERN = /^[a-zA-Z]{2,8}(?:-[a-zA-Z0-9]{1,8})*$/;
|
|
5
|
+
export const DEFAULT_LANG = 'en';
|
|
6
|
+
//# sourceMappingURL=consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,CAAC,MAAM,YAAY,GAAG,wCAAwC,CAAA;AAEpE,iGAAiG;AACjG,MAAM,CAAC,MAAM,YAAY,GAAG,uCAAuC,CAAA;AAEnE,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PackageManager } from './types.js';
|
|
2
|
+
export declare const HELP = "@owlmeans/create-app \u2014 scaffold a fullstack OwlMeans Common app\n\nUsage:\n npm create @owlmeans/app@latest <dir> [options]\n bun create @owlmeans/app <dir> [options]\n yarn create @owlmeans/app <dir> [options]\n npx @owlmeans/create-app@^0.1.18-rc.57 <dir> [options]\n\nGenerates three workspaces (common + api + web) with shadcn UI navigation and\nlayout, no authentication, and a session-scoped in-memory resource on the\nbackend. With --bare the demo is left out and only the working shell remains.\nAgent skills are deployed into the project by default.\n\nOptions:\n --name <name> human-readable app name (default: derived from <dir>)\n --slug <slug> package slug (default: derived from <dir>)\n --lang <code> language of the generated UI text (default: en)\n --description <t> one-line project description for the generated docs\n --bare scaffold the shell only \u2014 no example/demo code\n --pm <bun|npm|yarn> package manager (default: bun)\n --no-install do not install dependencies\n --no-skills do not deploy agent skills via @owlmeans/agent-skills\n --no-git do not run \"git init\"\n --yes, -y proceed without prompts / into a non-empty directory\n --help, -h show this help\n";
|
|
3
|
+
export declare const PMS: PackageManager[];
|
|
4
|
+
/** Dotfiles/dirs are shipped with an underscore prefix so npm does not strip them from the tarball. */
|
|
5
|
+
export declare const DOTFILE_RENAMES: Record<string, string>;
|
|
6
|
+
/** Files whose contents are binary or must not be string-substituted. */
|
|
7
|
+
export declare const BINARY_EXT: Set<string>;
|
|
8
|
+
/** Template-root manifest describing what the bare shell drops and what it swaps in. */
|
|
9
|
+
export declare const BARE_MANIFEST = "_bare.json";
|
|
10
|
+
/** Stand-in for the globstar segment while the single-`*` pass runs; cannot occur in a path. */
|
|
11
|
+
export declare const GLOBSTAR = "\0";
|
|
12
|
+
//# sourceMappingURL=consts.local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../src/consts.local.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,eAAO,MAAM,IAAI,6wCAyBhB,CAAA;AAED,eAAO,MAAM,GAAG,EAAE,cAAc,EAA2B,CAAA;AAE3D,uGAAuG;AACvG,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAalD,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,UAAU,aAAiF,CAAA;AAExG,wFAAwF;AACxF,eAAO,MAAM,aAAa,eAAe,CAAA;AAEzC,gGAAgG;AAChG,eAAO,MAAM,QAAQ,OAAW,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DEFAULT_LANG } from './consts.js';
|
|
2
|
+
export const HELP = `@owlmeans/create-app — scaffold a fullstack OwlMeans Common app
|
|
3
|
+
|
|
4
|
+
Usage:
|
|
5
|
+
npm create @owlmeans/app@latest <dir> [options]
|
|
6
|
+
bun create @owlmeans/app <dir> [options]
|
|
7
|
+
yarn create @owlmeans/app <dir> [options]
|
|
8
|
+
npx @owlmeans/create-app@^0.1.18-rc.57 <dir> [options]
|
|
9
|
+
|
|
10
|
+
Generates three workspaces (common + api + web) with shadcn UI navigation and
|
|
11
|
+
layout, no authentication, and a session-scoped in-memory resource on the
|
|
12
|
+
backend. With --bare the demo is left out and only the working shell remains.
|
|
13
|
+
Agent skills are deployed into the project by default.
|
|
14
|
+
|
|
15
|
+
Options:
|
|
16
|
+
--name <name> human-readable app name (default: derived from <dir>)
|
|
17
|
+
--slug <slug> package slug (default: derived from <dir>)
|
|
18
|
+
--lang <code> language of the generated UI text (default: ${DEFAULT_LANG})
|
|
19
|
+
--description <t> one-line project description for the generated docs
|
|
20
|
+
--bare scaffold the shell only — no example/demo code
|
|
21
|
+
--pm <bun|npm|yarn> package manager (default: bun)
|
|
22
|
+
--no-install do not install dependencies
|
|
23
|
+
--no-skills do not deploy agent skills via @owlmeans/agent-skills
|
|
24
|
+
--no-git do not run "git init"
|
|
25
|
+
--yes, -y proceed without prompts / into a non-empty directory
|
|
26
|
+
--help, -h show this help
|
|
27
|
+
`;
|
|
28
|
+
export const PMS = ['bun', 'npm', 'yarn'];
|
|
29
|
+
/** Dotfiles/dirs are shipped with an underscore prefix so npm does not strip them from the tarball. */
|
|
30
|
+
export const DOTFILE_RENAMES = {
|
|
31
|
+
'_gitignore': '.gitignore',
|
|
32
|
+
'_npmrc': '.npmrc',
|
|
33
|
+
'_env': '.env',
|
|
34
|
+
'_github': '.github',
|
|
35
|
+
'_owlmeans-structure.json': '.owlmeans-structure.json',
|
|
36
|
+
// `_agents` carries the canonical harness — AGENTS.md's skills, the shared memory
|
|
37
|
+
// store and the link-skills bridge; the template seed (sync-agent-meta) writes
|
|
38
|
+
// `_agents/skills/` into this tree. `_claude` carries only the Claude Code skill-link
|
|
39
|
+
// bridge (SessionStart hook + the gitkept symlink dir). Entries whose source dir is
|
|
40
|
+
// absent are inert.
|
|
41
|
+
'_agents': '.agents',
|
|
42
|
+
'_claude': '.claude',
|
|
43
|
+
};
|
|
44
|
+
/** Files whose contents are binary or must not be string-substituted. */
|
|
45
|
+
export const BINARY_EXT = new Set(['.ico', '.png', '.jpg', '.jpeg', '.gif', '.webp', '.woff', '.woff2']);
|
|
46
|
+
/** Template-root manifest describing what the bare shell drops and what it swaps in. */
|
|
47
|
+
export const BARE_MANIFEST = '_bare.json';
|
|
48
|
+
/** Stand-in for the globstar segment while the single-`*` pass runs; cannot occur in a path. */
|
|
49
|
+
export const GLOBSTAR = '\u0000';
|
|
50
|
+
//# sourceMappingURL=consts.local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../src/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG1C,MAAM,CAAC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;oEAgBgD,YAAY;;;;;;;;;CAS/E,CAAA;AAED,MAAM,CAAC,MAAM,GAAG,GAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;AAE3D,uGAAuG;AACvG,MAAM,CAAC,MAAM,eAAe,GAA2B;IACrD,YAAY,EAAE,YAAY;IAC1B,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,SAAS;IACpB,0BAA0B,EAAE,0BAA0B;IACtD,kFAAkF;IAClF,+EAA+E;IAC/E,sFAAsF;IACtF,oFAAoF;IACpF,oBAAoB;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;CACrB,CAAA;AAED,yEAAyE;AACzE,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAA;AAExG,wFAAwF;AACxF,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAA;AAEzC,gGAAgG;AAChG,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAA"}
|
package/build/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { run } from './run.js';
|
|
2
2
|
export { parseArgs, printHelp } from './args.js';
|
|
3
|
-
export type { CreateArgs, PackageManager } from './
|
|
3
|
+
export type { CreateArgs, PackageManager } from './types.js';
|
|
4
4
|
export { scaffold } from './scaffold.js';
|
|
5
|
-
export type { ScaffoldOptions } from './
|
|
5
|
+
export type { ScaffoldOptions } from './types.js';
|
|
6
6
|
export { copyTemplate, templateDir, isEmptyDir } from './template.js';
|
|
7
|
-
export type { BareManifest, CopyTemplateOptions, TemplateReplacements } from './
|
|
8
|
-
export {
|
|
7
|
+
export type { BareManifest, CopyTemplateOptions, TemplateReplacements } from './types.js';
|
|
8
|
+
export { defaultDescription, isValidLang, isValidSlug, slugify, titleize } from './naming.js';
|
|
9
|
+
export { DEFAULT_LANG, LANG_PATTERN, SLUG_PATTERN } from './consts.js';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAChD,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAChD,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACrE,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACzF,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC7F,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -2,5 +2,6 @@ export { run } from './run.js';
|
|
|
2
2
|
export { parseArgs, printHelp } from './args.js';
|
|
3
3
|
export { scaffold } from './scaffold.js';
|
|
4
4
|
export { copyTemplate, templateDir, isEmptyDir } from './template.js';
|
|
5
|
-
export {
|
|
5
|
+
export { defaultDescription, isValidLang, isValidSlug, slugify, titleize } from './naming.js';
|
|
6
|
+
export { DEFAULT_LANG, LANG_PATTERN, SLUG_PATTERN } from './consts.js';
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAErE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAErE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC7F,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA"}
|
package/build/naming.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/** npm-safe package slug: lowercase alphanumerics and inner dashes, 1–32 chars. */
|
|
2
|
-
export declare const SLUG_PATTERN: RegExp;
|
|
3
|
-
/** Loose BCP-47 shape — enough to keep junk out of `<html lang>` without shipping a registry. */
|
|
4
|
-
export declare const LANG_PATTERN: RegExp;
|
|
5
|
-
export declare const DEFAULT_LANG = "en";
|
|
6
1
|
export declare const isValidSlug: (slug: string) => boolean;
|
|
7
2
|
export declare const isValidLang: (lang: string) => boolean;
|
|
8
3
|
export declare const slugify: (input: string) => string;
|
package/build/naming.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../src/naming.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../src/naming.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,OAAkC,CAAA;AAE7E,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,OAAkC,CAAA;AAE7E,eAAO,MAAM,OAAO,UAAW,MAAM,KAAG,MAOnB,CAAA;AAErB,eAAO,MAAM,QAAQ,SAAU,MAAM,KAAG,MAC6C,CAAA;AAErF,eAAO,MAAM,kBAAkB,SAAU,MAAM,KAAG,MACJ,CAAA"}
|
package/build/naming.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { basename } from 'node:path';
|
|
2
|
-
|
|
3
|
-
export const SLUG_PATTERN = /^[a-z0-9](?:[a-z0-9-]{0,30}[a-z0-9])?$/;
|
|
4
|
-
/** Loose BCP-47 shape — enough to keep junk out of `<html lang>` without shipping a registry. */
|
|
5
|
-
export const LANG_PATTERN = /^[a-zA-Z]{2,8}(?:-[a-zA-Z0-9]{1,8})*$/;
|
|
6
|
-
export const DEFAULT_LANG = 'en';
|
|
2
|
+
import { LANG_PATTERN, SLUG_PATTERN } from './consts.js';
|
|
7
3
|
export const isValidSlug = (slug) => SLUG_PATTERN.test(slug);
|
|
8
4
|
export const isValidLang = (lang) => LANG_PATTERN.test(lang);
|
|
9
5
|
export const slugify = (input) => basename(input)
|
package/build/naming.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming.js","sourceRoot":"","sources":["../src/naming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"naming.js","sourceRoot":"","sources":["../src/naming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAExD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAE7E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAE7E,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAa,EAAU,EAAE,CAC/C,QAAQ,CAAC,KAAK,CAAC;KACZ,WAAW,EAAE;KACb,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;KAC5B,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;KACnB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;KACZ,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;OACjB,cAAc,CAAA;AAErB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAU,EAAE,CAC/C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAErF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAU,EAAE,CACzD,GAAG,IAAI,qCAAqC,CAAA"}
|
package/build/run.d.ts
CHANGED
package/build/run.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,YAAY,CAAA;AAQ5D,eAAO,MAAM,GAAG,SAAgB,UAAU,KAAG,OAAO,CAAC,MAAM,CAyF1D,CAAA"}
|
package/build/run.js
CHANGED
|
@@ -50,7 +50,7 @@ export const run = async (args) => {
|
|
|
50
50
|
log(args.install
|
|
51
51
|
? '\nDeploying agent skills via @owlmeans/agent-skills…'
|
|
52
52
|
: '\nDeploying harness guidance via @owlmeans/agent-skills (general skills only — re-run'
|
|
53
|
-
+ '\n`npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
53
|
+
+ '\n`npx @owlmeans/agent-skills@^0.1.18-rc.48` after installing to add the package-specific ones)…');
|
|
54
54
|
try {
|
|
55
55
|
const result = await installSkills({
|
|
56
56
|
dir: dest,
|
|
@@ -62,7 +62,7 @@ export const run = async (args) => {
|
|
|
62
62
|
help: false,
|
|
63
63
|
});
|
|
64
64
|
if (result.code !== 0) {
|
|
65
|
-
process.stderr.write(` agent-skills exited with code ${result.code} — you can re-run \`npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
65
|
+
process.stderr.write(` agent-skills exited with code ${result.code} — you can re-run \`npx @owlmeans/agent-skills@^0.1.18-rc.48\` later.\n`);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
catch (err) {
|
package/build/scaffold.d.ts
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/** Destination directory. Created when missing; an existing one is written into as-is. */
|
|
3
|
-
dir: string;
|
|
4
|
-
/** package/workspace slug, e.g. `my-app`. */
|
|
5
|
-
slug: string;
|
|
6
|
-
/** Human-readable name. Defaults to the titleized slug. */
|
|
7
|
-
name?: string;
|
|
8
|
-
/** BCP-47-ish UI language and `<html lang>`. Defaults to `en`. */
|
|
9
|
-
lang?: string;
|
|
10
|
-
/** One-line description for the README, AGENTS.md and the index.html meta tags. */
|
|
11
|
-
description?: string;
|
|
12
|
-
/** Scaffold the shell without the example/demo code. */
|
|
13
|
-
bare?: boolean;
|
|
14
|
-
}
|
|
1
|
+
import type { ScaffoldOptions } from './types.js';
|
|
15
2
|
/**
|
|
16
3
|
* Filesystem-only scaffolding for tools that drive create-app themselves: no git, no
|
|
17
4
|
* dependency install, no agent-skills deploy, no output. Everything the CLI adds around
|
package/build/scaffold.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD;;;;GAIG;AACH,eAAO,MAAM,QAAQ,SAAU,eAAe,KAAG,IAShD,CAAA"}
|
package/build/scaffold.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
|
-
import {
|
|
2
|
+
import { defaultDescription, titleize } from './naming.js';
|
|
3
|
+
import { DEFAULT_LANG } from './consts.js';
|
|
3
4
|
import { copyTemplate, templateDir } from './template.js';
|
|
4
5
|
/**
|
|
5
6
|
* Filesystem-only scaffolding for tools that drive create-app themselves: no git, no
|
package/build/scaffold.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAGzD;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAqB,EAAQ,EAAE;IACtD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAE7C,YAAY,CAAC,WAAW,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC7C,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI;QACJ,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,YAAY;QAC/B,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,kBAAkB,CAAC,IAAI,CAAC;KAC1D,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC,CAAA;AAClC,CAAC,CAAA"}
|
package/build/template.d.ts
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
import { renameSync } from 'node:fs';
|
|
2
|
-
|
|
3
|
-
/** Template-relative paths — a file, a directory subtree, or a `*` / `**` glob — the bare shell omits. */
|
|
4
|
-
remove: string[];
|
|
5
|
-
/** Target template path → the `.bare.`-infixed source whose CONTENT is written there instead. */
|
|
6
|
-
overrides: Record<string, string>;
|
|
7
|
-
}
|
|
8
|
-
export interface TemplateReplacements {
|
|
9
|
-
/** package/workspace slug, e.g. `my-app` */
|
|
10
|
-
slug: string;
|
|
11
|
-
/** human-readable name, e.g. `My App` */
|
|
12
|
-
name: string;
|
|
13
|
-
/** BCP-47-ish UI language, e.g. `en` — also the generated `<html lang>` */
|
|
14
|
-
lang: string;
|
|
15
|
-
/** one-line project description for the README, AGENTS.md and the index.html meta tags */
|
|
16
|
-
description: string;
|
|
17
|
-
}
|
|
18
|
-
export interface CopyTemplateOptions {
|
|
19
|
-
/** Scaffold the demo-free shell: apply `_bare.json`'s removals and overrides. */
|
|
20
|
-
bare?: boolean;
|
|
21
|
-
}
|
|
2
|
+
import type { CopyTemplateOptions, TemplateReplacements } from './types.js';
|
|
22
3
|
/** Absolute path to the bundled `template/` directory (sibling of `build/`). */
|
|
23
4
|
export declare const templateDir: () => string;
|
|
24
5
|
/**
|
package/build/template.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4D,UAAU,EAA2B,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4D,UAAU,EAA2B,MAAM,SAAS,CAAA;AAIvH,OAAO,KAAK,EAAgB,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEzF,gFAAgF;AAChF,eAAO,MAAM,WAAW,QAAO,MACqC,CAAA;AA8EpE;;;;;GAKG;AACH,eAAO,MAAM,YAAY,QAClB,MAAM,QAAQ,MAAM,KAAK,oBAAoB,SAAQ,mBAAmB,KAC5E,IAEF,CAAA;AAED,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,OAGxC,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
package/build/template.js
CHANGED
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, renameSync, statSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import { dirname, join, relative, resolve, sep } from 'node:path';
|
|
4
|
-
|
|
5
|
-
const DOTFILE_RENAMES = {
|
|
6
|
-
'_gitignore': '.gitignore',
|
|
7
|
-
'_npmrc': '.npmrc',
|
|
8
|
-
'_env': '.env',
|
|
9
|
-
'_github': '.github',
|
|
10
|
-
// `_agents` carries the canonical harness — AGENTS.md's skills, the shared memory
|
|
11
|
-
// store and the link-skills bridge; the template seed (sync-agent-meta) writes
|
|
12
|
-
// `_agents/skills/` into this tree. `_claude` carries only the Claude Code skill-link
|
|
13
|
-
// bridge (SessionStart hook + the gitkept symlink dir). Entries whose source dir is
|
|
14
|
-
// absent are inert.
|
|
15
|
-
'_agents': '.agents',
|
|
16
|
-
'_claude': '.claude',
|
|
17
|
-
};
|
|
18
|
-
/** Files whose contents are binary or must not be string-substituted. */
|
|
19
|
-
const BINARY_EXT = new Set(['.ico', '.png', '.jpg', '.jpeg', '.gif', '.webp', '.woff', '.woff2']);
|
|
20
|
-
/** Template-root manifest describing what the bare shell drops and what it swaps in. */
|
|
21
|
-
const BARE_MANIFEST = '_bare.json';
|
|
4
|
+
import { BARE_MANIFEST, BINARY_EXT, DOTFILE_RENAMES, GLOBSTAR } from './consts.local.js';
|
|
22
5
|
/** Absolute path to the bundled `template/` directory (sibling of `build/`). */
|
|
23
6
|
export const templateDir = () => resolve(dirname(fileURLToPath(import.meta.url)), '..', 'template');
|
|
24
7
|
const applyReplacements = (content, r) => content
|
|
@@ -35,8 +18,6 @@ const isBinary = (file) => {
|
|
|
35
18
|
* one project — which is also why they are filtered out of the copy in BOTH modes.
|
|
36
19
|
*/
|
|
37
20
|
const isBareVariant = (entry) => entry.includes('.bare.');
|
|
38
|
-
/** Stand-in for the globstar segment while the single-`*` pass runs; cannot occur in a path. */
|
|
39
|
-
const GLOBSTAR = '\u0000';
|
|
40
21
|
const globToRegExp = (pattern) => new RegExp('^' + pattern
|
|
41
22
|
.replace(/[.+^${}()|[\]\\]/g, '\\$&')
|
|
42
23
|
.replaceAll('**/', GLOBSTAR)
|
package/build/template.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE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AW,EAAE,IAAY,EAAE,CAAuB,EAAE,IAAI,GAAwB,EAAE,EAC5E,EAAE;IACR,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAChF,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAW,EAAE;IACjD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IACjC,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAA;AACtC,CAAC,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
package/build/types.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type PackageManager = 'bun' | 'npm' | 'yarn';
|
|
2
|
+
export interface CreateArgs {
|
|
3
|
+
/** Target directory (positional). `null` means it must be prompted/derived. */
|
|
4
|
+
dir: string | null;
|
|
5
|
+
/** Human-readable app name. Defaults to the directory slug. */
|
|
6
|
+
name: string | null;
|
|
7
|
+
/** Explicit package slug. `null` derives it from the target directory. */
|
|
8
|
+
slug: string | null;
|
|
9
|
+
/** BCP-47-ish language of the generated UI text and `<html lang>`. */
|
|
10
|
+
lang: string;
|
|
11
|
+
/** One-line project description for the README, AGENTS.md and the index.html meta tags. */
|
|
12
|
+
description: string | null;
|
|
13
|
+
/** Scaffold the shell without the example/demo code. */
|
|
14
|
+
bare: boolean;
|
|
15
|
+
/** Package manager used to install deps and (for `bun`) run the project. */
|
|
16
|
+
pm: PackageManager;
|
|
17
|
+
/** Install dependencies after copying the template. */
|
|
18
|
+
install: boolean;
|
|
19
|
+
/** Deploy agent skills via @owlmeans/agent-skills after install. */
|
|
20
|
+
skills: boolean;
|
|
21
|
+
/** Run `git init` in the new project. */
|
|
22
|
+
git: boolean;
|
|
23
|
+
/** Skip confirmations / proceed into a non-empty directory. */
|
|
24
|
+
yes: boolean;
|
|
25
|
+
help: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface ScaffoldOptions {
|
|
28
|
+
/** Destination directory. Created when missing; an existing one is written into as-is. */
|
|
29
|
+
dir: string;
|
|
30
|
+
/** package/workspace slug, e.g. `my-app`. */
|
|
31
|
+
slug: string;
|
|
32
|
+
/** Human-readable name. Defaults to the titleized slug. */
|
|
33
|
+
name?: string;
|
|
34
|
+
/** BCP-47-ish UI language and `<html lang>`. Defaults to `en`. */
|
|
35
|
+
lang?: string;
|
|
36
|
+
/** One-line description for the README, AGENTS.md and the index.html meta tags. */
|
|
37
|
+
description?: string;
|
|
38
|
+
/** Scaffold the shell without the example/demo code. */
|
|
39
|
+
bare?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface BareManifest {
|
|
42
|
+
/** Template-relative paths — a file, a directory subtree, or a `*` / `**` glob — the bare shell omits. */
|
|
43
|
+
remove: string[];
|
|
44
|
+
/** Target template path → the `.bare.`-infixed source whose CONTENT is written there instead. */
|
|
45
|
+
overrides: Record<string, string>;
|
|
46
|
+
}
|
|
47
|
+
export interface TemplateReplacements {
|
|
48
|
+
/** package/workspace slug, e.g. `my-app` */
|
|
49
|
+
slug: string;
|
|
50
|
+
/** human-readable name, e.g. `My App` */
|
|
51
|
+
name: string;
|
|
52
|
+
/** BCP-47-ish UI language, e.g. `en` — also the generated `<html lang>` */
|
|
53
|
+
lang: string;
|
|
54
|
+
/** one-line project description for the README, AGENTS.md and the index.html meta tags */
|
|
55
|
+
description: string;
|
|
56
|
+
}
|
|
57
|
+
export interface CopyTemplateOptions {
|
|
58
|
+
/** Scaffold the demo-free shell: apply `_bare.json`'s removals and overrides. */
|
|
59
|
+
bare?: boolean;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","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,IAAI,EAAE,MAAM,CAAA;IACZ,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAA;IACZ,0FAA0F;IAC1F,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,iFAAiF;IACjF,IAAI,CAAC,EAAE,OAAO,CAAA;CACf"}
|
package/build/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/create-app",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.57",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Scaffold a fullstack OwlMeans Common app — common + api + web workspaces, shadcn UI navigation/layout, no auth, and a session-scoped in-memory resource, or --bare for the demo-free shell. Also usable programmatically via scaffold(). Deploys agent skills via @owlmeans/agent-skills by default.",
|
|
6
6
|
"type": "module",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"template"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@owlmeans/agent-skills": "^0.1.18-rc.
|
|
33
|
+
"@owlmeans/agent-skills": "^0.1.18-rc.48"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@owlmeans/dep-config": "workspace:*",
|
|
37
|
-
"@types/node": "^26.
|
|
37
|
+
"@types/node": "^26.6.4",
|
|
38
38
|
"nodemon": "^3.1.14",
|
|
39
39
|
"typescript": "^7.0.2"
|
|
40
40
|
},
|
package/template/AGENTS.md
CHANGED
|
@@ -30,6 +30,13 @@ skill.
|
|
|
30
30
|
- Report finished git work as a Markdown table (**Action**, **Target**, **Result**), and never
|
|
31
31
|
commit a conflicted working copy — stop, list the conflicted paths, hand control back.
|
|
32
32
|
|
|
33
|
+
## Code structure (mandatory)
|
|
34
|
+
|
|
35
|
+
Types and interfaces live in `types.ts`, constants and enums in `consts.ts`, code in other files
|
|
36
|
+
(package-private ones in `*.local.ts`); helpers are factory-built objects and entity logic is a model
|
|
37
|
+
over a plain record. Load `/owlmeans-code-structure` before writing, moving or reviewing any
|
|
38
|
+
`.ts`/`.tsx`; `bun run check:structure` stays clean.
|
|
39
|
+
|
|
33
40
|
## Reporting (mandatory)
|
|
34
41
|
|
|
35
42
|
Always report concisely and briefly, in table format, about WHAT was done rather than why —
|
|
@@ -105,7 +112,7 @@ from the installed `@owlmeans/*` packages. Agents load a skill by topic, or you
|
|
|
105
112
|
explicitly. Copilot and Codex read `.agents/skills/` directly; Claude Code reads the generated
|
|
106
113
|
symlinks in `.claude/skills/` (see "Claude Code" below).
|
|
107
114
|
|
|
108
|
-
- After adding or updating any `@owlmeans/*` dependency, run `npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
115
|
+
- After adding or updating any `@owlmeans/*` dependency, run `npx @owlmeans/agent-skills@^0.1.18-rc.48` to refresh
|
|
109
116
|
the deployed skills.
|
|
110
117
|
- `/logging` — before adding any log line, catch block or `console` call (mechanics: `/log`).
|
|
111
118
|
- Deployed files carry an `AUTO-GENERATED` banner and are refreshed in place — never hand-edit them.
|
package/template/README.bare.md
CHANGED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: owlmeans-code-structure
|
|
3
|
+
description: "Mandatory layout rules for all OwlMeans TypeScript — types/interfaces, constants/enums and code live in separate files; helpers are factory-built objects; entity logic lives in models over plain records. Use whenever you write or change any .ts/.tsx in an @owlmeans package, an app built on OwlMeans or a generated target: adding a type, a constant, an enum, a function, a component or a new file, splitting or moving a module, or reviewing a diff."
|
|
4
|
+
metadata:
|
|
5
|
+
scope: general
|
|
6
|
+
---
|
|
7
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
8
|
+
|
|
9
|
+
# OwlMeans code structure
|
|
10
|
+
|
|
11
|
+
Every OwlMeans repo holds to the same layout. It is checked by `owlmeans-structure`
|
|
12
|
+
(`@owlmeans/code-structure`) and by a hook on every edit; a violation is a defect, not a style note.
|
|
13
|
+
|
|
14
|
+
## The rules
|
|
15
|
+
|
|
16
|
+
1. **One kind of thing per file.** Types and interfaces → `types.ts`. Constants and enums →
|
|
17
|
+
`consts.ts`. Code (functions, factories, classes, components, wiring) → every other file.
|
|
18
|
+
A code file declares no type, interface, enum or constant of its own.
|
|
19
|
+
2. **Exported vs package-private.** What the directory exports lives in `types.ts` / `consts.ts`.
|
|
20
|
+
What only one file of the directory uses lives in `types.local.ts` / `consts.local.ts`. Barrels
|
|
21
|
+
re-export the plain files and never a `.local` one.
|
|
22
|
+
3. **Helpers and utilities are objects built by factories.** `createXxxHelper(options)` /
|
|
23
|
+
`makeXxx(...)` returns a typed object; the module may also export one ready instance. A bag of
|
|
24
|
+
loose exported functions is the thing to avoid (see *Standalone functions*).
|
|
25
|
+
4. **Domain logic on an entity is a model.** `makeXxxModel(record)` wraps a plain, serializable
|
|
26
|
+
record and carries the logic; the record stays the wire and storage shape.
|
|
27
|
+
5. **Check before you finish:** `owlmeans-structure check <files>` (or the repo's
|
|
28
|
+
`bun run check:structure`) reports nothing for the files you touched.
|
|
29
|
+
|
|
30
|
+
## Where each declaration goes
|
|
31
|
+
|
|
32
|
+
| You are adding | It goes to |
|
|
33
|
+
|---|---|
|
|
34
|
+
| interface / type alias used outside the file | `<dir>/types.ts` |
|
|
35
|
+
| interface / type alias only this file uses | `<dir>/types.local.ts` |
|
|
36
|
+
| enum, `as const` table, literal, `Object.freeze({...})`, `process.env.X ?? 'y'` | `<dir>/consts.ts` (exported) or `<dir>/consts.local.ts` (this directory only) |
|
|
37
|
+
| JSON schema constant (`ajv`) | the directory's `schemas.ts`, or `consts.ts` when there is none |
|
|
38
|
+
| function, factory, class, component, hook, wiring (`route(...)`, `bind(...)`) | a code file named after what it does |
|
|
39
|
+
| error class | `errors.ts` |
|
|
40
|
+
| module state: `let`, a cache, a registry, a singleton holder | stays in the code file that owns it |
|
|
41
|
+
| anything referencing code (`const X = build()`, a call, an arrow) | code file — it is not a constant |
|
|
42
|
+
|
|
43
|
+
A constant is *constant-like* when its initializer is a literal, an object/array of literals,
|
|
44
|
+
`Object.freeze` of those, `as const`, a template over constants, or an imported CONSTANT_CASE /
|
|
45
|
+
PascalCase value. Anything built by a call, `new`, or an arrow function is code.
|
|
46
|
+
|
|
47
|
+
`types.ts` holds only types. An enum is a value: it goes to `consts.ts` even though it also names a
|
|
48
|
+
type. A function in `consts.ts` or a constant in `types.ts` is a violation.
|
|
49
|
+
|
|
50
|
+
## Barrels
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
// <dir>/index.ts
|
|
54
|
+
export type * from './types.js'
|
|
55
|
+
export * from './consts.js'
|
|
56
|
+
export * from './helper.js'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Never `export type *` a file that holds an enum. Never export `types.local` or `consts.local`.
|
|
60
|
+
An `index.ts` is for re-exports; code that does not belong anywhere else gets a named file.
|
|
61
|
+
|
|
62
|
+
## Standalone functions
|
|
63
|
+
|
|
64
|
+
More than three exported standalone functions in one file means they belong in a helper (or a
|
|
65
|
+
model). Not counted: factories (`make*`, `create*`, `append*`, `define*`, `build*`, `use*`,
|
|
66
|
+
`register*`, `configure*`, `setup*`, `init*`, `with*`), React components and hooks, declaration
|
|
67
|
+
builders that return a model (`route`, `protocol`, `contract`, …), entry scripts, and functions the
|
|
68
|
+
framework binds by their exported name — an endpoint handler or a job processor stays a plain exported
|
|
69
|
+
function (`bind(protocol, handleTaskList)`).
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
// types.ts
|
|
73
|
+
export interface SlugHelper { slugOf: (title: string) => string; titleOf: (slug: string) => string }
|
|
74
|
+
|
|
75
|
+
// slug.ts
|
|
76
|
+
import type { SlugHelper } from './types.js'
|
|
77
|
+
|
|
78
|
+
export const createSlugHelper = (): SlugHelper => {
|
|
79
|
+
const slugOf = (title: string): string => title.toLowerCase().replace(/\W+/g, '-')
|
|
80
|
+
const titleOf = (slug: string): string => slug.replace(/-/g, ' ')
|
|
81
|
+
|
|
82
|
+
return { slugOf, titleOf }
|
|
83
|
+
}
|
|
84
|
+
export const slugHelper = createSlugHelper()
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
A helper takes its collaborators and options as factory arguments; it holds no hidden global.
|
|
88
|
+
|
|
89
|
+
## Models
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
// types.ts
|
|
93
|
+
export interface Invoice { id: string; amountMinor: number; paidAt?: string }
|
|
94
|
+
export interface InvoiceModel { readonly record: Invoice; isPaid: () => boolean; owed: () => number }
|
|
95
|
+
|
|
96
|
+
// invoice.ts
|
|
97
|
+
export const makeInvoiceModel = (record: Invoice): InvoiceModel => ({
|
|
98
|
+
record,
|
|
99
|
+
isPaid: () => record.paidAt != null,
|
|
100
|
+
owed: () => (record.paidAt != null ? 0 : record.amountMinor)
|
|
101
|
+
})
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The package's existing models are the reference: `RouteModel` (`@owlmeans/route`),
|
|
105
|
+
`createStateModel` (`@owlmeans/state`), `makeWorkcardModel` (`@owlmeans/planning`). A model is built
|
|
106
|
+
from the record each time it is needed — never stored on the record, never serialized.
|
|
107
|
+
|
|
108
|
+
## Profiles
|
|
109
|
+
|
|
110
|
+
- **Strict** (default): every rule above.
|
|
111
|
+
- **Relaxed** (listed under `relaxed` in `.owlmeans-structure.json`; viable-agent's target-project
|
|
112
|
+
harness, skill catalogue, pipelines and the generated-app template): exported declarations still
|
|
113
|
+
go to `types.ts` / `consts.ts`; a package-private type or constant may stay beside its code.
|
|
114
|
+
- **Allowed exception:** `// owlmeans-structure: allow <reason>` on the line above a declaration, or
|
|
115
|
+
`/* owlmeans-structure: allow-file <reason> */` anywhere in a file. A reason is required in review.
|
|
116
|
+
|
|
117
|
+
## Tooling
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
owlmeans-structure check [files…] # violations, honouring the ratchet baseline
|
|
121
|
+
owlmeans-structure check --strict # ignore the baseline
|
|
122
|
+
owlmeans-structure split --slot <dir> --repos common,… [--apply] # plan or perform the mechanical split
|
|
123
|
+
owlmeans-structure api --snapshot a.json # public surface of every package
|
|
124
|
+
owlmeans-structure api --diff a.json # nothing removed, nothing demoted from value to type
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The hook (`owlmeans-structure hook` in `.claude/settings.json`, `PostToolUse` on `Edit|Write`)
|
|
128
|
+
prints violations of the edited file. Details, the classifier's exact rules and the procedure for
|
|
129
|
+
splitting a large module: `reference.md`.
|
|
@@ -47,7 +47,7 @@ How you research the repo depends on whether `@owlmeans/*` is linked locally:
|
|
|
47
47
|
**https://github.com/owlmeans/common** — `tree.md` and package READMEs — to find the right package.
|
|
48
48
|
|
|
49
49
|
This is the same dev-linked detection `@owlmeans/agent-skills` uses (see its `detectLinked`). After
|
|
50
|
-
adding an `@owlmeans/*` dependency, run `npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
50
|
+
adding an `@owlmeans/*` dependency, run `npx @owlmeans/agent-skills@^0.1.18-rc.48` to deploy its
|
|
51
51
|
skill. Prefer an `@owlmeans/*` package over a third-party library or bespoke code whenever one fits.
|
|
52
52
|
|
|
53
53
|
### Never add an OwlMeans dependency without an explicit range
|
|
@@ -95,7 +95,8 @@ members table, an invitation flow, a role column or an organization picker:
|
|
|
95
95
|
|
|
96
96
|
When no package solves it, search the codebase for code that already solves a **similar** problem.
|
|
97
97
|
Prefer factoring out a shared helper, base, or generic function — extract an abstraction — over
|
|
98
|
-
duplicating logic or writing from scratch.
|
|
98
|
+
duplicating logic or writing from scratch. A shared helper is a factory-built object and lives in its own
|
|
99
|
+
file beside the directory's `types.ts` / `consts.ts` (`/owlmeans-code-structure`). Only write genuinely new code when nothing reusable exists.
|
|
99
100
|
|
|
100
101
|
## 4. Simplify after writing
|
|
101
102
|
|
|
@@ -137,7 +137,7 @@ every session, so it has a budget: **≤ 40 000 chars**, checked by `sh .agents/
|
|
|
137
137
|
from the repo root where the repo carries it. A line enters it only as:
|
|
138
138
|
|
|
139
139
|
1. a mandatory rule that must hold before any skill is loaded (git, reporting, environments,
|
|
140
|
-
naming) — stated in one or two lines, with the detail in a skill;
|
|
140
|
+
naming, code structure) — stated in one or two lines, with the detail in a skill;
|
|
141
141
|
2. one line of the package map or the command list;
|
|
142
142
|
3. one line of the skills index: `` - `/name` — when to load it ``, ≤ 160 chars.
|
|
143
143
|
|
|
@@ -9,6 +9,17 @@
|
|
|
9
9
|
}
|
|
10
10
|
]
|
|
11
11
|
}
|
|
12
|
+
],
|
|
13
|
+
"PostToolUse": [
|
|
14
|
+
{
|
|
15
|
+
"matcher": "Edit|Write|MultiEdit",
|
|
16
|
+
"hooks": [
|
|
17
|
+
{
|
|
18
|
+
"type": "command",
|
|
19
|
+
"command": "sh -c 'b=\"${CLAUDE_PROJECT_DIR:-.}/node_modules/.bin/owlmeans-structure\"; [ -x \"$b\" ] && exec \"$b\" hook; exit 0'"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
12
23
|
]
|
|
13
24
|
}
|
|
14
25
|
}
|
package/template/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"packageManager": "bun@1.4.
|
|
6
|
+
"packageManager": "bun@1.4.2",
|
|
7
7
|
"workspaces": [
|
|
8
8
|
"sources/*"
|
|
9
9
|
],
|
|
@@ -11,9 +11,11 @@
|
|
|
11
11
|
"dev": "bun run --filter './sources/common' build && bun run --filter './sources/*' --parallel dev",
|
|
12
12
|
"build": "bun run --filter './sources/*' build",
|
|
13
13
|
"typecheck": "bun run --filter './sources/*' typecheck",
|
|
14
|
-
"prepare": "sh -c 'test -f .agents/scripts/link-skills.sh && sh .agents/scripts/link-skills.sh || true'"
|
|
14
|
+
"prepare": "sh -c 'test -f .agents/scripts/link-skills.sh && sh .agents/scripts/link-skills.sh || true'",
|
|
15
|
+
"check:structure": "owlmeans-structure check"
|
|
15
16
|
},
|
|
16
17
|
"devDependencies": {
|
|
18
|
+
"@owlmeans/code-structure": "^0.1.18-rc.0",
|
|
17
19
|
"nodemon": "^3.1.14"
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"typecheck": "tsc -b"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@owlmeans/log": "^0.1.18-rc.
|
|
15
|
-
"@owlmeans/server-app": "^0.1.18-rc.
|
|
16
|
-
"@owlmeans/static-resource": "^0.1.18-rc.
|
|
14
|
+
"@owlmeans/log": "^0.1.18-rc.1",
|
|
15
|
+
"@owlmeans/server-app": "^0.1.18-rc.51",
|
|
16
|
+
"@owlmeans/static-resource": "^0.1.18-rc.38",
|
|
17
17
|
"__APP_SLUG__-common": "workspace:^"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@owlmeans/dep-config": "^0.1.18-rc.6",
|
|
21
|
-
"@types/node": "^
|
|
21
|
+
"@types/node": "^26.6.4",
|
|
22
22
|
"typescript": "^7.0.2"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
"typecheck": "tsc -b"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@owlmeans/config": "^0.1.18-rc.
|
|
23
|
-
"@owlmeans/entrypoint": "^0.1.18-rc.
|
|
24
|
-
"@owlmeans/error": "^0.1.18-rc.
|
|
25
|
-
"@owlmeans/resource": "^0.1.18-rc.
|
|
26
|
-
"@owlmeans/route": "^0.1.18-rc.
|
|
27
|
-
"ajv": "^8.
|
|
22
|
+
"@owlmeans/config": "^0.1.18-rc.43",
|
|
23
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.40",
|
|
24
|
+
"@owlmeans/error": "^0.1.18-rc.37",
|
|
25
|
+
"@owlmeans/resource": "^0.1.18-rc.39",
|
|
26
|
+
"@owlmeans/route": "^0.1.18-rc.34",
|
|
27
|
+
"ajv": "^8.20.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@owlmeans/dep-config": "^0.1.18-rc.6",
|
|
31
|
-
"@types/node": "^
|
|
31
|
+
"@types/node": "^26.6.4",
|
|
32
32
|
"typescript": "^7.0.2"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -11,42 +11,42 @@
|
|
|
11
11
|
"preview": "vite preview"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@owlmeans/client": "^0.1.18-rc.
|
|
15
|
-
"@owlmeans/client-config": "^0.1.18-rc.
|
|
16
|
-
"@owlmeans/client-context": "^0.1.18-rc.
|
|
17
|
-
"@owlmeans/client-entrypoint": "^0.1.18-rc.
|
|
18
|
-
"@owlmeans/client-i18n": "^0.1.18-rc.
|
|
19
|
-
"@owlmeans/entrypoint": "^0.1.18-rc.
|
|
20
|
-
"@owlmeans/log": "^0.1.18-rc.
|
|
21
|
-
"@owlmeans/route": "^0.1.18-rc.
|
|
22
|
-
"@owlmeans/state": "^0.1.18-rc.
|
|
23
|
-
"@owlmeans/web-client": "^0.1.18-rc.
|
|
24
|
-
"@owlmeans/web-panel": "^0.1.18-rc.
|
|
25
|
-
"@radix-ui/react-
|
|
26
|
-
"@radix-ui/react-
|
|
27
|
-
"@radix-ui/react-
|
|
28
|
-
"@radix-ui/react-
|
|
14
|
+
"@owlmeans/client": "^0.1.18-rc.50",
|
|
15
|
+
"@owlmeans/client-config": "^0.1.18-rc.43",
|
|
16
|
+
"@owlmeans/client-context": "^0.1.18-rc.47",
|
|
17
|
+
"@owlmeans/client-entrypoint": "^0.1.18-rc.46",
|
|
18
|
+
"@owlmeans/client-i18n": "^0.1.18-rc.49",
|
|
19
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.40",
|
|
20
|
+
"@owlmeans/log": "^0.1.18-rc.1",
|
|
21
|
+
"@owlmeans/route": "^0.1.18-rc.34",
|
|
22
|
+
"@owlmeans/state": "^0.1.18-rc.38",
|
|
23
|
+
"@owlmeans/web-client": "^0.1.18-rc.60",
|
|
24
|
+
"@owlmeans/web-panel": "^0.1.18-rc.70",
|
|
25
|
+
"@radix-ui/react-dropdown-menu": "^2.1.24",
|
|
26
|
+
"@radix-ui/react-label": "^2.1.15",
|
|
27
|
+
"@radix-ui/react-navigation-menu": "^1.2.22",
|
|
28
|
+
"@radix-ui/react-progress": "^1.1.16",
|
|
29
|
+
"@radix-ui/react-slot": "^1.3.3",
|
|
29
30
|
"__APP_SLUG__-common": "workspace:^",
|
|
30
|
-
"ajv": "^8.
|
|
31
|
-
"class-variance-authority": "^0.7.
|
|
32
|
-
"clsx": "^2.1.
|
|
33
|
-
"i18next": "^26.2
|
|
34
|
-
"lucide-react": "^1.
|
|
35
|
-
"react": "^19.
|
|
36
|
-
"react-dom": "^19.
|
|
37
|
-
"react-hook-form": "^7.
|
|
38
|
-
"react-i18next": "^17.0.
|
|
39
|
-
"tailwind-merge": "^3.
|
|
40
|
-
"tailwindcss": "^4.
|
|
31
|
+
"ajv": "^8.20.0",
|
|
32
|
+
"class-variance-authority": "^0.7.1",
|
|
33
|
+
"clsx": "^2.1.1",
|
|
34
|
+
"i18next": "^26.4.2",
|
|
35
|
+
"lucide-react": "^1.52.0",
|
|
36
|
+
"react": "^19.3.0",
|
|
37
|
+
"react-dom": "^19.3.0",
|
|
38
|
+
"react-hook-form": "^7.89.0",
|
|
39
|
+
"react-i18next": "^17.0.15",
|
|
40
|
+
"tailwind-merge": "^3.7.0",
|
|
41
|
+
"tailwindcss": "^4.3.3"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@owlmeans/dep-config": "^0.1.18-rc.6",
|
|
44
|
-
"@tailwindcss/vite": "^4.
|
|
45
|
-
"@types/react": "^19.
|
|
46
|
-
"@types/react-dom": "^19.
|
|
47
|
-
"@vitejs/plugin-react": "^6.
|
|
45
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
46
|
+
"@types/react": "^19.3.0",
|
|
47
|
+
"@types/react-dom": "^19.3.0",
|
|
48
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
48
49
|
"typescript": "^7.0.2",
|
|
49
|
-
"vite": "^8.
|
|
50
|
-
"vite-tsconfig-paths": "^5.1.4"
|
|
50
|
+
"vite": "^8.3.2"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type PanelNavLink, HOME } from '@owlmeans/web-panel'
|
|
2
|
+
|
|
3
|
+
/** The alias the session items are stored under. Screens address the store by it, never by path. */
|
|
4
|
+
export const SESSION_STATE = 'session-items'
|
|
5
|
+
|
|
6
|
+
// The platform/owner credit — "Powered by OwlMeans" and the copyright the platform delivers — is
|
|
7
|
+
// rendered by the shell itself (`NavLayout`'s `Footer`) and is never a footer link: an app link
|
|
8
|
+
// list is places IN the app, and the credit is not one of those.
|
|
9
|
+
export const footerLinks: PanelNavLink[] = [
|
|
10
|
+
{ alias: HOME, label: '__APP_NAME__' },
|
|
11
|
+
]
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { makeContext as makeBasicContext, useContext as useBasicContext } from '@owlmeans/web-panel'
|
|
2
2
|
import { appendStateResource } from '@owlmeans/state'
|
|
3
3
|
import type { Config, Context } from './types.js'
|
|
4
|
-
|
|
5
|
-
/** The alias the session items are stored under. Screens address the store by it, never by path. */
|
|
6
|
-
export const SESSION_STATE = 'session-items'
|
|
4
|
+
import { SESSION_STATE } from './consts.js'
|
|
7
5
|
|
|
8
6
|
export const useContext = (): Context => useBasicContext<Config, Context>()
|
|
9
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { FC, PropsWithChildren } from 'react'
|
|
2
2
|
import { NavLayout } from '@owlmeans/web-panel'
|
|
3
|
-
import {
|
|
3
|
+
import { navConfig } from '@/nav'
|
|
4
|
+
import { footerLinks } from '@/consts'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* The application shell. `NavLayout` renders the header with the section menu, the side menu
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { HOME } from '@owlmeans/web-panel'
|
|
2
|
-
import type { PanelNavConfig, PanelNavLink } from '@owlmeans/web-panel'
|
|
1
|
+
import { HOME, type PanelNavConfig } from '@owlmeans/web-panel'
|
|
3
2
|
import { web } from '__APP_SLUG__-common'
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -22,9 +21,3 @@ export const navConfig: PanelNavConfig = {
|
|
|
22
21
|
],
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
// The platform/owner credit — "Powered by OwlMeans" and the copyright the platform delivers — is
|
|
26
|
-
// rendered by the shell itself (`NavLayout`'s `Footer`) and is never a footer link: an app link
|
|
27
|
-
// list is places IN the app, and the credit is not one of those.
|
|
28
|
-
export const footerLinks: PanelNavLink[] = [
|
|
29
|
-
{ alias: HOME, label: '__APP_NAME__' },
|
|
30
|
-
]
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useEffect, useState, type FC } from 'react'
|
|
2
2
|
import { useStoreList } from '@owlmeans/client'
|
|
3
3
|
import { session, type SessionItem } from '__APP_SLUG__-common'
|
|
4
|
-
import {
|
|
4
|
+
import { useContext } from '../context.js'
|
|
5
|
+
import { SESSION_STATE } from '../consts.js'
|
|
5
6
|
import { Button } from '@/components/ui/button'
|
|
6
7
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
|
7
8
|
import { Input } from '@/components/ui/input'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from 'vite'
|
|
2
2
|
import react from '@vitejs/plugin-react'
|
|
3
|
-
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
4
3
|
import tailwindcss from '@tailwindcss/vite'
|
|
5
4
|
import path from 'path'
|
|
6
5
|
|
|
@@ -14,13 +13,15 @@ const owlMeansSingletons = [
|
|
|
14
13
|
]
|
|
15
14
|
|
|
16
15
|
export default defineConfig({
|
|
17
|
-
plugins: [react(),
|
|
16
|
+
plugins: [react(), tailwindcss()],
|
|
18
17
|
server: {
|
|
19
18
|
port: 3001,
|
|
20
19
|
host: '0.0.0.0',
|
|
21
20
|
strictPort: true,
|
|
22
21
|
},
|
|
23
22
|
resolve: {
|
|
23
|
+
// Vite resolves the `paths` of tsconfig.json itself since 8.
|
|
24
|
+
tsconfigPaths: true,
|
|
24
25
|
alias: [
|
|
25
26
|
{ find: '@', replacement: path.resolve(__dirname, 'src') },
|
|
26
27
|
],
|