@idealyst/cli 1.2.0 → 1.2.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.
- package/dist/commands/add.js +233 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/index.js +13 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/info.js +193 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/init.js +155 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/constants.js +119 -0
- package/dist/constants.js.map +1 -0
- package/dist/generators/core/index.js +23 -0
- package/dist/generators/core/index.js.map +1 -0
- package/dist/generators/core/mobile.js +286 -0
- package/dist/generators/core/mobile.js.map +1 -0
- package/dist/generators/core/shared.js +207 -0
- package/dist/generators/core/shared.js.map +1 -0
- package/dist/generators/core/web.js +377 -0
- package/dist/generators/core/web.js.map +1 -0
- package/dist/generators/extensions/api.js +223 -0
- package/dist/generators/extensions/api.js.map +1 -0
- package/dist/generators/extensions/devcontainer.js +510 -0
- package/dist/generators/extensions/devcontainer.js.map +1 -0
- package/dist/generators/extensions/graphql.js +202 -0
- package/dist/generators/extensions/graphql.js.map +1 -0
- package/dist/generators/extensions/index.js +17 -0
- package/dist/generators/extensions/index.js.map +1 -0
- package/dist/generators/extensions/prisma.js +249 -0
- package/dist/generators/extensions/prisma.js.map +1 -0
- package/dist/generators/extensions/trpc.js +258 -0
- package/dist/generators/extensions/trpc.js.map +1 -0
- package/dist/generators/index.js +106 -4
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/reactNative.js +177 -0
- package/dist/generators/reactNative.js.map +1 -0
- package/dist/generators/workspace.js +272 -0
- package/dist/generators/workspace.js.map +1 -0
- package/dist/identifiers/android.js +75 -0
- package/dist/identifiers/android.js.map +1 -0
- package/dist/identifiers/index.js +35 -0
- package/dist/identifiers/index.js.map +1 -0
- package/dist/identifiers/ios.js +65 -0
- package/dist/identifiers/ios.js.map +1 -0
- package/dist/index.js +41 -319
- package/dist/index.js.map +1 -1
- package/dist/templates/copier.js +135 -0
- package/dist/templates/copier.js.map +1 -0
- package/dist/templates/index.js +23 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/merger.js +113 -0
- package/dist/templates/merger.js.map +1 -0
- package/dist/templates/processor.js +142 -0
- package/dist/templates/processor.js.map +1 -0
- package/dist/types/commands/add.d.ts +14 -0
- package/dist/types/commands/index.d.ts +6 -0
- package/dist/types/commands/info.d.ts +10 -0
- package/dist/types/commands/init.d.ts +19 -0
- package/dist/types/constants.d.ts +76 -0
- package/dist/types/generators/core/index.d.ts +6 -0
- package/dist/types/generators/core/mobile.d.ts +13 -0
- package/dist/types/generators/core/shared.d.ts +8 -0
- package/dist/types/generators/core/web.d.ts +8 -0
- package/dist/types/generators/extensions/api.d.ts +8 -0
- package/dist/types/generators/extensions/devcontainer.d.ts +15 -0
- package/dist/types/generators/extensions/graphql.d.ts +8 -0
- package/dist/types/generators/extensions/index.d.ts +8 -0
- package/dist/types/generators/extensions/prisma.d.ts +8 -0
- package/dist/types/generators/extensions/trpc.d.ts +9 -0
- package/dist/types/generators/index.d.ts +11 -3
- package/dist/types/generators/reactNative.d.ts +19 -0
- package/dist/types/generators/workspace.d.ts +8 -0
- package/dist/types/identifiers/android.d.ts +26 -0
- package/dist/types/identifiers/index.d.ts +26 -0
- package/dist/types/identifiers/ios.d.ts +21 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/templates/copier.d.ts +24 -0
- package/dist/types/templates/index.d.ts +6 -0
- package/dist/types/templates/merger.d.ts +43 -0
- package/dist/types/templates/processor.d.ts +39 -0
- package/dist/types/types.d.ts +153 -5
- package/dist/types/utils/filesystem.d.ts +56 -0
- package/dist/types/utils/index.d.ts +7 -0
- package/dist/types/utils/logger.d.ts +58 -0
- package/dist/types/utils/shell.d.ts +35 -0
- package/dist/types/utils/validation.d.ts +32 -0
- package/dist/types/wizard/index.d.ts +20 -0
- package/dist/types/wizard/steps/apiExtension.d.ts +5 -0
- package/dist/types/wizard/steps/appDisplayName.d.ts +5 -0
- package/dist/types/wizard/steps/devcontainerExtension.d.ts +5 -0
- package/dist/types/wizard/steps/graphqlExtension.d.ts +5 -0
- package/dist/types/wizard/steps/index.d.ts +12 -0
- package/dist/types/wizard/steps/orgDomain.d.ts +5 -0
- package/dist/types/wizard/steps/prismaExtension.d.ts +5 -0
- package/dist/types/wizard/steps/projectName.d.ts +5 -0
- package/dist/types/wizard/steps/summary.d.ts +5 -0
- package/dist/types/wizard/steps/trpcExtension.d.ts +5 -0
- package/dist/types/wizard/validators.d.ts +17 -0
- package/dist/types.js +41 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/filesystem.js +173 -0
- package/dist/utils/filesystem.js.map +1 -0
- package/dist/utils/index.js +24 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.js +95 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/shell.js +113 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/validation.js +196 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/wizard/index.js +177 -0
- package/dist/wizard/index.js.map +1 -0
- package/dist/wizard/steps/apiExtension.js +33 -0
- package/dist/wizard/steps/apiExtension.js.map +1 -0
- package/dist/wizard/steps/appDisplayName.js +53 -0
- package/dist/wizard/steps/appDisplayName.js.map +1 -0
- package/dist/wizard/steps/devcontainerExtension.js +78 -0
- package/dist/wizard/steps/devcontainerExtension.js.map +1 -0
- package/dist/wizard/steps/graphqlExtension.js +37 -0
- package/dist/wizard/steps/graphqlExtension.js.map +1 -0
- package/dist/wizard/steps/index.js +25 -0
- package/dist/wizard/steps/index.js.map +1 -0
- package/dist/wizard/steps/orgDomain.js +40 -0
- package/dist/wizard/steps/orgDomain.js.map +1 -0
- package/dist/wizard/steps/prismaExtension.js +33 -0
- package/dist/wizard/steps/prismaExtension.js.map +1 -0
- package/dist/wizard/steps/projectName.js +40 -0
- package/dist/wizard/steps/projectName.js.map +1 -0
- package/dist/wizard/steps/summary.js +107 -0
- package/dist/wizard/steps/summary.js.map +1 -0
- package/dist/wizard/steps/trpcExtension.js +37 -0
- package/dist/wizard/steps/trpcExtension.js.map +1 -0
- package/dist/wizard/validators.js +35 -0
- package/dist/wizard/validators.js.map +1 -0
- package/package.json +6 -19
- package/README.md +0 -110
- package/dist/generators/init.js +0 -268
- package/dist/generators/init.js.map +0 -1
- package/dist/generators/utils.js +0 -682
- package/dist/generators/utils.js.map +0 -1
- package/dist/scripts/configure-react-native-monorepo.js +0 -144
- package/dist/scripts/configure-react-native-monorepo.js.map +0 -1
- package/dist/template/.devcontainer/Dockerfile +0 -26
- package/dist/template/.devcontainer/devcontainer.json +0 -113
- package/dist/template/.devcontainer/docker-compose.yml +0 -59
- package/dist/template/.devcontainer/figma-mcp.sh +0 -32
- package/dist/template/.devcontainer/gitignore.template +0 -2
- package/dist/template/.devcontainer/setup.sh +0 -45
- package/dist/template/DOCKER.md +0 -0
- package/dist/template/Dockerfile +0 -111
- package/dist/template/README.md +0 -233
- package/dist/template/docker/nginx/prod.conf +0 -238
- package/dist/template/docker/nginx.conf +0 -131
- package/dist/template/docker/postgres/init.sql +0 -41
- package/dist/template/docker/prometheus/prometheus.yml +0 -52
- package/dist/template/docker-compose.prod.yml +0 -146
- package/dist/template/docker-compose.yml +0 -143
- package/dist/template/dockerignore.template +0 -151
- package/dist/template/env.example.template +0 -36
- package/dist/template/gitignore.template +0 -56
- package/dist/template/jest.config.js +0 -20
- package/dist/template/mcp.json.template +0 -8
- package/dist/template/package.json +0 -45
- package/dist/template/packages/api/README.md +0 -510
- package/dist/template/packages/api/__tests__/api.test.ts +0 -26
- package/dist/template/packages/api/env.example.template +0 -6
- package/dist/template/packages/api/gitignore.template +0 -35
- package/dist/template/packages/api/jest.config.js +0 -23
- package/dist/template/packages/api/jest.setup.js +0 -9
- package/dist/template/packages/api/package.json +0 -66
- package/dist/template/packages/api/src/context.ts +0 -52
- package/dist/template/packages/api/src/controllers/TestController.ts +0 -0
- package/dist/template/packages/api/src/graphql/builder.ts +0 -75
- package/dist/template/packages/api/src/graphql/generated.ts +0 -64
- package/dist/template/packages/api/src/graphql/index.ts +0 -75
- package/dist/template/packages/api/src/graphql/types/index.ts +0 -44
- package/dist/template/packages/api/src/graphql/types/test.ts +0 -245
- package/dist/template/packages/api/src/index.ts +0 -26
- package/dist/template/packages/api/src/lib/database.ts +0 -23
- package/dist/template/packages/api/src/router/index.ts +0 -163
- package/dist/template/packages/api/src/routers/test.ts +0 -161
- package/dist/template/packages/api/src/server.ts +0 -68
- package/dist/template/packages/api/src/trpc.ts +0 -28
- package/dist/template/packages/api/tsconfig.json +0 -44
- package/dist/template/packages/database/README.md +0 -162
- package/dist/template/packages/database/gitignore.template +0 -41
- package/dist/template/packages/database/package.json +0 -49
- package/dist/template/packages/database/prisma/seed.ts +0 -64
- package/dist/template/packages/database/schema.prisma +0 -107
- package/dist/template/packages/database/src/index.ts +0 -15
- package/dist/template/packages/database/src/validators.ts +0 -10
- package/dist/template/packages/database/tsconfig.json +0 -18
- package/dist/template/packages/mobile/README.md +0 -86
- package/dist/template/packages/mobile/__tests__/App.test.tsx +0 -156
- package/dist/template/packages/mobile/__tests__/components.test.tsx +0 -300
- package/dist/template/packages/mobile/app.json +0 -5
- package/dist/template/packages/mobile/babel.config.js +0 -10
- package/dist/template/packages/mobile/gitignore.template +0 -73
- package/dist/template/packages/mobile/index.js +0 -6
- package/dist/template/packages/mobile/jest.config.js +0 -21
- package/dist/template/packages/mobile/jest.setup.js +0 -12
- package/dist/template/packages/mobile/metro.config.js +0 -36
- package/dist/template/packages/mobile/package.json +0 -60
- package/dist/template/packages/mobile/src/App.tsx +0 -8
- package/dist/template/packages/mobile/src/utils/trpc.ts +0 -7
- package/dist/template/packages/mobile/tsconfig.json +0 -28
- package/dist/template/packages/shared/README.md +0 -135
- package/dist/template/packages/shared/__tests__/shared.test.ts +0 -51
- package/dist/template/packages/shared/gitignore.template +0 -35
- package/dist/template/packages/shared/jest.config.js +0 -22
- package/dist/template/packages/shared/package.json +0 -68
- package/dist/template/packages/shared/src/components/App.tsx +0 -57
- package/dist/template/packages/shared/src/components/HelloWorld.tsx +0 -531
- package/dist/template/packages/shared/src/components/index.ts +0 -1
- package/dist/template/packages/shared/src/graphql/client.ts +0 -34
- package/dist/template/packages/shared/src/index.ts +0 -22
- package/dist/template/packages/shared/src/navigation/AppRouter.tsx +0 -565
- package/dist/template/packages/shared/src/trpc/client.ts +0 -44
- package/dist/template/packages/shared/tsconfig.json +0 -22
- package/dist/template/packages/web/README.md +0 -131
- package/dist/template/packages/web/__tests__/App.test.tsx +0 -342
- package/dist/template/packages/web/__tests__/components.test.tsx +0 -564
- package/dist/template/packages/web/gitignore.template +0 -35
- package/dist/template/packages/web/index.html +0 -13
- package/dist/template/packages/web/jest.config.js +0 -27
- package/dist/template/packages/web/jest.setup.js +0 -24
- package/dist/template/packages/web/package.json +0 -69
- package/dist/template/packages/web/src/App.tsx +0 -14
- package/dist/template/packages/web/src/components/TestDemo.tsx +0 -164
- package/dist/template/packages/web/src/main.tsx +0 -25
- package/dist/template/packages/web/src/utils/trpc.ts +0 -7
- package/dist/template/packages/web/tsconfig.json +0 -26
- package/dist/template/packages/web/vite.config.ts +0 -98
- package/dist/template/setup.sh +0 -30
- package/dist/template/tsconfig.json +0 -22
- package/dist/template/yarnrc.yml.template +0 -4
- package/dist/types/generators/init.d.ts +0 -5
- package/dist/types/generators/utils.d.ts +0 -45
- package/dist/types/scripts/configure-react-native-monorepo.d.ts +0 -23
- package/template/.devcontainer/Dockerfile +0 -26
- package/template/.devcontainer/devcontainer.json +0 -113
- package/template/.devcontainer/docker-compose.yml +0 -59
- package/template/.devcontainer/figma-mcp.sh +0 -32
- package/template/.devcontainer/setup.sh +0 -45
- package/template/.dockerignore +0 -151
- package/template/.env.example +0 -36
- package/template/.env.production +0 -56
- package/template/DOCKER.md +0 -0
- package/template/Dockerfile +0 -111
- package/template/README.md +0 -233
- package/template/docker/nginx/prod.conf +0 -238
- package/template/docker/nginx.conf +0 -131
- package/template/docker/postgres/init.sql +0 -41
- package/template/docker/prometheus/prometheus.yml +0 -52
- package/template/docker-compose.prod.yml +0 -146
- package/template/docker-compose.yml +0 -143
- package/template/jest.config.js +0 -20
- package/template/package.json +0 -45
- package/template/packages/api/.env.example +0 -6
- package/template/packages/api/README.md +0 -510
- package/template/packages/api/__tests__/api.test.ts +0 -26
- package/template/packages/api/jest.config.js +0 -23
- package/template/packages/api/jest.setup.js +0 -9
- package/template/packages/api/package.json +0 -66
- package/template/packages/api/src/context.ts +0 -52
- package/template/packages/api/src/controllers/TestController.ts +0 -0
- package/template/packages/api/src/graphql/builder.ts +0 -75
- package/template/packages/api/src/graphql/generated.ts +0 -64
- package/template/packages/api/src/graphql/index.ts +0 -75
- package/template/packages/api/src/graphql/types/index.ts +0 -44
- package/template/packages/api/src/graphql/types/test.ts +0 -245
- package/template/packages/api/src/index.ts +0 -26
- package/template/packages/api/src/lib/database.ts +0 -23
- package/template/packages/api/src/router/index.ts +0 -163
- package/template/packages/api/src/routers/test.ts +0 -161
- package/template/packages/api/src/server.ts +0 -68
- package/template/packages/api/src/trpc.ts +0 -28
- package/template/packages/api/tsconfig.json +0 -44
- package/template/packages/database/README.md +0 -162
- package/template/packages/database/package.json +0 -49
- package/template/packages/database/prisma/seed.ts +0 -64
- package/template/packages/database/schema.prisma +0 -107
- package/template/packages/database/src/index.ts +0 -15
- package/template/packages/database/src/validators.ts +0 -10
- package/template/packages/database/tsconfig.json +0 -18
- package/template/packages/mobile/README.md +0 -86
- package/template/packages/mobile/__tests__/App.test.tsx +0 -156
- package/template/packages/mobile/__tests__/components.test.tsx +0 -300
- package/template/packages/mobile/app.json +0 -5
- package/template/packages/mobile/babel.config.js +0 -26
- package/template/packages/mobile/index.js +0 -8
- package/template/packages/mobile/jest.config.js +0 -21
- package/template/packages/mobile/jest.setup.js +0 -12
- package/template/packages/mobile/metro.config.js +0 -36
- package/template/packages/mobile/package.json +0 -60
- package/template/packages/mobile/src/App.tsx +0 -8
- package/template/packages/mobile/src/utils/trpc.ts +0 -7
- package/template/packages/mobile/tsconfig.json +0 -28
- package/template/packages/shared/README.md +0 -135
- package/template/packages/shared/__tests__/shared.test.ts +0 -51
- package/template/packages/shared/jest.config.js +0 -22
- package/template/packages/shared/package.json +0 -68
- package/template/packages/shared/src/components/App.tsx +0 -57
- package/template/packages/shared/src/components/HelloWorld.tsx +0 -531
- package/template/packages/shared/src/components/index.ts +0 -1
- package/template/packages/shared/src/graphql/client.ts +0 -34
- package/template/packages/shared/src/index.ts +0 -25
- package/template/packages/shared/src/navigation/AppRouter.tsx +0 -565
- package/template/packages/shared/src/trpc/client.ts +0 -44
- package/template/packages/shared/src/unistyles.ts +0 -50
- package/template/packages/shared/tsconfig.json +0 -22
- package/template/packages/web/README.md +0 -131
- package/template/packages/web/__tests__/App.test.tsx +0 -342
- package/template/packages/web/__tests__/components.test.tsx +0 -564
- package/template/packages/web/index.html +0 -13
- package/template/packages/web/jest.config.js +0 -27
- package/template/packages/web/jest.setup.js +0 -24
- package/template/packages/web/package.json +0 -69
- package/template/packages/web/src/App.tsx +0 -14
- package/template/packages/web/src/components/TestDemo.tsx +0 -164
- package/template/packages/web/src/main.tsx +0 -27
- package/template/packages/web/src/utils/trpc.ts +0 -7
- package/template/packages/web/tsconfig.json +0 -26
- package/template/packages/web/vite.config.ts +0 -114
- package/template/setup.sh +0 -30
- package/template/tsconfig.json +0 -22
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template file copying utilities
|
|
3
|
+
*/
|
|
4
|
+
import { TemplateData } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Copy a template directory with variable replacement
|
|
7
|
+
*/
|
|
8
|
+
export declare function copyTemplateDirectory(sourceDir: string, destDir: string, data: TemplateData): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Copy a single template file with variable replacement
|
|
11
|
+
*/
|
|
12
|
+
export declare function copyTemplateFile(sourceFile: string, destFile: string, data: TemplateData): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Get the path to a template directory
|
|
15
|
+
*/
|
|
16
|
+
export declare function getTemplatePath(...segments: string[]): string;
|
|
17
|
+
/**
|
|
18
|
+
* Check if a template exists and has content
|
|
19
|
+
*/
|
|
20
|
+
export declare function templateExists(...segments: string[]): Promise<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a template has content (non-empty directory)
|
|
23
|
+
*/
|
|
24
|
+
export declare function templateHasContent(templatePath: string): Promise<boolean>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package.json merging utilities
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Deep merge two objects, with source taking precedence
|
|
6
|
+
*/
|
|
7
|
+
export declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T;
|
|
8
|
+
/**
|
|
9
|
+
* Package.json structure
|
|
10
|
+
*/
|
|
11
|
+
export interface PackageJson {
|
|
12
|
+
name?: string;
|
|
13
|
+
version?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
main?: string;
|
|
16
|
+
types?: string;
|
|
17
|
+
scripts?: Record<string, string>;
|
|
18
|
+
dependencies?: Record<string, string>;
|
|
19
|
+
devDependencies?: Record<string, string>;
|
|
20
|
+
peerDependencies?: Record<string, string>;
|
|
21
|
+
workspaces?: string[];
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Merge additional configuration into a package.json file
|
|
26
|
+
*/
|
|
27
|
+
export declare function mergePackageJson(filePath: string, additions: Partial<PackageJson>): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Add dependencies to a package.json file
|
|
30
|
+
*/
|
|
31
|
+
export declare function addDependencies(filePath: string, dependencies: Record<string, string>, type?: 'dependencies' | 'devDependencies' | 'peerDependencies'): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Remove dependencies from a package.json file
|
|
34
|
+
*/
|
|
35
|
+
export declare function removeDependencies(filePath: string, dependencyNames: string[], type?: 'dependencies' | 'devDependencies' | 'peerDependencies'): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Add scripts to a package.json file
|
|
38
|
+
*/
|
|
39
|
+
export declare function addScripts(filePath: string, scripts: Record<string, string>): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Update workspace configuration in root package.json
|
|
42
|
+
*/
|
|
43
|
+
export declare function addToWorkspaces(filePath: string, packagePath: string): Promise<void>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template variable processor
|
|
3
|
+
*/
|
|
4
|
+
import { TemplateData } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Process template content and replace all variables
|
|
7
|
+
*/
|
|
8
|
+
export declare function processTemplate(content: string, data: TemplateData): string;
|
|
9
|
+
/**
|
|
10
|
+
* Process conditional blocks in templates
|
|
11
|
+
* Supports: {{#if hasApi}}...{{/if}} and {{#unless hasApi}}...{{/unless}}
|
|
12
|
+
*/
|
|
13
|
+
export declare function processConditionals(content: string, data: TemplateData): string;
|
|
14
|
+
/**
|
|
15
|
+
* Full template processing (variables + conditionals)
|
|
16
|
+
*/
|
|
17
|
+
export declare function processTemplateContent(content: string, data: TemplateData): string;
|
|
18
|
+
/**
|
|
19
|
+
* Check if a file should be processed for template variables
|
|
20
|
+
*/
|
|
21
|
+
export declare function shouldProcessFile(filename: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Build TemplateData from ProjectConfig and additional info
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildTemplateData(config: {
|
|
26
|
+
projectName: string;
|
|
27
|
+
appDisplayName: string;
|
|
28
|
+
iosBundleId: string;
|
|
29
|
+
androidPackageName: string;
|
|
30
|
+
extensions: {
|
|
31
|
+
api: boolean;
|
|
32
|
+
prisma: boolean;
|
|
33
|
+
trpc: boolean;
|
|
34
|
+
graphql: boolean;
|
|
35
|
+
devcontainer: boolean | {
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}, idealystVersion: string): TemplateData;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,15 +1,163 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for the CLI-Beta package
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Complete project configuration collected from wizard or CLI args
|
|
6
|
+
*/
|
|
7
|
+
export interface ProjectConfig {
|
|
8
|
+
projectName: string;
|
|
9
|
+
orgDomain: string;
|
|
10
|
+
appDisplayName: string;
|
|
11
|
+
iosBundleId: string;
|
|
12
|
+
androidPackageName: string;
|
|
13
|
+
extensions: ExtensionConfig;
|
|
3
14
|
directory: string;
|
|
4
15
|
skipInstall: boolean;
|
|
5
|
-
|
|
16
|
+
isInteractive: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Extension configuration - which optional features are enabled
|
|
20
|
+
*/
|
|
21
|
+
export interface ExtensionConfig {
|
|
22
|
+
api: boolean;
|
|
23
|
+
prisma: boolean;
|
|
24
|
+
trpc: boolean;
|
|
25
|
+
graphql: boolean;
|
|
26
|
+
devcontainer: boolean | DevcontainerConfig;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Devcontainer configuration options
|
|
30
|
+
*/
|
|
31
|
+
export interface DevcontainerConfig {
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
postgres: boolean;
|
|
34
|
+
redis: boolean;
|
|
35
|
+
chrome: boolean;
|
|
36
|
+
claudeCode: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* CLI arguments before processing
|
|
40
|
+
*/
|
|
41
|
+
export interface CLIArgs {
|
|
42
|
+
projectName?: string;
|
|
43
|
+
orgDomain?: string;
|
|
44
|
+
appDisplayName?: string;
|
|
45
|
+
withApi?: boolean;
|
|
46
|
+
withPrisma?: boolean;
|
|
47
|
+
withTrpc?: boolean;
|
|
48
|
+
withGraphql?: boolean;
|
|
49
|
+
withDevcontainer?: boolean;
|
|
50
|
+
noInteractive?: boolean;
|
|
51
|
+
skipInstall?: boolean;
|
|
52
|
+
directory?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A single wizard step definition
|
|
56
|
+
*/
|
|
57
|
+
export interface WizardStep<T = unknown> {
|
|
58
|
+
id: string;
|
|
59
|
+
prompt: (currentConfig: Partial<ProjectConfig>) => Promise<T>;
|
|
60
|
+
validate: (value: T) => ValidationResult;
|
|
61
|
+
shouldShow?: (config: Partial<ProjectConfig>) => boolean;
|
|
6
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Result of validation
|
|
65
|
+
*/
|
|
66
|
+
export interface ValidationResult {
|
|
67
|
+
valid: boolean;
|
|
68
|
+
error?: string;
|
|
69
|
+
suggestions?: string[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Wizard state during collection
|
|
73
|
+
*/
|
|
74
|
+
export interface WizardState {
|
|
75
|
+
currentStep: number;
|
|
76
|
+
totalSteps: number;
|
|
77
|
+
config: Partial<ProjectConfig>;
|
|
78
|
+
completed: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Template data passed to template processor
|
|
82
|
+
*/
|
|
7
83
|
export interface TemplateData {
|
|
8
84
|
projectName: string;
|
|
9
85
|
packageName: string;
|
|
86
|
+
workspaceScope: string;
|
|
10
87
|
version: string;
|
|
11
88
|
description: string;
|
|
12
|
-
|
|
13
|
-
|
|
89
|
+
appDisplayName: string;
|
|
90
|
+
iosBundleId: string;
|
|
91
|
+
androidPackageName: string;
|
|
14
92
|
idealystVersion: string;
|
|
93
|
+
hasApi: boolean;
|
|
94
|
+
hasPrisma: boolean;
|
|
95
|
+
hasTrpc: boolean;
|
|
96
|
+
hasGraphql: boolean;
|
|
97
|
+
hasDevcontainer: boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Generator result with metadata
|
|
101
|
+
*/
|
|
102
|
+
export interface GeneratorResult {
|
|
103
|
+
success: boolean;
|
|
104
|
+
projectPath: string;
|
|
105
|
+
packagesCreated: string[];
|
|
106
|
+
extensionsEnabled: string[];
|
|
107
|
+
warnings: string[];
|
|
108
|
+
nextSteps: string[];
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Result from generating a single package
|
|
112
|
+
*/
|
|
113
|
+
export interface PackageGeneratorResult {
|
|
114
|
+
success: boolean;
|
|
115
|
+
warning?: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Options for React Native initialization
|
|
119
|
+
*/
|
|
120
|
+
export interface ReactNativeInitOptions {
|
|
121
|
+
projectName: string;
|
|
122
|
+
displayName: string;
|
|
123
|
+
bundleId: string;
|
|
124
|
+
packageName: string;
|
|
125
|
+
directory: string;
|
|
126
|
+
skipInstall: boolean;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Types of projects that can be added to workspace
|
|
130
|
+
*/
|
|
131
|
+
export type AddableProjectType = 'web' | 'mobile' | 'api' | 'shared';
|
|
132
|
+
/**
|
|
133
|
+
* Options for add command
|
|
134
|
+
*/
|
|
135
|
+
export interface AddProjectOptions {
|
|
136
|
+
name: string;
|
|
137
|
+
type: AddableProjectType;
|
|
138
|
+
directory: string;
|
|
139
|
+
appDisplayName?: string;
|
|
140
|
+
withTrpc?: boolean;
|
|
141
|
+
withGraphql?: boolean;
|
|
142
|
+
skipInstall?: boolean;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Custom error for missing required arguments in non-interactive mode
|
|
146
|
+
*/
|
|
147
|
+
export declare class MissingArgumentsError extends Error {
|
|
148
|
+
missingArgs: string[];
|
|
149
|
+
providedArgs: Record<string, unknown>;
|
|
150
|
+
constructor(missingArgs: string[], providedArgs: Record<string, unknown>);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Error when trying to run outside workspace for certain operations
|
|
154
|
+
*/
|
|
155
|
+
export declare class NotInWorkspaceError extends Error {
|
|
156
|
+
constructor(operation: string);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Error for invalid extension combinations
|
|
160
|
+
*/
|
|
161
|
+
export declare class InvalidExtensionError extends Error {
|
|
162
|
+
constructor(extension: string, requirement: string);
|
|
15
163
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File system utilities for template copying and file operations
|
|
3
|
+
*/
|
|
4
|
+
import { TemplateData } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Check if a path matches any ignore patterns
|
|
7
|
+
*/
|
|
8
|
+
export declare function shouldIgnore(filePath: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Check if a file should have template variables processed
|
|
11
|
+
*/
|
|
12
|
+
export declare function shouldProcessTemplate(filePath: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Replace template variables in content
|
|
15
|
+
*/
|
|
16
|
+
export declare function processTemplateContent(content: string, data: TemplateData): string;
|
|
17
|
+
/**
|
|
18
|
+
* Copy a template directory with variable replacement
|
|
19
|
+
*/
|
|
20
|
+
export declare function copyTemplate(sourceDir: string, destDir: string, data: TemplateData): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Ensure a directory exists
|
|
23
|
+
*/
|
|
24
|
+
export declare function ensureDir(dirPath: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Check if a path exists
|
|
27
|
+
*/
|
|
28
|
+
export declare function pathExists(filePath: string): Promise<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* Read a JSON file
|
|
31
|
+
*/
|
|
32
|
+
export declare function readJson<T = unknown>(filePath: string): Promise<T>;
|
|
33
|
+
/**
|
|
34
|
+
* Write a JSON file
|
|
35
|
+
*/
|
|
36
|
+
export declare function writeJson(filePath: string, data: unknown): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Read a text file
|
|
39
|
+
*/
|
|
40
|
+
export declare function readFile(filePath: string): Promise<string>;
|
|
41
|
+
/**
|
|
42
|
+
* Write a text file
|
|
43
|
+
*/
|
|
44
|
+
export declare function writeFile(filePath: string, content: string): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Copy a file
|
|
47
|
+
*/
|
|
48
|
+
export declare function copyFile(source: string, dest: string): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Remove a file or directory
|
|
51
|
+
*/
|
|
52
|
+
export declare function remove(filePath: string): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Get the template path for cli-beta
|
|
55
|
+
*/
|
|
56
|
+
export declare function getTemplatePath(templateName: string): string;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger utility for consistent CLI output
|
|
3
|
+
*/
|
|
4
|
+
export declare const logger: {
|
|
5
|
+
/**
|
|
6
|
+
* Log an info message
|
|
7
|
+
*/
|
|
8
|
+
info(message: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Log a success message
|
|
11
|
+
*/
|
|
12
|
+
success(message: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Log a warning message
|
|
15
|
+
*/
|
|
16
|
+
warn(message: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Log an error message
|
|
19
|
+
*/
|
|
20
|
+
error(message: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Log a step in the process
|
|
23
|
+
*/
|
|
24
|
+
step(message: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Log a bullet point item
|
|
27
|
+
*/
|
|
28
|
+
bullet(message: string, color?: "green" | "yellow" | "blue" | "white"): void;
|
|
29
|
+
/**
|
|
30
|
+
* Log a code snippet or command
|
|
31
|
+
*/
|
|
32
|
+
code(message: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Log a dimmed/subtle message
|
|
35
|
+
*/
|
|
36
|
+
dim(message: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Log a bold message
|
|
39
|
+
*/
|
|
40
|
+
bold(message: string): void;
|
|
41
|
+
/**
|
|
42
|
+
* Log a newline
|
|
43
|
+
*/
|
|
44
|
+
newline(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Log a horizontal separator
|
|
47
|
+
*/
|
|
48
|
+
separator(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Log a header with separator
|
|
51
|
+
*/
|
|
52
|
+
header(message: string): void;
|
|
53
|
+
/**
|
|
54
|
+
* Log a key-value pair
|
|
55
|
+
*/
|
|
56
|
+
keyValue(key: string, value: string): void;
|
|
57
|
+
};
|
|
58
|
+
export default logger;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell command execution utilities
|
|
3
|
+
*/
|
|
4
|
+
export interface CommandOptions {
|
|
5
|
+
cwd?: string;
|
|
6
|
+
timeout?: number;
|
|
7
|
+
silent?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface CommandResult {
|
|
10
|
+
stdout: string;
|
|
11
|
+
stderr: string;
|
|
12
|
+
exitCode: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Run a shell command and return the result
|
|
16
|
+
*/
|
|
17
|
+
export declare function runCommand(command: string, args: string[], options?: CommandOptions): Promise<CommandResult>;
|
|
18
|
+
/**
|
|
19
|
+
* Run yarn install in a directory
|
|
20
|
+
*/
|
|
21
|
+
export declare function installDependencies(directory: string, options?: {
|
|
22
|
+
silent?: boolean;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Check if a command exists
|
|
26
|
+
*/
|
|
27
|
+
export declare function commandExists(command: string): Promise<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Get the current yarn version
|
|
30
|
+
*/
|
|
31
|
+
export declare function getYarnVersion(): Promise<string | null>;
|
|
32
|
+
/**
|
|
33
|
+
* Get the current node version
|
|
34
|
+
*/
|
|
35
|
+
export declare function getNodeVersion(): Promise<string | null>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input validation utilities
|
|
3
|
+
*/
|
|
4
|
+
import { ValidationResult } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Validate a project name
|
|
7
|
+
*/
|
|
8
|
+
export declare function validateProjectName(name: string): ValidationResult;
|
|
9
|
+
/**
|
|
10
|
+
* Validate an organization domain
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateOrgDomain(domain: string): ValidationResult;
|
|
13
|
+
/**
|
|
14
|
+
* Validate an app display name
|
|
15
|
+
*/
|
|
16
|
+
export declare function validateAppDisplayName(name: string): ValidationResult;
|
|
17
|
+
/**
|
|
18
|
+
* Validate an iOS bundle ID
|
|
19
|
+
*/
|
|
20
|
+
export declare function validateBundleId(bundleId: string): ValidationResult;
|
|
21
|
+
/**
|
|
22
|
+
* Validate an Android package name
|
|
23
|
+
*/
|
|
24
|
+
export declare function validateAndroidPackageName(packageName: string): ValidationResult;
|
|
25
|
+
/**
|
|
26
|
+
* Validate that extension dependencies are met
|
|
27
|
+
*/
|
|
28
|
+
export declare function validateExtensions(options: {
|
|
29
|
+
withApi?: boolean;
|
|
30
|
+
withTrpc?: boolean;
|
|
31
|
+
withGraphql?: boolean;
|
|
32
|
+
}): ValidationResult;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wizard orchestrator - manages the step-by-step configuration flow
|
|
3
|
+
*/
|
|
4
|
+
import { ProjectConfig, CLIArgs } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Run the interactive wizard to collect all configuration
|
|
7
|
+
*/
|
|
8
|
+
export declare function runWizard(prefilledArgs?: Partial<CLIArgs>): Promise<ProjectConfig | null>;
|
|
9
|
+
/**
|
|
10
|
+
* Validate CLI args for non-interactive mode
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateNonInteractiveArgs(args: CLIArgs): {
|
|
13
|
+
valid: boolean;
|
|
14
|
+
missing: string[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Build a ProjectConfig from CLI arguments (for non-interactive mode)
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildConfigFromArgs(args: CLIArgs): ProjectConfig;
|
|
20
|
+
export * from './validators';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wizard steps exports
|
|
3
|
+
*/
|
|
4
|
+
export { projectNameStep } from './projectName';
|
|
5
|
+
export { orgDomainStep } from './orgDomain';
|
|
6
|
+
export { appDisplayNameStep } from './appDisplayName';
|
|
7
|
+
export { apiExtensionStep } from './apiExtension';
|
|
8
|
+
export { trpcExtensionStep } from './trpcExtension';
|
|
9
|
+
export { graphqlExtensionStep } from './graphqlExtension';
|
|
10
|
+
export { prismaExtensionStep } from './prismaExtension';
|
|
11
|
+
export { devcontainerExtensionStep } from './devcontainerExtension';
|
|
12
|
+
export { summaryStep } from './summary';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wizard input validators
|
|
3
|
+
*/
|
|
4
|
+
import { ValidationResult } from '../types';
|
|
5
|
+
import { validateProjectName, validateOrgDomain, validateAppDisplayName } from '../utils/validation';
|
|
6
|
+
/**
|
|
7
|
+
* Re-export validators for use in wizard steps
|
|
8
|
+
*/
|
|
9
|
+
export { validateProjectName, validateOrgDomain, validateAppDisplayName, };
|
|
10
|
+
/**
|
|
11
|
+
* Validate a boolean input
|
|
12
|
+
*/
|
|
13
|
+
export declare function validateBoolean(value: unknown): ValidationResult;
|
|
14
|
+
/**
|
|
15
|
+
* Display validation error to user
|
|
16
|
+
*/
|
|
17
|
+
export declare function formatValidationError(result: ValidationResult): string;
|
package/dist/types.js
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Core type definitions for the CLI-Beta package
|
|
4
|
+
*/
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InvalidExtensionError = exports.NotInWorkspaceError = exports.MissingArgumentsError = void 0;
|
|
7
|
+
// ============================================
|
|
8
|
+
// ERROR TYPES
|
|
9
|
+
// ============================================
|
|
10
|
+
/**
|
|
11
|
+
* Custom error for missing required arguments in non-interactive mode
|
|
12
|
+
*/
|
|
13
|
+
class MissingArgumentsError extends Error {
|
|
14
|
+
constructor(missingArgs, providedArgs) {
|
|
15
|
+
const message = `Missing required arguments: ${missingArgs.join(', ')}\n` +
|
|
16
|
+
`Run with interactive mode (remove --no-interactive) or provide all required arguments.`;
|
|
17
|
+
super(message);
|
|
18
|
+
this.name = 'MissingArgumentsError';
|
|
19
|
+
this.missingArgs = missingArgs;
|
|
20
|
+
this.providedArgs = providedArgs;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.MissingArgumentsError = MissingArgumentsError;
|
|
24
|
+
/**
|
|
25
|
+
* Error when trying to run outside workspace for certain operations
|
|
26
|
+
*/
|
|
27
|
+
class NotInWorkspaceError extends Error {
|
|
28
|
+
constructor(operation) {
|
|
29
|
+
super(`The '${operation}' command must be run from within an Idealyst workspace.`);
|
|
30
|
+
this.name = 'NotInWorkspaceError';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.NotInWorkspaceError = NotInWorkspaceError;
|
|
34
|
+
/**
|
|
35
|
+
* Error for invalid extension combinations
|
|
36
|
+
*/
|
|
37
|
+
class InvalidExtensionError extends Error {
|
|
38
|
+
constructor(extension, requirement) {
|
|
39
|
+
super(`Extension '${extension}' requires '${requirement}' to be enabled.`);
|
|
40
|
+
this.name = 'InvalidExtensionError';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.InvalidExtensionError = InvalidExtensionError;
|
|
3
44
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAqLH,+CAA+C;AAC/C,cAAc;AACd,+CAA+C;AAE/C;;GAEG;AACH,MAAa,qBAAsB,SAAQ,KAAK;IAI9C,YACE,WAAqB,EACrB,YAAqC;QAErC,MAAM,OAAO,GAAG,+BAA+B,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YACvE,wFAAwF,CAAC;QAC3F,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF;AAfD,sDAeC;AAED;;GAEG;AACH,MAAa,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,SAAiB;QAC3B,KAAK,CAAC,QAAQ,SAAS,0DAA0D,CAAC,CAAC;QACnF,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AALD,kDAKC;AAED;;GAEG;AACH,MAAa,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,SAAiB,EAAE,WAAmB;QAChD,KAAK,CAAC,cAAc,SAAS,eAAe,WAAW,kBAAkB,CAAC,CAAC;QAC3E,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AALD,sDAKC"}
|