@frontmcp/nx 1.0.0-beta.6 → 1.0.0-beta.7
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.
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
version: '3.8'
|
|
2
|
-
|
|
3
1
|
services:
|
|
4
2
|
app:
|
|
5
3
|
build:
|
|
6
4
|
context: ../..
|
|
7
5
|
dockerfile: <%= projectRoot %>/Dockerfile
|
|
8
6
|
ports:
|
|
9
|
-
- '3000:3000'
|
|
7
|
+
- '${PORT:-3000}:3000'
|
|
10
8
|
environment:
|
|
11
|
-
- NODE_ENV
|
|
9
|
+
- NODE_ENV=${NODE_ENV:-production}
|
|
10
|
+
- PORT=${PORT:-3000}
|
|
12
11
|
<% if (redis === 'docker') { %>
|
|
13
12
|
- REDIS_HOST=redis
|
|
14
13
|
- REDIS_PORT=6379
|
|
@@ -20,9 +19,19 @@ services:
|
|
|
20
19
|
image: redis:7-alpine
|
|
21
20
|
ports:
|
|
22
21
|
- '6379:6379'
|
|
22
|
+
volumes:
|
|
23
|
+
- redis-data:/data
|
|
24
|
+
command: redis-server --appendonly yes
|
|
23
25
|
healthcheck:
|
|
24
26
|
test: ['CMD', 'redis-cli', 'ping']
|
|
25
|
-
interval:
|
|
27
|
+
interval: 3s
|
|
26
28
|
timeout: 5s
|
|
27
29
|
retries: 3
|
|
30
|
+
|
|
31
|
+
volumes:
|
|
32
|
+
redis-data:
|
|
28
33
|
<% } %>
|
|
34
|
+
|
|
35
|
+
# Selective rebuild:
|
|
36
|
+
# docker compose up --build app # rebuild only the app
|
|
37
|
+
# docker compose up --build # rebuild everything
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.workspaceGenerator = workspaceGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
5
6
|
const path_1 = require("path");
|
|
6
7
|
const index_js_1 = require("./lib/index.js");
|
|
7
8
|
const versions_js_1 = require("../../utils/versions.js");
|
|
@@ -35,13 +36,31 @@ async function workspaceGeneratorInternal(tree, schema) {
|
|
|
35
36
|
}
|
|
36
37
|
await (0, devkit_1.formatFiles)(tree);
|
|
37
38
|
if (options.skipInstall) {
|
|
39
|
+
if (!options.skipGit) {
|
|
40
|
+
return () => {
|
|
41
|
+
initGitRepository(options.workspaceRoot);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
38
44
|
return () => {
|
|
39
45
|
/* noop */
|
|
40
46
|
};
|
|
41
47
|
}
|
|
42
48
|
return () => {
|
|
43
49
|
(0, devkit_1.installPackagesTask)(tree);
|
|
50
|
+
if (!options.skipGit) {
|
|
51
|
+
initGitRepository(options.workspaceRoot);
|
|
52
|
+
}
|
|
44
53
|
};
|
|
45
54
|
}
|
|
55
|
+
function initGitRepository(workspaceRoot) {
|
|
56
|
+
try {
|
|
57
|
+
(0, child_process_1.execSync)('git init', { cwd: workspaceRoot, stdio: 'ignore' });
|
|
58
|
+
(0, child_process_1.execSync)('git add -A', { cwd: workspaceRoot, stdio: 'ignore' });
|
|
59
|
+
(0, child_process_1.execSync)('git commit -m "Initial commit"', { cwd: workspaceRoot, stdio: 'ignore' });
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// git may not be installed — silently skip
|
|
63
|
+
}
|
|
64
|
+
}
|
|
46
65
|
exports.default = workspaceGenerator;
|
|
47
66
|
//# sourceMappingURL=workspace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../src/generators/workspace/workspace.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../src/generators/workspace/workspace.ts"],"names":[],"mappings":";;AAOA,gDAEC;AATD,uCAAgH;AAChH,iDAAyC;AACzC,+BAA4B;AAE5B,6CAAkD;AAClD,yDAA6D;AAEtD,KAAK,UAA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SACjB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAExB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACrB,OAAO,GAAG,EAAE;gBACV,iBAAiB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;YAC3C,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,EAAE;YACV,UAAU;QACZ,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACrB,iBAAiB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,aAAqB;IAC9C,IAAI,CAAC;QACH,IAAA,wBAAQ,EAAC,UAAU,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC9D,IAAA,wBAAQ,EAAC,YAAY,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAChE,IAAA,wBAAQ,EAAC,gCAAgC,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtF,CAAC;IAAC,MAAM,CAAC;QACP,2CAA2C;IAC7C,CAAC;AACH,CAAC;AAED,kBAAe,kBAAkB,CAAC","sourcesContent":["import { type Tree, formatFiles, generateFiles, installPackagesTask, type GeneratorCallback } from '@nx/devkit';\nimport { execSync } from 'child_process';\nimport { join } from 'path';\nimport type { WorkspaceGeneratorSchema } from './schema.js';\nimport { normalizeOptions } from './lib/index.js';\nimport { getFrontmcpVersion } from '../../utils/versions.js';\n\nexport async function workspaceGenerator(tree: Tree, schema: WorkspaceGeneratorSchema): Promise<GeneratorCallback> {\n return workspaceGeneratorInternal(tree, schema);\n}\n\nasync function workspaceGeneratorInternal(tree: Tree, schema: WorkspaceGeneratorSchema): Promise<GeneratorCallback> {\n const options = normalizeOptions(schema);\n const frontmcpVersion = `~${getFrontmcpVersion()}`;\n const nxVersion = '22.3.3';\n\n generateFiles(tree, join(__dirname, 'files'), options.workspaceRoot, {\n ...options,\n frontmcpVersion,\n nxVersion,\n tmpl: '',\n dot: '.',\n });\n\n // Create empty directories\n tree.write(join(options.workspaceRoot, 'apps', '.gitkeep'), '');\n tree.write(join(options.workspaceRoot, 'libs', '.gitkeep'), '');\n tree.write(join(options.workspaceRoot, 'servers', '.gitkeep'), '');\n\n // Compose with app generator when createSampleApp is true\n if (options.createSampleApp) {\n const { appGenerator } = await import('../app/app.js');\n await appGenerator(tree, {\n name: 'demo',\n directory: join(options.workspaceRoot, 'apps', 'demo'),\n tags: 'scope:apps',\n skipFormat: true,\n });\n }\n\n await formatFiles(tree);\n\n if (options.skipInstall) {\n if (!options.skipGit) {\n return () => {\n initGitRepository(options.workspaceRoot);\n };\n }\n return () => {\n /* noop */\n };\n }\n\n return () => {\n installPackagesTask(tree);\n if (!options.skipGit) {\n initGitRepository(options.workspaceRoot);\n }\n };\n}\n\nfunction initGitRepository(workspaceRoot: string): void {\n try {\n execSync('git init', { cwd: workspaceRoot, stdio: 'ignore' });\n execSync('git add -A', { cwd: workspaceRoot, stdio: 'ignore' });\n execSync('git commit -m \"Initial commit\"', { cwd: workspaceRoot, stdio: 'ignore' });\n } catch {\n // git may not be installed — silently skip\n }\n}\n\nexport default workspaceGenerator;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/nx",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.7",
|
|
4
4
|
"description": "Nx plugin for FrontMCP — generators and executors for building MCP servers",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"homepage": "https://docs.agentfront.dev",
|