create-mindees 0.30.3 → 0.31.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/dist/bin.js +5 -1
- package/dist/bin.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/bin.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { runCreate } from "./index.js";
|
|
3
3
|
import { parseCreateCommand } from "./args.js";
|
|
4
4
|
import { quoteShellPath } from "@mindees/cli";
|
|
5
|
-
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
5
|
+
import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { dirname, join, relative, sep } from "node:path";
|
|
7
7
|
import process from "node:process";
|
|
8
8
|
//#region src/bin.ts
|
|
@@ -42,6 +42,10 @@ function nodeFileSystem() {
|
|
|
42
42
|
recursive: true,
|
|
43
43
|
force: true
|
|
44
44
|
});
|
|
45
|
+
},
|
|
46
|
+
copyFile: (src, dest) => {
|
|
47
|
+
mkdirSync(dirname(dest), { recursive: true });
|
|
48
|
+
copyFileSync(src, dest);
|
|
45
49
|
}
|
|
46
50
|
};
|
|
47
51
|
}
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +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 {\n existsSync,\n mkdirSync,\n readdirSync,\n readFileSync,\n rmSync,\n statSync,\n writeFileSync,\n} 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 rm: (path) => {\n rmSync(path, { recursive: true, force: true })\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":";;;;;;;;;;;;;;;;
|
|
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 {\n copyFileSync,\n existsSync,\n mkdirSync,\n readdirSync,\n readFileSync,\n rmSync,\n statSync,\n writeFileSync,\n} 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 rm: (path) => {\n rmSync(path, { recursive: true, force: true })\n },\n copyFile: (src, dest) => {\n mkdirSync(dirname(dest), { recursive: true })\n copyFileSync(src, dest)\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":";;;;;;;;;;;;;;;;AA0BA,SAAS,iBAA6B;CACpC,OAAO;EACL,SAAS,SAAS,WAAW,IAAI;EACjC,WAAW,SAAS,aAAa,M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AAO,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
CHANGED
|
@@ -20,7 +20,7 @@ declare function runCreate(fs: FileSystem, args: CreateArgs): ScaffoldResult;
|
|
|
20
20
|
/** The npm package name. */
|
|
21
21
|
declare const name = "create-mindees";
|
|
22
22
|
/** The package version. All `@mindees/*` packages share one locked version line. */
|
|
23
|
-
declare const VERSION = "0.
|
|
23
|
+
declare const VERSION = "0.31.0";
|
|
24
24
|
/** Current maturity. The scaffolder delegates to `@mindees/cli`'s tested core. */
|
|
25
25
|
declare const maturity: Maturity;
|
|
26
26
|
/**
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ function runCreate(fs, args) {
|
|
|
20
20
|
/** The npm package name. */
|
|
21
21
|
const name = "create-mindees";
|
|
22
22
|
/** The package version. All `@mindees/*` packages share one locked version line. */
|
|
23
|
-
const VERSION = "0.
|
|
23
|
+
const VERSION = "0.31.0";
|
|
24
24
|
/** Current maturity. The scaffolder delegates to `@mindees/cli`'s tested core. */
|
|
25
25
|
const maturity = "experimental";
|
|
26
26
|
/**
|
package/dist/index.js.map
CHANGED
|
@@ -1 +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
|
+
{"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.31.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-mindees",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "Create a new MindeesNative app — `npm create mindees@latest`.",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"directory": "packages/create-mindees"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@mindees/core": "0.
|
|
33
|
-
"@mindees/cli": "0.
|
|
32
|
+
"@mindees/core": "0.31.0",
|
|
33
|
+
"@mindees/cli": "0.31.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsdown",
|