create-fragno 0.0.1

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.
@@ -0,0 +1,13 @@
1
+ $ tsdown
2
+ ℹ tsdown v0.15.6 powered by rolldown v1.0.0-beta.41
3
+ ℹ Using tsdown config: /home/jan/rejot/fragno/packages/cli/tsdown.config.ts
4
+ ℹ entry: index.ts
5
+ ℹ target: node20.0.0
6
+ ℹ tsconfig: tsconfig.json
7
+ ℹ Build start
8
+ ℹ Cleaning 3 files
9
+ ℹ dist/index.js 1.82 kB │ gzip: 0.70 kB
10
+ ℹ dist/index.js.map 3.22 kB │ gzip: 1.08 kB
11
+ ℹ dist/index.d.ts 0.01 kB │ gzip: 0.03 kB
12
+ ℹ 3 files, total: 5.05 kB
13
+ ✔ Build complete in 1793ms
@@ -0,0 +1 @@
1
+ $ tsc --noEmit
@@ -0,0 +1 @@
1
+ export { };
package/dist/index.js ADDED
@@ -0,0 +1,86 @@
1
+ import { defineCommand, runMain } from "citty";
2
+ import { create } from "@fragno-dev/create";
3
+ import * as p from "@clack/prompts";
4
+
5
+ //#region index.ts
6
+ const createCommand = defineCommand({
7
+ meta: {
8
+ name: "create",
9
+ description: "Interactively create project from template"
10
+ },
11
+ async run() {
12
+ p.intro("@fragno-dev/create");
13
+ const name = await p.text({
14
+ message: "What is your project name?",
15
+ placeholder: "my-fragment",
16
+ validate(value) {
17
+ if (value.length === 0) return "Project name is required!";
18
+ }
19
+ });
20
+ if (p.isCancel(name)) {
21
+ p.cancel("Operation cancelled.");
22
+ process.exit(0);
23
+ }
24
+ const projectPath = await p.text({
25
+ message: "Where should we create your project?",
26
+ placeholder: `./${name}`,
27
+ initialValue: `./${name}`
28
+ });
29
+ if (p.isCancel(projectPath)) {
30
+ p.cancel("Operation cancelled.");
31
+ process.exit(0);
32
+ }
33
+ const template = await p.select({
34
+ message: "Pick a template",
35
+ options: [{
36
+ value: "fragment",
37
+ label: "Fragment"
38
+ }]
39
+ });
40
+ if (p.isCancel(template)) {
41
+ p.cancel("Operation cancelled.");
42
+ process.exit(0);
43
+ }
44
+ const buildTool = await p.select({
45
+ message: "Pick a build tool",
46
+ options: [
47
+ {
48
+ value: "tsdown",
49
+ label: "tsdown"
50
+ },
51
+ {
52
+ value: "esbuild",
53
+ label: "esbuild"
54
+ },
55
+ {
56
+ value: "none",
57
+ label: "none"
58
+ }
59
+ ]
60
+ });
61
+ if (p.isCancel(buildTool)) {
62
+ p.cancel("Operation cancelled.");
63
+ process.exit(0);
64
+ }
65
+ create({
66
+ name,
67
+ path: projectPath,
68
+ template,
69
+ buildTool
70
+ });
71
+ p.outro("Project created successfully!");
72
+ }
73
+ });
74
+ const main = defineCommand({
75
+ meta: {
76
+ name: "fragno",
77
+ version: process.env["npm_package_version"],
78
+ description: "Fragno CLI"
79
+ },
80
+ subCommands: { create: createCommand }
81
+ });
82
+ runMain(main);
83
+
84
+ //#endregion
85
+ export { };
86
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../index.ts"],"sourcesContent":["import { defineCommand, runMain } from \"citty\";\nimport { create } from \"@fragno-dev/create\";\nimport * as p from \"@clack/prompts\";\n\nconst createCommand = defineCommand({\n meta: {\n name: \"create\",\n description: \"Interactively create project from template\",\n },\n async run() {\n p.intro(\"@fragno-dev/create\");\n\n const name = await p.text({\n message: \"What is your project name?\",\n placeholder: \"my-fragment\",\n validate(value) {\n if (value.length === 0) return \"Project name is required!\";\n return undefined;\n },\n });\n\n if (p.isCancel(name)) {\n p.cancel(\"Operation cancelled.\");\n process.exit(0);\n }\n\n const projectPath = await p.text({\n message: \"Where should we create your project?\",\n placeholder: `./${name}`,\n initialValue: `./${name}`,\n });\n\n if (p.isCancel(projectPath)) {\n p.cancel(\"Operation cancelled.\");\n process.exit(0);\n }\n\n const template = await p.select({\n message: \"Pick a template\",\n options: [{ value: \"fragment\", label: \"Fragment\" }],\n });\n\n if (p.isCancel(template)) {\n p.cancel(\"Operation cancelled.\");\n process.exit(0);\n }\n\n const buildTool = await p.select({\n message: \"Pick a build tool\",\n options: [\n { value: \"tsdown\", label: \"tsdown\" },\n { value: \"esbuild\", label: \"esbuild\" },\n { value: \"none\", label: \"none\" },\n ],\n });\n\n if (p.isCancel(buildTool)) {\n p.cancel(\"Operation cancelled.\");\n process.exit(0);\n }\n\n create({\n name: name,\n path: projectPath,\n template: template,\n buildTool: buildTool,\n });\n\n p.outro(\"Project created successfully!\");\n },\n});\n\nconst main = defineCommand({\n meta: {\n name: \"fragno\",\n version: process.env[\"npm_package_version\"],\n description: \"Fragno CLI\",\n },\n subCommands: {\n create: createCommand,\n },\n});\n\nrunMain(main);\n"],"mappings":";;;;;AAIA,MAAM,gBAAgB,cAAc;CAClC,MAAM;EACJ,MAAM;EACN,aAAa;EACd;CACD,MAAM,MAAM;AACV,IAAE,MAAM,qBAAqB;EAE7B,MAAM,OAAO,MAAM,EAAE,KAAK;GACxB,SAAS;GACT,aAAa;GACb,SAAS,OAAO;AACd,QAAI,MAAM,WAAW,EAAG,QAAO;;GAGlC,CAAC;AAEF,MAAI,EAAE,SAAS,KAAK,EAAE;AACpB,KAAE,OAAO,uBAAuB;AAChC,WAAQ,KAAK,EAAE;;EAGjB,MAAM,cAAc,MAAM,EAAE,KAAK;GAC/B,SAAS;GACT,aAAa,KAAK;GAClB,cAAc,KAAK;GACpB,CAAC;AAEF,MAAI,EAAE,SAAS,YAAY,EAAE;AAC3B,KAAE,OAAO,uBAAuB;AAChC,WAAQ,KAAK,EAAE;;EAGjB,MAAM,WAAW,MAAM,EAAE,OAAO;GAC9B,SAAS;GACT,SAAS,CAAC;IAAE,OAAO;IAAY,OAAO;IAAY,CAAC;GACpD,CAAC;AAEF,MAAI,EAAE,SAAS,SAAS,EAAE;AACxB,KAAE,OAAO,uBAAuB;AAChC,WAAQ,KAAK,EAAE;;EAGjB,MAAM,YAAY,MAAM,EAAE,OAAO;GAC/B,SAAS;GACT,SAAS;IACP;KAAE,OAAO;KAAU,OAAO;KAAU;IACpC;KAAE,OAAO;KAAW,OAAO;KAAW;IACtC;KAAE,OAAO;KAAQ,OAAO;KAAQ;IACjC;GACF,CAAC;AAEF,MAAI,EAAE,SAAS,UAAU,EAAE;AACzB,KAAE,OAAO,uBAAuB;AAChC,WAAQ,KAAK,EAAE;;AAGjB,SAAO;GACC;GACN,MAAM;GACI;GACC;GACZ,CAAC;AAEF,IAAE,MAAM,gCAAgC;;CAE3C,CAAC;AAEF,MAAM,OAAO,cAAc;CACzB,MAAM;EACJ,MAAM;EACN,SAAS,QAAQ,IAAI;EACrB,aAAa;EACd;CACD,aAAa,EACX,QAAQ,eACT;CACF,CAAC;AAEF,QAAQ,KAAK"}
package/index.ts ADDED
@@ -0,0 +1,84 @@
1
+ import { defineCommand, runMain } from "citty";
2
+ import { create } from "@fragno-dev/create";
3
+ import * as p from "@clack/prompts";
4
+
5
+ const createCommand = defineCommand({
6
+ meta: {
7
+ name: "create",
8
+ description: "Interactively create project from template",
9
+ },
10
+ async run() {
11
+ p.intro("@fragno-dev/create");
12
+
13
+ const name = await p.text({
14
+ message: "What is your project name?",
15
+ placeholder: "my-fragment",
16
+ validate(value) {
17
+ if (value.length === 0) return "Project name is required!";
18
+ return undefined;
19
+ },
20
+ });
21
+
22
+ if (p.isCancel(name)) {
23
+ p.cancel("Operation cancelled.");
24
+ process.exit(0);
25
+ }
26
+
27
+ const projectPath = await p.text({
28
+ message: "Where should we create your project?",
29
+ placeholder: `./${name}`,
30
+ initialValue: `./${name}`,
31
+ });
32
+
33
+ if (p.isCancel(projectPath)) {
34
+ p.cancel("Operation cancelled.");
35
+ process.exit(0);
36
+ }
37
+
38
+ const template = await p.select({
39
+ message: "Pick a template",
40
+ options: [{ value: "fragment", label: "Fragment" }],
41
+ });
42
+
43
+ if (p.isCancel(template)) {
44
+ p.cancel("Operation cancelled.");
45
+ process.exit(0);
46
+ }
47
+
48
+ const buildTool = await p.select({
49
+ message: "Pick a build tool",
50
+ options: [
51
+ { value: "tsdown", label: "tsdown" },
52
+ { value: "esbuild", label: "esbuild" },
53
+ { value: "none", label: "none" },
54
+ ],
55
+ });
56
+
57
+ if (p.isCancel(buildTool)) {
58
+ p.cancel("Operation cancelled.");
59
+ process.exit(0);
60
+ }
61
+
62
+ create({
63
+ name: name,
64
+ path: projectPath,
65
+ template: template,
66
+ buildTool: buildTool,
67
+ });
68
+
69
+ p.outro("Project created successfully!");
70
+ },
71
+ });
72
+
73
+ const main = defineCommand({
74
+ meta: {
75
+ name: "fragno",
76
+ version: process.env["npm_package_version"],
77
+ description: "Fragno CLI",
78
+ },
79
+ subCommands: {
80
+ create: createCommand,
81
+ },
82
+ });
83
+
84
+ runMain(main);
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "create-fragno",
3
+ "version": "0.0.1",
4
+ "exports": {
5
+ ".": {
6
+ "bun": "./index.ts",
7
+ "development": "./index.ts",
8
+ "types": "./dist/index.d.ts",
9
+ "default": "./dist/index.js"
10
+ }
11
+ },
12
+ "type": "module",
13
+ "bin": {
14
+ "create-fragno": "./dist/index.js"
15
+ },
16
+ "scripts": {
17
+ "build": "tsdown",
18
+ "build:watch": "tsdown --watch",
19
+ "types:check": "tsc --noEmit"
20
+ },
21
+ "engines": {
22
+ "node": "^20.0.0 || >=22.0.0"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "^22",
26
+ "@fragno-private/typescript-config": "0.0.1"
27
+ },
28
+ "dependencies": {
29
+ "@clack/prompts": "^0.11.0",
30
+ "@fragno-dev/create": "0.0.1",
31
+ "citty": "^0.1.6"
32
+ },
33
+ "main": "./dist/index.js",
34
+ "module": "./dist/index.js",
35
+ "types": "./dist/index.d.ts"
36
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "@fragno-private/typescript-config/tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": ".",
6
+ "composite": true
7
+ },
8
+ "include": ["*.ts"],
9
+ "exclude": ["node_modules", "dist"]
10
+ }
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from "tsdown";
2
+
3
+ export default defineConfig({
4
+ entry: "./index.ts",
5
+ dts: true,
6
+ });
@@ -0,0 +1,3 @@
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ export default defineConfig({});