create-mindees 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +31 -0
- package/README.md +30 -0
- package/dist/args.js +62 -0
- package/dist/args.js.map +1 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +66 -0
- package/dist/bin.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/package.json +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# License
|
|
2
|
+
|
|
3
|
+
MindeesNative is dual-licensed under either of:
|
|
4
|
+
|
|
5
|
+
- **Apache License, Version 2.0** ([LICENSE-APACHE](./LICENSE-APACHE) or
|
|
6
|
+
<https://www.apache.org/licenses/LICENSE-2.0>)
|
|
7
|
+
- **MIT license** ([LICENSE-MIT](./LICENSE-MIT) or
|
|
8
|
+
<https://opensource.org/licenses/MIT>)
|
|
9
|
+
|
|
10
|
+
at your option.
|
|
11
|
+
|
|
12
|
+
This `MIT OR Apache-2.0` dual-license is the same model used by the Rust
|
|
13
|
+
ecosystem and many modern open-source projects. It gives downstream users
|
|
14
|
+
maximum flexibility: the MIT option is short and permissive, while the Apache
|
|
15
|
+
option adds an explicit patent grant.
|
|
16
|
+
|
|
17
|
+
## SPDX identifier
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
SPDX-License-Identifier: MIT OR Apache-2.0
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Contribution
|
|
24
|
+
|
|
25
|
+
Unless you explicitly state otherwise, any contribution intentionally
|
|
26
|
+
submitted for inclusion in the work by you, as defined in the Apache-2.0
|
|
27
|
+
license, shall be dual-licensed as above, without any additional terms or
|
|
28
|
+
conditions.
|
|
29
|
+
|
|
30
|
+
Contributions are accepted under the **Developer Certificate of Origin (DCO)**.
|
|
31
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for details on signing off your commits.
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# create-mindees
|
|
2
|
+
|
|
3
|
+
Scaffold a new MindeesNative app:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm create mindees@latest my-app
|
|
7
|
+
# or: pnpm create mindees my-app --template counter
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
> **Status: ๐งช Experimental (Phase 5).** Implemented and tested. Delegates to
|
|
11
|
+
> `@mindees/cli`'s tested `scaffold` core, so `npm create mindees` and
|
|
12
|
+
> `mindees create` behave identically.
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
create-mindees <app-name-or-path> [--template blank|counter] [--prompt "..."] [--force]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- `--template` โ pick a starter (`blank` or `counter`). Default `blank`.
|
|
21
|
+
- `--prompt "a reactive counter"` โ offline keyword mapping to a template
|
|
22
|
+
(real natural-language app generation arrives with `@mindees/ai` in Phase 10).
|
|
23
|
+
- `--force` โ overwrite a non-empty target directory.
|
|
24
|
+
- The positional can be a simple app name, a relative path, or an absolute
|
|
25
|
+
Windows/POSIX path; the generated package name is derived safely from the
|
|
26
|
+
final directory name.
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
`MIT OR Apache-2.0`
|
package/dist/args.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { resolveCreateTarget } from "@mindees/cli";
|
|
2
|
+
import { parseArgs } from "node:util";
|
|
3
|
+
//#region src/args.ts
|
|
4
|
+
const CREATE_USAGE = "Usage: create-mindees <app-name-or-path> [--template <name>] [--prompt \"...\"] [--force]";
|
|
5
|
+
/** Parse `create-mindees` argv into testable command intent. */
|
|
6
|
+
function parseCreateCommand(argv, cwd) {
|
|
7
|
+
const { values, positionals } = parseArgs({
|
|
8
|
+
args: [...argv],
|
|
9
|
+
allowPositionals: true,
|
|
10
|
+
strict: false,
|
|
11
|
+
options: {
|
|
12
|
+
help: {
|
|
13
|
+
type: "boolean",
|
|
14
|
+
short: "h"
|
|
15
|
+
},
|
|
16
|
+
template: {
|
|
17
|
+
type: "string",
|
|
18
|
+
short: "t"
|
|
19
|
+
},
|
|
20
|
+
prompt: {
|
|
21
|
+
type: "string",
|
|
22
|
+
short: "p"
|
|
23
|
+
},
|
|
24
|
+
force: { type: "boolean" }
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
if (values.help === true || positionals[0] === "help") return {
|
|
28
|
+
kind: "help",
|
|
29
|
+
exitCode: 0,
|
|
30
|
+
usage: CREATE_USAGE
|
|
31
|
+
};
|
|
32
|
+
const appName = positionals[0];
|
|
33
|
+
if (!appName) return {
|
|
34
|
+
kind: "error",
|
|
35
|
+
exitCode: 1,
|
|
36
|
+
error: "create-mindees: missing app name or target path.",
|
|
37
|
+
usage: CREATE_USAGE
|
|
38
|
+
};
|
|
39
|
+
const target = resolveCreateTarget(appName, cwd);
|
|
40
|
+
if (!target.ok) return {
|
|
41
|
+
kind: "error",
|
|
42
|
+
exitCode: 1,
|
|
43
|
+
error: target.error,
|
|
44
|
+
usage: CREATE_USAGE
|
|
45
|
+
};
|
|
46
|
+
const args = {
|
|
47
|
+
appName: target.packageName,
|
|
48
|
+
targetDir: target.targetDir,
|
|
49
|
+
force: values.force === true
|
|
50
|
+
};
|
|
51
|
+
if (typeof values.template === "string") args.template = values.template;
|
|
52
|
+
if (typeof values.prompt === "string") args.prompt = values.prompt;
|
|
53
|
+
return {
|
|
54
|
+
kind: "create",
|
|
55
|
+
args,
|
|
56
|
+
displayDir: target.displayDir
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { parseCreateCommand };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=args.js.map
|
package/dist/args.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.js","names":[],"sources":["../src/args.ts"],"sourcesContent":["import { parseArgs } from 'node:util'\nimport { resolveCreateTarget } from '@mindees/cli'\nimport type { CreateArgs } from './index'\n\nexport const CREATE_USAGE =\n 'Usage: create-mindees <app-name-or-path> [--template <name>] [--prompt \"...\"] [--force]'\n\nexport type ParsedCreateCommand =\n | {\n kind: 'help'\n exitCode: 0\n usage: string\n }\n | {\n kind: 'error'\n exitCode: 1\n error: string\n usage: string\n }\n | {\n kind: 'create'\n args: CreateArgs\n displayDir: string\n }\n\n/** Parse `create-mindees` argv into testable command intent. */\nexport function parseCreateCommand(argv: readonly string[], cwd: string): ParsedCreateCommand {\n const { values, positionals } = parseArgs({\n args: [...argv],\n allowPositionals: true,\n strict: false,\n options: {\n help: { type: 'boolean', short: 'h' },\n template: { type: 'string', short: 't' },\n prompt: { type: 'string', short: 'p' },\n force: { type: 'boolean' },\n },\n })\n\n if (values.help === true || positionals[0] === 'help') {\n return { kind: 'help', exitCode: 0, usage: CREATE_USAGE }\n }\n\n const appName = positionals[0]\n if (!appName) {\n return {\n kind: 'error',\n exitCode: 1,\n error: 'create-mindees: missing app name or target path.',\n usage: CREATE_USAGE,\n }\n }\n\n const target = resolveCreateTarget(appName, cwd)\n if (!target.ok) {\n return { kind: 'error', exitCode: 1, error: target.error, usage: CREATE_USAGE }\n }\n\n const args: CreateArgs = {\n appName: target.packageName,\n targetDir: target.targetDir,\n force: values.force === true,\n }\n if (typeof values.template === 'string') args.template = values.template\n if (typeof values.prompt === 'string') args.prompt = values.prompt\n\n return { kind: 'create', args, displayDir: target.displayDir }\n}\n"],"mappings":";;;AAIA,MAAa,eACX;;AAqBF,SAAgB,mBAAmB,MAAyB,KAAkC;CAC5F,MAAM,EAAE,QAAQ,gBAAgB,UAAU;EACxC,MAAM,CAAC,GAAG,IAAI;EACd,kBAAkB;EAClB,QAAQ;EACR,SAAS;GACP,MAAM;IAAE,MAAM;IAAW,OAAO;GAAI;GACpC,UAAU;IAAE,MAAM;IAAU,OAAO;GAAI;GACvC,QAAQ;IAAE,MAAM;IAAU,OAAO;GAAI;GACrC,OAAO,EAAE,MAAM,UAAU;EAC3B;CACF,CAAC;CAED,IAAI,OAAO,SAAS,QAAQ,YAAY,OAAO,QAC7C,OAAO;EAAE,MAAM;EAAQ,UAAU;EAAG,OAAO;CAAa;CAG1D,MAAM,UAAU,YAAY;CAC5B,IAAI,CAAC,SACH,OAAO;EACL,MAAM;EACN,UAAU;EACV,OAAO;EACP,OAAO;CACT;CAGF,MAAM,SAAS,oBAAoB,SAAS,GAAG;CAC/C,IAAI,CAAC,OAAO,IACV,OAAO;EAAE,MAAM;EAAS,UAAU;EAAG,OAAO,OAAO;EAAO,OAAO;CAAa;CAGhF,MAAM,OAAmB;EACvB,SAAS,OAAO;EAChB,WAAW,OAAO;EAClB,OAAO,OAAO,UAAU;CAC1B;CACA,IAAI,OAAO,OAAO,aAAa,UAAU,KAAK,WAAW,OAAO;CAChE,IAAI,OAAO,OAAO,WAAW,UAAU,KAAK,SAAS,OAAO;CAE5D,OAAO;EAAE,MAAM;EAAU;EAAM,YAAY,OAAO;CAAW;AAC/D"}
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runCreate } from "./index.js";
|
|
3
|
+
import { parseCreateCommand } from "./args.js";
|
|
4
|
+
import { quoteShellPath } from "@mindees/cli";
|
|
5
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { dirname, join, relative, sep } from "node:path";
|
|
7
|
+
import process from "node:process";
|
|
8
|
+
//#region src/bin.ts
|
|
9
|
+
/**
|
|
10
|
+
* `create-mindees` executable โ `npm create mindees@latest <name>`.
|
|
11
|
+
*
|
|
12
|
+
* A thin adapter: parse argv, wire a `node:fs`-backed filesystem, delegate to
|
|
13
|
+
* the tested {@link runCreate}. All logic lives in the core.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
function nodeFileSystem() {
|
|
18
|
+
return {
|
|
19
|
+
exists: (path) => existsSync(path),
|
|
20
|
+
readFile: (path) => readFileSync(path, "utf8"),
|
|
21
|
+
writeFile: (path, contents) => {
|
|
22
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
23
|
+
writeFileSync(path, contents, "utf8");
|
|
24
|
+
},
|
|
25
|
+
mkdir: (path) => {
|
|
26
|
+
mkdirSync(path, { recursive: true });
|
|
27
|
+
},
|
|
28
|
+
readDir: (dir) => {
|
|
29
|
+
const walk = (current, acc) => {
|
|
30
|
+
if (!existsSync(current)) return acc;
|
|
31
|
+
for (const entry of readdirSync(current)) {
|
|
32
|
+
const full = join(current, entry);
|
|
33
|
+
if (statSync(full).isDirectory()) walk(full, acc);
|
|
34
|
+
else acc.push(relative(dir, full).split(sep).join("/"));
|
|
35
|
+
}
|
|
36
|
+
return acc;
|
|
37
|
+
};
|
|
38
|
+
return walk(dir, []).sort();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function main() {
|
|
43
|
+
const command = parseCreateCommand(process.argv.slice(2), process.cwd());
|
|
44
|
+
if (command.kind === "help") {
|
|
45
|
+
process.stdout.write(`${command.usage}\n`);
|
|
46
|
+
process.exitCode = command.exitCode;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (command.kind === "error") {
|
|
50
|
+
process.stderr.write(`${command.error}\n${command.usage}\n`);
|
|
51
|
+
process.exitCode = command.exitCode;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const result = runCreate(nodeFileSystem(), command.args);
|
|
55
|
+
if (!result.ok) {
|
|
56
|
+
process.stderr.write(`${result.error ?? "create failed"}\n`);
|
|
57
|
+
process.exitCode = 1;
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
process.stdout.write(`Created "${command.args.appName}" from the ${result.template} template (${result.written.length} files).\n`);
|
|
61
|
+
process.stdout.write(`Next: cd ${quoteShellPath(command.displayDir)} && pnpm install && mindees dev\n`);
|
|
62
|
+
}
|
|
63
|
+
main();
|
|
64
|
+
//#endregion
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","names":[],"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * `create-mindees` executable โ `npm create mindees@latest <name>`.\n *\n * A thin adapter: parse argv, wire a `node:fs`-backed filesystem, delegate to\n * the tested {@link runCreate}. All logic lives in the core.\n *\n * @module\n */\n\nimport { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs'\nimport { dirname, join, relative, sep } from 'node:path'\nimport process from 'node:process'\nimport { type FileSystem, quoteShellPath } from '@mindees/cli'\nimport { parseCreateCommand } from './args'\nimport { runCreate } from './index'\n\nfunction nodeFileSystem(): FileSystem {\n return {\n exists: (path) => existsSync(path),\n readFile: (path) => readFileSync(path, 'utf8'),\n writeFile: (path, contents) => {\n mkdirSync(dirname(path), { recursive: true })\n writeFileSync(path, contents, 'utf8')\n },\n mkdir: (path) => {\n mkdirSync(path, { recursive: true })\n },\n readDir: (dir) => {\n const walk = (current: string, acc: string[]): string[] => {\n if (!existsSync(current)) return acc\n for (const entry of readdirSync(current)) {\n const full = join(current, entry)\n if (statSync(full).isDirectory()) walk(full, acc)\n else acc.push(relative(dir, full).split(sep).join('/'))\n }\n return acc\n }\n return walk(dir, []).sort()\n },\n }\n}\n\nfunction main(): void {\n const command = parseCreateCommand(process.argv.slice(2), process.cwd())\n if (command.kind === 'help') {\n process.stdout.write(`${command.usage}\\n`)\n process.exitCode = command.exitCode\n return\n }\n\n if (command.kind === 'error') {\n process.stderr.write(`${command.error}\\n${command.usage}\\n`)\n process.exitCode = command.exitCode\n return\n }\n\n const result = runCreate(nodeFileSystem(), command.args)\n if (!result.ok) {\n process.stderr.write(`${result.error ?? 'create failed'}\\n`)\n process.exitCode = 1\n return\n }\n process.stdout.write(\n `Created \"${command.args.appName}\" from the ${result.template} template (${result.written.length} files).\\n`,\n )\n process.stdout.write(\n `Next: cd ${quoteShellPath(command.displayDir)} && pnpm install && mindees dev\\n`,\n )\n}\n\nmain()\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,SAAS,iBAA6B;CACpC,OAAO;EACL,SAAS,SAAS,WAAW,IAAI;EACjC,WAAW,SAAS,aAAa,MAAM,MAAM;EAC7C,YAAY,MAAM,aAAa;GAC7B,UAAU,QAAQ,IAAI,GAAG,EAAE,WAAW,KAAK,CAAC;GAC5C,cAAc,MAAM,UAAU,MAAM;EACtC;EACA,QAAQ,SAAS;GACf,UAAU,MAAM,EAAE,WAAW,KAAK,CAAC;EACrC;EACA,UAAU,QAAQ;GAChB,MAAM,QAAQ,SAAiB,QAA4B;IACzD,IAAI,CAAC,WAAW,OAAO,GAAG,OAAO;IACjC,KAAK,MAAM,SAAS,YAAY,OAAO,GAAG;KACxC,MAAM,OAAO,KAAK,SAAS,KAAK;KAChC,IAAI,SAAS,IAAI,EAAE,YAAY,GAAG,KAAK,MAAM,GAAG;UAC3C,IAAI,KAAK,SAAS,KAAK,IAAI,EAAE,MAAM,GAAG,EAAE,KAAK,GAAG,CAAC;IACxD;IACA,OAAO;GACT;GACA,OAAO,KAAK,KAAK,CAAC,CAAC,EAAE,KAAK;EAC5B;CACF;AACF;AAEA,SAAS,OAAa;CACpB,MAAM,UAAU,mBAAmB,QAAQ,KAAK,MAAM,CAAC,GAAG,QAAQ,IAAI,CAAC;CACvE,IAAI,QAAQ,SAAS,QAAQ;EAC3B,QAAQ,OAAO,MAAM,GAAG,QAAQ,MAAM,GAAG;EACzC,QAAQ,WAAW,QAAQ;EAC3B;CACF;CAEA,IAAI,QAAQ,SAAS,SAAS;EAC5B,QAAQ,OAAO,MAAM,GAAG,QAAQ,MAAM,IAAI,QAAQ,MAAM,GAAG;EAC3D,QAAQ,WAAW,QAAQ;EAC3B;CACF;CAEA,MAAM,SAAS,UAAU,eAAe,GAAG,QAAQ,IAAI;CACvD,IAAI,CAAC,OAAO,IAAI;EACd,QAAQ,OAAO,MAAM,GAAG,OAAO,SAAS,gBAAgB,GAAG;EAC3D,QAAQ,WAAW;EACnB;CACF;CACA,QAAQ,OAAO,MACb,YAAY,QAAQ,KAAK,QAAQ,aAAa,OAAO,SAAS,aAAa,OAAO,QAAQ,OAAO,WACnG;CACA,QAAQ,OAAO,MACb,YAAY,eAAe,QAAQ,UAAU,EAAE,kCACjD;AACF;AAEA,KAAK"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FileSystem, ScaffoldResult, naturalLanguageToTemplate } from "@mindees/cli";
|
|
2
|
+
import { Maturity, NotImplementedError, PackageInfo, notImplemented } from "@mindees/core";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
/** Arguments accepted by `create-mindees` (after the app name). */
|
|
6
|
+
interface CreateArgs {
|
|
7
|
+
appName: string;
|
|
8
|
+
targetDir: string;
|
|
9
|
+
template?: string;
|
|
10
|
+
/** Free-text prompt โ template (offline keyword mapping; AI is Phase 10). */
|
|
11
|
+
prompt?: string;
|
|
12
|
+
force?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Scaffold a new MindeesNative app. Thin wrapper over `@mindees/cli`'s tested
|
|
16
|
+
* {@link scaffold}, adding the `--prompt` โ template resolution so
|
|
17
|
+
* `npm create mindees` and `mindees create` behave identically.
|
|
18
|
+
*/
|
|
19
|
+
declare function runCreate(fs: FileSystem, args: CreateArgs): ScaffoldResult;
|
|
20
|
+
/** The npm package name. */
|
|
21
|
+
declare const name = "create-mindees";
|
|
22
|
+
/** The package version. All `@mindees/*` packages share one locked version line. */
|
|
23
|
+
declare const VERSION = "0.1.0";
|
|
24
|
+
/** Current maturity. The scaffolder delegates to `@mindees/cli`'s tested core. */
|
|
25
|
+
declare const maturity: Maturity;
|
|
26
|
+
/**
|
|
27
|
+
* Static identity + maturity metadata for this package. Frozen so the
|
|
28
|
+
* self-reported identity tooling introspects cannot be mutated at runtime,
|
|
29
|
+
* matching the `readonly` fields of {@link PackageInfo}.
|
|
30
|
+
*/
|
|
31
|
+
declare const info: PackageInfo;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { CreateArgs, type Maturity, NotImplementedError, type PackageInfo, VERSION, info, maturity, name, naturalLanguageToTemplate, notImplemented, runCreate };
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;UAWiB,UAAA;EACf,OAAA;EACA,SAAA;EACA,QAAA;EAFA;EAIA,MAAA;EACA,KAAA;AAAA;;;AAAK;AAQP;;iBAAgB,SAAA,CAAU,EAAA,EAAI,UAAA,EAAY,IAAA,EAAM,UAAA,GAAa,cAAA;;cAqBhD,IAAA;;cAGA,OAAA;;cAGA,QAAA,EAAU,QAAyB;;;;;AA3B2B;cAkC9D,IAAA,EAAM,WAAiE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DEFAULT_TEMPLATE, naturalLanguageToTemplate, naturalLanguageToTemplate as naturalLanguageToTemplate$1, scaffold } from "@mindees/cli";
|
|
2
|
+
import { NotImplementedError, notImplemented } from "@mindees/core";
|
|
3
|
+
//#region src/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* Scaffold a new MindeesNative app. Thin wrapper over `@mindees/cli`'s tested
|
|
6
|
+
* {@link scaffold}, adding the `--prompt` โ template resolution so
|
|
7
|
+
* `npm create mindees` and `mindees create` behave identically.
|
|
8
|
+
*/
|
|
9
|
+
function runCreate(fs, args) {
|
|
10
|
+
const explicit = args.template && args.template.length > 0 ? args.template : void 0;
|
|
11
|
+
let template = explicit ?? DEFAULT_TEMPLATE;
|
|
12
|
+
if (!explicit && args.prompt && args.prompt.length > 0) template = naturalLanguageToTemplate$1(args.prompt).template;
|
|
13
|
+
return scaffold(fs, {
|
|
14
|
+
appName: args.appName,
|
|
15
|
+
targetDir: args.targetDir,
|
|
16
|
+
template,
|
|
17
|
+
force: args.force === true
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/** The npm package name. */
|
|
21
|
+
const name = "create-mindees";
|
|
22
|
+
/** The package version. All `@mindees/*` packages share one locked version line. */
|
|
23
|
+
const VERSION = "0.1.0";
|
|
24
|
+
/** Current maturity. The scaffolder delegates to `@mindees/cli`'s tested core. */
|
|
25
|
+
const maturity = "experimental";
|
|
26
|
+
/**
|
|
27
|
+
* Static identity + maturity metadata for this package. Frozen so the
|
|
28
|
+
* self-reported identity tooling introspects cannot be mutated at runtime,
|
|
29
|
+
* matching the `readonly` fields of {@link PackageInfo}.
|
|
30
|
+
*/
|
|
31
|
+
const info = Object.freeze({
|
|
32
|
+
name,
|
|
33
|
+
version: VERSION,
|
|
34
|
+
maturity
|
|
35
|
+
});
|
|
36
|
+
//#endregion
|
|
37
|
+
export { NotImplementedError, VERSION, info, maturity, name, naturalLanguageToTemplate, notImplemented, runCreate };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["naturalLanguageToTemplate"],"sources":["../src/index.ts"],"sourcesContent":["import {\n DEFAULT_TEMPLATE,\n type FileSystem,\n naturalLanguageToTemplate,\n type ScaffoldResult,\n scaffold,\n} from '@mindees/cli'\nimport type { Maturity, PackageInfo } from '@mindees/core'\nimport { NotImplementedError, notImplemented } from '@mindees/core'\n\n/** Arguments accepted by `create-mindees` (after the app name). */\nexport interface CreateArgs {\n appName: string\n targetDir: string\n template?: string\n /** Free-text prompt โ template (offline keyword mapping; AI is Phase 10). */\n prompt?: string\n force?: boolean\n}\n\n/**\n * Scaffold a new MindeesNative app. Thin wrapper over `@mindees/cli`'s tested\n * {@link scaffold}, adding the `--prompt` โ template resolution so\n * `npm create mindees` and `mindees create` behave identically.\n */\nexport function runCreate(fs: FileSystem, args: CreateArgs): ScaffoldResult {\n // A non-empty explicit `--template` always wins; an empty or absent one defers to\n // the prompt, else the default. (Treating empty as \"not chosen\" keeps this in lock-\n // step with `mindees create` โ both normalize `--template \"\"` the same way.)\n const explicit = args.template && args.template.length > 0 ? args.template : undefined\n let template = explicit ?? DEFAULT_TEMPLATE\n if (!explicit && args.prompt && args.prompt.length > 0) {\n template = naturalLanguageToTemplate(args.prompt).template\n }\n const options: Parameters<typeof scaffold>[1] = {\n appName: args.appName,\n targetDir: args.targetDir,\n template,\n force: args.force === true,\n }\n return scaffold(fs, options)\n}\n\nexport { naturalLanguageToTemplate } from '@mindees/cli'\n\n/** The npm package name. */\nexport const name = 'create-mindees'\n\n/** The package version. All `@mindees/*` packages share one locked version line. */\nexport const VERSION = '0.1.0'\n\n/** Current maturity. The scaffolder delegates to `@mindees/cli`'s tested core. */\nexport const maturity: Maturity = 'experimental'\n\n/**\n * Static identity + maturity metadata for this package. Frozen so the\n * self-reported identity tooling introspects cannot be mutated at runtime,\n * matching the `readonly` fields of {@link PackageInfo}.\n */\nexport const info: PackageInfo = Object.freeze({ name, version: VERSION, maturity })\n\nexport type { Maturity, PackageInfo }\nexport { NotImplementedError, notImplemented }\n"],"mappings":";;;;;;;;AAyBA,SAAgB,UAAU,IAAgB,MAAkC;CAI1E,MAAM,WAAW,KAAK,YAAY,KAAK,SAAS,SAAS,IAAI,KAAK,WAAW,KAAA;CAC7E,IAAI,WAAW,YAAY;CAC3B,IAAI,CAAC,YAAY,KAAK,UAAU,KAAK,OAAO,SAAS,GACnD,WAAWA,4BAA0B,KAAK,MAAM,EAAE;CAQpD,OAAO,SAAS,IAAI;EALlB,SAAS,KAAK;EACd,WAAW,KAAK;EAChB;EACA,OAAO,KAAK,UAAU;CAEE,CAAC;AAC7B;;AAKA,MAAa,OAAO;;AAGpB,MAAa,UAAU;;AAGvB,MAAa,WAAqB;;;;;;AAOlC,MAAa,OAAoB,OAAO,OAAO;CAAE;CAAM,SAAS;CAAS;AAAS,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-mindees",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Create a new MindeesNative app โ `npm create mindees@latest`.",
|
|
5
|
+
"license": "MIT OR Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"bin": {
|
|
9
|
+
"create-mindees": "./dist/bin.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/mindees/mindees.git",
|
|
26
|
+
"directory": "packages/create-mindees"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@mindees/core": "0.1.0",
|
|
30
|
+
"@mindees/cli": "0.1.0"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsdown",
|
|
34
|
+
"typecheck": "tsc --noEmit"
|
|
35
|
+
}
|
|
36
|
+
}
|