@geekmidas/cli 1.10.27 → 1.10.28
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +13 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +13 -57
- package/dist/index.mjs.map +1 -1
- package/dist/{openapi-BXuCY14q.cjs → openapi-CBU4TEi-.cjs} +23 -130
- package/dist/openapi-CBU4TEi-.cjs.map +1 -0
- package/dist/{openapi-DeG0ffQ8.mjs → openapi-CQCoLuzh.mjs} +24 -113
- package/dist/openapi-CQCoLuzh.mjs.map +1 -0
- package/dist/openapi.cjs +1 -1
- package/dist/openapi.mjs +1 -1
- package/package.json +1 -1
- package/src/dev/index.ts +5 -100
- package/src/init/generators/monorepo.ts +0 -3
- package/src/init/generators/package.ts +1 -4
- package/src/init/generators/web.ts +7 -3
- package/dist/openapi-BXuCY14q.cjs.map +0 -1
- package/dist/openapi-DeG0ffQ8.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @geekmidas/cli
|
|
2
2
|
|
|
3
|
+
## 1.10.28
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 🔥 [`9e8f923`](https://github.com/geekmidas/toolbox/commit/9e8f9239798649bedeb16906ed83d0b71065c917) Thanks [@geekmidas](https://github.com/geekmidas)! - Remove client generation from cli
|
|
8
|
+
|
|
3
9
|
## 1.10.27
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ const require_config = require('./config-D3ORuiUs.cjs');
|
|
|
5
5
|
const require_credentials = require('./credentials-C8DWtnMY.cjs');
|
|
6
6
|
const require_fullstack_secrets = require('./fullstack-secrets-CsxU84eN.cjs');
|
|
7
7
|
const require_storage = require('./storage-B1wvztiJ.cjs');
|
|
8
|
-
const require_openapi = require('./openapi-
|
|
8
|
+
const require_openapi = require('./openapi-CBU4TEi-.cjs');
|
|
9
9
|
const require_dokploy_api = require('./dokploy-api-Dvyq-LsM.cjs');
|
|
10
10
|
const require_encryption = require('./encryption-DgKS-Dv9.cjs');
|
|
11
11
|
const require_CachedStateProvider = require('./CachedStateProvider-CxsXOKkg.cjs');
|
|
@@ -35,7 +35,7 @@ const prompts = require_chunk.__toESM(require("prompts"));
|
|
|
35
35
|
|
|
36
36
|
//#region package.json
|
|
37
37
|
var name = "@geekmidas/cli";
|
|
38
|
-
var version = "1.10.
|
|
38
|
+
var version = "1.10.27";
|
|
39
39
|
var description = "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs";
|
|
40
40
|
var private$1 = false;
|
|
41
41
|
var type = "module";
|
|
@@ -1558,11 +1558,6 @@ async function workspaceDevCommand(workspace, options) {
|
|
|
1558
1558
|
if (hasErrors) throw new Error("Frontend app validation failed. Fix the issues above and try again.");
|
|
1559
1559
|
logger$11.log("✅ Frontend apps validated");
|
|
1560
1560
|
}
|
|
1561
|
-
if (frontendApps.length > 0 && backendApps.length > 0) {
|
|
1562
|
-
const clientResults = await require_openapi.copyAllClients(workspace);
|
|
1563
|
-
const copiedCount = clientResults.filter((r) => r.success).length;
|
|
1564
|
-
if (copiedCount > 0) logger$11.log(`\n📦 Copied ${copiedCount} API client(s)`);
|
|
1565
|
-
}
|
|
1566
1561
|
const resolvedPorts = await resolveServicePorts(workspace.root);
|
|
1567
1562
|
const rawSecrets = await loadDevSecrets(workspace);
|
|
1568
1563
|
await startWorkspaceServices(workspace, resolvedPorts.dockerEnv, rawSecrets);
|
|
@@ -1625,50 +1620,11 @@ async function workspaceDevCommand(workspace, options) {
|
|
|
1625
1620
|
env: turboEnv,
|
|
1626
1621
|
detached: true
|
|
1627
1622
|
});
|
|
1628
|
-
let openApiWatcher = null;
|
|
1629
|
-
if (frontendApps.length > 0 && backendApps.length > 0) {
|
|
1630
|
-
const openApiPaths = [];
|
|
1631
|
-
for (const [appName] of backendApps) {
|
|
1632
|
-
const openApiPath = require_openapi.getBackendOpenApiPath(workspace, appName);
|
|
1633
|
-
if (openApiPath) openApiPaths.push({
|
|
1634
|
-
path: openApiPath,
|
|
1635
|
-
appName
|
|
1636
|
-
});
|
|
1637
|
-
}
|
|
1638
|
-
if (openApiPaths.length > 0) {
|
|
1639
|
-
logger$11.log(`\n👀 Watching ${openApiPaths.length} backend OpenAPI spec(s) for changes`);
|
|
1640
|
-
const pathToApp = new Map(openApiPaths.map((p) => [p.path, p.appName]));
|
|
1641
|
-
openApiWatcher = chokidar.default.watch(openApiPaths.map((p) => p.path), {
|
|
1642
|
-
persistent: true,
|
|
1643
|
-
ignoreInitial: true,
|
|
1644
|
-
depth: 0
|
|
1645
|
-
});
|
|
1646
|
-
let copyTimeout = null;
|
|
1647
|
-
const handleChange = async (changedPath) => {
|
|
1648
|
-
if (copyTimeout) clearTimeout(copyTimeout);
|
|
1649
|
-
copyTimeout = setTimeout(async () => {
|
|
1650
|
-
const backendAppName = pathToApp.get(changedPath);
|
|
1651
|
-
if (!backendAppName) return;
|
|
1652
|
-
logger$11.log(`\n🔄 OpenAPI spec changed for ${backendAppName}`);
|
|
1653
|
-
try {
|
|
1654
|
-
const results = await require_openapi.copyClientToFrontends(workspace, backendAppName, { silent: true });
|
|
1655
|
-
for (const result of results) if (result.success) logger$11.log(` 📦 Copied client to ${result.frontendApp} (${result.endpointCount} endpoints)`);
|
|
1656
|
-
else if (result.error) logger$11.error(` ❌ Failed to copy client to ${result.frontendApp}: ${result.error}`);
|
|
1657
|
-
} catch (error) {
|
|
1658
|
-
logger$11.error(` ❌ Failed to copy clients: ${error.message}`);
|
|
1659
|
-
}
|
|
1660
|
-
}, 200);
|
|
1661
|
-
};
|
|
1662
|
-
openApiWatcher.on("change", handleChange);
|
|
1663
|
-
openApiWatcher.on("add", handleChange);
|
|
1664
|
-
}
|
|
1665
|
-
}
|
|
1666
1623
|
let isShuttingDown = false;
|
|
1667
1624
|
const shutdown = () => {
|
|
1668
1625
|
if (isShuttingDown) return;
|
|
1669
1626
|
isShuttingDown = true;
|
|
1670
1627
|
logger$11.log("\n🛑 Shutting down workspace...");
|
|
1671
|
-
if (openApiWatcher) openApiWatcher.close().catch(() => {});
|
|
1672
1628
|
const pid = turboProcess.pid;
|
|
1673
1629
|
if (pid) try {
|
|
1674
1630
|
process.kill(-pid, "SIGTERM");
|
|
@@ -1696,7 +1652,6 @@ async function workspaceDevCommand(workspace, options) {
|
|
|
1696
1652
|
reject(error);
|
|
1697
1653
|
});
|
|
1698
1654
|
turboProcess.on("exit", (code) => {
|
|
1699
|
-
if (openApiWatcher) openApiWatcher.close().catch(() => {});
|
|
1700
1655
|
if (code !== null && code !== 0) reject(new Error(`Turbo exited with code ${code}`));
|
|
1701
1656
|
else resolve$4();
|
|
1702
1657
|
});
|
|
@@ -8104,9 +8059,6 @@ export default defineWorkspace({
|
|
|
8104
8059
|
client: './src/config/client.ts',
|
|
8105
8060
|
server: './src/config/server.ts',
|
|
8106
8061
|
},
|
|
8107
|
-
client: {
|
|
8108
|
-
output: './src/api',
|
|
8109
|
-
},
|
|
8110
8062
|
},
|
|
8111
8063
|
},
|
|
8112
8064
|
shared: {
|
|
@@ -9179,10 +9131,7 @@ function generatePackageJson(options, template) {
|
|
|
9179
9131
|
version: "0.0.1",
|
|
9180
9132
|
private: true,
|
|
9181
9133
|
type: "module",
|
|
9182
|
-
exports: { "./client":
|
|
9183
|
-
types: OPENAPI_OUTPUT_PATH$1,
|
|
9184
|
-
import: OPENAPI_OUTPUT_PATH$1
|
|
9185
|
-
} },
|
|
9134
|
+
exports: { "./client": OPENAPI_OUTPUT_PATH$1 },
|
|
9186
9135
|
scripts: scripts$1,
|
|
9187
9136
|
dependencies: sortObject(dependencies$1),
|
|
9188
9137
|
devDependencies: sortObject(devDependencies$1)
|
|
@@ -10736,6 +10685,7 @@ storybook-static/
|
|
|
10736
10685
|
function generateWebAppFiles(options) {
|
|
10737
10686
|
if (!options.monorepo || options.template !== "fullstack") return [];
|
|
10738
10687
|
const packageName = `@${options.name}/web`;
|
|
10688
|
+
const apiPackage = `@${options.name}/api`;
|
|
10739
10689
|
const modelsPackage = `@${options.name}/models`;
|
|
10740
10690
|
const uiPackage = `@${options.name}/ui`;
|
|
10741
10691
|
const packageJson = {
|
|
@@ -10750,6 +10700,7 @@ function generateWebAppFiles(options) {
|
|
|
10750
10700
|
typecheck: "tsc --noEmit"
|
|
10751
10701
|
},
|
|
10752
10702
|
dependencies: {
|
|
10703
|
+
[apiPackage]: "workspace:*",
|
|
10753
10704
|
[modelsPackage]: "workspace:*",
|
|
10754
10705
|
[uiPackage]: "workspace:*",
|
|
10755
10706
|
"@geekmidas/client": GEEKMIDAS_VERSIONS["@geekmidas/client"],
|
|
@@ -10776,7 +10727,7 @@ function generateWebAppFiles(options) {
|
|
|
10776
10727
|
const nextConfig: NextConfig = {
|
|
10777
10728
|
output: 'standalone',
|
|
10778
10729
|
reactStrictMode: true,
|
|
10779
|
-
transpilePackages: ['${modelsPackage}', '${uiPackage}'],
|
|
10730
|
+
transpilePackages: ['${apiPackage}', '${modelsPackage}', '${uiPackage}'],
|
|
10780
10731
|
};
|
|
10781
10732
|
|
|
10782
10733
|
export default nextConfig;
|
|
@@ -10811,6 +10762,7 @@ export default nextConfig;
|
|
|
10811
10762
|
baseUrl: ".",
|
|
10812
10763
|
paths: {
|
|
10813
10764
|
"~/*": ["./src/*", "../../packages/ui/src/*"],
|
|
10765
|
+
[`${apiPackage}/client`]: ["../../apps/api/.gkm/openapi.ts"],
|
|
10814
10766
|
[`${modelsPackage}`]: ["../../packages/models/src"],
|
|
10815
10767
|
[`${modelsPackage}/*`]: ["../../packages/models/src/*"],
|
|
10816
10768
|
[`${uiPackage}`]: ["../../packages/ui/src"],
|
|
@@ -10824,7 +10776,11 @@ export default nextConfig;
|
|
|
10824
10776
|
".next/types/**/*.ts"
|
|
10825
10777
|
],
|
|
10826
10778
|
exclude: ["node_modules"],
|
|
10827
|
-
references: [
|
|
10779
|
+
references: [
|
|
10780
|
+
{ path: "../../apps/api" },
|
|
10781
|
+
{ path: "../../packages/ui" },
|
|
10782
|
+
{ path: "../../packages/models" }
|
|
10783
|
+
]
|
|
10828
10784
|
};
|
|
10829
10785
|
const queryClientTs = `import { QueryClient } from '@tanstack/react-query';
|
|
10830
10786
|
|
|
@@ -10903,7 +10859,7 @@ export function Providers({ children }: { children: React.ReactNode }) {
|
|
|
10903
10859
|
);
|
|
10904
10860
|
}
|
|
10905
10861
|
`;
|
|
10906
|
-
const apiIndexTs = `import { createApi } from '
|
|
10862
|
+
const apiIndexTs = `import { createApi } from '${apiPackage}/client';
|
|
10907
10863
|
import { getQueryClient } from '~/lib/query-client.ts';
|
|
10908
10864
|
import { clientConfig } from '~/config/client.ts';
|
|
10909
10865
|
|