@owlmeans/create-app 0.1.18-rc.6 → 0.1.18-rc.60
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 +49 -5
- package/build/args/types.d.ts +9 -0
- package/build/args/types.d.ts.map +1 -0
- package/build/args/types.js +2 -0
- package/build/args/types.js.map +1 -0
- package/build/args.d.ts +3 -20
- package/build/args.d.ts.map +1 -1
- package/build/args.js +121 -88
- package/build/args.js.map +1 -1
- package/build/bin.js +3 -3
- package/build/bin.js.map +1 -1
- 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 +49 -0
- package/build/consts.local.js.map +1 -0
- package/build/index.d.ts +11 -4
- package/build/index.d.ts.map +1 -1
- package/build/index.js +5 -2
- package/build/index.js.map +1 -1
- package/build/naming/types.d.ts +14 -0
- package/build/naming/types.d.ts.map +1 -0
- package/build/naming/types.js +2 -0
- package/build/naming/types.js.map +1 -0
- package/build/naming.d.ts +4 -0
- package/build/naming.d.ts.map +1 -0
- package/build/naming.js +18 -0
- package/build/naming.js.map +1 -0
- package/build/run.d.ts +1 -1
- package/build/run.d.ts.map +1 -1
- package/build/run.js +23 -17
- package/build/run.js.map +1 -1
- package/build/scaffold.d.ts +8 -0
- package/build/scaffold.d.ts.map +1 -0
- package/build/scaffold.js +19 -0
- package/build/scaffold.js.map +1 -0
- package/build/template/types.d.ts +16 -0
- package/build/template/types.d.ts.map +1 -0
- package/build/template/types.js +2 -0
- package/build/template/types.js.map +1 -0
- package/build/template.d.ts +3 -16
- package/build/template.d.ts.map +1 -1
- package/build/template.js +69 -52
- 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 +5 -4
- package/template/AGENTS.md +61 -2
- package/template/README.bare.md +70 -0
- package/template/README.md +9 -60
- package/template/_agents/scripts/link-skills.sh +327 -15
- package/template/_agents/skills/agent-memory/SKILL.md +12 -11
- package/template/_agents/skills/getting-started/SKILL.md +38 -79
- package/template/_agents/skills/logging/SKILL.md +38 -0
- package/template/_agents/skills/memory-promotion/SKILL.md +10 -4
- package/template/_agents/skills/memory-recompact/SKILL.md +15 -14
- package/template/_agents/skills/owlmeans-code-structure/SKILL.md +182 -0
- package/template/_agents/skills/reuse-code/SKILL.md +56 -10
- package/template/_agents/skills/self-education/SKILL.md +25 -5
- package/template/_agents/skills/skill-authoring/SKILL.md +78 -12
- package/template/_bare.json +24 -0
- package/template/_gitignore +8 -0
- package/template/bunfig.toml +2 -0
- package/template/package.json +3 -2
- package/template/sources/api/package.json +5 -4
- package/template/sources/api/src/app/session/add.ts +6 -17
- package/template/sources/api/src/app/session/list.ts +6 -12
- package/template/sources/api/src/app/session/remove.ts +6 -15
- package/template/sources/api/src/config.ts +7 -0
- package/template/sources/api/src/context.bare.ts +11 -0
- package/template/sources/api/src/entrypoints.bare.ts +4 -0
- package/template/sources/api/src/entrypoints.ts +13 -0
- package/template/sources/api/src/index.ts +8 -2
- package/template/sources/api/src/models/session/types.ts +14 -0
- package/template/sources/api/src/models/session.ts +43 -0
- package/template/sources/api/src/types.bare.ts +5 -0
- package/template/sources/common/package.json +8 -8
- package/template/sources/common/src/config.ts +2 -1
- package/template/sources/common/src/consts.bare.ts +8 -0
- package/template/sources/common/src/consts.ts +0 -13
- package/template/sources/common/src/entrypoints.bare.ts +14 -0
- package/template/sources/common/src/entrypoints.ts +60 -0
- package/template/sources/common/src/index.bare.ts +3 -0
- package/template/sources/common/src/index.ts +1 -1
- package/template/sources/common/src/schemas.ts +7 -7
- package/template/sources/web/index.html +3 -1
- package/template/sources/web/package.json +33 -30
- package/template/sources/web/src/components/ui/dropdown-menu.tsx +257 -0
- package/template/sources/web/src/components/ui/navigation-menu.tsx +169 -0
- package/template/sources/web/src/config.ts +8 -0
- package/template/sources/web/src/consts.ts +14 -0
- package/template/sources/web/src/context.bare.ts +13 -0
- package/template/sources/web/src/context.ts +12 -2
- package/template/sources/web/src/entrypoints.bare.ts +13 -0
- package/template/sources/web/src/entrypoints.ts +16 -0
- package/template/sources/web/src/index.css +7 -0
- package/template/sources/web/src/index.tsx +2 -2
- package/template/sources/web/src/layout/main.tsx +17 -19
- package/template/sources/web/src/nav.bare.ts +23 -0
- package/template/sources/web/src/nav.ts +23 -0
- package/template/sources/web/src/screens/about.tsx +19 -0
- package/template/sources/web/src/screens/home.bare.tsx +17 -0
- package/template/sources/web/src/screens/session.tsx +30 -17
- package/template/sources/web/src/vite-env.d.ts +8 -0
- package/template/sources/web/vite.config.ts +3 -2
- package/template/CLAUDE.md +0 -13
- package/template/sources/api/src/modules.ts +0 -11
- package/template/sources/common/src/modules.ts +0 -26
- package/template/sources/web/src/components/nav/main.tsx +0 -15
- package/template/sources/web/src/modules.ts +0 -20
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ bun create @owlmeans/app my-app
|
|
|
9
9
|
# or
|
|
10
10
|
yarn create @owlmeans/app my-app
|
|
11
11
|
# or
|
|
12
|
-
npx @owlmeans/create-app my-app
|
|
12
|
+
npx @owlmeans/create-app@^0.1.18-rc.60 my-app
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## What it generates
|
|
@@ -18,12 +18,11 @@ A bun-workspace monorepo with three packages and **no authentication**:
|
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
my-app/
|
|
21
|
-
├── AGENTS.md # agent context, read by every coding agent
|
|
22
|
-
├── CLAUDE.md # thin bridge: imports AGENTS.md, links skills for Claude Code
|
|
21
|
+
├── AGENTS.md # agent context, read by every coding agent (Claude Code included)
|
|
23
22
|
├── .agents/skills/<name>/SKILL.md # deployed agent skills
|
|
24
23
|
├── .agents/memory/MEMORY.md # shared agent memory index
|
|
25
24
|
├── sources/
|
|
26
|
-
│ ├── common/ # shared
|
|
25
|
+
│ ├── common/ # shared protocol declarations (routes), schemas and types
|
|
27
26
|
│ ├── api/ # @owlmeans/server-app backend; session data in an in-memory static resource
|
|
28
27
|
│ └── web/ # @owlmeans/web-panel + shadcn UI: navigation, layout and screens
|
|
29
28
|
```
|
|
@@ -32,6 +31,13 @@ The web app ships a basic shadcn UI **navigation + layout** and a **Session** sc
|
|
|
32
31
|
that creates, lists and removes items held in a **session-scoped in-memory resource**
|
|
33
32
|
(`@owlmeans/static-resource`) on the backend — no database required.
|
|
34
33
|
|
|
34
|
+
Logging goes through [`@owlmeans/log`](https://www.npmjs.com/package/@owlmeans/log), with the level
|
|
35
|
+
set per environment and never in code: the api's `config.ts` reads `LOG_LEVEL` (default `info`) and
|
|
36
|
+
`LOG_DEBUG` from the Bun runtime, the web's reads `VITE_LOG_LEVEL` (default `debug` under `vite`,
|
|
37
|
+
`info` in a build) and `VITE_LOG_DEBUG` at build time. The shared `sources/common` config runs in
|
|
38
|
+
both runtimes, so it sets no level and no `cfg.debug` flag. Local values go in the git-ignored
|
|
39
|
+
`sources/api/.env` / `sources/web/.env`.
|
|
40
|
+
|
|
35
41
|
By default the scaffolder also installs dependencies and **deploys agent guidance**
|
|
36
42
|
into the project via [`@owlmeans/agent-skills`](https://www.npmjs.com/package/@owlmeans/agent-skills)
|
|
37
43
|
(`.agents/skills/`).
|
|
@@ -39,7 +45,7 @@ into the project via [`@owlmeans/agent-skills`](https://www.npmjs.com/package/@o
|
|
|
39
45
|
`AGENTS.md` carries the four mandatory sections a real OwlMeans monorepo uses — **Git Workflow**,
|
|
40
46
|
**Reporting**, **Memory**, **Self-Education** — plus a project-purpose placeholder your agent fills
|
|
41
47
|
in on its first session. GitHub Copilot and Codex read `AGENTS.md` and `.agents/skills/` natively;
|
|
42
|
-
Claude Code reads `
|
|
48
|
+
Claude Code reads `AGENTS.md` too and keeps per-skill symlinks in
|
|
43
49
|
`.claude/skills/` fresh through `sh .agents/scripts/link-skills.sh`. The harness guidance (memory
|
|
44
50
|
protocol, self-education, git policy, skill authoring, reuse-first) ships with the template, so it
|
|
45
51
|
is present even with `--no-install`.
|
|
@@ -49,6 +55,10 @@ is present even with `--no-install`.
|
|
|
49
55
|
| Flag | Description |
|
|
50
56
|
|------|-------------|
|
|
51
57
|
| `--name <name>` | Human-readable app name (default: derived from the target dir) |
|
|
58
|
+
| `--slug <slug>` | Package slug, `^[a-z0-9](?:[a-z0-9-]{0,30}[a-z0-9])?$` (default: derived from the target dir) |
|
|
59
|
+
| `--lang <code>` | Language of the generated UI text and `<html lang>` (default: `en`) |
|
|
60
|
+
| `--description <text>` | One-line description used in `README.md`, `AGENTS.md`, the Home screen and the `index.html` meta tags |
|
|
61
|
+
| `--bare` | Scaffold the working shell with no example/demo code |
|
|
52
62
|
| `--pm <bun\|npm\|yarn>` | Package manager (default: `bun`) |
|
|
53
63
|
| `--no-install` | Skip dependency installation |
|
|
54
64
|
| `--no-skills` | Skip the `@owlmeans/agent-skills` deploy |
|
|
@@ -56,6 +66,40 @@ is present even with `--no-install`.
|
|
|
56
66
|
| `--yes`, `-y` | Proceed without prompts / into a non-empty directory |
|
|
57
67
|
| `--help`, `-h` | Show help |
|
|
58
68
|
|
|
69
|
+
## `--bare`
|
|
70
|
+
|
|
71
|
+
`--bare` keeps the three workspaces, the config/context/entrypoint wiring, the layout, the nav
|
|
72
|
+
skeleton and one Home screen, and drops every piece of example code — the `SessionItem` types and
|
|
73
|
+
schemas, the api's `app/session/**` handlers and its static resource, the About and Session screens.
|
|
74
|
+
`sources/common/src/entrypoints.ts` exports an immutable `appProtocols` tree with an empty `api`
|
|
75
|
+
branch and the web routes. The API and web bind those branches locally, so the first feature adds a
|
|
76
|
+
declaration to the tree, then a handler and a screen binding.
|
|
77
|
+
|
|
78
|
+
What bare removes and what it swaps in is declared in `template/_bare.json`, next to the
|
|
79
|
+
`.bare.`-infixed variants it points at — not in the scaffolder's code.
|
|
80
|
+
|
|
81
|
+
## Programmatic use
|
|
82
|
+
|
|
83
|
+
`scaffold` performs the filesystem copy and nothing else: no `git init`, no install, no
|
|
84
|
+
agent-skills deploy, no logging. The destination directory may already exist.
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
import { scaffold } from '@owlmeans/create-app'
|
|
88
|
+
|
|
89
|
+
scaffold({
|
|
90
|
+
dir: '/tmp/my-app',
|
|
91
|
+
slug: 'my-app',
|
|
92
|
+
name: 'My App', // default: the titleized slug
|
|
93
|
+
lang: 'en',
|
|
94
|
+
description: 'What the app is for.',
|
|
95
|
+
bare: true,
|
|
96
|
+
})
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`templateHelper.templateDir()`, `templateHelper.copyTemplate(src, dest, replacements, { bare })` and
|
|
100
|
+
`templateHelper.isEmptyDir(dir)` are exported for callers that want the pieces (`namingHelper` and
|
|
101
|
+
`argsHelper` likewise); `run(args)` is the full CLI flow.
|
|
102
|
+
|
|
59
103
|
## Running the generated app
|
|
60
104
|
|
|
61
105
|
```sh
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CreateArgs } from '../types.js';
|
|
2
|
+
/** The scaffolder CLI's command line. */
|
|
3
|
+
export interface ArgsHelper {
|
|
4
|
+
/** The options of a process argv, or `null` (after an error on stderr) for an unusable one. */
|
|
5
|
+
parseArgs: (argv: string[]) => CreateArgs | null;
|
|
6
|
+
/** Print the usage text to stdout. */
|
|
7
|
+
printHelp: () => void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/args/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,yCAAyC;AACzC,MAAM,WAAW,UAAU;IACzB,+FAA+F;IAC/F,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,UAAU,GAAG,IAAI,CAAA;IAChD,sCAAsC;IACtC,SAAS,EAAE,MAAM,IAAI,CAAA;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/args/types.ts"],"names":[],"mappings":""}
|
package/build/args.d.ts
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
dir: string | null;
|
|
5
|
-
/** Human-readable app name. Defaults to the directory slug. */
|
|
6
|
-
name: string | null;
|
|
7
|
-
/** Package manager used to install deps and (for `bun`) run the project. */
|
|
8
|
-
pm: PackageManager;
|
|
9
|
-
/** Install dependencies after copying the template. */
|
|
10
|
-
install: boolean;
|
|
11
|
-
/** Deploy agent skills via @owlmeans/agent-skills after install. */
|
|
12
|
-
skills: boolean;
|
|
13
|
-
/** Run `git init` in the new project. */
|
|
14
|
-
git: boolean;
|
|
15
|
-
/** Skip confirmations / proceed into a non-empty directory. */
|
|
16
|
-
yes: boolean;
|
|
17
|
-
help: boolean;
|
|
18
|
-
}
|
|
19
|
-
export declare const parseArgs: (argv: string[]) => CreateArgs | null;
|
|
20
|
-
export declare const printHelp: () => void;
|
|
1
|
+
import type { ArgsHelper } from './args/types.js';
|
|
2
|
+
export declare const createArgsHelper: () => ArgsHelper;
|
|
3
|
+
export declare const argsHelper: ArgsHelper;
|
|
21
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":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,eAAO,MAAM,gBAAgB,QAAO,UA6HnC,CAAA;AAED,eAAO,MAAM,UAAU,YAAqB,CAAA"}
|
package/build/args.js
CHANGED
|
@@ -1,96 +1,129 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
pm: 'bun',
|
|
29
|
-
install: true,
|
|
30
|
-
skills: true,
|
|
31
|
-
git: true,
|
|
32
|
-
yes: false,
|
|
33
|
-
help: false,
|
|
34
|
-
};
|
|
35
|
-
let i = 0;
|
|
36
|
-
while (i < args.length) {
|
|
37
|
-
const a = args[i];
|
|
38
|
-
switch (a) {
|
|
39
|
-
case '--help':
|
|
40
|
-
case '-h':
|
|
41
|
-
result.help = true;
|
|
42
|
-
break;
|
|
43
|
-
case '--yes':
|
|
44
|
-
case '-y':
|
|
45
|
-
result.yes = true;
|
|
46
|
-
break;
|
|
47
|
-
case '--no-install':
|
|
48
|
-
result.install = false;
|
|
49
|
-
break;
|
|
50
|
-
case '--no-skills':
|
|
51
|
-
result.skills = false;
|
|
52
|
-
break;
|
|
53
|
-
case '--no-git':
|
|
54
|
-
result.git = false;
|
|
55
|
-
break;
|
|
56
|
-
case '--name': {
|
|
57
|
-
const v = args[i + 1];
|
|
58
|
-
if (v == null || v.startsWith('-')) {
|
|
59
|
-
process.stderr.write('error: --name requires a value\n');
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
result.name = v;
|
|
63
|
-
i++;
|
|
64
|
-
break;
|
|
1
|
+
import { namingHelper } from './naming.js';
|
|
2
|
+
import { DEFAULT_LANG, SLUG_PATTERN } from './consts.js';
|
|
3
|
+
import { HELP, PMS } from './consts.local.js';
|
|
4
|
+
export const createArgsHelper = () => {
|
|
5
|
+
const parseArgs = (argv) => {
|
|
6
|
+
const args = argv.slice(2);
|
|
7
|
+
const result = {
|
|
8
|
+
dir: null,
|
|
9
|
+
name: null,
|
|
10
|
+
slug: null,
|
|
11
|
+
lang: DEFAULT_LANG,
|
|
12
|
+
description: null,
|
|
13
|
+
bare: false,
|
|
14
|
+
pm: 'bun',
|
|
15
|
+
install: true,
|
|
16
|
+
skills: true,
|
|
17
|
+
git: true,
|
|
18
|
+
yes: false,
|
|
19
|
+
help: false,
|
|
20
|
+
};
|
|
21
|
+
// A value may legitimately start with `-` only for free-form text, so `--description`
|
|
22
|
+
// takes whatever follows it; the identifier-shaped flags stay strict.
|
|
23
|
+
const value = (i, flag, free = false) => {
|
|
24
|
+
const v = args[i + 1];
|
|
25
|
+
if (v == null || (!free && v.startsWith('-'))) {
|
|
26
|
+
process.stderr.write(`error: ${flag} requires a value\n`);
|
|
27
|
+
return null;
|
|
65
28
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
29
|
+
return v;
|
|
30
|
+
};
|
|
31
|
+
let i = 0;
|
|
32
|
+
while (i < args.length) {
|
|
33
|
+
const a = args[i];
|
|
34
|
+
switch (a) {
|
|
35
|
+
case '--help':
|
|
36
|
+
case '-h':
|
|
37
|
+
result.help = true;
|
|
38
|
+
break;
|
|
39
|
+
case '--yes':
|
|
40
|
+
case '-y':
|
|
41
|
+
result.yes = true;
|
|
42
|
+
break;
|
|
43
|
+
case '--bare':
|
|
44
|
+
result.bare = true;
|
|
45
|
+
break;
|
|
46
|
+
case '--no-install':
|
|
47
|
+
result.install = false;
|
|
48
|
+
break;
|
|
49
|
+
case '--no-skills':
|
|
50
|
+
result.skills = false;
|
|
51
|
+
break;
|
|
52
|
+
case '--no-git':
|
|
53
|
+
result.git = false;
|
|
54
|
+
break;
|
|
55
|
+
case '--name': {
|
|
56
|
+
const v = value(i, '--name');
|
|
57
|
+
if (v == null)
|
|
58
|
+
return null;
|
|
59
|
+
result.name = v;
|
|
60
|
+
i++;
|
|
61
|
+
break;
|
|
71
62
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
63
|
+
case '--slug': {
|
|
64
|
+
const v = value(i, '--slug');
|
|
65
|
+
if (v == null)
|
|
66
|
+
return null;
|
|
67
|
+
if (!namingHelper.isValidSlug(v)) {
|
|
68
|
+
process.stderr.write(`error: --slug must match ${SLUG_PATTERN.source}`
|
|
69
|
+
+ ' — lowercase letters, digits and inner dashes, 1-32 characters\n');
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
result.slug = v;
|
|
73
|
+
i++;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
case '--lang': {
|
|
77
|
+
const v = value(i, '--lang');
|
|
78
|
+
if (v == null)
|
|
79
|
+
return null;
|
|
80
|
+
if (!namingHelper.isValidLang(v)) {
|
|
81
|
+
process.stderr.write(`error: --lang must be a language code such as en or pt-BR\n`);
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
result.lang = v;
|
|
85
|
+
i++;
|
|
86
|
+
break;
|
|
80
87
|
}
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
case '--description': {
|
|
89
|
+
const v = value(i, '--description', true);
|
|
90
|
+
if (v == null)
|
|
91
|
+
return null;
|
|
92
|
+
result.description = v;
|
|
93
|
+
i++;
|
|
94
|
+
break;
|
|
83
95
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
96
|
+
case '--pm': {
|
|
97
|
+
const v = args[i + 1];
|
|
98
|
+
if (v == null || !PMS.includes(v)) {
|
|
99
|
+
process.stderr.write(`error: --pm must be one of ${PMS.join(', ')}\n`);
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
result.pm = v;
|
|
103
|
+
i++;
|
|
104
|
+
break;
|
|
87
105
|
}
|
|
106
|
+
default:
|
|
107
|
+
if (a.startsWith('-')) {
|
|
108
|
+
process.stderr.write(`error: unknown flag ${a}\n`);
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
if (result.dir == null) {
|
|
112
|
+
result.dir = a;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
process.stderr.write(`error: unexpected argument ${a}\n`);
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
i++;
|
|
88
120
|
}
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
121
|
+
return result;
|
|
122
|
+
};
|
|
123
|
+
const printHelp = () => {
|
|
124
|
+
process.stdout.write(HELP);
|
|
125
|
+
};
|
|
126
|
+
return { parseArgs, printHelp };
|
|
95
127
|
};
|
|
128
|
+
export const argsHelper = createArgsHelper();
|
|
96
129
|
//# sourceMappingURL=args.js.map
|
package/build/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAI7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAe,EAAE;IAC/C,MAAM,SAAS,GAAG,CAAC,IAAc,EAAqB,EAAE;QACtD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAC1B,MAAM,MAAM,GAAe;YACzB,GAAG,EAAE,IAAI;YACT,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,IAAI;YACjB,IAA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A;IAED,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;AACjC,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,EAAE,CAAA"}
|
package/build/bin.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { argsHelper } from './args.js';
|
|
3
3
|
import { run } from './run.js';
|
|
4
|
-
const args = parseArgs(process.argv);
|
|
4
|
+
const args = argsHelper.parseArgs(process.argv);
|
|
5
5
|
if (args == null) {
|
|
6
6
|
process.stderr.write('Run with --help for usage.\n');
|
|
7
7
|
process.exit(2);
|
|
8
8
|
}
|
|
9
9
|
else if (args.help) {
|
|
10
|
-
printHelp();
|
|
10
|
+
argsHelper.printHelp();
|
|
11
11
|
process.exit(0);
|
|
12
12
|
}
|
|
13
13
|
else {
|
package/build/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAE/C,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;IACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAA;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC;KAAM,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,UAAU,CAAC,SAAS,EAAE,CAAA;IACtB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC;KAAM,CAAC;IACN,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACpB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACpB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;QACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACpF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -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.60 <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,CAYlD,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,49 @@
|
|
|
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.60 <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
|
+
// `_agents` carries the canonical harness — AGENTS.md's skills, the shared memory
|
|
36
|
+
// store and the link-skills bridge; the template seed (sync-agent-meta) writes
|
|
37
|
+
// `_agents/skills/` into this tree. `_claude` carries only the Claude Code skill-link
|
|
38
|
+
// bridge (SessionStart hook + the gitkept symlink dir). Entries whose source dir is
|
|
39
|
+
// absent are inert.
|
|
40
|
+
'_agents': '.agents',
|
|
41
|
+
'_claude': '.claude',
|
|
42
|
+
};
|
|
43
|
+
/** Files whose contents are binary or must not be string-substituted. */
|
|
44
|
+
export const BINARY_EXT = new Set(['.ico', '.png', '.jpg', '.jpeg', '.gif', '.webp', '.woff', '.woff2']);
|
|
45
|
+
/** Template-root manifest describing what the bare shell drops and what it swaps in. */
|
|
46
|
+
export const BARE_MANIFEST = '_bare.json';
|
|
47
|
+
/** Stand-in for the globstar segment while the single-`*` pass runs; cannot occur in a path. */
|
|
48
|
+
export const GLOBSTAR = '\u0000';
|
|
49
|
+
//# 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,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,6 +1,13 @@
|
|
|
1
1
|
export { run } from './run.js';
|
|
2
|
-
export {
|
|
3
|
-
export type {
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
2
|
+
export { argsHelper, createArgsHelper } from './args.js';
|
|
3
|
+
export type { ArgsHelper } from './args/types.js';
|
|
4
|
+
export type { CreateArgs, PackageManager } from './types.js';
|
|
5
|
+
export { scaffold } from './scaffold.js';
|
|
6
|
+
export type { ScaffoldOptions } from './types.js';
|
|
7
|
+
export { createTemplateHelper, templateHelper } from './template.js';
|
|
8
|
+
export type { TemplateHelper } from './template/types.js';
|
|
9
|
+
export type { BareManifest, CopyTemplateOptions, TemplateReplacements } from './types.js';
|
|
10
|
+
export { createNamingHelper, namingHelper } from './naming.js';
|
|
11
|
+
export type { NamingHelper } from './naming/types.js';
|
|
12
|
+
export { DEFAULT_LANG, LANG_PATTERN, SLUG_PATTERN } from './consts.js';
|
|
6
13
|
//# 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,
|
|
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,UAAU,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACxD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,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,oBAAoB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACpE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACzF,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { run } from './run.js';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { argsHelper, createArgsHelper } from './args.js';
|
|
3
|
+
export { scaffold } from './scaffold.js';
|
|
4
|
+
export { createTemplateHelper, templateHelper } from './template.js';
|
|
5
|
+
export { createNamingHelper, namingHelper } from './naming.js';
|
|
6
|
+
export { DEFAULT_LANG, LANG_PATTERN, SLUG_PATTERN } from './consts.js';
|
|
4
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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAGxD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGpE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE9D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** The names a scaffolded app is given: its package slug, language, title and description. */
|
|
2
|
+
export interface NamingHelper {
|
|
3
|
+
/** Whether a string is an npm-safe package slug (`SLUG_PATTERN`). */
|
|
4
|
+
isValidSlug: (slug: string) => boolean;
|
|
5
|
+
/** Whether a string has the loose BCP-47 shape of `LANG_PATTERN`. */
|
|
6
|
+
isValidLang: (lang: string) => boolean;
|
|
7
|
+
/** A package slug derived from a target directory; `owlmeans-app` when nothing usable is left. */
|
|
8
|
+
slugify: (input: string) => string;
|
|
9
|
+
/** `my-app` → `My App`. */
|
|
10
|
+
titleize: (slug: string) => string;
|
|
11
|
+
/** The one-line description an app gets when none is given. */
|
|
12
|
+
defaultDescription: (name: string) => string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/naming/types.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,MAAM,WAAW,YAAY;IAC3B,qEAAqE;IACrE,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAA;IACtC,qEAAqE;IACrE,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAA;IACtC,kGAAkG;IAClG,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAClC,2BAA2B;IAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IAClC,+DAA+D;IAC/D,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/naming/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../src/naming.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,kBAAkB,QAAO,YAqBrC,CAAA;AAED,eAAO,MAAM,YAAY,cAAuB,CAAA"}
|
package/build/naming.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { basename } from 'node:path';
|
|
2
|
+
import { LANG_PATTERN, SLUG_PATTERN } from './consts.js';
|
|
3
|
+
export const createNamingHelper = () => {
|
|
4
|
+
const isValidSlug = (slug) => SLUG_PATTERN.test(slug);
|
|
5
|
+
const isValidLang = (lang) => LANG_PATTERN.test(lang);
|
|
6
|
+
const slugify = (input) => basename(input)
|
|
7
|
+
.toLowerCase()
|
|
8
|
+
.replace(/[^a-z0-9-]+/g, '-')
|
|
9
|
+
.replace(/^-+/g, '')
|
|
10
|
+
.slice(0, 32)
|
|
11
|
+
.replace(/-+$/g, '')
|
|
12
|
+
|| 'owlmeans-app';
|
|
13
|
+
const titleize = (slug) => slug.split('-').filter(Boolean).map(w => w[0].toUpperCase() + w.slice(1)).join(' ');
|
|
14
|
+
const defaultDescription = (name) => `${name} — a fullstack OwlMeans Common app.`;
|
|
15
|
+
return { isValidSlug, isValidLang, slugify, titleize, defaultDescription };
|
|
16
|
+
};
|
|
17
|
+
export const namingHelper = createNamingHelper();
|
|
18
|
+
//# sourceMappingURL=naming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAGxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAiB,EAAE;IACnD,MAAM,WAAW,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEtE,MAAM,WAAW,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEtE,MAAM,OAAO,GAAG,CAAC,KAAa,EAAU,EAAE,CACxC,QAAQ,CAAC,KAAK,CAAC;S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