create-gtkx 1.0.0-rc.3 → 1.0.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/README.md +8 -9
- package/dist/build-allowance.d.ts +4 -0
- package/dist/build-allowance.d.ts.map +1 -0
- package/dist/build-allowance.js +35 -0
- package/dist/build-allowance.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/command.d.ts +1 -7
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +4 -10
- package/dist/command.js.map +1 -1
- package/dist/install-hints.d.ts +3 -0
- package/dist/install-hints.d.ts.map +1 -0
- package/dist/install-hints.js +35 -0
- package/dist/install-hints.js.map +1 -0
- package/dist/manifest.d.ts +3 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +13 -0
- package/dist/manifest.js.map +1 -0
- package/dist/package-managers.d.ts +6 -6
- package/dist/package-managers.js +3 -3
- package/dist/package-managers.js.map +1 -1
- package/dist/scaffolder.d.ts +4 -4
- package/dist/scaffolder.d.ts.map +1 -1
- package/dist/scaffolder.js +90 -50
- package/dist/scaffolder.js.map +1 -1
- package/dist/templates/package.json.ejs +2 -6
- package/dist/templates/tsconfig.json.ejs +5 -2
- package/dist/templates/vitest.config.ts.ejs +1 -1
- package/dist/templates.d.ts +2 -2
- package/dist/templates.d.ts.map +1 -1
- package/dist/templates.js.map +1 -1
- package/package.json +6 -6
- package/src/build-allowance.ts +46 -0
- package/src/cli.ts +1 -1
- package/src/command.ts +5 -11
- package/src/install-hints.ts +54 -0
- package/src/manifest.ts +15 -0
- package/src/package-managers.ts +3 -3
- package/src/scaffolder.ts +118 -64
- package/src/templates/package.json.ejs +2 -6
- package/src/templates/tsconfig.json.ejs +5 -2
- package/src/templates/vitest.config.ts.ejs +1 -1
- package/src/templates.ts +2 -2
package/README.md
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
The React framework for Linux.<br />
|
|
9
|
-
|
|
9
|
+
Write native Linux applications with React and TypeScript.
|
|
10
|
+
Built on the GNOME stack and standard web tooling.
|
|
10
11
|
</p>
|
|
11
12
|
|
|
12
13
|
<p align="center">
|
|
@@ -20,15 +21,13 @@
|
|
|
20
21
|
|
|
21
22
|
<p align="center">
|
|
22
23
|
<a href="https://gtkx.dev">Homepage</a> ·
|
|
23
|
-
<a href="https://gtkx.dev/guide/
|
|
24
|
+
<a href="https://gtkx.dev/guide/getting-started">Documentation</a> ·
|
|
24
25
|
<a href="https://github.com/gtkx-org/gtkx/tree/main/examples">Examples</a> ·
|
|
25
26
|
<a href="https://github.com/gtkx-org/gtkx/blob/main/CONTRIBUTING.md">Contributing</a>
|
|
26
27
|
</p>
|
|
27
28
|
|
|
28
29
|
---
|
|
29
30
|
|
|
30
|
-
GTKX generates fully typed bindings for the entire GTK4 and Adwaita surface directly from GObject-Introspection. On top of those bindings you get the React programming model: components and hooks driving GObject instances, with Fast Refresh while you develop.
|
|
31
|
-
|
|
32
31
|
<p align="center">
|
|
33
32
|
<img src="https://raw.githubusercontent.com/gtkx-org/gtkx/main/examples/tutorial/assets/screenshot.png" alt="The Tasks app: an Adwaita window with a sidebar of smart views and colored lists on the left, and a boxed task list on the right." />
|
|
34
33
|
</p>
|
|
@@ -109,7 +108,7 @@ React Native and similar frameworks hide the native toolkit so one API can run e
|
|
|
109
108
|
|
|
110
109
|
### Why Node.js, and why generated bindings
|
|
111
110
|
|
|
112
|
-
GTKX runs on Node.js, which puts native modules, the npm ecosystem, and the tooling built for Node.js APIs within reach. GJS is GNOME's own runtime, built on SpiderMonkey rather than V8; node-gtk runs on Node.js but is lightly maintained, on the older nan/V8 ABI rather than N-API, and still centered on GTK3. The [
|
|
111
|
+
GTKX runs on Node.js, which puts native modules, the npm ecosystem, and the tooling built for Node.js APIs within reach. GJS is GNOME's own runtime, built on SpiderMonkey rather than V8; node-gtk runs on Node.js but is lightly maintained, on the older nan/V8 ABI rather than N-API, and still centered on GTK3. The [Why GTKX guide](https://gtkx.dev/guide/why-gtkx) covers what running on Node.js means day to day.
|
|
113
112
|
|
|
114
113
|
GTKX generates the TypeScript types and the native FFI calls from the same GObject-Introspection data, so the types cannot drift from the calls they back. Codegen covers the whole GTK4 and Adwaita surface.
|
|
115
114
|
|
|
@@ -122,10 +121,10 @@ GTKX is Linux-only and needs Node.js 24 or later. See [Requirements](#requiremen
|
|
|
122
121
|
Scaffold a new app with the `create-gtkx` initializer:
|
|
123
122
|
|
|
124
123
|
```sh
|
|
125
|
-
npm create gtkx
|
|
124
|
+
npm create gtkx
|
|
126
125
|
```
|
|
127
126
|
|
|
128
|
-
The same command works with other package managers: `pnpm create gtkx
|
|
127
|
+
The same command works with other package managers: `pnpm create gtkx` or `yarn create gtkx`.
|
|
129
128
|
|
|
130
129
|
Then run your new app:
|
|
131
130
|
|
|
@@ -146,7 +145,7 @@ The documentation at **[gtkx.dev](https://gtkx.dev)** includes a step-by-step tu
|
|
|
146
145
|
|
|
147
146
|
GTKX is Linux-only. You need:
|
|
148
147
|
|
|
149
|
-
- Linux with the GTK4 (4.20 or later), Adwaita (1.8 or later)
|
|
148
|
+
- Linux with the GTK4 (4.20 or later) and GLib development libraries, plus Adwaita (1.8 or later) once your project binds `Adw-1`
|
|
150
149
|
- Node.js 24 or later
|
|
151
150
|
|
|
152
151
|
The `@gtkx/native` addon ships prebuilt for x64 and arm64 glibc Linux; other targets need to build it from the GTKX repository, which requires a Rust toolchain.
|
|
@@ -162,7 +161,7 @@ Explore the [example apps](https://github.com/gtkx-org/gtkx/tree/main/examples):
|
|
|
162
161
|
|
|
163
162
|
## Status
|
|
164
163
|
|
|
165
|
-
GTKX 1.0 is
|
|
164
|
+
GTKX 1.0 is released.
|
|
166
165
|
|
|
167
166
|
## Contributing
|
|
168
167
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-allowance.d.ts","sourceRoot":"","sources":["../src/build-allowance.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA2B5D,QAAA,MAAM,mBAAmB,GAAI,MAAM,MAAM,EAAE,gBAAgB,cAAc,KAAG,IAc3E,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { updateManifest } from "./manifest.js";
|
|
4
|
+
const BUILT_DEPENDENCIES = ["@swc/core", "esbuild"];
|
|
5
|
+
const PNPM_WORKSPACE_FILE = "pnpm-workspace.yaml";
|
|
6
|
+
const SAFE_YAML_KEY = /^[A-Za-z][A-Za-z0-9-]*$/;
|
|
7
|
+
const PNPM_PACKAGES_BLOCK = "packages:\n - '.'\n";
|
|
8
|
+
const quoteYamlKey = (name) => (SAFE_YAML_KEY.test(name) ? name : `'${name}'`);
|
|
9
|
+
const writePnpmAllowance = (root) => {
|
|
10
|
+
const entries = BUILT_DEPENDENCIES.map((name) => ` ${quoteYamlKey(name)}: true`).join("\n");
|
|
11
|
+
writeFileSync(join(root, PNPM_WORKSPACE_FILE), `${PNPM_PACKAGES_BLOCK}allowBuilds:\n${entries}\n`);
|
|
12
|
+
};
|
|
13
|
+
const writeNpmAllowance = (root) => {
|
|
14
|
+
updateManifest(root, (manifest) => {
|
|
15
|
+
manifest.allowScripts = Object.fromEntries(BUILT_DEPENDENCIES.map((name) => [name, true]));
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const writeYarnAllowance = (root) => {
|
|
19
|
+
updateManifest(root, (manifest) => {
|
|
20
|
+
manifest.dependenciesMeta = Object.fromEntries(BUILT_DEPENDENCIES.map((name) => [name, { built: true }]));
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
const writeBuildAllowance = (root, packageManager) => {
|
|
24
|
+
if (packageManager === "pnpm") {
|
|
25
|
+
writePnpmAllowance(root);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (packageManager === "yarn") {
|
|
29
|
+
writeYarnAllowance(root);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
writeNpmAllowance(root);
|
|
33
|
+
};
|
|
34
|
+
export { writeBuildAllowance };
|
|
35
|
+
//# sourceMappingURL=build-allowance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-allowance.js","sourceRoot":"","sources":["../src/build-allowance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,kBAAkB,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AACpD,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAClD,MAAM,aAAa,GAAG,yBAAyB,CAAC;AAChD,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AAEnD,MAAM,YAAY,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;AAE/F,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAQ,EAAE;IAC9C,MAAM,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7F,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,EAAE,GAAG,mBAAmB,iBAAiB,OAAO,IAAI,CAAC,CAAC;AACvG,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAQ,EAAE;IAC7C,cAAc,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE;QAC9B,QAAQ,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAQ,EAAE;IAC9C,cAAc,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE;QAC9B,QAAQ,CAAC,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9G,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,cAA8B,EAAQ,EAAE;IAC/E,IAAI,cAAc,KAAK,MAAM,EAAE,CAAC;QAC5B,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAEzB,OAAO;IACX,CAAC;IAED,IAAI,cAAc,KAAK,MAAM,EAAE,CAAC;QAC5B,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAEzB,OAAO;IACX,CAAC;IAED,iBAAiB,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC","sourcesContent":["import { writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { PackageManager } from \"./package-managers.js\";\nimport { updateManifest } from \"./manifest.js\";\n\nconst BUILT_DEPENDENCIES = [\"@swc/core\", \"esbuild\"];\nconst PNPM_WORKSPACE_FILE = \"pnpm-workspace.yaml\";\nconst SAFE_YAML_KEY = /^[A-Za-z][A-Za-z0-9-]*$/;\nconst PNPM_PACKAGES_BLOCK = \"packages:\\n - '.'\\n\";\n\nconst quoteYamlKey = (name: string): string => (SAFE_YAML_KEY.test(name) ? name : `'${name}'`);\n\nconst writePnpmAllowance = (root: string): void => {\n const entries = BUILT_DEPENDENCIES.map((name) => ` ${quoteYamlKey(name)}: true`).join(\"\\n\");\n writeFileSync(join(root, PNPM_WORKSPACE_FILE), `${PNPM_PACKAGES_BLOCK}allowBuilds:\\n${entries}\\n`);\n};\n\nconst writeNpmAllowance = (root: string): void => {\n updateManifest(root, (manifest) => {\n manifest.allowScripts = Object.fromEntries(BUILT_DEPENDENCIES.map((name) => [name, true]));\n });\n};\n\nconst writeYarnAllowance = (root: string): void => {\n updateManifest(root, (manifest) => {\n manifest.dependenciesMeta = Object.fromEntries(BUILT_DEPENDENCIES.map((name) => [name, { built: true }]));\n });\n};\n\nconst writeBuildAllowance = (root: string, packageManager: PackageManager): void => {\n if (packageManager === \"pnpm\") {\n writePnpmAllowance(root);\n\n return;\n }\n\n if (packageManager === \"yarn\") {\n writeYarnAllowance(root);\n\n return;\n }\n\n writeNpmAllowance(root);\n};\n\nexport { writeBuildAllowance };\n"]}
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { packageVersion } from "@gtkx/utils";
|
|
2
2
|
import { defineCommand, runMain } from "citty";
|
|
3
3
|
import { scaffoldCommand } from "./command.js";
|
|
4
|
-
const version = packageVersion(import.meta.url);
|
|
4
|
+
const version = packageVersion(import.meta.url, "../package.json");
|
|
5
5
|
const main = defineCommand({
|
|
6
6
|
...scaffoldCommand,
|
|
7
7
|
meta: {
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;AAEnE,MAAM,IAAI,GAAG,aAAa,CAAC;IACvB,GAAG,eAAe;IAClB,IAAI,EAAE;QACF,IAAI,EAAE,aAAa;QACnB,OAAO;QACP,WAAW,EAAE,iCAAiC;KACjD;CACJ,CAAC,CAAC;AAEH,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import { packageVersion } from \"@gtkx/utils\";\nimport { defineCommand, runMain } from \"citty\";\nimport { scaffoldCommand } from \"./command.js\";\n\nconst version = packageVersion(import.meta.url, \"../package.json\");\n\nconst main = defineCommand({\n ...scaffoldCommand,\n meta: {\n name: \"create-gtkx\",\n version,\n description: \"Scaffold a new GTKX application\",\n },\n});\n\nvoid runMain(main);\n"]}
|
package/dist/command.d.ts
CHANGED
|
@@ -8,12 +8,6 @@ type CreateCommandArgs = {
|
|
|
8
8
|
"no-interactive"?: boolean | undefined;
|
|
9
9
|
overwrite?: boolean | undefined;
|
|
10
10
|
};
|
|
11
|
-
/**
|
|
12
|
-
* Citty command definition for the CLI `create` subcommand. It declares the
|
|
13
|
-
* scaffolder's arguments (target name, application ID, package manager,
|
|
14
|
-
* TypeScript and Vitest toggles, prompt behavior, and overwrite) and runs the
|
|
15
|
-
* scaffolder to generate a new GTKX application.
|
|
16
|
-
*/
|
|
17
11
|
declare const scaffoldCommand: import("citty").CommandDef<{
|
|
18
12
|
readonly name: {
|
|
19
13
|
readonly type: "positional";
|
|
@@ -54,5 +48,5 @@ declare const scaffoldCommand: import("citty").CommandDef<{
|
|
|
54
48
|
};
|
|
55
49
|
}>;
|
|
56
50
|
declare const runCreate: (args: CreateCommandArgs) => Promise<void>;
|
|
57
|
-
export { scaffoldCommand, runCreate
|
|
51
|
+
export { scaffoldCommand, runCreate };
|
|
58
52
|
//# sourceMappingURL=command.d.ts.map
|
package/dist/command.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAKA,KAAK,iBAAiB,GAAG;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAKA,KAAK,iBAAiB,GAAG;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CnB,CAAC;AA4BH,QAAA,MAAM,SAAS,GAAU,MAAM,iBAAiB,KAAG,OAAO,CAAC,IAAI,CAiB9D,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/command.js
CHANGED
|
@@ -2,12 +2,6 @@ import { defineCommand } from "citty";
|
|
|
2
2
|
import { OperationCanceledError, ScaffoldAbortedError } from "./errors.js";
|
|
3
3
|
import { isKnownPackageManager, PACKAGE_MANAGER_FLAG_DESCRIPTION } from "./package-managers.js";
|
|
4
4
|
import { scaffold } from "./scaffolder.js";
|
|
5
|
-
/**
|
|
6
|
-
* Citty command definition for the CLI `create` subcommand. It declares the
|
|
7
|
-
* scaffolder's arguments (target name, application ID, package manager,
|
|
8
|
-
* TypeScript and Vitest toggles, prompt behavior, and overwrite) and runs the
|
|
9
|
-
* scaffolder to generate a new GTKX application.
|
|
10
|
-
*/
|
|
11
5
|
const scaffoldCommand = defineCommand({
|
|
12
6
|
meta: {
|
|
13
7
|
name: "create",
|
|
@@ -82,10 +76,10 @@ const runCreate = async (args) => {
|
|
|
82
76
|
name: args.name,
|
|
83
77
|
applicationId: args["application-id"],
|
|
84
78
|
packageManager,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
79
|
+
isTypescript: args.typescript,
|
|
80
|
+
shouldIncludeTesting: args.vitest,
|
|
81
|
+
isInteractive,
|
|
82
|
+
shouldOverwrite: args.overwrite,
|
|
89
83
|
});
|
|
90
84
|
}
|
|
91
85
|
catch (error) {
|
package/dist/command.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,gCAAgC,EAAuB,MAAM,uBAAuB,CAAC;AACrH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAa3C
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"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","sourcesContent":["import { defineCommand } from \"citty\";\nimport { OperationCanceledError, ScaffoldAbortedError } from \"./errors.js\";\nimport { isKnownPackageManager, PACKAGE_MANAGER_FLAG_DESCRIPTION, type PackageManager } from \"./package-managers.js\";\nimport { scaffold } from \"./scaffolder.js\";\n\ntype CreateCommandArgs = {\n name?: string | undefined;\n \"application-id\"?: string | undefined;\n \"package-manager\"?: string | undefined;\n typescript?: boolean | undefined;\n vitest?: boolean | undefined;\n yes?: boolean | undefined;\n \"no-interactive\"?: boolean | undefined;\n overwrite?: boolean | undefined;\n};\n\nconst scaffoldCommand = defineCommand({\n meta: {\n name: \"create\",\n description: \"Create a new GTKX application\",\n },\n args: {\n name: {\n type: \"positional\",\n description: \"Target directory or project name (e.g. my-app, ., apps/my-app)\",\n required: false,\n },\n \"application-id\": {\n type: \"string\",\n description: \"Application ID (e.g., com.example.myapp)\",\n },\n \"package-manager\": {\n type: \"string\",\n alias: \"pm\",\n description: PACKAGE_MANAGER_FLAG_DESCRIPTION,\n },\n typescript: {\n type: \"boolean\",\n negativeDescription: \"Scaffold the application in JavaScript instead of TypeScript\",\n description: \"Scaffold the application in TypeScript\",\n },\n vitest: {\n type: \"boolean\",\n description: \"Include a Vitest testing setup\",\n },\n yes: {\n type: \"boolean\",\n alias: \"y\",\n description: \"Skip prompts and accept defaults for unspecified options\",\n },\n \"no-interactive\": {\n type: \"boolean\",\n description:\n \"Run without prompts, using the default for every option not passed on the command line \" +\n \"(same as --yes)\",\n },\n overwrite: {\n type: \"boolean\",\n alias: \"force\",\n description: \"Overwrite the contents of a non-empty target directory when running without prompts\",\n },\n },\n run: ({ args }) => runCreate(args),\n});\n\nconst parsePackageManager = (value: string | undefined): PackageManager | undefined => {\n if (value === undefined) {\n return undefined;\n }\n\n if (!isKnownPackageManager(value)) {\n throw new Error(`Unknown package manager \"${value}\". Expected one of: ${PACKAGE_MANAGER_FLAG_DESCRIPTION}.`);\n }\n\n return value;\n};\n\nconst settleScaffoldFailure = (error: unknown): void => {\n if (error instanceof OperationCanceledError) {\n return;\n }\n\n if (error instanceof ScaffoldAbortedError) {\n process.exitCode = 1;\n\n return;\n }\n\n throw error;\n};\n\nconst runCreate = async (args: CreateCommandArgs): Promise<void> => {\n const isInteractive = args[\"no-interactive\"] || args.yes ? false : process.stdin.isTTY;\n const packageManager = parsePackageManager(args[\"package-manager\"]);\n\n try {\n await scaffold({\n name: args.name,\n applicationId: args[\"application-id\"],\n packageManager,\n isTypescript: args.typescript,\n shouldIncludeTesting: args.vitest,\n isInteractive,\n shouldOverwrite: args.overwrite,\n });\n } catch (error) {\n settleScaffoldFailure(error);\n }\n};\n\nexport { scaffoldCommand, runCreate };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-hints.d.ts","sourceRoot":"","sources":["../src/install-hints.ts"],"names":[],"mappings":"AAkDA,QAAA,MAAM,cAAc,GAAI,SAAS,MAAM,KAAG,MAAM,GAAG,SAC4B,CAAC;AAEhF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const RELEASE_AGE_PATTERN = /ERR_PNPM_(?:MINIMUM_RELEASE_AGE_VIOLATION|NO_MATURE_MATCHING_VERSION)/;
|
|
2
|
+
const BLOCKED_VERSION_PATTERN = /^[ \t]*(\S+) was published at .+ within the minimumReleaseAge cutoff/gm;
|
|
3
|
+
const RELEASE_AGE_POLICY = "pnpm refused the install under its minimumReleaseAge policy, which by default holds back every package " +
|
|
4
|
+
"published in the last 24 hours so a compromised release has time to be caught and pulled. Nothing is wrong " +
|
|
5
|
+
"with these versions other than their age.";
|
|
6
|
+
const RELEASE_AGE_REMEDY = "Wait for them to clear that window and install again, or allow the versions pnpm named. They belong at the " +
|
|
7
|
+
"top level of pnpm-workspace.yaml, as a sibling of packages: and allowBuilds: rather than nested inside " +
|
|
8
|
+
"either of them:";
|
|
9
|
+
const RELEASE_AGE_REMEDY_WITHOUT_VERSIONS = "Wait for them to clear that window and install again, or list the versions pnpm reported under a top-level " +
|
|
10
|
+
"minimumReleaseAgeExclude key in pnpm-workspace.yaml.";
|
|
11
|
+
const RELEASE_AGE_PARTIAL_LIST = "pnpm reports only the versions the command it stopped on had to resolve, so a later install can name more. " +
|
|
12
|
+
"Add each one to the same list.";
|
|
13
|
+
const RELEASE_AGE_OPT_OUT = 'Listing exact versions keeps the policy on for every other package. Setting "minimumReleaseAge: 0" in the ' +
|
|
14
|
+
"same file turns it off for all of them, so prefer the list above. npm and yarn apply no such policy.";
|
|
15
|
+
const getBlockedVersions = (message) => {
|
|
16
|
+
const matches = Array.from(message.matchAll(BLOCKED_VERSION_PATTERN), (match) => match[1] ?? "");
|
|
17
|
+
return [...new Set(matches.filter(Boolean))];
|
|
18
|
+
};
|
|
19
|
+
const formatExcludeBlock = (versions) => ["minimumReleaseAgeExclude:", ...versions.map((version) => ` - '${version}'`)].join("\n");
|
|
20
|
+
const describeReleaseAge = (message) => {
|
|
21
|
+
const versions = getBlockedVersions(message);
|
|
22
|
+
if (versions.length === 0) {
|
|
23
|
+
return [RELEASE_AGE_POLICY, RELEASE_AGE_REMEDY_WITHOUT_VERSIONS].join("\n\n");
|
|
24
|
+
}
|
|
25
|
+
return [
|
|
26
|
+
RELEASE_AGE_POLICY,
|
|
27
|
+
RELEASE_AGE_REMEDY,
|
|
28
|
+
formatExcludeBlock(versions),
|
|
29
|
+
RELEASE_AGE_PARTIAL_LIST,
|
|
30
|
+
RELEASE_AGE_OPT_OUT,
|
|
31
|
+
].join("\n\n");
|
|
32
|
+
};
|
|
33
|
+
const getInstallHint = (message) => RELEASE_AGE_PATTERN.test(message) ? describeReleaseAge(message) : undefined;
|
|
34
|
+
export { getInstallHint };
|
|
35
|
+
//# sourceMappingURL=install-hints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-hints.js","sourceRoot":"","sources":["../src/install-hints.ts"],"names":[],"mappings":"AAAA,MAAM,mBAAmB,GAAG,uEAAuE,CAAC;AACpG,MAAM,uBAAuB,GAAG,wEAAwE,CAAC;AAEzG,MAAM,kBAAkB,GACpB,yGAAyG;IACzG,6GAA6G;IAC7G,2CAA2C,CAAC;AAEhD,MAAM,kBAAkB,GACpB,6GAA6G;IAC7G,yGAAyG;IACzG,iBAAiB,CAAC;AAEtB,MAAM,mCAAmC,GACrC,6GAA6G;IAC7G,sDAAsD,CAAC;AAE3D,MAAM,wBAAwB,GAC1B,6GAA6G;IAC7G,gCAAgC,CAAC;AAErC,MAAM,mBAAmB,GACrB,4GAA4G;IAC5G,sGAAsG,CAAC;AAE3G,MAAM,kBAAkB,GAAG,CAAC,OAAe,EAAY,EAAE;IACrD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAEjG,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,QAAkB,EAAU,EAAE,CACtD,CAAC,2BAA2B,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,QAAQ,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAE/F,MAAM,kBAAkB,GAAG,CAAC,OAAe,EAAU,EAAE;IACnD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAE7C,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,kBAAkB,EAAE,mCAAmC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClF,CAAC;IAED,OAAO;QACH,kBAAkB;QAClB,kBAAkB;QAClB,kBAAkB,CAAC,QAAQ,CAAC;QAC5B,wBAAwB;QACxB,mBAAmB;KACtB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,OAAe,EAAsB,EAAE,CAC3D,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAEhF,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["const RELEASE_AGE_PATTERN = /ERR_PNPM_(?:MINIMUM_RELEASE_AGE_VIOLATION|NO_MATURE_MATCHING_VERSION)/;\nconst BLOCKED_VERSION_PATTERN = /^[ \\t]*(\\S+) was published at .+ within the minimumReleaseAge cutoff/gm;\n\nconst RELEASE_AGE_POLICY =\n \"pnpm refused the install under its minimumReleaseAge policy, which by default holds back every package \" +\n \"published in the last 24 hours so a compromised release has time to be caught and pulled. Nothing is wrong \" +\n \"with these versions other than their age.\";\n\nconst RELEASE_AGE_REMEDY =\n \"Wait for them to clear that window and install again, or allow the versions pnpm named. They belong at the \" +\n \"top level of pnpm-workspace.yaml, as a sibling of packages: and allowBuilds: rather than nested inside \" +\n \"either of them:\";\n\nconst RELEASE_AGE_REMEDY_WITHOUT_VERSIONS =\n \"Wait for them to clear that window and install again, or list the versions pnpm reported under a top-level \" +\n \"minimumReleaseAgeExclude key in pnpm-workspace.yaml.\";\n\nconst RELEASE_AGE_PARTIAL_LIST =\n \"pnpm reports only the versions the command it stopped on had to resolve, so a later install can name more. \" +\n \"Add each one to the same list.\";\n\nconst RELEASE_AGE_OPT_OUT =\n 'Listing exact versions keeps the policy on for every other package. Setting \"minimumReleaseAge: 0\" in the ' +\n \"same file turns it off for all of them, so prefer the list above. npm and yarn apply no such policy.\";\n\nconst getBlockedVersions = (message: string): string[] => {\n const matches = Array.from(message.matchAll(BLOCKED_VERSION_PATTERN), (match) => match[1] ?? \"\");\n\n return [...new Set(matches.filter(Boolean))];\n};\n\nconst formatExcludeBlock = (versions: string[]): string =>\n [\"minimumReleaseAgeExclude:\", ...versions.map((version) => ` - '${version}'`)].join(\"\\n\");\n\nconst describeReleaseAge = (message: string): string => {\n const versions = getBlockedVersions(message);\n\n if (versions.length === 0) {\n return [RELEASE_AGE_POLICY, RELEASE_AGE_REMEDY_WITHOUT_VERSIONS].join(\"\\n\\n\");\n }\n\n return [\n RELEASE_AGE_POLICY,\n RELEASE_AGE_REMEDY,\n formatExcludeBlock(versions),\n RELEASE_AGE_PARTIAL_LIST,\n RELEASE_AGE_OPT_OUT,\n ].join(\"\\n\\n\");\n};\n\nconst getInstallHint = (message: string): string | undefined =>\n RELEASE_AGE_PATTERN.test(message) ? describeReleaseAge(message) : undefined;\n\nexport { getInstallHint };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,KAAG,IAO3F,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
const PACKAGE_JSON_FILE = "package.json";
|
|
4
|
+
const updateManifest = (root, mutate) => {
|
|
5
|
+
const manifestPath = join(root, PACKAGE_JSON_FILE);
|
|
6
|
+
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
7
|
+
mutate(manifest);
|
|
8
|
+
const pendingPath = `${manifestPath}.pending`;
|
|
9
|
+
writeFileSync(pendingPath, `${JSON.stringify(manifest, null, 4)}\n`);
|
|
10
|
+
renameSync(pendingPath, manifestPath);
|
|
11
|
+
};
|
|
12
|
+
export { updateManifest };
|
|
13
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAEzC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,MAAmD,EAAQ,EAAE;IAC/F,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAA4B,CAAC;IAC3F,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjB,MAAM,WAAW,GAAG,GAAG,YAAY,UAAU,CAAC;IAC9C,aAAa,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACrE,UAAU,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;AAC1C,CAAC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { readFileSync, renameSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nconst PACKAGE_JSON_FILE = \"package.json\";\n\nconst updateManifest = (root: string, mutate: (manifest: Record<string, unknown>) => void): void => {\n const manifestPath = join(root, PACKAGE_JSON_FILE);\n const manifest = JSON.parse(readFileSync(manifestPath, \"utf8\")) as Record<string, unknown>;\n mutate(manifest);\n const pendingPath = `${manifestPath}.pending`;\n writeFileSync(pendingPath, `${JSON.stringify(manifest, null, 4)}\\n`);\n renameSync(pendingPath, manifestPath);\n};\n\nexport { updateManifest };\n"]}
|
|
@@ -3,20 +3,20 @@ declare const PACKAGE_MANAGERS: readonly [{
|
|
|
3
3
|
readonly value: "pnpm";
|
|
4
4
|
readonly label: "pnpm";
|
|
5
5
|
readonly devCommand: "pnpm dev";
|
|
6
|
-
readonly
|
|
7
|
-
readonly
|
|
6
|
+
readonly addCommand: "pnpm add";
|
|
7
|
+
readonly isRecommended: true;
|
|
8
8
|
}, {
|
|
9
9
|
readonly value: "npm";
|
|
10
10
|
readonly label: "npm";
|
|
11
11
|
readonly devCommand: "npm run dev";
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
12
|
+
readonly addCommand: "npm install";
|
|
13
|
+
readonly isRecommended: false;
|
|
14
14
|
}, {
|
|
15
15
|
readonly value: "yarn";
|
|
16
16
|
readonly label: "yarn";
|
|
17
17
|
readonly devCommand: "yarn dev";
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
18
|
+
readonly addCommand: "yarn add";
|
|
19
|
+
readonly isRecommended: false;
|
|
20
20
|
}];
|
|
21
21
|
declare const PACKAGE_MANAGER_FLAG_DESCRIPTION: string;
|
|
22
22
|
declare const isKnownPackageManager: (name: string) => name is PackageManager;
|
package/dist/package-managers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const PACKAGE_MANAGERS = [
|
|
2
|
-
{ value: "pnpm", label: "pnpm", devCommand: "pnpm dev",
|
|
3
|
-
{ value: "npm", label: "npm", devCommand: "npm run dev",
|
|
4
|
-
{ value: "yarn", label: "yarn", devCommand: "yarn dev",
|
|
2
|
+
{ value: "pnpm", label: "pnpm", devCommand: "pnpm dev", addCommand: "pnpm add", isRecommended: true },
|
|
3
|
+
{ value: "npm", label: "npm", devCommand: "npm run dev", addCommand: "npm install", isRecommended: false },
|
|
4
|
+
{ value: "yarn", label: "yarn", devCommand: "yarn dev", addCommand: "yarn add", isRecommended: false },
|
|
5
5
|
];
|
|
6
6
|
const PACKAGE_MANAGER_VALUES = PACKAGE_MANAGERS.map((manager) => manager.value);
|
|
7
7
|
const PACKAGE_MANAGER_FLAG_DESCRIPTION = `Package manager (${PACKAGE_MANAGER_VALUES.join(", ")})`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-managers.js","sourceRoot":"","sources":["../src/package-managers.ts"],"names":[],"mappings":"AAEA,MAAM,gBAAgB,GAAG;IACrB,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"package-managers.js","sourceRoot":"","sources":["../src/package-managers.ts"],"names":[],"mappings":"AAEA,MAAM,gBAAgB,GAAG;IACrB,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE;IACrG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE;IAC1G,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE;CAChG,CAAC;AAEX,MAAM,sBAAsB,GAAqB,gBAAgB,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAClG,MAAM,gCAAgC,GAAG,oBAAoB,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AAElG,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAA0B,EAAE,CAClE,sBAAmC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,gCAAgC,EAAE,qBAAqB,EAAuB,CAAC","sourcesContent":["type PackageManager = (typeof PACKAGE_MANAGERS)[number][\"value\"];\n\nconst PACKAGE_MANAGERS = [\n { value: \"pnpm\", label: \"pnpm\", devCommand: \"pnpm dev\", addCommand: \"pnpm add\", isRecommended: true },\n { value: \"npm\", label: \"npm\", devCommand: \"npm run dev\", addCommand: \"npm install\", isRecommended: false },\n { value: \"yarn\", label: \"yarn\", devCommand: \"yarn dev\", addCommand: \"yarn add\", isRecommended: false },\n] as const;\n\nconst PACKAGE_MANAGER_VALUES: PackageManager[] = PACKAGE_MANAGERS.map((manager) => manager.value);\nconst PACKAGE_MANAGER_FLAG_DESCRIPTION = `Package manager (${PACKAGE_MANAGER_VALUES.join(\", \")})`;\n\nconst isKnownPackageManager = (name: string): name is PackageManager =>\n (PACKAGE_MANAGER_VALUES as string[]).includes(name);\n\nexport { PACKAGE_MANAGERS, PACKAGE_MANAGER_FLAG_DESCRIPTION, isKnownPackageManager, type PackageManager };\n"]}
|
package/dist/scaffolder.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ type CreateOptions = {
|
|
|
3
3
|
name?: string | undefined;
|
|
4
4
|
applicationId?: string | undefined;
|
|
5
5
|
packageManager?: PackageManager | undefined;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
isTypescript?: boolean | undefined;
|
|
7
|
+
shouldIncludeTesting?: boolean | undefined;
|
|
8
|
+
isInteractive?: boolean | undefined;
|
|
9
|
+
shouldOverwrite?: boolean | undefined;
|
|
10
10
|
};
|
|
11
11
|
declare const scaffold: (options?: CreateOptions) => Promise<void>;
|
|
12
12
|
export { scaffold, type CreateOptions };
|
package/dist/scaffolder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffolder.d.ts","sourceRoot":"","sources":["../src/scaffolder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scaffolder.d.ts","sourceRoot":"","sources":["../src/scaffolder.ts"],"names":[],"mappings":"AAWA,OAAO,EAA2C,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIrG,KAAK,aAAa,GAAG;IACjB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,cAAc,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC5C,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3C,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACzC,CAAC;AAwfF,QAAA,MAAM,QAAQ,GAAU,UAAS,aAAkB,KAAG,OAAO,CAAC,IAAI,CAwBjE,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,CAAC"}
|