@tixyel/cli 1.0.0 → 2.0.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/README.md +31 -31
- package/dist/index.d.ts +1 -1
- package/dist/index.js +188 -33
- package/dist/templates/workspace.d.ts +1 -0
- package/dist/templates/workspace.js +111 -0
- package/dist/widget.d.ts +31 -0
- package/dist/widget.js +499 -0
- package/dist/workspace.d.ts +111 -0
- package/dist/workspace.js +225 -0
- package/package.json +70 -62
- package/dist/commands/base.d.ts +0 -24
- package/dist/commands/base.js +0 -15
- package/dist/commands/build.d.ts +0 -15
- package/dist/commands/build.js +0 -155
- package/dist/commands/generate-new.d.ts +0 -11
- package/dist/commands/generate-new.js +0 -146
- package/dist/commands/generate.d.ts +0 -11
- package/dist/commands/generate.js +0 -198
- package/dist/commands/init.d.ts +0 -9
- package/dist/commands/init.js +0 -140
- package/dist/types/tixyel-cli-config.d.ts +0 -149
- package/dist/types/tixyel-cli-config.js +0 -162
- package/dist/types/tixyel-config.d.ts +0 -83
- package/dist/types/tixyel-config.js +0 -43
- package/dist/utils/build-processor.d.ts +0 -12
- package/dist/utils/build-processor.js +0 -156
- package/dist/utils/config.d.ts +0 -23
- package/dist/utils/config.js +0 -34
- package/dist/utils/find-widgets.d.ts +0 -19
- package/dist/utils/find-widgets.js +0 -35
- package/dist/utils/load-cli-config.d.ts +0 -5
- package/dist/utils/load-cli-config.js +0 -66
- package/dist/utils/version.d.ts +0 -12
- package/dist/utils/version.js +0 -49
- package/dist/utils/workspace.d.ts +0 -13
- package/dist/utils/workspace.js +0 -43
package/dist/utils/version.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { readFile, writeFile } from 'fs/promises';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import { parse } from 'jsonc-parser';
|
|
4
|
-
/**
|
|
5
|
-
* Bumps the version of a widget configuration
|
|
6
|
-
*/
|
|
7
|
-
export async function bumpWidgetVersion(widgetPath, bumpType = 'patch') {
|
|
8
|
-
try {
|
|
9
|
-
const configPath = join(widgetPath, '.tixyel');
|
|
10
|
-
const content = await readFile(configPath, 'utf-8');
|
|
11
|
-
const config = parse(content);
|
|
12
|
-
if (!config.version) {
|
|
13
|
-
config.version = '0.0.0';
|
|
14
|
-
}
|
|
15
|
-
// Parse current version
|
|
16
|
-
const [major, minor, patch] = config.version.split('.').map(Number);
|
|
17
|
-
// Calculate new version
|
|
18
|
-
let newVersion;
|
|
19
|
-
switch (bumpType) {
|
|
20
|
-
case 'major':
|
|
21
|
-
newVersion = `${major + 1}.0.0`;
|
|
22
|
-
break;
|
|
23
|
-
case 'minor':
|
|
24
|
-
newVersion = `${major}.${minor + 1}.0`;
|
|
25
|
-
break;
|
|
26
|
-
case 'patch':
|
|
27
|
-
default:
|
|
28
|
-
newVersion = `${major}.${minor}.${patch + 1}`;
|
|
29
|
-
break;
|
|
30
|
-
}
|
|
31
|
-
// Update config
|
|
32
|
-
config.version = newVersion;
|
|
33
|
-
// Write back to file (JSON format)
|
|
34
|
-
const formattedContent = JSON.stringify(config, null, 2);
|
|
35
|
-
await writeFile(configPath, formattedContent, 'utf-8');
|
|
36
|
-
return newVersion;
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
console.error(`Failed to bump version in ${widgetPath}:`, error);
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Prompts user to select version bump type
|
|
45
|
-
*/
|
|
46
|
-
export async function promptVersionBump() {
|
|
47
|
-
// This will be used with inquirer in the build command
|
|
48
|
-
return 'patch'; // Default, will be replaced with prompt
|
|
49
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Finds the workspace root by searching for tixyel.config.ts or tixyel.config.js
|
|
3
|
-
* Searches upwards from the current directory
|
|
4
|
-
*/
|
|
5
|
-
export declare function findWorkspaceRoot(startPath?: string): Promise<string | null>;
|
|
6
|
-
/**
|
|
7
|
-
* Gets the relative path from a widget directory to the workspace root config
|
|
8
|
-
*/
|
|
9
|
-
export declare function getConfigPathFromWidget(widgetPath: string, workspaceRoot: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Validates that workspace is initialized
|
|
12
|
-
*/
|
|
13
|
-
export declare function validateWorkspaceInit(): Promise<string>;
|
package/dist/utils/workspace.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { resolve, relative } from 'path';
|
|
2
|
-
import { existsSync } from 'fs';
|
|
3
|
-
/**
|
|
4
|
-
* Finds the workspace root by searching for tixyel.config.ts or tixyel.config.js
|
|
5
|
-
* Searches upwards from the current directory
|
|
6
|
-
*/
|
|
7
|
-
export async function findWorkspaceRoot(startPath = process.cwd()) {
|
|
8
|
-
let currentPath = resolve(startPath);
|
|
9
|
-
// Limit search to 10 levels up to avoid infinite loops
|
|
10
|
-
for (let i = 0; i < 10; i++) {
|
|
11
|
-
const configTs = resolve(currentPath, 'tixyel.config.ts');
|
|
12
|
-
const configJs = resolve(currentPath, 'tixyel.config.js');
|
|
13
|
-
if (existsSync(configTs) || existsSync(configJs)) {
|
|
14
|
-
return currentPath;
|
|
15
|
-
}
|
|
16
|
-
const parentPath = resolve(currentPath, '..');
|
|
17
|
-
if (parentPath === currentPath) {
|
|
18
|
-
// Reached filesystem root
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
21
|
-
currentPath = parentPath;
|
|
22
|
-
}
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Gets the relative path from a widget directory to the workspace root config
|
|
27
|
-
*/
|
|
28
|
-
export function getConfigPathFromWidget(widgetPath, workspaceRoot) {
|
|
29
|
-
const relPath = relative(widgetPath, resolve(workspaceRoot, 'tixyel.config.ts'));
|
|
30
|
-
// Normalize path separators and ensure it starts with ./
|
|
31
|
-
const normalized = relPath.replace(/\\/g, '/');
|
|
32
|
-
return normalized.startsWith('.') ? normalized : `./${normalized}`;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Validates that workspace is initialized
|
|
36
|
-
*/
|
|
37
|
-
export async function validateWorkspaceInit() {
|
|
38
|
-
const workspaceRoot = await findWorkspaceRoot();
|
|
39
|
-
if (!workspaceRoot) {
|
|
40
|
-
throw new Error('❌ Workspace not initialized. Run `tixyel init` in your workspace root first.');
|
|
41
|
-
}
|
|
42
|
-
return workspaceRoot;
|
|
43
|
-
}
|