@slicemachine/init 2.8.2-dev-next-release.14 → 2.8.2-dev-next-release.16
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 +45 -25
- package/dist/SliceMachineInitProcess.cjs.map +1 -1
- package/dist/SliceMachineInitProcess.d.ts +2 -0
- package/dist/SliceMachineInitProcess.js +45 -25
- 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/hosted-git-info/index.cjs +1 -1
- package/dist/_node_modules/hosted-git-info/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/normalize-package-data/_node_modules/hosted-git-info/lib/index.cjs +1 -1
- package/dist/_node_modules/meow/_node_modules/normalize-package-data/_node_modules/hosted-git-info/lib/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/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 +53 -24
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.8.2-dev-next-release.
|
|
4
|
+
const version = "2.8.2-dev-next-release.16";
|
|
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.15.1-dev-next-release.
|
|
58
|
+
"@slicemachine/manager": "^0.15.1-dev-next-release.16",
|
|
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.22-dev-next-release.
|
|
71
|
+
"@slicemachine/plugin-kit": "0.4.22-dev-next-release.16",
|
|
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 = "98d11675df6e207519a0d7e606a8c4d6cb9ff700";
|
|
98
98
|
const pkg = {
|
|
99
99
|
name,
|
|
100
100
|
version,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const name = "@slicemachine/init";
|
|
2
|
-
const version = "2.8.2-dev-next-release.
|
|
2
|
+
const version = "2.8.2-dev-next-release.16";
|
|
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.15.1-dev-next-release.
|
|
56
|
+
"@slicemachine/manager": "^0.15.1-dev-next-release.16",
|
|
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.22-dev-next-release.
|
|
69
|
+
"@slicemachine/plugin-kit": "0.4.22-dev-next-release.16",
|
|
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 = "98d11675df6e207519a0d7e606a8c4d6cb9ff700";
|
|
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.8.2-dev-next-release.
|
|
3
|
+
"version": "2.8.2-dev-next-release.16",
|
|
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.15.1-dev-next-release.
|
|
57
|
+
"@slicemachine/manager": "^0.15.1-dev-next-release.16",
|
|
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.22-dev-next-release.
|
|
70
|
+
"@slicemachine/plugin-kit": "0.4.22-dev-next-release.16",
|
|
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": "98d11675df6e207519a0d7e606a8c4d6cb9ff700"
|
|
97
97
|
}
|
|
@@ -267,7 +267,7 @@ Continue with next steps in Slice Machine.
|
|
|
267
267
|
if (ctLibrary.ids.length === 0) {
|
|
268
268
|
return true;
|
|
269
269
|
}
|
|
270
|
-
} catch (
|
|
270
|
+
} catch (error) {
|
|
271
271
|
return true;
|
|
272
272
|
}
|
|
273
273
|
|
|
@@ -549,25 +549,9 @@ Continue with next steps in Slice Machine.
|
|
|
549
549
|
|
|
550
550
|
if (!isLoggedIn) {
|
|
551
551
|
parentTask.output = "Press any key to open the browser to login...";
|
|
552
|
-
await
|
|
553
|
-
const initialRawMode = !!process.stdin.isRaw;
|
|
554
|
-
process.stdin.setRawMode?.(true);
|
|
555
|
-
process.stdin.resume();
|
|
556
|
-
process.stdin.once("data", (data: Buffer) => {
|
|
557
|
-
process.stdin.setRawMode?.(initialRawMode);
|
|
558
|
-
process.stdin.pause();
|
|
559
|
-
resolve(data.toString("utf-8"));
|
|
560
|
-
});
|
|
561
|
-
});
|
|
562
|
-
|
|
552
|
+
await this.pressKeyToLogin();
|
|
563
553
|
parentTask.output = "Browser opened, waiting for you to login...";
|
|
564
|
-
|
|
565
|
-
await this.manager.user.nodeLoginSession({
|
|
566
|
-
port,
|
|
567
|
-
onListenCallback() {
|
|
568
|
-
open(url);
|
|
569
|
-
},
|
|
570
|
-
});
|
|
554
|
+
await this.waitingForLogin();
|
|
571
555
|
}
|
|
572
556
|
|
|
573
557
|
parentTask.output = "";
|
|
@@ -600,6 +584,29 @@ Continue with next steps in Slice Machine.
|
|
|
600
584
|
]);
|
|
601
585
|
}
|
|
602
586
|
|
|
587
|
+
protected async pressKeyToLogin(): Promise<void> {
|
|
588
|
+
await new Promise((resolve) => {
|
|
589
|
+
const initialRawMode = !!process.stdin.isRaw;
|
|
590
|
+
process.stdin.setRawMode?.(true);
|
|
591
|
+
process.stdin.resume();
|
|
592
|
+
process.stdin.once("data", (data: Buffer) => {
|
|
593
|
+
process.stdin.setRawMode?.(initialRawMode);
|
|
594
|
+
process.stdin.pause();
|
|
595
|
+
resolve(data.toString("utf-8"));
|
|
596
|
+
});
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
protected async waitingForLogin(): Promise<void> {
|
|
601
|
+
const { port, url } = await this.manager.user.getLoginSessionInfo();
|
|
602
|
+
await this.manager.user.nodeLoginSession({
|
|
603
|
+
port,
|
|
604
|
+
onListenCallback() {
|
|
605
|
+
open(url);
|
|
606
|
+
},
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
|
|
603
610
|
protected useRepositoryFlag(): Promise<void> {
|
|
604
611
|
return listrRun([
|
|
605
612
|
{
|
|
@@ -871,13 +878,35 @@ ${chalk.cyan("?")} Your Prismic repository name`.replace("\n", ""),
|
|
|
871
878
|
"Project framework must be available through context to run `createNewRepository`",
|
|
872
879
|
);
|
|
873
880
|
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
881
|
+
try {
|
|
882
|
+
await this.manager.prismicRepository.create({
|
|
883
|
+
domain: this.context.repository.domain,
|
|
884
|
+
framework: this.context.framework.wroomTelemetryID,
|
|
885
|
+
starterId: this.context.starterId,
|
|
886
|
+
});
|
|
887
|
+
} catch (error) {
|
|
888
|
+
// When we have an error here, it's most probably because the user has a stale SESSION cookie
|
|
889
|
+
|
|
890
|
+
// Ensure to logout user to remove SESSION and prismic-auth cookies
|
|
891
|
+
await this.manager.user.logout();
|
|
892
|
+
|
|
893
|
+
// Force a new login to get a brand new cookies value
|
|
894
|
+
task.output =
|
|
895
|
+
"It seems there is an authentication problem, press any key to open the browser to login again...";
|
|
896
|
+
await this.pressKeyToLogin();
|
|
897
|
+
task.output = "Browser opened, waiting for you to login...";
|
|
898
|
+
await this.waitingForLogin();
|
|
899
|
+
|
|
900
|
+
// Try to create repository again with the new cookies value
|
|
901
|
+
await this.manager.prismicRepository.create({
|
|
902
|
+
domain: this.context.repository.domain,
|
|
903
|
+
framework: this.context.framework.wroomTelemetryID,
|
|
904
|
+
starterId: this.context.starterId,
|
|
905
|
+
});
|
|
906
|
+
}
|
|
879
907
|
|
|
880
908
|
this.context.repository.exists = true;
|
|
909
|
+
task.output = "";
|
|
881
910
|
task.title = `Created new repository ${chalk.cyan(
|
|
882
911
|
this.context.repository.domain,
|
|
883
912
|
)}`;
|