@baseplate-dev/project-builder-cli 0.2.3 → 0.2.5
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/diff.js
CHANGED
|
@@ -13,6 +13,7 @@ export function addDiffCommand(program) {
|
|
|
13
13
|
.option('--compact', 'Show compact diff format instead of unified diff')
|
|
14
14
|
.option('--app <apps...>', 'Filter by specific app names')
|
|
15
15
|
.option('--glob <patterns...>', 'Filter files by glob patterns')
|
|
16
|
+
.option('--no-ignore-file', 'Disable .baseplateignore file filtering')
|
|
16
17
|
.action(async (directory, options) => {
|
|
17
18
|
const { diffProject } = await import('@baseplate-dev/project-builder-server');
|
|
18
19
|
const resolvedDirectory = directory
|
|
@@ -28,6 +29,7 @@ export function addDiffCommand(program) {
|
|
|
28
29
|
compact: options.compact ?? false,
|
|
29
30
|
appFilter: options.app,
|
|
30
31
|
globPatterns: options.glob,
|
|
32
|
+
useIgnoreFile: options.ignoreFile ?? true,
|
|
31
33
|
});
|
|
32
34
|
});
|
|
33
35
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
2
|
/**
|
|
3
|
-
* Adds a
|
|
3
|
+
* Adds a sync command to the program.
|
|
4
4
|
* @param program - The program to add the command to.
|
|
5
5
|
*/
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function addSyncCommand(program: Command): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createSchemaParserContext } from '#src/services/schema-parser-context.js';
|
|
2
|
+
import { getUserConfig } from '#src/services/user-config.js';
|
|
3
|
+
import { expandPathWithTilde } from '#src/utils/path.js';
|
|
4
|
+
import { logger } from '../services/logger.js';
|
|
5
|
+
/**
|
|
6
|
+
* Adds a sync command to the program.
|
|
7
|
+
* @param program - The program to add the command to.
|
|
8
|
+
*/
|
|
9
|
+
export function addSyncCommand(program) {
|
|
10
|
+
program
|
|
11
|
+
.command('sync [directory]')
|
|
12
|
+
.description('Syncs project from project-definition.json in baseplate/ directory')
|
|
13
|
+
.option('--force-overwrite', 'Force overwrite existing files without merge conflict detection')
|
|
14
|
+
.action(async (directory, options) => {
|
|
15
|
+
const { syncProject, SyncMetadataController } = await import('@baseplate-dev/project-builder-server');
|
|
16
|
+
const resolvedDirectory = directory
|
|
17
|
+
? expandPathWithTilde(directory)
|
|
18
|
+
: '.';
|
|
19
|
+
const context = await createSchemaParserContext(resolvedDirectory);
|
|
20
|
+
const userConfig = await getUserConfig();
|
|
21
|
+
const syncMetadataController = new SyncMetadataController(resolvedDirectory, logger);
|
|
22
|
+
try {
|
|
23
|
+
await syncProject({
|
|
24
|
+
directory: resolvedDirectory,
|
|
25
|
+
logger,
|
|
26
|
+
context,
|
|
27
|
+
userConfig,
|
|
28
|
+
cliFilePath: process.argv[1],
|
|
29
|
+
syncMetadataController,
|
|
30
|
+
forceOverwrite: options.forceOverwrite ?? false,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
logger.error('Sync failed:', error);
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { program } from 'commander';
|
|
2
|
-
import { addBuildCommand } from './commands/build.js';
|
|
3
2
|
import { addConfigCommand } from './commands/config.js';
|
|
4
3
|
import { addDiffCommand } from './commands/diff.js';
|
|
5
4
|
import { addServeCommand } from './commands/server.js';
|
|
5
|
+
import { addSyncCommand } from './commands/sync.js';
|
|
6
6
|
import { addTemplatesCommand } from './commands/templates.js';
|
|
7
7
|
import { getEnabledFeatureFlags } from './services/feature-flags.js';
|
|
8
8
|
import { getPackageVersion } from './utils/version.js';
|
|
@@ -17,7 +17,7 @@ export async function runCli() {
|
|
|
17
17
|
if (enabledFlags.includes('TEMPLATE_EXTRACTOR')) {
|
|
18
18
|
addTemplatesCommand(program);
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
addSyncCommand(program);
|
|
21
21
|
addDiffCommand(program);
|
|
22
22
|
addServeCommand(program);
|
|
23
23
|
addConfigCommand(program);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baseplate-dev/project-builder-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Full-stack CLI builder using Baseplate generators",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"pino-pretty": "13.0.0",
|
|
46
46
|
"pkg-dir": "^8.0.0",
|
|
47
47
|
"zod": "3.24.1",
|
|
48
|
-
"@baseplate-dev/project-builder-common": "0.2.
|
|
49
|
-
"@baseplate-dev/project-builder-lib": "0.2.
|
|
50
|
-
"@baseplate-dev/project-builder-server": "0.2.
|
|
51
|
-
"@baseplate-dev/project-builder-web": "0.2.
|
|
52
|
-
"@baseplate-dev/utils": "0.2.
|
|
48
|
+
"@baseplate-dev/project-builder-common": "0.2.5",
|
|
49
|
+
"@baseplate-dev/project-builder-lib": "0.2.5",
|
|
50
|
+
"@baseplate-dev/project-builder-server": "0.2.5",
|
|
51
|
+
"@baseplate-dev/project-builder-web": "0.2.5",
|
|
52
|
+
"@baseplate-dev/utils": "0.2.5"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@playwright/test": "1.51.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"tsx": "4.19.3",
|
|
62
62
|
"typescript": "5.7.3",
|
|
63
63
|
"vitest": "3.0.7",
|
|
64
|
-
"@baseplate-dev/tools": "0.2.
|
|
64
|
+
"@baseplate-dev/tools": "0.2.5"
|
|
65
65
|
},
|
|
66
66
|
"engines": {
|
|
67
67
|
"node": "^22.0.0"
|
package/dist/commands/build.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createSchemaParserContext } from '#src/services/schema-parser-context.js';
|
|
2
|
-
import { getUserConfig } from '#src/services/user-config.js';
|
|
3
|
-
import { expandPathWithTilde } from '#src/utils/path.js';
|
|
4
|
-
import { logger } from '../services/logger.js';
|
|
5
|
-
/**
|
|
6
|
-
* Adds a build command to the program.
|
|
7
|
-
* @param program - The program to add the command to.
|
|
8
|
-
*/
|
|
9
|
-
export function addBuildCommand(program) {
|
|
10
|
-
program
|
|
11
|
-
.command('generate [directory]')
|
|
12
|
-
.description('Builds project from project-definition.json in baseplate/ directory')
|
|
13
|
-
.action(async (directory) => {
|
|
14
|
-
const { buildProject, SyncMetadataController } = await import('@baseplate-dev/project-builder-server');
|
|
15
|
-
const resolvedDirectory = directory
|
|
16
|
-
? expandPathWithTilde(directory)
|
|
17
|
-
: '.';
|
|
18
|
-
const context = await createSchemaParserContext(resolvedDirectory);
|
|
19
|
-
const userConfig = await getUserConfig();
|
|
20
|
-
const syncMetadataController = new SyncMetadataController(resolvedDirectory, logger);
|
|
21
|
-
await buildProject({
|
|
22
|
-
directory: resolvedDirectory,
|
|
23
|
-
logger,
|
|
24
|
-
context,
|
|
25
|
-
userConfig,
|
|
26
|
-
cliFilePath: process.argv[1],
|
|
27
|
-
syncMetadataController,
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
}
|