sb-mig 5.5.4-beta.1 → 5.6.0-beta.2
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 +20 -19
- package/dist/api/assets/assets.js +1 -14
- package/dist/api/components/components.js +2 -1
- package/dist/api/components/components.sync.d.ts +8 -0
- package/dist/api/components/components.sync.js +193 -0
- package/dist/api/data-migration/component-data-migration.d.ts +6 -2
- package/dist/api/data-migration/component-data-migration.js +35 -11
- package/dist/api/datasources/datasource-entries.js +4 -5
- package/dist/api/datasources/datasources.d.ts +5 -2
- package/dist/api/datasources/datasources.js +42 -35
- package/dist/api/datasources/datasources.sync.d.ts +2 -0
- package/dist/api/datasources/datasources.sync.js +11 -0
- package/dist/api/datasources/datasources.types.d.ts +1 -1
- package/dist/api/datasources/index.d.ts +2 -1
- package/dist/api/datasources/index.js +2 -1
- package/dist/api/managementApi.d.ts +2 -2
- package/dist/api/migrate.d.ts +1 -1
- package/dist/api/migrate.js +3 -48
- package/dist/api/plugins/index.d.ts +2 -1
- package/dist/api/plugins/index.js +2 -1
- package/dist/api/plugins/plugins.d.ts +7 -2
- package/dist/api/plugins/plugins.js +28 -15
- package/dist/api/plugins/plugins.sync.d.ts +2 -0
- package/dist/api/plugins/plugins.sync.js +11 -0
- package/dist/api/roles/index.d.ts +2 -1
- package/dist/api/roles/index.js +2 -1
- package/dist/api/roles/roles.d.ts +5 -2
- package/dist/api/roles/roles.js +34 -11
- package/dist/api/roles/roles.sync.d.ts +2 -0
- package/dist/api/roles/roles.sync.js +6 -0
- package/dist/api/roles/roles.types.d.ts +1 -1
- package/dist/api/stories/stories.js +5 -13
- package/dist/api/sync/sync.types.d.ts +30 -0
- package/dist/api/sync/sync.types.js +1 -0
- package/dist/api/testApi.d.ts +2 -2
- package/dist/api/utils/helper-functions.d.ts +5 -1
- package/dist/api/utils/helper-functions.js +6 -1
- package/dist/api/utils/request.d.ts +1 -1
- package/dist/api/utils/request.js +11 -2
- package/dist/api/utils/resolverTransformations.js +2 -57
- package/dist/api-v2/assets/index.d.ts +13 -0
- package/dist/api-v2/assets/index.js +25 -0
- package/dist/api-v2/auth/index.d.ts +3 -0
- package/dist/api-v2/auth/index.js +8 -0
- package/dist/api-v2/client.d.ts +13 -0
- package/dist/api-v2/client.js +17 -0
- package/dist/api-v2/components/index.d.ts +10 -0
- package/dist/api-v2/components/index.js +29 -0
- package/dist/api-v2/datasources/index.d.ts +8 -0
- package/dist/api-v2/datasources/index.js +58 -0
- package/dist/api-v2/discover/discover.d.ts +36 -0
- package/dist/api-v2/discover/discover.js +281 -0
- package/dist/api-v2/discover/index.d.ts +2 -0
- package/dist/api-v2/discover/index.js +1 -0
- package/dist/api-v2/index.d.ts +19 -0
- package/dist/api-v2/index.js +21 -0
- package/dist/api-v2/plugins/index.d.ts +9 -0
- package/dist/api-v2/plugins/index.js +42 -0
- package/dist/api-v2/precompile/index.d.ts +2 -0
- package/dist/api-v2/precompile/index.js +1 -0
- package/dist/api-v2/precompile/precompile.d.ts +65 -0
- package/dist/api-v2/precompile/precompile.js +127 -0
- package/dist/api-v2/presets/index.d.ts +13 -0
- package/dist/api-v2/presets/index.js +25 -0
- package/dist/api-v2/requestConfig.d.ts +5 -0
- package/dist/api-v2/requestConfig.js +34 -0
- package/dist/api-v2/roles/index.d.ts +5 -0
- package/dist/api-v2/roles/index.js +35 -0
- package/dist/api-v2/spaces/index.d.ts +7 -0
- package/dist/api-v2/spaces/index.js +11 -0
- package/dist/api-v2/stories/index.d.ts +34 -0
- package/dist/api-v2/stories/index.js +172 -0
- package/dist/api-v2/stories/types.d.ts +28 -0
- package/dist/api-v2/stories/types.js +1 -0
- package/dist/api-v2/sync/index.d.ts +24 -0
- package/dist/api-v2/sync/index.js +109 -0
- package/dist/api-v2/sync/types.d.ts +1 -0
- package/dist/api-v2/sync/types.js +1 -0
- package/dist/api-v2/test.d.ts +15 -0
- package/dist/api-v2/test.js +21 -0
- package/dist/cli/cli-descriptions.d.ts +1 -1
- package/dist/cli/cli-descriptions.js +4 -0
- package/dist/cli/commands/backup.js +7 -3
- package/dist/cli/commands/copy.js +2 -2
- package/dist/cli/commands/migrate.js +13 -2
- package/dist/cli/commands/migrations.js +2 -2
- package/dist/cli/commands/remove.js +1 -1
- package/dist/cli/commands/revert.js +2 -2
- package/dist/cli/commands/sync.js +1 -2
- package/dist/cli/index.js +8 -1
- package/dist/cli/utils/cli-utils.d.ts +69 -0
- package/dist/cli/utils/cli-utils.js +100 -0
- package/dist/cli/utils/discover.d.ts +3 -22
- package/dist/cli/utils/discover.js +4 -51
- package/dist/config/config.d.ts +2 -39
- package/dist/config/config.types.d.ts +40 -0
- package/dist/config/config.types.js +1 -0
- package/dist/config/defaultConfig.d.ts +1 -1
- package/dist/config/defaultConfig.js +2 -2
- package/dist/utils/array-utils.d.ts +20 -0
- package/dist/utils/array-utils.js +20 -0
- package/dist/utils/async-utils.d.ts +13 -0
- package/dist/utils/async-utils.js +13 -0
- package/dist/utils/date-utils.d.ts +14 -0
- package/dist/utils/date-utils.js +21 -0
- package/dist/utils/files.d.ts +35 -0
- package/dist/utils/files.js +57 -2
- package/dist/utils/main.d.ts +8 -18
- package/dist/utils/main.js +12 -104
- package/dist/utils/migrations.d.ts +9 -3
- package/dist/utils/object-utils.d.ts +46 -0
- package/dist/utils/object-utils.js +71 -0
- package/dist/utils/others.d.ts +6 -9
- package/dist/utils/others.js +8 -15
- package/dist/utils/path-utils.d.ts +89 -0
- package/dist/utils/path-utils.js +106 -0
- package/dist/utils/pkg.d.ts +16 -2
- package/dist/utils/pkg.js +16 -3
- package/dist/utils/string-utils.d.ts +33 -0
- package/dist/utils/string-utils.js +45 -0
- package/dist/utils/transform-utils.d.ts +62 -0
- package/dist/utils/transform-utils.js +113 -0
- package/dist-cjs/api/auth/auth.js +28 -0
- package/dist-cjs/api/auth/auth.types.js +2 -0
- package/dist-cjs/api/components/components.js +202 -0
- package/dist-cjs/api/components/components.sync.js +199 -0
- package/dist-cjs/api/components/components.types.js +2 -0
- package/dist-cjs/api/datasources/datasource-entries.js +166 -0
- package/dist-cjs/api/datasources/datasources.js +166 -0
- package/dist-cjs/api/datasources/datasources.types.js +2 -0
- package/dist-cjs/api/plugins/plugins.js +132 -0
- package/dist-cjs/api/plugins/plugins.types.js +2 -0
- package/dist-cjs/api/presets/componentPresets.js +25 -0
- package/dist-cjs/api/presets/presets.js +92 -0
- package/dist-cjs/api/presets/presets.types.js +2 -0
- package/dist-cjs/api/presets/resolvePresets.js +49 -0
- package/dist-cjs/api/roles/roles.js +131 -0
- package/dist-cjs/api/roles/roles.types.js +2 -0
- package/dist-cjs/api/spaces/spaces.js +34 -0
- package/dist-cjs/api/spaces/spaces.types.js +2 -0
- package/dist-cjs/api/stories/stories.js +214 -0
- package/dist-cjs/api/stories/stories.types.js +2 -0
- package/dist-cjs/api/sync/sync.types.js +2 -0
- package/dist-cjs/api/utils/request.js +48 -0
- package/dist-cjs/api/utils/resolvers.types.js +2 -0
- package/dist-cjs/api-v2/assets/index.js +30 -0
- package/dist-cjs/api-v2/auth/index.js +12 -0
- package/dist-cjs/api-v2/client.js +23 -0
- package/dist-cjs/api-v2/components/index.js +40 -0
- package/dist-cjs/api-v2/datasources/index.js +64 -0
- package/dist-cjs/api-v2/discover/discover.js +321 -0
- package/dist-cjs/api-v2/discover/index.js +9 -0
- package/dist-cjs/api-v2/index.js +60 -0
- package/dist-cjs/api-v2/plugins/index.js +49 -0
- package/dist-cjs/api-v2/precompile/index.js +7 -0
- package/dist-cjs/api-v2/precompile/precompile.js +136 -0
- package/dist-cjs/api-v2/presets/index.js +33 -0
- package/dist-cjs/api-v2/requestConfig.js +37 -0
- package/dist-cjs/api-v2/roles/index.js +41 -0
- package/dist-cjs/api-v2/spaces/index.js +16 -0
- package/dist-cjs/api-v2/stories/index.js +180 -0
- package/dist-cjs/api-v2/stories/types.js +2 -0
- package/dist-cjs/api-v2/sync/index.js +115 -0
- package/dist-cjs/api-v2/sync/types.js +2 -0
- package/dist-cjs/api-v2/test.js +25 -0
- package/dist-cjs/config/config.types.js +2 -0
- package/dist-cjs/config/constants.js +29 -0
- package/dist-cjs/package.json +3 -0
- package/dist-cjs/utils/array-utils.js +24 -0
- package/dist-cjs/utils/logger.js +32 -0
- package/dist-cjs/utils/object-utils.js +77 -0
- package/dist-cjs/utils/path-utils.js +115 -0
- package/package.json +37 -20
- package/dist/utils/pkg-require.d.ts +0 -2
- package/dist/utils/pkg-require.js +0 -4
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
7
|
+
class Logger {
|
|
8
|
+
static log(content) {
|
|
9
|
+
console.log(content);
|
|
10
|
+
}
|
|
11
|
+
static success(content) {
|
|
12
|
+
console.log(chalk_1.default.green(`✓ ${content}`));
|
|
13
|
+
}
|
|
14
|
+
static warning(content) {
|
|
15
|
+
console.log(chalk_1.default.yellow(`! ${content}`));
|
|
16
|
+
}
|
|
17
|
+
static error(content, { verbose } = { verbose: false }) {
|
|
18
|
+
if (verbose) {
|
|
19
|
+
console.log(content);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
console.log(chalk_1.default.red(`✘ ${content}`));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
static upload(content) {
|
|
26
|
+
console.log(chalk_1.default.blue(`↑ ${content}`));
|
|
27
|
+
}
|
|
28
|
+
static download(content) {
|
|
29
|
+
console.log(chalk_1.default.yellow(`↓ ${content}`));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = Logger;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* General object utility functions
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.extractFields = exports.isObjectEmpty = exports.notNullish = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Filter out null and undefined values from an object
|
|
9
|
+
* Keeps all properties that have defined values (including falsy values like 0, '', false)
|
|
10
|
+
*
|
|
11
|
+
* @param params - The object to filter
|
|
12
|
+
* @returns A new object with only non-nullish values
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* notNullish({ a: 1, b: null, c: undefined, d: 0 }) // => { a: 1, d: 0 }
|
|
16
|
+
*/
|
|
17
|
+
const notNullish = (params) => {
|
|
18
|
+
return Object.keys(params).reduce((acc, key) => {
|
|
19
|
+
if (params[key] !== null && params[key] !== undefined) {
|
|
20
|
+
acc[key] = params[key];
|
|
21
|
+
}
|
|
22
|
+
return acc;
|
|
23
|
+
}, {});
|
|
24
|
+
};
|
|
25
|
+
exports.notNullish = notNullish;
|
|
26
|
+
/**
|
|
27
|
+
* Check if an object is empty (has no own properties)
|
|
28
|
+
* Returns true for null, undefined, and empty objects {}
|
|
29
|
+
* Returns false for arrays (even empty ones) and objects with properties
|
|
30
|
+
*
|
|
31
|
+
* @param obj - The object to check
|
|
32
|
+
* @returns true if the object is empty, null, or undefined
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* isObjectEmpty({}) // => true
|
|
36
|
+
* isObjectEmpty(null) // => true
|
|
37
|
+
* isObjectEmpty({ name: 'test' }) // => false
|
|
38
|
+
* isObjectEmpty([]) // => false (arrays are not plain objects)
|
|
39
|
+
*/
|
|
40
|
+
const isObjectEmpty = (obj) => {
|
|
41
|
+
if (obj) {
|
|
42
|
+
return Object.keys(obj).length === 0 && obj.constructor === Object;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
exports.isObjectEmpty = isObjectEmpty;
|
|
49
|
+
/**
|
|
50
|
+
* Extract specific fields from an object based on a filter object
|
|
51
|
+
* Supports nested object extraction
|
|
52
|
+
*
|
|
53
|
+
* @param data - The source object to extract fields from
|
|
54
|
+
* @param filter - An object where true means include the field, nested objects for nested extraction
|
|
55
|
+
* @returns A new object containing only the specified fields
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* const data = { name: 'hero', id: 123, schema: { title: 'text' } };
|
|
59
|
+
* extractFields(data, { name: true, id: true }) // => { name: 'hero', id: 123 }
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* // Nested extraction
|
|
63
|
+
* extractFields(data, { schema: { title: true } }) // => { schema: { title: 'text' } }
|
|
64
|
+
*/
|
|
65
|
+
const extractFields = (data, filter) => {
|
|
66
|
+
const result = {};
|
|
67
|
+
for (const key in filter) {
|
|
68
|
+
if (filter[key] === true) {
|
|
69
|
+
result[key] = data[key];
|
|
70
|
+
}
|
|
71
|
+
else if (typeof filter[key] === "object") {
|
|
72
|
+
result[key] = (0, exports.extractFields)(data[key], filter[key]);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return result;
|
|
76
|
+
};
|
|
77
|
+
exports.extractFields = extractFields;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Path and glob pattern utilities for file discovery
|
|
4
|
+
*/
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.compare = exports.filesPattern = exports.normalizeDiscover = void 0;
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
/**
|
|
12
|
+
* Normalizes an array of directory segments for glob pattern usage.
|
|
13
|
+
* Handles the glob.sync quirk where single segments don't need braces,
|
|
14
|
+
* but multiple segments need {segment1,segment2} format.
|
|
15
|
+
*
|
|
16
|
+
* @param segments - Array of directory path segments
|
|
17
|
+
* @returns Normalized string for glob pattern
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* normalizeDiscover({ segments: [] }) // => ""
|
|
21
|
+
* normalizeDiscover({ segments: ["src"] }) // => "src"
|
|
22
|
+
* normalizeDiscover({ segments: ["src", "lib"] }) // => "{src,lib}"
|
|
23
|
+
*/
|
|
24
|
+
const normalizeDiscover = ({ segments, }) => {
|
|
25
|
+
if (segments.length === 0) {
|
|
26
|
+
return "";
|
|
27
|
+
}
|
|
28
|
+
if (segments.length === 1) {
|
|
29
|
+
return segments[0];
|
|
30
|
+
}
|
|
31
|
+
return `{${segments.join(",")}}`;
|
|
32
|
+
};
|
|
33
|
+
exports.normalizeDiscover = normalizeDiscover;
|
|
34
|
+
/**
|
|
35
|
+
* Builds a glob file pattern for discovering files with a specific extension.
|
|
36
|
+
* Automatically handles single vs multiple directory paths.
|
|
37
|
+
*
|
|
38
|
+
* @param mainDirectory - The root directory to search from
|
|
39
|
+
* @param componentDirectories - Array of subdirectories to search in
|
|
40
|
+
* @param ext - File extension to match (without leading dot)
|
|
41
|
+
* @returns A glob pattern string
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* filesPattern({
|
|
45
|
+
* mainDirectory: "/project",
|
|
46
|
+
* componentDirectories: ["src"],
|
|
47
|
+
* ext: "sb.js"
|
|
48
|
+
* })
|
|
49
|
+
* // => "/project/src/**\/[^_]*.sb.js"
|
|
50
|
+
*
|
|
51
|
+
* filesPattern({
|
|
52
|
+
* mainDirectory: "/project",
|
|
53
|
+
* componentDirectories: ["src", "lib"],
|
|
54
|
+
* ext: "sb.js"
|
|
55
|
+
* })
|
|
56
|
+
* // => "/project/{src,lib}/**\/[^_]*.sb.js"
|
|
57
|
+
*/
|
|
58
|
+
const filesPattern = ({ mainDirectory, componentDirectories, ext, }) => {
|
|
59
|
+
return componentDirectories.length === 1
|
|
60
|
+
? path_1.default.join(`${mainDirectory}`, `${componentDirectories[0]}`, "**", `[^_]*.${ext}`)
|
|
61
|
+
: path_1.default.join(`${mainDirectory}`, `{${componentDirectories.join(",")}}`, "**", `[^_]*.${ext}`);
|
|
62
|
+
};
|
|
63
|
+
exports.filesPattern = filesPattern;
|
|
64
|
+
/**
|
|
65
|
+
* Compares local and external file path arrays.
|
|
66
|
+
* Splits paths to extract file names, filters out duplicates from external
|
|
67
|
+
* (preferring local files), and filters out nested node_modules.
|
|
68
|
+
*
|
|
69
|
+
* @param request - Object containing local and external path arrays
|
|
70
|
+
* @returns CompareResult with processed local and external file elements
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* compare({
|
|
74
|
+
* local: ["/project/src/hero.sb.js"],
|
|
75
|
+
* external: ["/project/node_modules/pkg/hero.sb.js", "/project/node_modules/pkg/card.sb.js"]
|
|
76
|
+
* })
|
|
77
|
+
* // => {
|
|
78
|
+
* // local: [{ name: "hero.sb.js", p: "/project/src/hero.sb.js" }],
|
|
79
|
+
* // external: [{ name: "card.sb.js", p: "/project/node_modules/pkg/card.sb.js" }]
|
|
80
|
+
* // }
|
|
81
|
+
*/
|
|
82
|
+
const compare = (request) => {
|
|
83
|
+
const { local, external } = request;
|
|
84
|
+
const splittedLocal = local.map((p) => {
|
|
85
|
+
return {
|
|
86
|
+
name: p.split(path_1.default.sep)[p.split(path_1.default.sep).length - 1], // last element of split array - file name
|
|
87
|
+
p,
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
const splittedExternal = external
|
|
91
|
+
.map((p) => {
|
|
92
|
+
return {
|
|
93
|
+
name: p.split(path_1.default.sep)[p.split(path_1.default.sep).length - 1], // last element of split array - file name
|
|
94
|
+
p,
|
|
95
|
+
};
|
|
96
|
+
})
|
|
97
|
+
.filter((file) => {
|
|
98
|
+
// Filter out files from nested node_modules (node_modules within node_modules)
|
|
99
|
+
const nodeModulesCount = (file.p.match(/node_modules/g) || [])
|
|
100
|
+
.length;
|
|
101
|
+
return nodeModulesCount <= 1;
|
|
102
|
+
});
|
|
103
|
+
// Filter external array to remove items that exist locally (local takes priority)
|
|
104
|
+
const result = {
|
|
105
|
+
local: splittedLocal,
|
|
106
|
+
external: splittedExternal.filter((externalComponent) => {
|
|
107
|
+
if (splittedLocal.find((localComponent) => externalComponent.name === localComponent.name)) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
}),
|
|
112
|
+
};
|
|
113
|
+
return result;
|
|
114
|
+
};
|
|
115
|
+
exports.compare = compare;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sb-mig",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0-beta.2",
|
|
4
4
|
"description": "CLI to rule the world. (and handle stuff related to Storyblok CMS)",
|
|
5
5
|
"author": "Marcin Krawczyk <marckraw@icloud.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
"type": "module",
|
|
26
26
|
"exports": {
|
|
27
27
|
".": "./dist/cli/index.js",
|
|
28
|
+
"./api-v2": {
|
|
29
|
+
"types": "./dist/api-v2/index.d.ts",
|
|
30
|
+
"import": "./dist/api-v2/index.js",
|
|
31
|
+
"require": "./dist-cjs/api-v2/index.js"
|
|
32
|
+
},
|
|
28
33
|
"./dist/*": "./dist/*"
|
|
29
34
|
},
|
|
30
35
|
"engines": {
|
|
@@ -32,30 +37,47 @@
|
|
|
32
37
|
},
|
|
33
38
|
"files": [
|
|
34
39
|
"/dist",
|
|
40
|
+
"/dist-cjs",
|
|
35
41
|
"README.md"
|
|
36
42
|
],
|
|
37
43
|
"scripts": {
|
|
38
44
|
"lint-staged": "node ./src/scripts/fix-esm.js && lint-staged",
|
|
39
|
-
"build": "rm -rf dist && tsc -p tsconfig.json && chmod +x ./dist/cli/index.js",
|
|
40
|
-
"build:dev": "chokidar 'src/**/*.{js,ts,cjs,mjs}' -c '
|
|
41
|
-
"build:dev:yalc": "chokidar 'src/**/*.{js,ts,cjs,mjs}' -c '
|
|
42
|
-
"
|
|
43
|
-
"build:test:dev": "chokidar '__tests__/**/*.ts' -c 'yarn build:test'",
|
|
45
|
+
"build": "rm -rf dist dist-cjs && tsc -p tsconfig.json && tsc -p tsconfig.api-v2.cjs.json && node ./src/scripts/write-cjs-package.js && chmod +x ./dist/cli/index.js",
|
|
46
|
+
"build:dev": "chokidar 'src/**/*.{js,ts,cjs,mjs}' -c 'npm run build'",
|
|
47
|
+
"build:dev:yalc": "chokidar 'src/**/*.{js,ts,cjs,mjs}' -c 'npm run build && yalc push'",
|
|
48
|
+
"lint": "eslint . --max-warnings=0",
|
|
44
49
|
"lint:fix": "eslint --fix",
|
|
45
50
|
"lint:all": "eslint .",
|
|
46
51
|
"lint:fix:all": "eslint . --fix",
|
|
47
52
|
"lint:ts": "cd src && tsc --declaration --emitDeclarationOnly && cd ..",
|
|
48
|
-
"
|
|
49
|
-
"start": "
|
|
50
|
-
"debug": "
|
|
53
|
+
"typecheck": "tsc --noEmit",
|
|
54
|
+
"start": "npm run build && ./dist/cli/index.js",
|
|
55
|
+
"debug": "npm run build && ./dist/cli/index.js sync components accordion accordion-item",
|
|
51
56
|
"semantic-release": "semantic-release",
|
|
52
57
|
"prepare": "husky install",
|
|
53
|
-
"build:yalc": "
|
|
58
|
+
"build:yalc": "npm run build && yalc push",
|
|
59
|
+
"########## Tests ##########": "########################################################",
|
|
60
|
+
"test": "vitest run",
|
|
61
|
+
"test:watch": "vitest",
|
|
62
|
+
"test:coverage": "vitest run --coverage",
|
|
63
|
+
"test:unit": "vitest run --exclude=**/*.live.test.ts --exclude=**/*.e2e.test.ts",
|
|
64
|
+
"test:config": "vitest run __tests__/config",
|
|
65
|
+
"########## API Live Tests ##########": "########################################################",
|
|
66
|
+
"test:api-live": "STORYBLOK_LIVE_TESTS=true vitest run --testTimeout 60000 __tests__/api-live",
|
|
67
|
+
"test:api-live:spaces": "STORYBLOK_LIVE_TESTS=true vitest run --testTimeout 60000 __tests__/api-live/spaces",
|
|
68
|
+
"test:api-live:components": "STORYBLOK_LIVE_TESTS=true vitest run --testTimeout 60000 __tests__/api-live/components",
|
|
69
|
+
"test:api-live:stories": "STORYBLOK_LIVE_TESTS=true vitest run --testTimeout 60000 __tests__/api-live/stories",
|
|
70
|
+
"########## E2E Tests ##########": "########################################################",
|
|
71
|
+
"test:e2e": "STORYBLOK_E2E_TESTS=true vitest run --testTimeout 120000 __tests__/e2e",
|
|
72
|
+
"test:e2e:cli": "STORYBLOK_E2E_TESTS=true vitest run --testTimeout 120000 __tests__/e2e/cli-basic",
|
|
73
|
+
"test:e2e:sync": "STORYBLOK_E2E_TESTS=true vitest run --testTimeout 120000 __tests__/e2e/sync-components",
|
|
74
|
+
"########## All Tests ##########": "########################################################",
|
|
75
|
+
"test:all": "npm run test:unit && npm run test:api-live && npm run test:e2e"
|
|
54
76
|
},
|
|
55
77
|
"dependencies": {
|
|
56
78
|
"@swc/core": "1.3.41",
|
|
57
79
|
"@swc/helpers": "0.4.14",
|
|
58
|
-
"chalk": "^
|
|
80
|
+
"chalk": "^4.1.2",
|
|
59
81
|
"dotenv": "^16.4.5",
|
|
60
82
|
"form-data": "^4.0.0",
|
|
61
83
|
"fs-extra": "^11.2.0",
|
|
@@ -66,7 +88,7 @@
|
|
|
66
88
|
"rollup": "^3.28.0",
|
|
67
89
|
"rollup-plugin-ts": "^3.4.4",
|
|
68
90
|
"semver": "^7.6.2",
|
|
69
|
-
"storyblok-js-client": "
|
|
91
|
+
"storyblok-js-client": "5.12.0",
|
|
70
92
|
"storyblok-schema-types": "^1.2.4",
|
|
71
93
|
"typescript": "^5.1.6",
|
|
72
94
|
"uuid": "^9.0.0"
|
|
@@ -81,30 +103,25 @@
|
|
|
81
103
|
"@semantic-release/git": "^10.0.1",
|
|
82
104
|
"@sindresorhus/tsconfig": "^3.0.1",
|
|
83
105
|
"@storyblok/react": "^3.0.10",
|
|
84
|
-
"@types/chai": "^4.3.10",
|
|
85
106
|
"@types/fs-extra": "^11.0.4",
|
|
86
107
|
"@types/glob": "^8.1.0",
|
|
87
|
-
"@types/mocha": "^10.0.4",
|
|
88
108
|
"@types/ncp": "^2.0.8",
|
|
89
109
|
"@types/node": "18.16.18",
|
|
90
|
-
"@types/sinon": "^10.0.16",
|
|
91
110
|
"@types/uuid": "^9.0.7",
|
|
92
111
|
"@typescript-eslint/eslint-plugin": "^6.4.1",
|
|
93
112
|
"@typescript-eslint/parser": "^6.4.1",
|
|
94
|
-
"
|
|
113
|
+
"@vitest/coverage-v8": "^2.1.0",
|
|
95
114
|
"chokidar-cli": "^3.0.0",
|
|
96
115
|
"eslint": "^8.47.0",
|
|
97
116
|
"eslint-config-prettier": "^9.0.0",
|
|
98
117
|
"eslint-plugin-import": "^2.28.1",
|
|
99
|
-
"esm": "^3.2.25",
|
|
100
118
|
"husky": "^8.0.3",
|
|
101
119
|
"lint-staged": "^13.2.3",
|
|
102
|
-
"mocha": "^10.2.0",
|
|
103
120
|
"prettier": "^3.0.3",
|
|
104
121
|
"semantic-release": "^21.0.9",
|
|
105
122
|
"semantic-release-slack-bot": "^4.0.1",
|
|
106
|
-
"
|
|
107
|
-
"
|
|
123
|
+
"tsc-files": "^1.1.4",
|
|
124
|
+
"vitest": "^2.1.0"
|
|
108
125
|
},
|
|
109
126
|
"config": {
|
|
110
127
|
"commitizen": {
|