@idealyst/cli 1.1.9 → 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,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Package.json merging utilities
|
|
4
|
+
*/
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.deepMerge = deepMerge;
|
|
10
|
+
exports.mergePackageJson = mergePackageJson;
|
|
11
|
+
exports.addDependencies = addDependencies;
|
|
12
|
+
exports.removeDependencies = removeDependencies;
|
|
13
|
+
exports.addScripts = addScripts;
|
|
14
|
+
exports.addToWorkspaces = addToWorkspaces;
|
|
15
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
16
|
+
/**
|
|
17
|
+
* Deep merge two objects, with source taking precedence
|
|
18
|
+
*/
|
|
19
|
+
function deepMerge(target, source) {
|
|
20
|
+
const output = { ...target };
|
|
21
|
+
for (const key of Object.keys(source)) {
|
|
22
|
+
const sourceValue = source[key];
|
|
23
|
+
const targetValue = target[key];
|
|
24
|
+
if (sourceValue !== null &&
|
|
25
|
+
typeof sourceValue === 'object' &&
|
|
26
|
+
!Array.isArray(sourceValue) &&
|
|
27
|
+
targetValue !== null &&
|
|
28
|
+
typeof targetValue === 'object' &&
|
|
29
|
+
!Array.isArray(targetValue)) {
|
|
30
|
+
// Recursively merge nested objects
|
|
31
|
+
output[key] = deepMerge(targetValue, sourceValue);
|
|
32
|
+
}
|
|
33
|
+
else if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
|
|
34
|
+
// Merge arrays by concatenating unique values
|
|
35
|
+
output[key] = [
|
|
36
|
+
...new Set([...targetValue, ...sourceValue])
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Override with source value
|
|
41
|
+
output[key] = sourceValue;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return output;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Merge additional configuration into a package.json file
|
|
48
|
+
*/
|
|
49
|
+
async function mergePackageJson(filePath, additions) {
|
|
50
|
+
const existing = await fs_extra_1.default.readJson(filePath);
|
|
51
|
+
const merged = deepMerge(existing, additions);
|
|
52
|
+
await fs_extra_1.default.writeJson(filePath, merged, { spaces: 2 });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Add dependencies to a package.json file
|
|
56
|
+
*/
|
|
57
|
+
async function addDependencies(filePath, dependencies, type = 'dependencies') {
|
|
58
|
+
const packageJson = await fs_extra_1.default.readJson(filePath);
|
|
59
|
+
if (!packageJson[type]) {
|
|
60
|
+
packageJson[type] = {};
|
|
61
|
+
}
|
|
62
|
+
packageJson[type] = {
|
|
63
|
+
...packageJson[type],
|
|
64
|
+
...dependencies,
|
|
65
|
+
};
|
|
66
|
+
// Sort dependencies alphabetically
|
|
67
|
+
packageJson[type] = Object.keys(packageJson[type])
|
|
68
|
+
.sort()
|
|
69
|
+
.reduce((acc, key) => {
|
|
70
|
+
acc[key] = packageJson[type][key];
|
|
71
|
+
return acc;
|
|
72
|
+
}, {});
|
|
73
|
+
await fs_extra_1.default.writeJson(filePath, packageJson, { spaces: 2 });
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Remove dependencies from a package.json file
|
|
77
|
+
*/
|
|
78
|
+
async function removeDependencies(filePath, dependencyNames, type = 'dependencies') {
|
|
79
|
+
const packageJson = await fs_extra_1.default.readJson(filePath);
|
|
80
|
+
if (!packageJson[type]) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
for (const name of dependencyNames) {
|
|
84
|
+
delete packageJson[type][name];
|
|
85
|
+
}
|
|
86
|
+
await fs_extra_1.default.writeJson(filePath, packageJson, { spaces: 2 });
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Add scripts to a package.json file
|
|
90
|
+
*/
|
|
91
|
+
async function addScripts(filePath, scripts) {
|
|
92
|
+
const packageJson = await fs_extra_1.default.readJson(filePath);
|
|
93
|
+
packageJson.scripts = {
|
|
94
|
+
...packageJson.scripts,
|
|
95
|
+
...scripts,
|
|
96
|
+
};
|
|
97
|
+
await fs_extra_1.default.writeJson(filePath, packageJson, { spaces: 2 });
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Update workspace configuration in root package.json
|
|
101
|
+
*/
|
|
102
|
+
async function addToWorkspaces(filePath, packagePath) {
|
|
103
|
+
const packageJson = await fs_extra_1.default.readJson(filePath);
|
|
104
|
+
if (!packageJson.workspaces) {
|
|
105
|
+
packageJson.workspaces = [];
|
|
106
|
+
}
|
|
107
|
+
if (!packageJson.workspaces.includes(packagePath)) {
|
|
108
|
+
packageJson.workspaces.push(packagePath);
|
|
109
|
+
packageJson.workspaces.sort();
|
|
110
|
+
}
|
|
111
|
+
await fs_extra_1.default.writeJson(filePath, packageJson, { spaces: 2 });
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=merger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merger.js","sourceRoot":"","sources":["../../src/templates/merger.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;AAOH,8BAmCC;AAsBD,4CAOC;AAKD,0CAyBC;AAKD,gDAgBC;AAKD,gCAYC;AAKD,0CAgBC;AA9JD,wDAA0B;AAE1B;;GAEG;AACH,SAAgB,SAAS,CACvB,MAAS,EACT,MAAkB;IAElB,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAE7B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAc,CAAC,CAAC;QAC3C,MAAM,WAAW,GAAG,MAAM,CAAC,GAAc,CAAC,CAAC;QAE3C,IACE,WAAW,KAAK,IAAI;YACpB,OAAO,WAAW,KAAK,QAAQ;YAC/B,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;YAC3B,WAAW,KAAK,IAAI;YACpB,OAAO,WAAW,KAAK,QAAQ;YAC/B,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAC3B,CAAC;YACD,mCAAmC;YACnC,MAAM,CAAC,GAAc,CAAC,GAAG,SAAS,CAChC,WAAsC,EACtC,WAAsC,CACzB,CAAC;QAClB,CAAC;aAAM,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YACpE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UAAU,GAAG,EAAE,CAAC;IAC9B,CAAC;IAED,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACzC,WAAW,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;IAED,MAAM,kBAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Template variable processor
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.processTemplate = processTemplate;
|
|
7
|
+
exports.processConditionals = processConditionals;
|
|
8
|
+
exports.processTemplateContent = processTemplateContent;
|
|
9
|
+
exports.shouldProcessFile = shouldProcessFile;
|
|
10
|
+
exports.buildTemplateData = buildTemplateData;
|
|
11
|
+
/**
|
|
12
|
+
* All template variables and their patterns
|
|
13
|
+
*/
|
|
14
|
+
const TEMPLATE_VARIABLES = [
|
|
15
|
+
'projectName',
|
|
16
|
+
'packageName',
|
|
17
|
+
'workspaceScope',
|
|
18
|
+
'version',
|
|
19
|
+
'description',
|
|
20
|
+
'appDisplayName',
|
|
21
|
+
'iosBundleId',
|
|
22
|
+
'androidPackageName',
|
|
23
|
+
'idealystVersion',
|
|
24
|
+
'hasApi',
|
|
25
|
+
'hasPrisma',
|
|
26
|
+
'hasTrpc',
|
|
27
|
+
'hasGraphql',
|
|
28
|
+
'hasDevcontainer',
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* Process template content and replace all variables
|
|
32
|
+
*/
|
|
33
|
+
function processTemplate(content, data) {
|
|
34
|
+
let result = content;
|
|
35
|
+
for (const variable of TEMPLATE_VARIABLES) {
|
|
36
|
+
const pattern = new RegExp(`\\{\\{${variable}\\}\\}`, 'g');
|
|
37
|
+
const value = String(data[variable]);
|
|
38
|
+
result = result.replace(pattern, value);
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Process conditional blocks in templates
|
|
44
|
+
* Supports: {{#if hasApi}}...{{/if}} and {{#unless hasApi}}...{{/unless}}
|
|
45
|
+
*/
|
|
46
|
+
function processConditionals(content, data) {
|
|
47
|
+
let result = content;
|
|
48
|
+
// Process {{#if variable}}...{{/if}} blocks
|
|
49
|
+
const ifPattern = /\{\{#if\s+(\w+)\}\}([\s\S]*?)\{\{\/if\}\}/g;
|
|
50
|
+
result = result.replace(ifPattern, (match, variable, block) => {
|
|
51
|
+
const value = data[variable];
|
|
52
|
+
return value ? block : '';
|
|
53
|
+
});
|
|
54
|
+
// Process {{#unless variable}}...{{/unless}} blocks
|
|
55
|
+
const unlessPattern = /\{\{#unless\s+(\w+)\}\}([\s\S]*?)\{\{\/unless\}\}/g;
|
|
56
|
+
result = result.replace(unlessPattern, (match, variable, block) => {
|
|
57
|
+
const value = data[variable];
|
|
58
|
+
return !value ? block : '';
|
|
59
|
+
});
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Full template processing (variables + conditionals)
|
|
64
|
+
*/
|
|
65
|
+
function processTemplateContent(content, data) {
|
|
66
|
+
let result = content;
|
|
67
|
+
// First process conditionals
|
|
68
|
+
result = processConditionals(result, data);
|
|
69
|
+
// Then process variables
|
|
70
|
+
result = processTemplate(result, data);
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* File extensions that should have template variables processed
|
|
75
|
+
*/
|
|
76
|
+
const PROCESSABLE_EXTENSIONS = [
|
|
77
|
+
'.ts', '.tsx', '.js', '.jsx', '.json', '.md', '.txt',
|
|
78
|
+
'.yml', '.yaml', '.env', '.sh', '.conf', '.sql',
|
|
79
|
+
];
|
|
80
|
+
/**
|
|
81
|
+
* File extensions that should NOT be processed (binary files)
|
|
82
|
+
*/
|
|
83
|
+
const BINARY_EXTENSIONS = [
|
|
84
|
+
'.png', '.jpg', '.jpeg', '.gif', '.svg', '.ico', '.webp',
|
|
85
|
+
'.ttf', '.woff', '.woff2', '.eot', '.otf',
|
|
86
|
+
'.zip', '.tar', '.gz', '.rar',
|
|
87
|
+
'.pdf', '.doc', '.docx',
|
|
88
|
+
'.mp3', '.mp4', '.wav', '.avi', '.mov',
|
|
89
|
+
'.min.js', '.min.css',
|
|
90
|
+
'.bin', '.dat', '.exe', '.dll',
|
|
91
|
+
];
|
|
92
|
+
/**
|
|
93
|
+
* Check if a file should be processed for template variables
|
|
94
|
+
*/
|
|
95
|
+
function shouldProcessFile(filename) {
|
|
96
|
+
const lowerFilename = filename.toLowerCase();
|
|
97
|
+
const basename = lowerFilename.split('/').pop() || lowerFilename;
|
|
98
|
+
// Check if it's a known binary file
|
|
99
|
+
for (const ext of BINARY_EXTENSIONS) {
|
|
100
|
+
if (lowerFilename.endsWith(ext)) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Special handling for env files (can have various suffixes like .env.example, .env.local)
|
|
105
|
+
if (basename.startsWith('.env') || basename.includes('.env')) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
// Check if it's a processable text file
|
|
109
|
+
for (const ext of PROCESSABLE_EXTENSIONS) {
|
|
110
|
+
if (lowerFilename.endsWith(ext)) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// Default: don't process unknown file types
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Build TemplateData from ProjectConfig and additional info
|
|
119
|
+
*/
|
|
120
|
+
function buildTemplateData(config, idealystVersion) {
|
|
121
|
+
// Normalize devcontainer to boolean for template data
|
|
122
|
+
const hasDevcontainer = typeof config.extensions.devcontainer === 'boolean'
|
|
123
|
+
? config.extensions.devcontainer
|
|
124
|
+
: config.extensions.devcontainer?.enabled ?? false;
|
|
125
|
+
return {
|
|
126
|
+
projectName: config.projectName,
|
|
127
|
+
packageName: `@${config.projectName}`,
|
|
128
|
+
workspaceScope: config.projectName,
|
|
129
|
+
version: '0.1.0',
|
|
130
|
+
description: `${config.appDisplayName} - Built with Idealyst Framework`,
|
|
131
|
+
appDisplayName: config.appDisplayName,
|
|
132
|
+
iosBundleId: config.iosBundleId,
|
|
133
|
+
androidPackageName: config.androidPackageName,
|
|
134
|
+
idealystVersion,
|
|
135
|
+
hasApi: config.extensions.api,
|
|
136
|
+
hasPrisma: config.extensions.prisma,
|
|
137
|
+
hasTrpc: config.extensions.trpc,
|
|
138
|
+
hasGraphql: config.extensions.graphql,
|
|
139
|
+
hasDevcontainer,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor.js","sourceRoot":"","sources":["../../src/templates/processor.ts"],"names":[],"mappings":";AAAA;;GAEG;;AA2BH,0CAUC;AAMD,kDAkBC;AAKD,wDAUC;AA0BD,8CAyBC;AAKD,8CAkCC;AAlKD;;GAEG;AACH,MAAM,kBAAkB,GAAG;IACzB,aAAa;IACb,aAAa;IACb,gBAAgB;IAChB,SAAS;IACT,aAAa;IACb,gBAAgB;IAChB,aAAa;IACb,oBAAoB;IACpB,iBAAiB;IACjB,QAAQ;IACR,WAAW;IACX,SAAS;IACT,YAAY;IACZ,iBAAiB;CACT,CAAC;AAEX;;GAEG;AACH,SAAgB,eAAe,CAAC,OAAe,EAAE,IAAkB;IACjE,IAAI,MAAM,GAAG,OAAO,CAAC;IAErB,KAAK,MAAM,QAAQ,IAAI,kBAAkB,EAAE,CAAC;QAC1C,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,SAAS,QAAQ,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC3D,MAAM,KAA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,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,4CAA4C;IAC5C,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAAC,MAYjC,EAAE,eAAuB;IACxB,sDAAsD;IACtD,MAAM,eAAe,GAAG,OAAO,MAAM,CAAC,UAAU,CAAC,YAAY,KAAK,SAAS;QACzE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY;QAChC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,EAAE,OAAO,IAAI,KAAK,CAAC;IAErD,OAAO;QACL,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,WAAW,EAAE,IAAI,MAAM,CAAC,WAAW,EAAE;QACrC,cAAc,EAAE,MAAM,CAAC,WAAW;QAClC,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,GAAG,MAAM,CAAC,cAAc,kCAAkC;QACvE,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;QAC7C,eAAe;QACf,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG;QAC7B,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,MAAM;QACnC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI;QAC/B,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,OAAO;QACrC,eAAe;KAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add command - adds a new project to an existing workspace
|
|
3
|
+
*/
|
|
4
|
+
export interface AddCommandOptions {
|
|
5
|
+
type: string;
|
|
6
|
+
appName?: string;
|
|
7
|
+
withTrpc?: boolean;
|
|
8
|
+
withGraphql?: boolean;
|
|
9
|
+
skipInstall?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Handle the `idealyst-beta add` command
|
|
13
|
+
*/
|
|
14
|
+
export declare function addCommand(name: string, options: AddCommandOptions): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Info command - display CLI information
|
|
3
|
+
*/
|
|
4
|
+
export interface InfoOptions {
|
|
5
|
+
format?: 'text' | 'json' | 'markdown' | 'llm';
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Handle the `idealyst-beta info` command
|
|
9
|
+
*/
|
|
10
|
+
export declare function infoCommand(options?: InfoOptions): Promise<void>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Init command - creates a new Idealyst workspace
|
|
3
|
+
*/
|
|
4
|
+
export interface InitOptions {
|
|
5
|
+
directory: string;
|
|
6
|
+
orgDomain?: string;
|
|
7
|
+
appName?: string;
|
|
8
|
+
withApi?: boolean;
|
|
9
|
+
withPrisma?: boolean;
|
|
10
|
+
withTrpc?: boolean;
|
|
11
|
+
withGraphql?: boolean;
|
|
12
|
+
withDevcontainer?: boolean;
|
|
13
|
+
interactive?: boolean;
|
|
14
|
+
skipInstall?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Handle the `idealyst-beta init` command
|
|
18
|
+
*/
|
|
19
|
+
export declare function initCommand(projectName: string | undefined, options: InitOptions): Promise<void>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants and default values for the CLI
|
|
3
|
+
*/
|
|
4
|
+
export declare const VERSION = "0.1.0";
|
|
5
|
+
export declare const IDEALYST_VERSION = "1.1.8";
|
|
6
|
+
export declare const REACT_NATIVE_VERSION = "0.83.0";
|
|
7
|
+
export declare const REACT_VERSION = "19.1.0";
|
|
8
|
+
export declare const DEFAULT_TIMEOUT = 300000;
|
|
9
|
+
export declare const RN_TIMEOUT = 600000;
|
|
10
|
+
export declare const PATTERNS: {
|
|
11
|
+
readonly PROJECT_NAME: RegExp;
|
|
12
|
+
readonly ORG_DOMAIN: RegExp;
|
|
13
|
+
readonly IOS_BUNDLE_ID: RegExp;
|
|
14
|
+
readonly ANDROID_PACKAGE: RegExp;
|
|
15
|
+
};
|
|
16
|
+
export declare const JAVA_RESERVED_KEYWORDS: readonly ["abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "default", "do", "double", "else", "enum", "extends", "final", "finally", "float", "for", "goto", "if", "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "package", "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", "void", "volatile", "while"];
|
|
17
|
+
export declare const TEMPLATE_EXTENSIONS: readonly [".ts", ".tsx", ".js", ".jsx", ".json", ".md", ".txt", ".yml", ".yaml", ".env", ".sh", ".conf", ".sql"];
|
|
18
|
+
export declare const IGNORE_PATTERNS: readonly ["node_modules", ".git", "dist", "build", ".cache", ".DS_Store", "Thumbs.db", "*.log", "*.tmp", "*.bak", "~*"];
|
|
19
|
+
export declare const DEPENDENCIES: {
|
|
20
|
+
readonly core: {
|
|
21
|
+
readonly '@idealyst/components': "^1.1.8";
|
|
22
|
+
readonly '@idealyst/theme': "^1.1.8";
|
|
23
|
+
readonly '@idealyst/navigation': "^1.1.8";
|
|
24
|
+
};
|
|
25
|
+
readonly web: {
|
|
26
|
+
readonly '@mdi/js': "^7.4.47";
|
|
27
|
+
readonly '@mdi/react': "^1.6.1";
|
|
28
|
+
readonly react: "^19.1.0";
|
|
29
|
+
readonly 'react-dom': "^19.1.0";
|
|
30
|
+
readonly 'react-native': "^0.83.0";
|
|
31
|
+
readonly 'react-native-unistyles': "^3.0.0";
|
|
32
|
+
readonly 'react-native-web': "^0.19.12";
|
|
33
|
+
readonly 'react-router': "^7.6.0";
|
|
34
|
+
readonly 'react-router-dom': "^7.6.0";
|
|
35
|
+
};
|
|
36
|
+
readonly mobile: {
|
|
37
|
+
readonly react: "^19.1.0";
|
|
38
|
+
readonly 'react-native': "^0.83.0";
|
|
39
|
+
readonly 'react-native-unistyles': "^3.0.15";
|
|
40
|
+
readonly '@react-navigation/native': "^7.0.0";
|
|
41
|
+
readonly '@react-navigation/native-stack': "^7.0.0";
|
|
42
|
+
readonly 'react-native-safe-area-context': "^4.10.0";
|
|
43
|
+
readonly 'react-native-screens': "^4.4.0";
|
|
44
|
+
readonly 'react-native-gesture-handler': "^2.20.0";
|
|
45
|
+
readonly 'react-native-reanimated': "^3.16.0";
|
|
46
|
+
readonly 'react-native-vector-icons': "^10.2.0";
|
|
47
|
+
};
|
|
48
|
+
readonly trpc: {
|
|
49
|
+
readonly '@trpc/client': "^11.5.0";
|
|
50
|
+
readonly '@trpc/react-query': "^11.5.0";
|
|
51
|
+
readonly '@tanstack/react-query': "^5.83.0";
|
|
52
|
+
};
|
|
53
|
+
readonly trpcServer: {
|
|
54
|
+
readonly '@trpc/server': "^11.5.0";
|
|
55
|
+
};
|
|
56
|
+
readonly graphql: {
|
|
57
|
+
readonly '@apollo/client': "^3.11.0";
|
|
58
|
+
readonly graphql: "^16.9.0";
|
|
59
|
+
};
|
|
60
|
+
readonly graphqlServer: {
|
|
61
|
+
readonly '@pothos/core': "^4.3.0";
|
|
62
|
+
readonly 'graphql-yoga': "^5.10.0";
|
|
63
|
+
};
|
|
64
|
+
readonly prisma: {
|
|
65
|
+
readonly '@prisma/client': "^5.19.0";
|
|
66
|
+
};
|
|
67
|
+
readonly prismaDev: {
|
|
68
|
+
readonly prisma: "^5.19.0";
|
|
69
|
+
};
|
|
70
|
+
readonly api: {
|
|
71
|
+
readonly express: "^4.21.0";
|
|
72
|
+
readonly cors: "^2.8.5";
|
|
73
|
+
readonly dotenv: "^16.4.0";
|
|
74
|
+
readonly zod: "^3.22.0";
|
|
75
|
+
};
|
|
76
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mobile package generator
|
|
3
|
+
*/
|
|
4
|
+
import { TemplateData, PackageGeneratorResult } from '../../types';
|
|
5
|
+
export interface MobileGeneratorOptions extends TemplateData {
|
|
6
|
+
bundleId: string;
|
|
7
|
+
packageName: string;
|
|
8
|
+
skipInstall?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generate the mobile package
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateMobilePackage(projectPath: string, options: MobileGeneratorOptions): Promise<PackageGeneratorResult>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared package generator
|
|
3
|
+
*/
|
|
4
|
+
import { TemplateData, PackageGeneratorResult } from '../../types';
|
|
5
|
+
/**
|
|
6
|
+
* Generate the shared package
|
|
7
|
+
*/
|
|
8
|
+
export declare function generateSharedPackage(projectPath: string, data: TemplateData): Promise<PackageGeneratorResult>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API extension generator
|
|
3
|
+
*/
|
|
4
|
+
import { TemplateData, PackageGeneratorResult } from '../../types';
|
|
5
|
+
/**
|
|
6
|
+
* Apply API extension to a workspace
|
|
7
|
+
*/
|
|
8
|
+
export declare function applyApiExtension(projectPath: string, data: TemplateData): Promise<PackageGeneratorResult>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Devcontainer extension generator
|
|
3
|
+
*
|
|
4
|
+
* Creates a development container setup with optional services:
|
|
5
|
+
* - Base: Node.js, Yarn, Expo CLI (always included)
|
|
6
|
+
* - Optional: PostgreSQL database
|
|
7
|
+
* - Optional: Redis cache
|
|
8
|
+
* - Optional: Headless Chrome for browser automation
|
|
9
|
+
* - Optional: Claude Code with MCP servers
|
|
10
|
+
*/
|
|
11
|
+
import { TemplateData, DevcontainerConfig } from '../../types';
|
|
12
|
+
/**
|
|
13
|
+
* Apply devcontainer extension to a project
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyDevcontainerExtension(projectPath: string, data: TemplateData, devcontainerConfig?: boolean | DevcontainerConfig): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL extension generator
|
|
3
|
+
*/
|
|
4
|
+
import { TemplateData, PackageGeneratorResult } from '../../types';
|
|
5
|
+
/**
|
|
6
|
+
* Apply GraphQL extension to a workspace
|
|
7
|
+
*/
|
|
8
|
+
export declare function applyGraphqlExtension(projectPath: string, data: TemplateData): Promise<PackageGeneratorResult>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension generators exports
|
|
3
|
+
*/
|
|
4
|
+
export { applyApiExtension } from './api';
|
|
5
|
+
export { applyPrismaExtension } from './prisma';
|
|
6
|
+
export { applyTrpcExtension } from './trpc';
|
|
7
|
+
export { applyGraphqlExtension } from './graphql';
|
|
8
|
+
export { applyDevcontainerExtension } from './devcontainer';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prisma extension generator
|
|
3
|
+
*/
|
|
4
|
+
import { TemplateData, PackageGeneratorResult } from '../../types';
|
|
5
|
+
/**
|
|
6
|
+
* Apply Prisma extension to a workspace
|
|
7
|
+
*/
|
|
8
|
+
export declare function applyPrismaExtension(projectPath: string, data: TemplateData): Promise<PackageGeneratorResult>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tRPC extension generator
|
|
3
|
+
*/
|
|
4
|
+
import { TemplateData, PackageGeneratorResult } from '../../types';
|
|
5
|
+
/**
|
|
6
|
+
* Apply tRPC extension to a workspace
|
|
7
|
+
* This adds tRPC to API, web, and mobile packages
|
|
8
|
+
*/
|
|
9
|
+
export declare function applyTrpcExtension(projectPath: string, data: TemplateData): Promise<PackageGeneratorResult>;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Generator orchestrator - main entry point for project generation
|
|
3
|
+
*/
|
|
4
|
+
import { ProjectConfig, GeneratorResult } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Main generator function - orchestrates all generation
|
|
7
|
+
*/
|
|
8
|
+
export declare function generateProject(config: ProjectConfig): Promise<GeneratorResult>;
|
|
9
|
+
export * from './workspace';
|
|
10
|
+
export * from './core';
|
|
11
|
+
export * from './reactNative';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Native initialization utilities
|
|
3
|
+
*/
|
|
4
|
+
import { ReactNativeInitOptions, PackageGeneratorResult } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Initialize a React Native project with correct identifiers
|
|
7
|
+
*/
|
|
8
|
+
export declare function initializeReactNative(options: ReactNativeInitOptions): Promise<PackageGeneratorResult>;
|
|
9
|
+
/**
|
|
10
|
+
* Check if native folders exist in a mobile package
|
|
11
|
+
*/
|
|
12
|
+
export declare function hasNativeFolders(mobileDir: string): Promise<{
|
|
13
|
+
android: boolean;
|
|
14
|
+
ios: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Overlay Idealyst files onto an existing React Native project
|
|
18
|
+
*/
|
|
19
|
+
export declare function overlayIdealystFiles(mobileDir: string, templateDir: string, data: import('../types').TemplateData): Promise<void>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Android Package Name generation utilities
|
|
3
|
+
*/
|
|
4
|
+
import { ValidationResult } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Generate Android package name
|
|
7
|
+
* Android does NOT allow hyphens - must be lowercase alphanumeric with dots
|
|
8
|
+
*
|
|
9
|
+
* @param orgDomain - Organization domain (e.g., "com.company")
|
|
10
|
+
* @param projectName - Project name in kebab-case
|
|
11
|
+
* @returns Android package name (hyphens removed)
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* generateAndroidPackageName('com.mycompany', 'my-app')
|
|
15
|
+
* // Returns: 'com.mycompany.myapp'
|
|
16
|
+
*/
|
|
17
|
+
export declare function generateAndroidPackageName(orgDomain: string, projectName: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Validate Android package name format
|
|
20
|
+
*/
|
|
21
|
+
export declare function validateAndroidPackageName(packageName: string): ValidationResult;
|
|
22
|
+
/**
|
|
23
|
+
* Convert a kebab-case string to a valid Android package segment
|
|
24
|
+
* Removes hyphens and ensures lowercase
|
|
25
|
+
*/
|
|
26
|
+
export declare function toAndroidSegment(input: string): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mobile identifier generation
|
|
3
|
+
*/
|
|
4
|
+
import { generateIosBundleId, validateIosBundleId } from './ios';
|
|
5
|
+
import { generateAndroidPackageName, validateAndroidPackageName } from './android';
|
|
6
|
+
export interface MobileIdentifiers {
|
|
7
|
+
iosBundleId: string;
|
|
8
|
+
androidPackageName: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generate iOS and Android identifiers from org domain and project name
|
|
12
|
+
*
|
|
13
|
+
* @param orgDomain - Organization domain (e.g., "com.company")
|
|
14
|
+
* @param projectName - Project name in kebab-case
|
|
15
|
+
* @returns Generated identifiers for both platforms
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* generateIdentifiers('com.mycompany', 'awesome-app')
|
|
19
|
+
* // Returns:
|
|
20
|
+
* // {
|
|
21
|
+
* // iosBundleId: 'com.mycompany.awesome-app',
|
|
22
|
+
* // androidPackageName: 'com.mycompany.awesomeapp'
|
|
23
|
+
* // }
|
|
24
|
+
*/
|
|
25
|
+
export declare function generateIdentifiers(orgDomain: string, projectName: string): MobileIdentifiers;
|
|
26
|
+
export { generateIosBundleId, validateIosBundleId, generateAndroidPackageName, validateAndroidPackageName, };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* iOS Bundle ID generation utilities
|
|
3
|
+
*/
|
|
4
|
+
import { ValidationResult } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Generate iOS bundle identifier
|
|
7
|
+
* iOS allows hyphens in bundle IDs
|
|
8
|
+
*
|
|
9
|
+
* @param orgDomain - Organization domain (e.g., "com.company")
|
|
10
|
+
* @param projectName - Project name in kebab-case
|
|
11
|
+
* @returns iOS bundle identifier
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* generateIosBundleId('com.mycompany', 'my-app')
|
|
15
|
+
* // Returns: 'com.mycompany.my-app'
|
|
16
|
+
*/
|
|
17
|
+
export declare function generateIosBundleId(orgDomain: string, projectName: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Validate iOS bundle ID format
|
|
20
|
+
*/
|
|
21
|
+
export declare function validateIosBundleId(bundleId: string): ValidationResult;
|