@slicemachine/init 2.7.1 → 2.7.2-dev-upgrade-legacy.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/dist/SliceMachineInitProcess.cjs +27 -8
- package/dist/SliceMachineInitProcess.cjs.map +1 -1
- package/dist/SliceMachineInitProcess.d.ts +1 -1
- package/dist/SliceMachineInitProcess.js +27 -8
- package/dist/SliceMachineInitProcess.js.map +1 -1
- package/dist/_node_modules/@babel/code-frame/lib/index.cjs +2 -2
- package/dist/_node_modules/@babel/code-frame/lib/index.js +2 -2
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs +1 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js +1 -1
- package/dist/_node_modules/@babel/highlight/lib/index.cjs +3 -3
- package/dist/_node_modules/@babel/highlight/lib/index.js +3 -3
- package/dist/_node_modules/@nodelib/fs.scandir/out/providers/async.cjs +1 -1
- package/dist/_node_modules/@nodelib/fs.scandir/out/providers/async.js +1 -1
- package/dist/_node_modules/@nodelib/fs.scandir/out/providers/sync.cjs +1 -1
- package/dist/_node_modules/@nodelib/fs.scandir/out/providers/sync.js +1 -1
- package/dist/_node_modules/@nodelib/fs.scandir/out/settings.cjs +1 -1
- package/dist/_node_modules/@nodelib/fs.scandir/out/settings.js +1 -1
- package/dist/_node_modules/@nodelib/fs.stat/out/index.cjs +1 -1
- package/dist/_node_modules/@nodelib/fs.stat/out/index.js +1 -1
- package/dist/_node_modules/@nodelib/fs.walk/out/index.cjs +1 -1
- package/dist/_node_modules/@nodelib/fs.walk/out/index.js +1 -1
- package/dist/_node_modules/cross-spawn/index.cjs +1 -1
- package/dist/_node_modules/cross-spawn/index.js +1 -1
- package/dist/_node_modules/dir-glob/index.cjs +2 -2
- package/dist/_node_modules/dir-glob/index.js +2 -2
- package/dist/_node_modules/fast-glob/out/index.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/index.js +1 -1
- package/dist/_node_modules/fast-glob/out/managers/tasks.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/managers/tasks.js +1 -1
- package/dist/_node_modules/fast-glob/out/providers/filters/deep.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/providers/filters/deep.js +1 -1
- package/dist/_node_modules/fast-glob/out/providers/filters/entry.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/providers/filters/entry.js +1 -1
- package/dist/_node_modules/fast-glob/out/providers/filters/error.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/providers/filters/error.js +1 -1
- package/dist/_node_modules/fast-glob/out/providers/matchers/matcher.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/providers/matchers/matcher.js +1 -1
- package/dist/_node_modules/fast-glob/out/providers/transformers/entry.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/providers/transformers/entry.js +1 -1
- package/dist/_node_modules/fast-glob/out/readers/async.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/readers/async.js +1 -1
- package/dist/_node_modules/fast-glob/out/readers/reader.cjs +2 -2
- package/dist/_node_modules/fast-glob/out/readers/reader.js +2 -2
- package/dist/_node_modules/fast-glob/out/readers/stream.cjs +2 -2
- package/dist/_node_modules/fast-glob/out/readers/stream.js +2 -2
- package/dist/_node_modules/fast-glob/out/readers/sync.cjs +2 -2
- package/dist/_node_modules/fast-glob/out/readers/sync.js +2 -2
- package/dist/_node_modules/fast-glob/out/utils/index.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/utils/index.js +1 -1
- package/dist/_node_modules/get-stream/index.cjs +1 -1
- package/dist/_node_modules/get-stream/index.js +1 -1
- package/dist/_node_modules/js-tokens/index.cjs +1 -1
- package/dist/_node_modules/js-tokens/index.js +1 -1
- package/dist/_node_modules/lines-and-columns/build/index.cjs +1 -1
- package/dist/_node_modules/lines-and-columns/build/index.js +1 -1
- package/dist/_node_modules/map-obj/index.cjs +1 -1
- package/dist/_node_modules/map-obj/index.js +1 -1
- package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/index.cjs +1 -1
- package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/index.js +1 -1
- package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs +1 -1
- package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js +1 -1
- package/dist/_node_modules/parse-json/index.cjs +2 -2
- package/dist/_node_modules/parse-json/index.js +2 -2
- package/dist/_node_modules/path-key/index.cjs +1 -1
- package/dist/_node_modules/path-key/index.js +1 -1
- package/dist/_node_modules/path-type/index.cjs +1 -1
- package/dist/_node_modules/path-type/index.js +1 -1
- package/dist/_node_modules/signal-exit/index.cjs +1 -1
- package/dist/_node_modules/signal-exit/index.js +1 -1
- package/dist/_virtual/index10.cjs +2 -2
- package/dist/_virtual/index10.js +2 -2
- package/dist/_virtual/index11.cjs +2 -2
- package/dist/_virtual/index11.js +2 -2
- package/dist/_virtual/index12.cjs +2 -2
- package/dist/_virtual/index12.js +2 -2
- package/dist/_virtual/index13.cjs +2 -2
- package/dist/_virtual/index13.js +2 -2
- package/dist/_virtual/index14.cjs +2 -2
- package/dist/_virtual/index14.js +2 -2
- package/dist/_virtual/index15.cjs +2 -2
- package/dist/_virtual/index15.js +2 -2
- package/dist/_virtual/index16.cjs +2 -2
- package/dist/_virtual/index16.js +2 -2
- package/dist/_virtual/index17.cjs +2 -2
- package/dist/_virtual/index17.js +2 -2
- package/dist/_virtual/index18.cjs +2 -2
- package/dist/_virtual/index18.js +2 -2
- package/dist/_virtual/index19.cjs +2 -2
- package/dist/_virtual/index19.js +2 -2
- package/dist/_virtual/index3.cjs +2 -2
- package/dist/_virtual/index3.js +2 -2
- package/dist/_virtual/index4.cjs +2 -2
- package/dist/_virtual/index4.js +2 -2
- package/dist/_virtual/index5.cjs +2 -2
- package/dist/_virtual/index5.js +2 -2
- package/dist/_virtual/index6.cjs +2 -2
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.cjs +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/_virtual/index8.cjs +2 -2
- package/dist/_virtual/index8.js +2 -2
- package/dist/_virtual/index9.cjs +2 -2
- package/dist/_virtual/index9.js +2 -2
- package/dist/packages/init/package.json.cjs +4 -4
- package/dist/packages/init/package.json.js +4 -4
- package/package.json +4 -4
- package/src/SliceMachineInitProcess.ts +46 -8
package/dist/_virtual/index6.js
CHANGED
package/dist/_virtual/index7.cjs
CHANGED
package/dist/_virtual/index7.js
CHANGED
package/dist/_virtual/index8.cjs
CHANGED
package/dist/_virtual/index8.js
CHANGED
package/dist/_virtual/index9.cjs
CHANGED
package/dist/_virtual/index9.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const name = "@slicemachine/init";
|
|
4
|
-
const version = "2.7.
|
|
4
|
+
const version = "2.7.2-dev-upgrade-legacy.2";
|
|
5
5
|
const description = "Init Prismic Slice Machine in your project";
|
|
6
6
|
const keywords = [
|
|
7
7
|
"typescript",
|
|
@@ -55,7 +55,7 @@ const dependencies = {
|
|
|
55
55
|
"@antfu/ni": "^0.20.0",
|
|
56
56
|
"@lihbr/listr-update-renderer": "^0.5.3",
|
|
57
57
|
"@sentry/node": "^7.70.0",
|
|
58
|
-
"@slicemachine/manager": "^0.12.
|
|
58
|
+
"@slicemachine/manager": "^0.12.1-dev-upgrade-legacy.2",
|
|
59
59
|
chalk: "^4.1.2",
|
|
60
60
|
giget: "^1.1.2",
|
|
61
61
|
globby: "^13.1.3",
|
|
@@ -68,7 +68,7 @@ const dependencies = {
|
|
|
68
68
|
};
|
|
69
69
|
const devDependencies = {
|
|
70
70
|
"@size-limit/preset-small-lib": "8.2.4",
|
|
71
|
-
"@slicemachine/plugin-kit": "0.4.
|
|
71
|
+
"@slicemachine/plugin-kit": "0.4.19-dev-upgrade-legacy.2",
|
|
72
72
|
"@types/listr": "0.14.4",
|
|
73
73
|
"@types/prompts": "2.4.3",
|
|
74
74
|
"@types/semver": "7.3.13",
|
|
@@ -94,7 +94,7 @@ const devDependencies = {
|
|
|
94
94
|
"vite-plugin-sdk": "0.1.1",
|
|
95
95
|
vitest: "0.32.0"
|
|
96
96
|
};
|
|
97
|
-
const gitHead = "
|
|
97
|
+
const gitHead = "c724ac17e981d2df75c8831afeb36408f108d062";
|
|
98
98
|
const pkg = {
|
|
99
99
|
name,
|
|
100
100
|
version,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const name = "@slicemachine/init";
|
|
2
|
-
const version = "2.7.
|
|
2
|
+
const version = "2.7.2-dev-upgrade-legacy.2";
|
|
3
3
|
const description = "Init Prismic Slice Machine in your project";
|
|
4
4
|
const keywords = [
|
|
5
5
|
"typescript",
|
|
@@ -53,7 +53,7 @@ const dependencies = {
|
|
|
53
53
|
"@antfu/ni": "^0.20.0",
|
|
54
54
|
"@lihbr/listr-update-renderer": "^0.5.3",
|
|
55
55
|
"@sentry/node": "^7.70.0",
|
|
56
|
-
"@slicemachine/manager": "^0.12.
|
|
56
|
+
"@slicemachine/manager": "^0.12.1-dev-upgrade-legacy.2",
|
|
57
57
|
chalk: "^4.1.2",
|
|
58
58
|
giget: "^1.1.2",
|
|
59
59
|
globby: "^13.1.3",
|
|
@@ -66,7 +66,7 @@ const dependencies = {
|
|
|
66
66
|
};
|
|
67
67
|
const devDependencies = {
|
|
68
68
|
"@size-limit/preset-small-lib": "8.2.4",
|
|
69
|
-
"@slicemachine/plugin-kit": "0.4.
|
|
69
|
+
"@slicemachine/plugin-kit": "0.4.19-dev-upgrade-legacy.2",
|
|
70
70
|
"@types/listr": "0.14.4",
|
|
71
71
|
"@types/prompts": "2.4.3",
|
|
72
72
|
"@types/semver": "7.3.13",
|
|
@@ -92,7 +92,7 @@ const devDependencies = {
|
|
|
92
92
|
"vite-plugin-sdk": "0.1.1",
|
|
93
93
|
vitest: "0.32.0"
|
|
94
94
|
};
|
|
95
|
-
const gitHead = "
|
|
95
|
+
const gitHead = "c724ac17e981d2df75c8831afeb36408f108d062";
|
|
96
96
|
const pkg = {
|
|
97
97
|
name,
|
|
98
98
|
version,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slicemachine/init",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2-dev-upgrade-legacy.2",
|
|
4
4
|
"description": "Init Prismic Slice Machine in your project",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@antfu/ni": "^0.20.0",
|
|
55
55
|
"@lihbr/listr-update-renderer": "^0.5.3",
|
|
56
56
|
"@sentry/node": "^7.70.0",
|
|
57
|
-
"@slicemachine/manager": "^0.12.
|
|
57
|
+
"@slicemachine/manager": "^0.12.1-dev-upgrade-legacy.2",
|
|
58
58
|
"chalk": "^4.1.2",
|
|
59
59
|
"giget": "^1.1.2",
|
|
60
60
|
"globby": "^13.1.3",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@size-limit/preset-small-lib": "8.2.4",
|
|
70
|
-
"@slicemachine/plugin-kit": "0.4.
|
|
70
|
+
"@slicemachine/plugin-kit": "0.4.19-dev-upgrade-legacy.2",
|
|
71
71
|
"@types/listr": "0.14.4",
|
|
72
72
|
"@types/prompts": "2.4.3",
|
|
73
73
|
"@types/semver": "7.3.13",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"vite-plugin-sdk": "0.1.1",
|
|
94
94
|
"vitest": "0.32.0"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "c724ac17e981d2df75c8831afeb36408f108d062"
|
|
97
97
|
}
|
|
@@ -176,7 +176,7 @@ export class SliceMachineInitProcess {
|
|
|
176
176
|
await this.createNewRepository();
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
await this.
|
|
179
|
+
await this.syncDataWithPrismic();
|
|
180
180
|
await this.initializeProject();
|
|
181
181
|
await this.initializePlugins();
|
|
182
182
|
} catch (error) {
|
|
@@ -320,6 +320,8 @@ export class SliceMachineInitProcess {
|
|
|
320
320
|
this.manager.customTypes.readCustomTypeLibrary(),
|
|
321
321
|
this.readDocuments(),
|
|
322
322
|
]);
|
|
323
|
+
|
|
324
|
+
// If repository exists, and there's anything to push
|
|
323
325
|
if (
|
|
324
326
|
slices.length > 0 ||
|
|
325
327
|
ctLibrary.ids.length > 0 ||
|
|
@@ -327,6 +329,11 @@ export class SliceMachineInitProcess {
|
|
|
327
329
|
) {
|
|
328
330
|
return true;
|
|
329
331
|
}
|
|
332
|
+
|
|
333
|
+
// If repository exists, and there might be things to pull
|
|
334
|
+
if (ctLibrary.ids.length === 0) {
|
|
335
|
+
return true;
|
|
336
|
+
}
|
|
330
337
|
} catch (e) {
|
|
331
338
|
return true;
|
|
332
339
|
}
|
|
@@ -1110,10 +1117,10 @@ ${chalk.cyan("?")} Your Prismic repository name`.replace("\n", ""),
|
|
|
1110
1117
|
return { signature, documents, directoryPath: documentsDirectoryPath };
|
|
1111
1118
|
}
|
|
1112
1119
|
|
|
1113
|
-
protected
|
|
1120
|
+
protected syncDataWithPrismic(): Promise<void> {
|
|
1114
1121
|
return listrRun([
|
|
1115
1122
|
{
|
|
1116
|
-
title: "
|
|
1123
|
+
title: "Syncing data with Prismic...",
|
|
1117
1124
|
task: (_, parentTask) =>
|
|
1118
1125
|
listr([
|
|
1119
1126
|
{
|
|
@@ -1209,7 +1216,7 @@ ${chalk.cyan("?")} Your Prismic repository name`.replace("\n", ""),
|
|
|
1209
1216
|
task: async (_, task) => {
|
|
1210
1217
|
assertExists(
|
|
1211
1218
|
this.context.repository,
|
|
1212
|
-
"Repository selection must be available through context to run `
|
|
1219
|
+
"Repository selection must be available through context to run `syncDataWithPrismic`",
|
|
1213
1220
|
);
|
|
1214
1221
|
|
|
1215
1222
|
try {
|
|
@@ -1219,7 +1226,6 @@ ${chalk.cyan("?")} Your Prismic repository name`.replace("\n", ""),
|
|
|
1219
1226
|
documentsRead === undefined ||
|
|
1220
1227
|
documentsRead.documents.length === 0
|
|
1221
1228
|
) {
|
|
1222
|
-
parentTask.title = "Pushed data to Prismic";
|
|
1223
1229
|
task.skip("No document to push");
|
|
1224
1230
|
|
|
1225
1231
|
return;
|
|
@@ -1261,9 +1267,7 @@ ${chalk.cyan("?")} Your Prismic repository name`.replace("\n", ""),
|
|
|
1261
1267
|
});
|
|
1262
1268
|
|
|
1263
1269
|
task.title = "Pushed all documents";
|
|
1264
|
-
parentTask.title = "Pushed data to Prismic";
|
|
1265
1270
|
} catch {
|
|
1266
|
-
parentTask.title = "Pushed data to Prismic";
|
|
1267
1271
|
task.skip("No document to push");
|
|
1268
1272
|
|
|
1269
1273
|
return;
|
|
@@ -1285,7 +1289,41 @@ ${chalk.cyan("?")} Your Prismic repository name`.replace("\n", ""),
|
|
|
1285
1289
|
}
|
|
1286
1290
|
|
|
1287
1291
|
task.title = "Cleaned up data push artifacts";
|
|
1288
|
-
|
|
1292
|
+
},
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
title: "Pulling existing types...",
|
|
1296
|
+
task: async (_, task) => {
|
|
1297
|
+
const { ids, errors } =
|
|
1298
|
+
await this.manager.customTypes.readCustomTypeLibrary();
|
|
1299
|
+
|
|
1300
|
+
if (errors.length > 0) {
|
|
1301
|
+
// TODO: Provide better error message.
|
|
1302
|
+
throw new Error(
|
|
1303
|
+
`Failed to read custom type libraries: ${errors.join(
|
|
1304
|
+
", ",
|
|
1305
|
+
)}`,
|
|
1306
|
+
);
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
if (ids && ids.length > 0) {
|
|
1310
|
+
task.skip("Types already exists");
|
|
1311
|
+
parentTask.title = "Synced data with Prismic";
|
|
1312
|
+
|
|
1313
|
+
return;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
const remoteTypes =
|
|
1317
|
+
await this.manager.customTypes.fetchRemoteCustomTypes();
|
|
1318
|
+
|
|
1319
|
+
await Promise.all(
|
|
1320
|
+
remoteTypes.map(async (model) => {
|
|
1321
|
+
await this.manager.customTypes.createCustomType({ model });
|
|
1322
|
+
}),
|
|
1323
|
+
);
|
|
1324
|
+
|
|
1325
|
+
task.title = "Pulled existing types";
|
|
1326
|
+
parentTask.title = "Synced data with Prismic";
|
|
1289
1327
|
},
|
|
1290
1328
|
},
|
|
1291
1329
|
]),
|