create-nattyjs 0.0.1-beta.71 → 0.0.1-beta.72

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.
Files changed (28) hide show
  1. package/index.js +92 -92
  2. package/package.json +1 -1
  3. package/src/const/template-definitions.js +76 -76
  4. package/src/const/version-registry.js +73 -73
  5. package/src/const/workspace-definitions.js +55 -55
  6. package/src/functions/cli-theme.js +81 -81
  7. package/src/functions/file-system.js +96 -96
  8. package/src/functions/package-manager.js +9 -9
  9. package/src/functions/package-name.js +12 -12
  10. package/src/functions/prompt-project-options.js +156 -156
  11. package/src/functions/render-package-jsons.js +98 -98
  12. package/src/functions/render-workspace.js +254 -254
  13. package/src/functions/scaffold-project.js +65 -65
  14. package/template-fullstack-angular/apps/api/package.json +8 -8
  15. package/template-fullstack-angular/apps/web/package.json +1 -1
  16. package/template-fullstack-astro/apps/api/package.json +8 -8
  17. package/template-fullstack-astro/apps/web/package.json +1 -1
  18. package/template-fullstack-next/apps/api/package.json +8 -8
  19. package/template-fullstack-next/apps/web/package.json +1 -1
  20. package/template-fullstack-nuxt/apps/api/package.json +8 -8
  21. package/template-fullstack-nuxt/apps/web/package.json +1 -1
  22. package/template-fullstack-react/apps/api/package.json +8 -8
  23. package/template-fullstack-react/apps/web/package.json +1 -1
  24. package/template-fullstack-sveltekit/apps/api/package.json +8 -8
  25. package/template-fullstack-sveltekit/apps/web/package.json +1 -1
  26. package/template-fullstack-vue/apps/api/package.json +8 -8
  27. package/template-fullstack-vue/apps/web/package.json +1 -1
  28. package/template-nattyjs-blank/package.json +8 -8
package/index.js CHANGED
@@ -1,92 +1,92 @@
1
- #!/usr/bin/env node
2
- import path from "path";
3
- import minimist from "minimist";
4
- import prompts from "prompts";
5
- import { fileURLToPath } from "url";
6
- import { getTemplateById, TEMPLATE_DEFINITIONS } from "./src/const/template-definitions.js";
7
- import { printIntro, formatSuccessSummary } from "./src/functions/cli-theme.js";
8
- import { pkgFromUserAgent } from "./src/functions/package-manager.js";
9
- import { toValidPackageName } from "./src/functions/package-name.js";
10
- import { resolveProjectOptions } from "./src/functions/prompt-project-options.js";
11
- import { prepareTargetDirectory, scaffoldProject } from "./src/functions/scaffold-project.js";
12
- import { getWorkspaceById, isFullstackTemplate } from "./src/const/workspace-definitions.js";
13
-
14
- const argv = minimist(process.argv.slice(2), {
15
- string: ["template", "workspace"],
16
- boolean: ["examples"],
17
- alias: {
18
- t: "template",
19
- e: "examples",
20
- w: "workspace",
21
- },
22
- });
23
- const rawArguments = process.argv.slice(2);
24
- const examplesFlagProvided = rawArguments.some((argument) => {
25
- return argument === "--examples" || argument === "--no-examples" || argument === "-e";
26
- });
27
-
28
- const cwd = process.cwd();
29
-
30
- if (process.env.NATTYJS_PROMPT_INJECT) {
31
- prompts.inject(JSON.parse(process.env.NATTYJS_PROMPT_INJECT));
32
- }
33
-
34
- async function initNatty() {
35
- printIntro();
36
- const selectedTemplate = getTemplateById(argv.template);
37
- const defaultProjectName =
38
- (typeof argv._[0] === "string" ? argv._[0].trim() : "") || "nattyjs-project";
39
- const promptResult = await resolveProjectOptions({
40
- argv,
41
- defaultProjectName,
42
- selectedTemplate,
43
- templateDefinitions: TEMPLATE_DEFINITIONS,
44
- examplesFlagProvided,
45
- });
46
- if (!promptResult) {
47
- return;
48
- }
49
-
50
- const targetDir = (promptResult.projectName || argv._[0] || "").trim() || "nattyjs-project";
51
- const template = getTemplateById(promptResult.templateId || argv.template) || TEMPLATE_DEFINITIONS[0];
52
- const isFullstack = isFullstackTemplate(template);
53
- const workspaceSetup = (promptResult.workspaceSetup || argv.workspace || "standalone").trim();
54
- const selectedWorkspace = isFullstack ? getWorkspaceById(workspaceSetup) || getWorkspaceById("standalone") : undefined;
55
- const includeExamples = examplesFlagProvided ? argv.examples : promptResult.includeExamples !== false;
56
- const root = path.join(cwd, targetDir);
57
-
58
- prepareTargetDirectory(root, promptResult.overwrite);
59
-
60
- const __filename = fileURLToPath(import.meta.url);
61
- const __dirname = path.dirname(__filename);
62
-
63
- console.log(`\nScaffolding project in ${root}...`);
64
-
65
- const packageName = promptResult.packageName || toValidPackageName(path.basename(targetDir));
66
- scaffoldProject({
67
- cwd,
68
- root,
69
- targetDir,
70
- template,
71
- includeExamples,
72
- packageName,
73
- packageBaseDir: __dirname,
74
- workspaceSetup: selectedWorkspace?.id,
75
- isFullstack,
76
- });
77
-
78
- const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent);
79
- const pkgManager = pkgInfo ? pkgInfo.name : "npm";
80
- formatSuccessSummary({
81
- cwd,
82
- root,
83
- packageManager: pkgManager,
84
- template,
85
- workspace: selectedWorkspace,
86
- includeExamples,
87
- });
88
- }
89
-
90
- initNatty().catch((error) => {
91
- console.error(error);
92
- });
1
+ #!/usr/bin/env node
2
+ import path from "path";
3
+ import minimist from "minimist";
4
+ import prompts from "prompts";
5
+ import { fileURLToPath } from "url";
6
+ import { getTemplateById, TEMPLATE_DEFINITIONS } from "./src/const/template-definitions.js";
7
+ import { printIntro, formatSuccessSummary } from "./src/functions/cli-theme.js";
8
+ import { pkgFromUserAgent } from "./src/functions/package-manager.js";
9
+ import { toValidPackageName } from "./src/functions/package-name.js";
10
+ import { resolveProjectOptions } from "./src/functions/prompt-project-options.js";
11
+ import { prepareTargetDirectory, scaffoldProject } from "./src/functions/scaffold-project.js";
12
+ import { getWorkspaceById, isFullstackTemplate } from "./src/const/workspace-definitions.js";
13
+
14
+ const argv = minimist(process.argv.slice(2), {
15
+ string: ["template", "workspace"],
16
+ boolean: ["examples"],
17
+ alias: {
18
+ t: "template",
19
+ e: "examples",
20
+ w: "workspace",
21
+ },
22
+ });
23
+ const rawArguments = process.argv.slice(2);
24
+ const examplesFlagProvided = rawArguments.some((argument) => {
25
+ return argument === "--examples" || argument === "--no-examples" || argument === "-e";
26
+ });
27
+
28
+ const cwd = process.cwd();
29
+
30
+ if (process.env.NATTYJS_PROMPT_INJECT) {
31
+ prompts.inject(JSON.parse(process.env.NATTYJS_PROMPT_INJECT));
32
+ }
33
+
34
+ async function initNatty() {
35
+ printIntro();
36
+ const selectedTemplate = getTemplateById(argv.template);
37
+ const defaultProjectName =
38
+ (typeof argv._[0] === "string" ? argv._[0].trim() : "") || "nattyjs-project";
39
+ const promptResult = await resolveProjectOptions({
40
+ argv,
41
+ defaultProjectName,
42
+ selectedTemplate,
43
+ templateDefinitions: TEMPLATE_DEFINITIONS,
44
+ examplesFlagProvided,
45
+ });
46
+ if (!promptResult) {
47
+ return;
48
+ }
49
+
50
+ const targetDir = (promptResult.projectName || argv._[0] || "").trim() || "nattyjs-project";
51
+ const template = getTemplateById(promptResult.templateId || argv.template) || TEMPLATE_DEFINITIONS[0];
52
+ const isFullstack = isFullstackTemplate(template);
53
+ const workspaceSetup = (promptResult.workspaceSetup || argv.workspace || "standalone").trim();
54
+ const selectedWorkspace = isFullstack ? getWorkspaceById(workspaceSetup) || getWorkspaceById("standalone") : undefined;
55
+ const includeExamples = examplesFlagProvided ? argv.examples : promptResult.includeExamples !== false;
56
+ const root = path.join(cwd, targetDir);
57
+
58
+ prepareTargetDirectory(root, promptResult.overwrite);
59
+
60
+ const __filename = fileURLToPath(import.meta.url);
61
+ const __dirname = path.dirname(__filename);
62
+
63
+ console.log(`\nScaffolding project in ${root}...`);
64
+
65
+ const packageName = promptResult.packageName || toValidPackageName(path.basename(targetDir));
66
+ scaffoldProject({
67
+ cwd,
68
+ root,
69
+ targetDir,
70
+ template,
71
+ includeExamples,
72
+ packageName,
73
+ packageBaseDir: __dirname,
74
+ workspaceSetup: selectedWorkspace?.id,
75
+ isFullstack,
76
+ });
77
+
78
+ const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent);
79
+ const pkgManager = pkgInfo ? pkgInfo.name : "npm";
80
+ formatSuccessSummary({
81
+ cwd,
82
+ root,
83
+ packageManager: pkgManager,
84
+ template,
85
+ workspace: selectedWorkspace,
86
+ includeExamples,
87
+ });
88
+ }
89
+
90
+ initNatty().catch((error) => {
91
+ console.error(error);
92
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-nattyjs",
3
- "version": "0.0.1-beta.71",
3
+ "version": "0.0.1-beta.72",
4
4
  "description": "Create NattyJS API Project",
5
5
  "main": "./index.js",
6
6
  "type": "module",
@@ -1,76 +1,76 @@
1
- export const TEMPLATE_DEFINITIONS = [
2
- {
3
- id: "api-only",
4
- aliases: ["nattyjs-blank"],
5
- title: "API Only",
6
- description: "Backend API starter with NattyJS conventions",
7
- templateDir: "template-nattyjs-blank",
8
- exampleExcludedPaths: ["controllers"],
9
- },
10
- {
11
- id: "fullstack-vue",
12
- aliases: ["vue", "nattyjs-vue"],
13
- title: "Fullstack + Vue",
14
- description: "NattyJS API + Vue (Vite) + typed client",
15
- templateDir: "template-fullstack-vue",
16
- exampleOverlayDir: "__examples",
17
- },
18
- {
19
- id: "fullstack-react",
20
- aliases: ["react", "nattyjs-react"],
21
- title: "Fullstack + React",
22
- description: "NattyJS API + React (Vite) + typed client",
23
- templateDir: "template-fullstack-react",
24
- exampleOverlayDir: "__examples",
25
- },
26
- {
27
- id: "fullstack-next",
28
- aliases: ["next", "nextjs", "nattyjs-next"],
29
- title: "Fullstack + Next.js",
30
- description: "NattyJS API + Next.js + typed client",
31
- templateDir: "template-fullstack-next",
32
- exampleOverlayDir: "__examples",
33
- },
34
- {
35
- id: "fullstack-nuxt",
36
- aliases: ["nuxt", "nuxtjs", "nattyjs-nuxt"],
37
- title: "Fullstack + Nuxt",
38
- description: "NattyJS API + Nuxt + typed client",
39
- templateDir: "template-fullstack-nuxt",
40
- exampleOverlayDir: "__examples",
41
- },
42
- {
43
- id: "fullstack-angular",
44
- aliases: ["angular", "ng", "nattyjs-angular"],
45
- title: "Fullstack + Angular",
46
- description: "NattyJS API + Angular + typed client",
47
- templateDir: "template-fullstack-angular",
48
- exampleOverlayDir: "__examples",
49
- },
50
- {
51
- id: "fullstack-astro",
52
- aliases: ["astro", "nattyjs-astro"],
53
- title: "Fullstack + Astro",
54
- description: "NattyJS API + Astro + typed client",
55
- templateDir: "template-fullstack-astro",
56
- exampleOverlayDir: "__examples",
57
- },
58
- {
59
- id: "fullstack-sveltekit",
60
- aliases: ["sveltekit", "svelte-kit", "svelte", "nattyjs-sveltekit"],
61
- title: "Fullstack + SvelteKit",
62
- description: "NattyJS API + SvelteKit + typed client",
63
- templateDir: "template-fullstack-sveltekit",
64
- exampleOverlayDir: "__examples",
65
- },
66
- ];
67
-
68
- export function getTemplateById(value) {
69
- if (!value) {
70
- return undefined;
71
- }
72
-
73
- return TEMPLATE_DEFINITIONS.find((template) => {
74
- return template.id === value || template.aliases.includes(value);
75
- });
76
- }
1
+ export const TEMPLATE_DEFINITIONS = [
2
+ {
3
+ id: "api-only",
4
+ aliases: ["nattyjs-blank"],
5
+ title: "API Only",
6
+ description: "Backend API starter with NattyJS conventions",
7
+ templateDir: "template-nattyjs-blank",
8
+ exampleExcludedPaths: ["controllers"],
9
+ },
10
+ {
11
+ id: "fullstack-vue",
12
+ aliases: ["vue", "nattyjs-vue"],
13
+ title: "Fullstack + Vue",
14
+ description: "NattyJS API + Vue (Vite) + typed client",
15
+ templateDir: "template-fullstack-vue",
16
+ exampleOverlayDir: "__examples",
17
+ },
18
+ {
19
+ id: "fullstack-react",
20
+ aliases: ["react", "nattyjs-react"],
21
+ title: "Fullstack + React",
22
+ description: "NattyJS API + React (Vite) + typed client",
23
+ templateDir: "template-fullstack-react",
24
+ exampleOverlayDir: "__examples",
25
+ },
26
+ {
27
+ id: "fullstack-next",
28
+ aliases: ["next", "nextjs", "nattyjs-next"],
29
+ title: "Fullstack + Next.js",
30
+ description: "NattyJS API + Next.js + typed client",
31
+ templateDir: "template-fullstack-next",
32
+ exampleOverlayDir: "__examples",
33
+ },
34
+ {
35
+ id: "fullstack-nuxt",
36
+ aliases: ["nuxt", "nuxtjs", "nattyjs-nuxt"],
37
+ title: "Fullstack + Nuxt",
38
+ description: "NattyJS API + Nuxt + typed client",
39
+ templateDir: "template-fullstack-nuxt",
40
+ exampleOverlayDir: "__examples",
41
+ },
42
+ {
43
+ id: "fullstack-angular",
44
+ aliases: ["angular", "ng", "nattyjs-angular"],
45
+ title: "Fullstack + Angular",
46
+ description: "NattyJS API + Angular + typed client",
47
+ templateDir: "template-fullstack-angular",
48
+ exampleOverlayDir: "__examples",
49
+ },
50
+ {
51
+ id: "fullstack-astro",
52
+ aliases: ["astro", "nattyjs-astro"],
53
+ title: "Fullstack + Astro",
54
+ description: "NattyJS API + Astro + typed client",
55
+ templateDir: "template-fullstack-astro",
56
+ exampleOverlayDir: "__examples",
57
+ },
58
+ {
59
+ id: "fullstack-sveltekit",
60
+ aliases: ["sveltekit", "svelte-kit", "svelte", "nattyjs-sveltekit"],
61
+ title: "Fullstack + SvelteKit",
62
+ description: "NattyJS API + SvelteKit + typed client",
63
+ templateDir: "template-fullstack-sveltekit",
64
+ exampleOverlayDir: "__examples",
65
+ },
66
+ ];
67
+
68
+ export function getTemplateById(value) {
69
+ if (!value) {
70
+ return undefined;
71
+ }
72
+
73
+ return TEMPLATE_DEFINITIONS.find((template) => {
74
+ return template.id === value || template.aliases.includes(value);
75
+ });
76
+ }
@@ -1,73 +1,73 @@
1
- import fs from "fs";
2
- import path from "path";
3
-
4
- const FRONTEND_PACKAGE_VERSIONS = {
5
- concurrently: "^9.0.1",
6
- turbo: "^2.1.3",
7
- nx: "^20.0.0",
8
- "@vitejs/plugin-vue": "^5.1.4",
9
- "@vitejs/plugin-react": "^4.3.2",
10
- vue: "^3.5.13",
11
- "vue-tsc": "^2.1.6",
12
- vite: "^5.4.8",
13
- react: "^18.3.1",
14
- "react-dom": "^18.3.1",
15
- "@types/react": "^18.3.3",
16
- "@types/react-dom": "^18.3.0",
17
- next: "^14.2.15",
18
- nuxt: "^3.13.2",
19
- "@angular/animations": "^18.2.8",
20
- "@angular/common": "^18.2.8",
21
- "@angular/compiler": "^18.2.8",
22
- "@angular/core": "^18.2.8",
23
- "@angular/forms": "^18.2.8",
24
- "@angular/platform-browser": "^18.2.8",
25
- "@angular/platform-browser-dynamic": "^18.2.8",
26
- "@angular/router": "^18.2.8",
27
- "@angular-devkit/build-angular": "^18.2.8",
28
- "@angular/cli": "^18.2.8",
29
- "@angular/compiler-cli": "^18.2.8",
30
- rxjs: "^7.8.1",
31
- tslib: "^2.7.0",
32
- "zone.js": "^0.14.10",
33
- astro: "^4.16.12",
34
- "@sveltejs/adapter-auto": "^3.2.5",
35
- "@sveltejs/kit": "^2.7.1",
36
- "@sveltejs/vite-plugin-svelte": "^3.1.2",
37
- svelte: "^4.2.19",
38
- "svelte-check": "^4.0.4",
39
- typescript: "^5.6.3",
40
- "@types/node": "^22.7.4",
41
- "reflect-metadata": "^0.2.2",
42
- mri: "^1.2.0",
43
- prompts: "^2.4.2",
44
- };
45
-
46
- const NATTY_PACKAGE_NAMES = [
47
- "@nattyjs/cli",
48
- "@nattyjs/client",
49
- "@nattyjs/common",
50
- "@nattyjs/core",
51
- "@nattyjs/entity",
52
- "@nattyjs/express",
53
- "@nattyjs/orm",
54
- "@nattyjs/types",
55
- "@nattyjs/validation-decorators",
56
- ];
57
-
58
- export function getVersionRegistry(packageBaseDir) {
59
- const createPackageJsonPath = path.join(packageBaseDir, "package.json");
60
- const createPackageJson = JSON.parse(fs.readFileSync(createPackageJsonPath, "utf8"));
61
- const nattyVersion = createPackageJson.version;
62
- const versions = {
63
- ...FRONTEND_PACKAGE_VERSIONS,
64
- };
65
-
66
- for (const packageName of NATTY_PACKAGE_NAMES) {
67
- versions[packageName] = nattyVersion;
68
- }
69
-
70
- return {
71
- versions,
72
- };
73
- }
1
+ import fs from "fs";
2
+ import path from "path";
3
+
4
+ const FRONTEND_PACKAGE_VERSIONS = {
5
+ concurrently: "^9.0.1",
6
+ turbo: "^2.1.3",
7
+ nx: "^20.0.0",
8
+ "@vitejs/plugin-vue": "^5.1.4",
9
+ "@vitejs/plugin-react": "^4.3.2",
10
+ vue: "^3.5.13",
11
+ "vue-tsc": "^2.1.6",
12
+ vite: "^5.4.8",
13
+ react: "^18.3.1",
14
+ "react-dom": "^18.3.1",
15
+ "@types/react": "^18.3.3",
16
+ "@types/react-dom": "^18.3.0",
17
+ next: "^14.2.15",
18
+ nuxt: "^3.13.2",
19
+ "@angular/animations": "^18.2.8",
20
+ "@angular/common": "^18.2.8",
21
+ "@angular/compiler": "^18.2.8",
22
+ "@angular/core": "^18.2.8",
23
+ "@angular/forms": "^18.2.8",
24
+ "@angular/platform-browser": "^18.2.8",
25
+ "@angular/platform-browser-dynamic": "^18.2.8",
26
+ "@angular/router": "^18.2.8",
27
+ "@angular-devkit/build-angular": "^18.2.8",
28
+ "@angular/cli": "^18.2.8",
29
+ "@angular/compiler-cli": "^18.2.8",
30
+ rxjs: "^7.8.1",
31
+ tslib: "^2.7.0",
32
+ "zone.js": "^0.14.10",
33
+ astro: "^4.16.12",
34
+ "@sveltejs/adapter-auto": "^3.2.5",
35
+ "@sveltejs/kit": "^2.7.1",
36
+ "@sveltejs/vite-plugin-svelte": "^3.1.2",
37
+ svelte: "^4.2.19",
38
+ "svelte-check": "^4.0.4",
39
+ typescript: "^5.6.3",
40
+ "@types/node": "^22.7.4",
41
+ "reflect-metadata": "^0.2.2",
42
+ mri: "^1.2.0",
43
+ prompts: "^2.4.2",
44
+ };
45
+
46
+ const NATTY_PACKAGE_NAMES = [
47
+ "@nattyjs/cli",
48
+ "@nattyjs/client",
49
+ "@nattyjs/common",
50
+ "@nattyjs/core",
51
+ "@nattyjs/entity",
52
+ "@nattyjs/express",
53
+ "@nattyjs/orm",
54
+ "@nattyjs/types",
55
+ "@nattyjs/validation-decorators",
56
+ ];
57
+
58
+ export function getVersionRegistry(packageBaseDir) {
59
+ const createPackageJsonPath = path.join(packageBaseDir, "package.json");
60
+ const createPackageJson = JSON.parse(fs.readFileSync(createPackageJsonPath, "utf8"));
61
+ const nattyVersion = createPackageJson.version;
62
+ const versions = {
63
+ ...FRONTEND_PACKAGE_VERSIONS,
64
+ };
65
+
66
+ for (const packageName of NATTY_PACKAGE_NAMES) {
67
+ versions[packageName] = nattyVersion;
68
+ }
69
+
70
+ return {
71
+ versions,
72
+ };
73
+ }
@@ -1,55 +1,55 @@
1
- export const PROJECT_LAYOUT_DEFINITIONS = [
2
- {
3
- id: "standalone",
4
- title: "Single Repo",
5
- description: "api/ + web/ folders with the simplest dev flow",
6
- recommended: true,
7
- },
8
- {
9
- id: "monorepo",
10
- title: "Monorepo",
11
- description: "apps/api + apps/web with a dedicated workspace tool",
12
- },
13
- ];
14
-
15
- export const WORKSPACE_DEFINITIONS = [
16
- {
17
- id: "standalone",
18
- title: "Single Repo",
19
- description: "api/ + web/ folders with no workspace tool",
20
- },
21
- {
22
- id: "npm-workspaces",
23
- title: "npm workspaces",
24
- description: "Simple npm-native monorepo",
25
- recommended: true,
26
- },
27
- {
28
- id: "turborepo",
29
- title: "Turborepo",
30
- description: "Fast task orchestration and caching",
31
- },
32
- {
33
- id: "nx",
34
- title: "Nx",
35
- description: "Structured workspace tooling and task graph",
36
- },
37
- ];
38
-
39
- export const MONOREPO_WORKSPACE_DEFINITIONS = WORKSPACE_DEFINITIONS.filter((workspace) => {
40
- return workspace.id !== "standalone";
41
- });
42
-
43
- const FULLSTACK_TEMPLATE_PREFIX = "fullstack-";
44
-
45
- export function isFullstackTemplate(template) {
46
- return Boolean(template?.id?.startsWith(FULLSTACK_TEMPLATE_PREFIX));
47
- }
48
-
49
- export function getWorkspaceById(value) {
50
- if (!value) {
51
- return undefined;
52
- }
53
-
54
- return WORKSPACE_DEFINITIONS.find((workspace) => workspace.id === value);
55
- }
1
+ export const PROJECT_LAYOUT_DEFINITIONS = [
2
+ {
3
+ id: "standalone",
4
+ title: "Single Repo",
5
+ description: "api/ + web/ folders with the simplest dev flow",
6
+ recommended: true,
7
+ },
8
+ {
9
+ id: "monorepo",
10
+ title: "Monorepo",
11
+ description: "apps/api + apps/web with a dedicated workspace tool",
12
+ },
13
+ ];
14
+
15
+ export const WORKSPACE_DEFINITIONS = [
16
+ {
17
+ id: "standalone",
18
+ title: "Single Repo",
19
+ description: "api/ + web/ folders with no workspace tool",
20
+ },
21
+ {
22
+ id: "npm-workspaces",
23
+ title: "npm workspaces",
24
+ description: "Simple npm-native monorepo",
25
+ recommended: true,
26
+ },
27
+ {
28
+ id: "turborepo",
29
+ title: "Turborepo",
30
+ description: "Fast task orchestration and caching",
31
+ },
32
+ {
33
+ id: "nx",
34
+ title: "Nx",
35
+ description: "Structured workspace tooling and task graph",
36
+ },
37
+ ];
38
+
39
+ export const MONOREPO_WORKSPACE_DEFINITIONS = WORKSPACE_DEFINITIONS.filter((workspace) => {
40
+ return workspace.id !== "standalone";
41
+ });
42
+
43
+ const FULLSTACK_TEMPLATE_PREFIX = "fullstack-";
44
+
45
+ export function isFullstackTemplate(template) {
46
+ return Boolean(template?.id?.startsWith(FULLSTACK_TEMPLATE_PREFIX));
47
+ }
48
+
49
+ export function getWorkspaceById(value) {
50
+ if (!value) {
51
+ return undefined;
52
+ }
53
+
54
+ return WORKSPACE_DEFINITIONS.find((workspace) => workspace.id === value);
55
+ }