@lumy-pack/syncpoint 0.0.5 → 0.0.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.
- package/README.md +9 -9
- package/assets/config.default.yml +1 -1
- package/assets/template.example.yml +1 -1
- package/dist/cli.mjs +112 -50
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1 -1
- package/dist/utils/types.d.ts +0 -2
- package/dist/version.d.ts +1 -1
- package/package.json +18 -18
package/README.md
CHANGED
|
@@ -31,8 +31,8 @@ Or install globally if you prefer:
|
|
|
31
31
|
# Using npm
|
|
32
32
|
npm install -g @lumy-pack/syncpoint
|
|
33
33
|
|
|
34
|
-
# Using
|
|
35
|
-
|
|
34
|
+
# Using yarn
|
|
35
|
+
yarn global add @lumy-pack/syncpoint
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
## 🚀 Quick Start
|
|
@@ -872,23 +872,23 @@ If restore shows many "overwrite" actions:
|
|
|
872
872
|
|
|
873
873
|
```bash
|
|
874
874
|
# Install dependencies
|
|
875
|
-
|
|
875
|
+
yarn install
|
|
876
876
|
|
|
877
877
|
# Development mode
|
|
878
|
-
|
|
878
|
+
yarn dev
|
|
879
879
|
|
|
880
880
|
# Build
|
|
881
|
-
|
|
881
|
+
yarn build
|
|
882
882
|
|
|
883
883
|
# Run tests
|
|
884
|
-
|
|
884
|
+
yarn test
|
|
885
885
|
|
|
886
886
|
# Run all tests (unit + integration + e2e + docker)
|
|
887
|
-
|
|
887
|
+
yarn test:all
|
|
888
888
|
|
|
889
889
|
# Lint and format
|
|
890
|
-
|
|
891
|
-
|
|
890
|
+
yarn lint
|
|
891
|
+
yarn format
|
|
892
892
|
```
|
|
893
893
|
|
|
894
894
|
### Technology Stack
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
yaml-language-server: $schema=https://cdn.jsdelivr.net/npm/@lumy-pack/syncpoint/assets/schemas/config.schema.json
|
|
1
|
+
# yaml-language-server: $schema=https://cdn.jsdelivr.net/npm/@lumy-pack/syncpoint/assets/schemas/config.schema.json
|
|
2
2
|
# ──────────────────────────────────────────
|
|
3
3
|
# Syncpoint Configuration
|
|
4
4
|
# ──────────────────────────────────────────
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
yaml-language-server: $schema=https://cdn.jsdelivr.net/npm/@lumy-pack/syncpoint/assets/schemas/template.schema.json
|
|
1
|
+
# yaml-language-server: $schema=https://cdn.jsdelivr.net/npm/@lumy-pack/syncpoint/assets/schemas/template.schema.json
|
|
2
2
|
# ──────────────────────────────────────────
|
|
3
3
|
# Syncpoint Provisioning Template
|
|
4
4
|
# ──────────────────────────────────────────
|
package/dist/cli.mjs
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import { Command } from "commander";
|
|
5
5
|
|
|
6
6
|
// src/commands/Backup.tsx
|
|
7
|
-
import { Box, Text as Text2, useApp } from "ink";
|
|
7
|
+
import { Box, Static, Text as Text2, useApp } from "ink";
|
|
8
8
|
import { render } from "ink";
|
|
9
|
-
import { useEffect, useState } from "react";
|
|
9
|
+
import { useEffect, useMemo, useState } from "react";
|
|
10
10
|
|
|
11
11
|
// src/components/ProgressBar.tsx
|
|
12
12
|
import { Text } from "ink";
|
|
@@ -486,7 +486,7 @@ function validateMetadata(data) {
|
|
|
486
486
|
}
|
|
487
487
|
|
|
488
488
|
// src/version.ts
|
|
489
|
-
var VERSION = "0.0.
|
|
489
|
+
var VERSION = "0.0.7";
|
|
490
490
|
|
|
491
491
|
// src/core/metadata.ts
|
|
492
492
|
var METADATA_VERSION = "1.0.0";
|
|
@@ -1201,6 +1201,24 @@ var BackupView = ({ options }) => {
|
|
|
1201
1201
|
const [progress, setProgress] = useState(0);
|
|
1202
1202
|
const [result, setResult] = useState(null);
|
|
1203
1203
|
const [error, setError] = useState(null);
|
|
1204
|
+
const staticItems = useMemo(() => {
|
|
1205
|
+
if (foundFiles.length === 0 && missingFiles.length === 0) return [];
|
|
1206
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1207
|
+
const deduped = [
|
|
1208
|
+
{ id: "scan-header", type: "header" }
|
|
1209
|
+
];
|
|
1210
|
+
for (const f of foundFiles) {
|
|
1211
|
+
if (seen.has(f.absolutePath)) continue;
|
|
1212
|
+
seen.add(f.absolutePath);
|
|
1213
|
+
deduped.push({ id: `found-${f.absolutePath}`, type: "found", file: f });
|
|
1214
|
+
}
|
|
1215
|
+
for (const p of missingFiles) {
|
|
1216
|
+
if (seen.has(p)) continue;
|
|
1217
|
+
seen.add(p);
|
|
1218
|
+
deduped.push({ id: `missing-${p}`, type: "missing", path: p });
|
|
1219
|
+
}
|
|
1220
|
+
return deduped;
|
|
1221
|
+
}, [foundFiles, missingFiles]);
|
|
1204
1222
|
useEffect(() => {
|
|
1205
1223
|
(async () => {
|
|
1206
1224
|
let progressInterval;
|
|
@@ -1243,27 +1261,33 @@ var BackupView = ({ options }) => {
|
|
|
1243
1261
|
] }) });
|
|
1244
1262
|
}
|
|
1245
1263
|
return /* @__PURE__ */ jsxs2(Box, { flexDirection: "column", children: [
|
|
1246
|
-
/* @__PURE__ */ jsx2(
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
"
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
/* @__PURE__ */ jsxs2(Text2, {
|
|
1263
|
-
"
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1264
|
+
/* @__PURE__ */ jsx2(Static, { items: staticItems, children: (item) => {
|
|
1265
|
+
if (item.type === "header") {
|
|
1266
|
+
return /* @__PURE__ */ jsx2(Text2, { bold: true, children: "\u25B8 Scanning backup targets..." }, item.id);
|
|
1267
|
+
}
|
|
1268
|
+
if (item.type === "found") {
|
|
1269
|
+
return /* @__PURE__ */ jsxs2(Text2, { children: [
|
|
1270
|
+
" ",
|
|
1271
|
+
/* @__PURE__ */ jsx2(Text2, { color: "green", children: "\u2713" }),
|
|
1272
|
+
" ",
|
|
1273
|
+
contractTilde(item.file.absolutePath),
|
|
1274
|
+
/* @__PURE__ */ jsxs2(Text2, { color: "gray", children: [
|
|
1275
|
+
" ",
|
|
1276
|
+
formatBytes(item.file.size).padStart(10)
|
|
1277
|
+
] })
|
|
1278
|
+
] }, item.id);
|
|
1279
|
+
}
|
|
1280
|
+
return /* @__PURE__ */ jsxs2(Text2, { children: [
|
|
1281
|
+
" ",
|
|
1282
|
+
/* @__PURE__ */ jsx2(Text2, { color: "yellow", children: "\u26A0" }),
|
|
1283
|
+
" ",
|
|
1284
|
+
item.path,
|
|
1285
|
+
/* @__PURE__ */ jsxs2(Text2, { color: "gray", children: [
|
|
1286
|
+
" ",
|
|
1287
|
+
"File not found, skipped"
|
|
1288
|
+
] })
|
|
1289
|
+
] }, item.id);
|
|
1290
|
+
} }),
|
|
1267
1291
|
options.dryRun && phase === "done" && /* @__PURE__ */ jsxs2(Box, { flexDirection: "column", marginTop: 1, children: [
|
|
1268
1292
|
/* @__PURE__ */ jsx2(Text2, { color: "yellow", children: "(dry-run) No actual backup was created" }),
|
|
1269
1293
|
/* @__PURE__ */ jsxs2(Text2, { children: [
|
|
@@ -3060,7 +3084,7 @@ ${pc2.red("\u2717")} Sudo authentication failed or was cancelled. Aborting.`
|
|
|
3060
3084
|
}
|
|
3061
3085
|
|
|
3062
3086
|
// src/components/StepRunner.tsx
|
|
3063
|
-
import { Text as Text10, Box as Box8 } from "ink";
|
|
3087
|
+
import { Text as Text10, Box as Box8, Static as Static2 } from "ink";
|
|
3064
3088
|
import Spinner2 from "ink-spinner";
|
|
3065
3089
|
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3066
3090
|
var StepIcon = ({ status }) => {
|
|
@@ -3099,35 +3123,73 @@ var StepStatusText = ({ step }) => {
|
|
|
3099
3123
|
return null;
|
|
3100
3124
|
}
|
|
3101
3125
|
};
|
|
3126
|
+
var StepItemView = ({
|
|
3127
|
+
step,
|
|
3128
|
+
index,
|
|
3129
|
+
total,
|
|
3130
|
+
isLast
|
|
3131
|
+
}) => /* @__PURE__ */ jsxs10(Box8, { flexDirection: "column", marginBottom: isLast ? 0 : 1, children: [
|
|
3132
|
+
/* @__PURE__ */ jsxs10(Text10, { children: [
|
|
3133
|
+
" ",
|
|
3134
|
+
/* @__PURE__ */ jsx10(StepIcon, { status: step.status }),
|
|
3135
|
+
/* @__PURE__ */ jsxs10(Text10, { children: [
|
|
3136
|
+
" ",
|
|
3137
|
+
/* @__PURE__ */ jsxs10(Text10, { bold: true, children: [
|
|
3138
|
+
"Step ",
|
|
3139
|
+
index + 1,
|
|
3140
|
+
"/",
|
|
3141
|
+
total
|
|
3142
|
+
] }),
|
|
3143
|
+
" ",
|
|
3144
|
+
step.name
|
|
3145
|
+
] })
|
|
3146
|
+
] }),
|
|
3147
|
+
step.output && step.status !== "pending" && /* @__PURE__ */ jsxs10(Text10, { color: "gray", children: [
|
|
3148
|
+
" ",
|
|
3149
|
+
step.output
|
|
3150
|
+
] }),
|
|
3151
|
+
/* @__PURE__ */ jsxs10(Text10, { children: [
|
|
3152
|
+
" ",
|
|
3153
|
+
/* @__PURE__ */ jsx10(StepStatusText, { step })
|
|
3154
|
+
] })
|
|
3155
|
+
] });
|
|
3102
3156
|
var StepRunner = ({
|
|
3103
3157
|
steps,
|
|
3104
3158
|
total
|
|
3105
3159
|
}) => {
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3160
|
+
const completedSteps = [];
|
|
3161
|
+
const activeSteps = [];
|
|
3162
|
+
steps.forEach((step, idx) => {
|
|
3163
|
+
const indexed = { ...step, idx };
|
|
3164
|
+
if (step.status === "success" || step.status === "failed" || step.status === "skipped") {
|
|
3165
|
+
completedSteps.push(indexed);
|
|
3166
|
+
} else {
|
|
3167
|
+
activeSteps.push(indexed);
|
|
3168
|
+
}
|
|
3169
|
+
});
|
|
3170
|
+
const lastIdx = steps.length - 1;
|
|
3171
|
+
return /* @__PURE__ */ jsxs10(Box8, { flexDirection: "column", children: [
|
|
3172
|
+
/* @__PURE__ */ jsx10(Static2, { items: completedSteps, children: (item) => /* @__PURE__ */ jsx10(
|
|
3173
|
+
StepItemView,
|
|
3174
|
+
{
|
|
3175
|
+
step: item,
|
|
3176
|
+
index: item.idx,
|
|
3177
|
+
total,
|
|
3178
|
+
isLast: item.idx === lastIdx && activeSteps.length === 0
|
|
3179
|
+
},
|
|
3180
|
+
item.idx
|
|
3181
|
+
) }),
|
|
3182
|
+
activeSteps.map((item) => /* @__PURE__ */ jsx10(
|
|
3183
|
+
StepItemView,
|
|
3184
|
+
{
|
|
3185
|
+
step: item,
|
|
3186
|
+
index: item.idx,
|
|
3187
|
+
total,
|
|
3188
|
+
isLast: item.idx === lastIdx
|
|
3189
|
+
},
|
|
3190
|
+
item.idx
|
|
3191
|
+
))
|
|
3192
|
+
] });
|
|
3131
3193
|
};
|
|
3132
3194
|
|
|
3133
3195
|
// src/commands/Provision.tsx
|
package/dist/index.cjs
CHANGED
|
@@ -44,7 +44,7 @@ __export(src_exports, {
|
|
|
44
44
|
});
|
|
45
45
|
module.exports = __toCommonJS(src_exports);
|
|
46
46
|
|
|
47
|
-
// ../../node_modules
|
|
47
|
+
// ../../node_modules/tsup/assets/cjs_shims.js
|
|
48
48
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
49
49
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
50
50
|
|
|
@@ -652,7 +652,7 @@ function validateMetadata(data) {
|
|
|
652
652
|
}
|
|
653
653
|
|
|
654
654
|
// src/version.ts
|
|
655
|
-
var VERSION = "0.0.
|
|
655
|
+
var VERSION = "0.0.7";
|
|
656
656
|
|
|
657
657
|
// src/core/metadata.ts
|
|
658
658
|
var METADATA_VERSION = "1.0.0";
|
package/dist/index.mjs
CHANGED
package/dist/utils/types.d.ts
CHANGED
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.7",
|
|
4
4
|
"description": "CLI tool for project synchronization and scaffolding",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -37,6 +37,23 @@
|
|
|
37
37
|
"assets",
|
|
38
38
|
"README.md"
|
|
39
39
|
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "node scripts/inject-version.js && tsup && yarn build:types",
|
|
42
|
+
"build:publish:npm": "yarn build && yarn publish:npm",
|
|
43
|
+
"build:types": "tsc -p ./tsconfig.declarations.json",
|
|
44
|
+
"dev": "node scripts/inject-version.js && tsx src/cli.ts",
|
|
45
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
46
|
+
"lint": "eslint \"src/**/*.ts\"",
|
|
47
|
+
"publish:npm": "yarn npm publish --access public",
|
|
48
|
+
"test": "vitest",
|
|
49
|
+
"test:all": "vitest run && yarn test:e2e && yarn test:docker",
|
|
50
|
+
"test:docker": "vitest run --config vitest.e2e.config.ts src/__tests__/docker/",
|
|
51
|
+
"test:e2e": "vitest run --config vitest.e2e.config.ts src/__tests__/e2e/",
|
|
52
|
+
"test:run": "vitest run",
|
|
53
|
+
"version:major": "yarn version major",
|
|
54
|
+
"version:minor": "yarn version minor",
|
|
55
|
+
"version:patch": "yarn version patch"
|
|
56
|
+
},
|
|
40
57
|
"dependencies": {
|
|
41
58
|
"ajv": "^8.0.0",
|
|
42
59
|
"ajv-formats": "^3.0.0",
|
|
@@ -57,22 +74,5 @@
|
|
|
57
74
|
"@types/react": "^18.0.0",
|
|
58
75
|
"@vitest/coverage-v8": "^3.2.4",
|
|
59
76
|
"ink-testing-library": "^4.0.0"
|
|
60
|
-
},
|
|
61
|
-
"scripts": {
|
|
62
|
-
"build": "node scripts/inject-version.js && tsup && pnpm build:types",
|
|
63
|
-
"build:publish:npm": "pnpm build && pnpm publish:npm",
|
|
64
|
-
"build:types": "tsc -p ./tsconfig.declarations.json",
|
|
65
|
-
"dev": "node scripts/inject-version.js && tsx src/cli.ts",
|
|
66
|
-
"format": "prettier --write \"src/**/*.ts\"",
|
|
67
|
-
"lint": "eslint \"src/**/*.ts\"",
|
|
68
|
-
"publish:npm": "pnpm publish --access public --no-git-checks",
|
|
69
|
-
"test": "vitest",
|
|
70
|
-
"test:all": "vitest run && pnpm test:e2e && pnpm test:docker",
|
|
71
|
-
"test:docker": "vitest run --config vitest.e2e.config.ts src/__tests__/docker/",
|
|
72
|
-
"test:e2e": "vitest run --config vitest.e2e.config.ts src/__tests__/e2e/",
|
|
73
|
-
"test:run": "vitest run",
|
|
74
|
-
"version:major": "pnpm version major",
|
|
75
|
-
"version:minor": "pnpm version minor",
|
|
76
|
-
"version:patch": "pnpm version patch"
|
|
77
77
|
}
|
|
78
78
|
}
|