@lumy-pack/syncpoint 0.0.9 → 0.0.11
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/cli.mjs +1329 -456
- package/dist/commands/Link.d.ts +9 -0
- package/dist/commands/Unlink.d.ts +2 -0
- package/dist/core/link.d.ts +19 -0
- package/dist/errors.d.ts +18 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/utils/command-registry.d.ts +1 -0
- package/dist/utils/types.d.ts +15 -0
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface LinkViewProps {
|
|
4
|
+
refPath?: string;
|
|
5
|
+
yes: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const LinkView: React.FC<LinkViewProps>;
|
|
8
|
+
export declare function registerLinkCommand(program: Command): void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { LinkOptions, LinkResult, UnlinkOptions, UnlinkResult } from '../utils/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Move ~/.syncpoint to {destination}/.syncpoint/ and create a symlink.
|
|
4
|
+
* If ~/.syncpoint is already a symlink, unlink and restore before re-linking.
|
|
5
|
+
*/
|
|
6
|
+
export declare function linkSyncpoint(destination: string, _options?: LinkOptions): Promise<LinkResult>;
|
|
7
|
+
/**
|
|
8
|
+
* Create a symlink ~/.syncpoint → <refPath>/.syncpoint.
|
|
9
|
+
* For backwards compatibility, if refPath already points to a .syncpoint directory,
|
|
10
|
+
* it is used as-is.
|
|
11
|
+
* If ~/.syncpoint already exists, the caller must handle confirmation before invoking this.
|
|
12
|
+
*/
|
|
13
|
+
export declare function linkSyncpointByRef(refPath: string): Promise<LinkResult>;
|
|
14
|
+
/**
|
|
15
|
+
* Remove the symlink at ~/.syncpoint and restore its contents by copying
|
|
16
|
+
* from the symlink target back to ~/.syncpoint.
|
|
17
|
+
* With options.clean=true, also removes the destination copy.
|
|
18
|
+
*/
|
|
19
|
+
export declare function unlinkSyncpoint(options?: UnlinkOptions): Promise<UnlinkResult>;
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const SyncpointErrorCode: {
|
|
2
|
+
readonly CONFIG_NOT_FOUND: "CONFIG_NOT_FOUND";
|
|
3
|
+
readonly CONFIG_INVALID: "CONFIG_INVALID";
|
|
4
|
+
readonly BACKUP_FAILED: "BACKUP_FAILED";
|
|
5
|
+
readonly RESTORE_FAILED: "RESTORE_FAILED";
|
|
6
|
+
readonly TEMPLATE_NOT_FOUND: "TEMPLATE_NOT_FOUND";
|
|
7
|
+
readonly PROVISION_FAILED: "PROVISION_FAILED";
|
|
8
|
+
readonly MISSING_ARGUMENT: "MISSING_ARGUMENT";
|
|
9
|
+
readonly INVALID_ARGUMENT: "INVALID_ARGUMENT";
|
|
10
|
+
readonly LINK_FAILED: "LINK_FAILED";
|
|
11
|
+
readonly UNLINK_FAILED: "UNLINK_FAILED";
|
|
12
|
+
readonly UNKNOWN: "UNKNOWN";
|
|
13
|
+
};
|
|
14
|
+
export type SyncpointErrorCode = (typeof SyncpointErrorCode)[keyof typeof SyncpointErrorCode];
|
|
15
|
+
/**
|
|
16
|
+
* Classify an error into a SyncpointErrorCode based on the error message.
|
|
17
|
+
*/
|
|
18
|
+
export declare function classifyError(err: unknown): SyncpointErrorCode;
|
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
package/dist/utils/types.d.ts
CHANGED
|
@@ -144,3 +144,18 @@ export interface InitOptions {
|
|
|
144
144
|
export interface CliOptions {
|
|
145
145
|
verbose?: boolean;
|
|
146
146
|
}
|
|
147
|
+
export interface LinkOptions {
|
|
148
|
+
}
|
|
149
|
+
export interface UnlinkOptions {
|
|
150
|
+
clean?: boolean;
|
|
151
|
+
}
|
|
152
|
+
export interface LinkResult {
|
|
153
|
+
appDir: string;
|
|
154
|
+
targetDir: string;
|
|
155
|
+
wasAlreadyLinked: boolean;
|
|
156
|
+
}
|
|
157
|
+
export interface UnlinkResult {
|
|
158
|
+
appDir: string;
|
|
159
|
+
targetDir: string;
|
|
160
|
+
cleaned: boolean;
|
|
161
|
+
}
|
package/dist/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumy-pack/syncpoint",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "CLI tool for project synchronization and scaffolding",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
"version:patch": "yarn version patch"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@lumy-pack/shared": "0.0.1",
|
|
60
59
|
"ajv": "^8.0.0",
|
|
61
60
|
"ajv-formats": "^3.0.0",
|
|
62
61
|
"commander": "^12.1.0",
|
|
@@ -71,6 +70,7 @@
|
|
|
71
70
|
"yaml": "^2.0.0"
|
|
72
71
|
},
|
|
73
72
|
"devDependencies": {
|
|
73
|
+
"@lumy-pack/shared": "0.0.1",
|
|
74
74
|
"@types/micromatch": "^4.0.9",
|
|
75
75
|
"@types/node": "^20.11.0",
|
|
76
76
|
"@types/react": "^18.0.0",
|