@slicemachine/init 2.9.21-beta.5 → 2.9.21-beta.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/dist/SliceMachineInitProcess.cjs +23 -10
- package/dist/SliceMachineInitProcess.cjs.map +1 -1
- package/dist/SliceMachineInitProcess.d.ts +2 -1
- package/dist/SliceMachineInitProcess.js +24 -11
- 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/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/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 +1 -1
- package/dist/packages/init/package.json.js +1 -1
- package/package.json +3 -3
- package/src/SliceMachineInitProcess.ts +36 -10
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.9.21-beta.
|
|
4
|
+
const version = "2.9.21-beta.7";
|
|
5
5
|
const description = "Init Prismic Slice Machine in your project";
|
|
6
6
|
const keywords = [
|
|
7
7
|
"typescript",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slicemachine/init",
|
|
3
|
-
"version": "2.9.21-beta.
|
|
3
|
+
"version": "2.9.21-beta.7",
|
|
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.116.0",
|
|
57
|
-
"@slicemachine/manager": "0.19.4-beta.
|
|
57
|
+
"@slicemachine/manager": "0.19.4-beta.7",
|
|
58
58
|
"chalk": "^4.1.2",
|
|
59
59
|
"giget": "^1.1.2",
|
|
60
60
|
"globby": "^13.1.3",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@size-limit/preset-small-lib": "8.2.4",
|
|
71
|
-
"@slicemachine/plugin-kit": "0.4.43-beta.
|
|
71
|
+
"@slicemachine/plugin-kit": "0.4.43-beta.7",
|
|
72
72
|
"@types/listr": "0.14.4",
|
|
73
73
|
"@types/prompts": "2.4.3",
|
|
74
74
|
"@types/semver": "7.3.13",
|
|
@@ -548,22 +548,41 @@ Continue with next steps in Slice Machine.
|
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
|
|
551
|
+
protected getLoggingInTitle(subtitle?: string, ...extra: string[]): string {
|
|
552
|
+
return `Logging in to Prismic...
|
|
553
|
+
|
|
554
|
+
███████████████████████████████████████████████████████████████████████████
|
|
555
|
+
|
|
556
|
+
${subtitle ? `* * ${subtitle}` : ""}
|
|
557
|
+
${extra.length ? `\n${extra.map((line) => ` ${line}`).join("\n")}\n` : ""}
|
|
558
|
+
███████████████████████████████████████████████████████████████████████████
|
|
559
|
+
`;
|
|
560
|
+
}
|
|
561
|
+
|
|
551
562
|
protected loginAndFetchUserData(): Promise<void> {
|
|
552
563
|
return listrRun([
|
|
553
564
|
{
|
|
554
|
-
title:
|
|
565
|
+
title: this.getLoggingInTitle(),
|
|
555
566
|
task: async (_, parentTask) => {
|
|
556
|
-
parentTask.
|
|
567
|
+
parentTask.title = this.getLoggingInTitle("Validating session...");
|
|
557
568
|
const isLoggedIn = await this.manager.user.checkIsLoggedIn();
|
|
558
569
|
|
|
559
570
|
if (!isLoggedIn) {
|
|
560
|
-
parentTask.
|
|
571
|
+
parentTask.title = this.getLoggingInTitle(
|
|
572
|
+
chalk.cyan("Press any key to open the browser to login..."),
|
|
573
|
+
);
|
|
561
574
|
await this.pressKeyToLogin();
|
|
562
|
-
|
|
563
|
-
|
|
575
|
+
await this.waitingForLogin(({ url }) => {
|
|
576
|
+
parentTask.title = this.getLoggingInTitle(
|
|
577
|
+
chalk.cyan("Opening browser, waiting for you to login..."),
|
|
578
|
+
chalk.yellow(
|
|
579
|
+
"If your browser did not open automatically, please use the url below:",
|
|
580
|
+
),
|
|
581
|
+
url,
|
|
582
|
+
);
|
|
583
|
+
});
|
|
564
584
|
}
|
|
565
585
|
|
|
566
|
-
parentTask.output = "";
|
|
567
586
|
parentTask.title = `Logged in`;
|
|
568
587
|
|
|
569
588
|
return listr(
|
|
@@ -606,12 +625,19 @@ Continue with next steps in Slice Machine.
|
|
|
606
625
|
});
|
|
607
626
|
}
|
|
608
627
|
|
|
609
|
-
protected async waitingForLogin(
|
|
610
|
-
|
|
628
|
+
protected async waitingForLogin(
|
|
629
|
+
onListenCallback?: (
|
|
630
|
+
sessionInfo: Awaited<
|
|
631
|
+
ReturnType<typeof this.manager.user.getLoginSessionInfo>
|
|
632
|
+
>,
|
|
633
|
+
) => void,
|
|
634
|
+
): Promise<void> {
|
|
635
|
+
const sessionInfo = await this.manager.user.getLoginSessionInfo();
|
|
611
636
|
await this.manager.user.nodeLoginSession({
|
|
612
|
-
port,
|
|
637
|
+
port: sessionInfo.port,
|
|
613
638
|
onListenCallback() {
|
|
614
|
-
open(url);
|
|
639
|
+
open(sessionInfo.url);
|
|
640
|
+
onListenCallback?.(sessionInfo);
|
|
615
641
|
},
|
|
616
642
|
});
|
|
617
643
|
}
|