@slicemachine/init 2.9.9 → 2.9.10-alpha.dev-new-release-process.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.
Files changed (155) hide show
  1. package/dist/SliceMachineInitProcess.cjs +4 -1
  2. package/dist/SliceMachineInitProcess.cjs.map +1 -1
  3. package/dist/SliceMachineInitProcess.js +4 -1
  4. package/dist/SliceMachineInitProcess.js.map +1 -1
  5. package/dist/_node_modules/execa/_node_modules/get-stream/buffer-stream.cjs.map +1 -0
  6. package/dist/_node_modules/execa/_node_modules/get-stream/buffer-stream.js.map +1 -0
  7. package/dist/_node_modules/{get-stream → execa/_node_modules/get-stream}/index.cjs +2 -2
  8. package/dist/_node_modules/execa/_node_modules/get-stream/index.cjs.map +1 -0
  9. package/dist/_node_modules/{get-stream → execa/_node_modules/get-stream}/index.js +2 -2
  10. package/dist/_node_modules/execa/_node_modules/get-stream/index.js.map +1 -0
  11. package/dist/_node_modules/execa/lib/stream.cjs +1 -1
  12. package/dist/_node_modules/execa/lib/stream.js +1 -1
  13. package/dist/_node_modules/{glob-parent → fast-glob/_node_modules/glob-parent}/index.cjs +1 -1
  14. package/dist/_node_modules/fast-glob/_node_modules/glob-parent/index.cjs.map +1 -0
  15. package/dist/_node_modules/{glob-parent → fast-glob/_node_modules/glob-parent}/index.js +1 -1
  16. package/dist/_node_modules/fast-glob/_node_modules/glob-parent/index.js.map +1 -0
  17. package/dist/_node_modules/fast-glob/out/utils/pattern.cjs +1 -1
  18. package/dist/_node_modules/fast-glob/out/utils/pattern.js +1 -1
  19. package/dist/_node_modules/json-parse-even-better-errors/index.cjs.map +1 -0
  20. package/dist/_node_modules/json-parse-even-better-errors/index.js.map +1 -0
  21. package/dist/_node_modules/meow/_node_modules/decamelize-keys/_node_modules/decamelize/index.cjs.map +1 -0
  22. package/dist/_node_modules/meow/_node_modules/decamelize-keys/_node_modules/decamelize/index.js.map +1 -0
  23. package/dist/_node_modules/{decamelize-keys → meow/_node_modules/decamelize-keys}/index.cjs +2 -2
  24. package/dist/_node_modules/meow/_node_modules/decamelize-keys/index.cjs.map +1 -0
  25. package/dist/_node_modules/{decamelize-keys → meow/_node_modules/decamelize-keys}/index.js +2 -2
  26. package/dist/_node_modules/meow/_node_modules/decamelize-keys/index.js.map +1 -0
  27. package/dist/_node_modules/meow/_node_modules/hosted-git-info/_node_modules/lru-cache/index.cjs.map +1 -0
  28. package/dist/_node_modules/meow/_node_modules/hosted-git-info/_node_modules/lru-cache/index.js.map +1 -0
  29. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/git-host-info.cjs.map +1 -0
  30. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/git-host-info.js.map +1 -0
  31. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/git-host.cjs.map +1 -0
  32. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/git-host.js.map +1 -0
  33. package/dist/_node_modules/meow/_node_modules/{normalize-package-data/_node_modules/hosted-git-info → hosted-git-info}/lib/index.cjs +2 -2
  34. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/index.cjs.map +1 -0
  35. package/dist/_node_modules/meow/_node_modules/{normalize-package-data/_node_modules/hosted-git-info → hosted-git-info}/lib/index.js +2 -2
  36. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/index.js.map +1 -0
  37. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/parse-url.cjs.map +1 -0
  38. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/parse-url.js.map +1 -0
  39. package/dist/_node_modules/meow/_node_modules/map-obj/index.cjs.map +1 -0
  40. package/dist/_node_modules/meow/_node_modules/map-obj/index.js.map +1 -0
  41. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/fixer.cjs +1 -1
  42. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/fixer.js +1 -1
  43. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.cjs.map +1 -0
  44. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.js.map +1 -0
  45. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.cjs.map +1 -0
  46. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.js.map +1 -0
  47. package/dist/_node_modules/{hosted-git-info → meow/_node_modules/read-pkg/_node_modules/hosted-git-info}/index.cjs +2 -2
  48. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs.map +1 -0
  49. package/dist/_node_modules/{hosted-git-info → meow/_node_modules/read-pkg/_node_modules/hosted-git-info}/index.js +2 -2
  50. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js.map +1 -0
  51. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.cjs +1 -1
  52. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.js +1 -1
  53. package/dist/_node_modules/meow/index.cjs +2 -2
  54. package/dist/_node_modules/meow/index.js +2 -2
  55. package/dist/_node_modules/minimist-options/_node_modules/arrify/index.cjs.map +1 -0
  56. package/dist/_node_modules/minimist-options/_node_modules/arrify/index.js.map +1 -0
  57. package/dist/_node_modules/minimist-options/index.cjs +1 -1
  58. package/dist/_node_modules/minimist-options/index.js +1 -1
  59. package/dist/_node_modules/parse-json/index.cjs +1 -1
  60. package/dist/_node_modules/parse-json/index.js +1 -1
  61. package/dist/_node_modules/redent/_node_modules/indent-string/index.cjs.map +1 -0
  62. package/dist/_node_modules/redent/_node_modules/indent-string/index.js.map +1 -0
  63. package/dist/_node_modules/redent/_node_modules/strip-indent/index.cjs.map +1 -0
  64. package/dist/_node_modules/redent/_node_modules/strip-indent/index.js.map +1 -0
  65. package/dist/_node_modules/{meow/_node_modules/redent → redent}/index.cjs +2 -2
  66. package/dist/_node_modules/redent/index.cjs.map +1 -0
  67. package/dist/_node_modules/{meow/_node_modules/redent → redent}/index.js +2 -2
  68. package/dist/_node_modules/redent/index.js.map +1 -0
  69. package/dist/_node_modules/signal-exit/index.cjs +1 -1
  70. package/dist/_node_modules/signal-exit/index.js +1 -1
  71. package/dist/_virtual/index15.cjs +2 -2
  72. package/dist/_virtual/index15.js +2 -2
  73. package/dist/_virtual/index16.cjs +2 -2
  74. package/dist/_virtual/index16.js +2 -2
  75. package/dist/lib/framework.cjs +15 -8
  76. package/dist/lib/framework.cjs.map +1 -1
  77. package/dist/lib/framework.js +15 -8
  78. package/dist/lib/framework.js.map +1 -1
  79. package/dist/lib/setupSentry.cjs +4 -4
  80. package/dist/lib/setupSentry.cjs.map +1 -1
  81. package/dist/lib/setupSentry.js +5 -5
  82. package/dist/lib/setupSentry.js.map +1 -1
  83. package/dist/packages/init/package.json.cjs +12 -7
  84. package/dist/packages/init/package.json.cjs.map +1 -1
  85. package/dist/packages/init/package.json.js +12 -7
  86. package/dist/packages/init/package.json.js.map +1 -1
  87. package/package.json +100 -97
  88. package/src/SliceMachineInitProcess.ts +7 -1
  89. package/src/lib/framework.ts +19 -9
  90. package/src/lib/setupSentry.ts +5 -8
  91. package/LICENSE +0 -202
  92. package/dist/_node_modules/arrify/index.cjs.map +0 -1
  93. package/dist/_node_modules/arrify/index.js.map +0 -1
  94. package/dist/_node_modules/decamelize-keys/_node_modules/decamelize/index.cjs.map +0 -1
  95. package/dist/_node_modules/decamelize-keys/_node_modules/decamelize/index.js.map +0 -1
  96. package/dist/_node_modules/decamelize-keys/_node_modules/map-obj/index.cjs.map +0 -1
  97. package/dist/_node_modules/decamelize-keys/_node_modules/map-obj/index.js.map +0 -1
  98. package/dist/_node_modules/decamelize-keys/index.cjs.map +0 -1
  99. package/dist/_node_modules/decamelize-keys/index.js.map +0 -1
  100. package/dist/_node_modules/get-stream/buffer-stream.cjs.map +0 -1
  101. package/dist/_node_modules/get-stream/buffer-stream.js.map +0 -1
  102. package/dist/_node_modules/get-stream/index.cjs.map +0 -1
  103. package/dist/_node_modules/get-stream/index.js.map +0 -1
  104. package/dist/_node_modules/glob-parent/index.cjs.map +0 -1
  105. package/dist/_node_modules/glob-parent/index.js.map +0 -1
  106. package/dist/_node_modules/hosted-git-info/git-host-info.cjs.map +0 -1
  107. package/dist/_node_modules/hosted-git-info/git-host-info.js.map +0 -1
  108. package/dist/_node_modules/hosted-git-info/git-host.cjs.map +0 -1
  109. package/dist/_node_modules/hosted-git-info/git-host.js.map +0 -1
  110. package/dist/_node_modules/hosted-git-info/index.cjs.map +0 -1
  111. package/dist/_node_modules/hosted-git-info/index.js.map +0 -1
  112. package/dist/_node_modules/meow/_node_modules/indent-string/index.cjs.map +0 -1
  113. package/dist/_node_modules/meow/_node_modules/indent-string/index.js.map +0 -1
  114. package/dist/_node_modules/meow/_node_modules/lru-cache/index.cjs.map +0 -1
  115. package/dist/_node_modules/meow/_node_modules/lru-cache/index.js.map +0 -1
  116. package/dist/_node_modules/meow/_node_modules/normalize-package-data/_node_modules/hosted-git-info/lib/git-host-info.cjs.map +0 -1
  117. package/dist/_node_modules/meow/_node_modules/normalize-package-data/_node_modules/hosted-git-info/lib/git-host-info.js.map +0 -1
  118. package/dist/_node_modules/meow/_node_modules/normalize-package-data/_node_modules/hosted-git-info/lib/git-host.cjs.map +0 -1
  119. package/dist/_node_modules/meow/_node_modules/normalize-package-data/_node_modules/hosted-git-info/lib/git-host.js.map +0 -1
  120. package/dist/_node_modules/meow/_node_modules/normalize-package-data/_node_modules/hosted-git-info/lib/index.cjs.map +0 -1
  121. package/dist/_node_modules/meow/_node_modules/normalize-package-data/_node_modules/hosted-git-info/lib/index.js.map +0 -1
  122. package/dist/_node_modules/meow/_node_modules/normalize-package-data/_node_modules/hosted-git-info/lib/parse-url.cjs.map +0 -1
  123. package/dist/_node_modules/meow/_node_modules/normalize-package-data/_node_modules/hosted-git-info/lib/parse-url.js.map +0 -1
  124. package/dist/_node_modules/meow/_node_modules/redent/index.cjs.map +0 -1
  125. package/dist/_node_modules/meow/_node_modules/redent/index.js.map +0 -1
  126. package/dist/_node_modules/meow/_node_modules/strip-indent/index.cjs.map +0 -1
  127. package/dist/_node_modules/meow/_node_modules/strip-indent/index.js.map +0 -1
  128. package/dist/_node_modules/parse-json/_node_modules/json-parse-even-better-errors/index.cjs.map +0 -1
  129. package/dist/_node_modules/parse-json/_node_modules/json-parse-even-better-errors/index.js.map +0 -1
  130. /package/dist/_node_modules/{get-stream → execa/_node_modules/get-stream}/buffer-stream.cjs +0 -0
  131. /package/dist/_node_modules/{get-stream → execa/_node_modules/get-stream}/buffer-stream.js +0 -0
  132. /package/dist/_node_modules/{parse-json/_node_modules/json-parse-even-better-errors → json-parse-even-better-errors}/index.cjs +0 -0
  133. /package/dist/_node_modules/{parse-json/_node_modules/json-parse-even-better-errors → json-parse-even-better-errors}/index.js +0 -0
  134. /package/dist/_node_modules/{decamelize-keys → meow/_node_modules/decamelize-keys}/_node_modules/decamelize/index.cjs +0 -0
  135. /package/dist/_node_modules/{decamelize-keys → meow/_node_modules/decamelize-keys}/_node_modules/decamelize/index.js +0 -0
  136. /package/dist/_node_modules/meow/_node_modules/{lru-cache → hosted-git-info/_node_modules/lru-cache}/index.cjs +0 -0
  137. /package/dist/_node_modules/meow/_node_modules/{lru-cache → hosted-git-info/_node_modules/lru-cache}/index.js +0 -0
  138. /package/dist/_node_modules/meow/_node_modules/{normalize-package-data/_node_modules/hosted-git-info → hosted-git-info}/lib/git-host-info.cjs +0 -0
  139. /package/dist/_node_modules/meow/_node_modules/{normalize-package-data/_node_modules/hosted-git-info → hosted-git-info}/lib/git-host-info.js +0 -0
  140. /package/dist/_node_modules/meow/_node_modules/{normalize-package-data/_node_modules/hosted-git-info → hosted-git-info}/lib/git-host.cjs +0 -0
  141. /package/dist/_node_modules/meow/_node_modules/{normalize-package-data/_node_modules/hosted-git-info → hosted-git-info}/lib/git-host.js +0 -0
  142. /package/dist/_node_modules/meow/_node_modules/{normalize-package-data/_node_modules/hosted-git-info → hosted-git-info}/lib/parse-url.cjs +0 -0
  143. /package/dist/_node_modules/meow/_node_modules/{normalize-package-data/_node_modules/hosted-git-info → hosted-git-info}/lib/parse-url.js +0 -0
  144. /package/dist/_node_modules/{decamelize-keys → meow}/_node_modules/map-obj/index.cjs +0 -0
  145. /package/dist/_node_modules/{decamelize-keys → meow}/_node_modules/map-obj/index.js +0 -0
  146. /package/dist/_node_modules/{hosted-git-info → meow/_node_modules/read-pkg/_node_modules/hosted-git-info}/git-host-info.cjs +0 -0
  147. /package/dist/_node_modules/{hosted-git-info → meow/_node_modules/read-pkg/_node_modules/hosted-git-info}/git-host-info.js +0 -0
  148. /package/dist/_node_modules/{hosted-git-info → meow/_node_modules/read-pkg/_node_modules/hosted-git-info}/git-host.cjs +0 -0
  149. /package/dist/_node_modules/{hosted-git-info → meow/_node_modules/read-pkg/_node_modules/hosted-git-info}/git-host.js +0 -0
  150. /package/dist/_node_modules/{arrify → minimist-options/_node_modules/arrify}/index.cjs +0 -0
  151. /package/dist/_node_modules/{arrify → minimist-options/_node_modules/arrify}/index.js +0 -0
  152. /package/dist/_node_modules/{meow → redent}/_node_modules/indent-string/index.cjs +0 -0
  153. /package/dist/_node_modules/{meow → redent}/_node_modules/indent-string/index.js +0 -0
  154. /package/dist/_node_modules/{meow → redent}/_node_modules/strip-indent/index.cjs +0 -0
  155. /package/dist/_node_modules/{meow → redent}/_node_modules/strip-indent/index.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"SliceMachineInitProcess.js","sources":["../../src/SliceMachineInitProcess.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport chalk from \"chalk\";\n\nimport { execaCommand, type ExecaChildProcess } from \"execa\";\n\nimport open from \"open\";\nimport logSymbols from \"log-symbols\";\nimport { globby } from \"globby\";\nimport { downloadTemplate } from \"giget\";\nimport pLimit from \"p-limit\";\n\nimport {\n\tcreateSliceMachineManager,\n\tPrismicUserProfile,\n\tPrismicRepository,\n\tSliceMachineManager,\n\tPackageManager,\n\tStarterId,\n\tREPOSITORY_NAME_VALIDATION,\n} from \"@slicemachine/manager\";\n\nimport pkg from \"../package.json\";\nimport { detectFramework, Framework } from \"./lib/framework\";\nimport { getRunScriptCommand } from \"./lib/getRunScriptCommand\";\nimport { getExecuteCommand } from \"./lib/getExecuteCommand\";\nimport {\n\tgetRandomRepositoryDomain,\n\tformatRepositoryDomain,\n\tvalidateRepositoryDomain,\n\tvalidateRepositoryDomainAndAvailability,\n\tgetErrorMessageForRepositoryDomainValidation,\n} from \"./lib/repositoryDomain\";\nimport { listr, listrRun } from \"./lib/listr\";\nimport { prompt } from \"./lib/prompt\";\nimport { assertExists } from \"./lib/assertExists\";\nimport {\n\tGIGET_ORGANIZATION,\n\tGIGET_PROVIDER,\n\tSLICE_MACHINE_INIT_USER_AGENT,\n\tSTART_SCRIPT_KEY,\n\tSTART_SCRIPT_VALUE,\n} from \"./constants\";\nimport { detectStarterId } from \"./lib/starters\";\nimport { setupSentry } from \"./lib/setupSentry\";\nimport { trackSentryError } from \"./lib/sentryErrorHandlers\";\nimport { updateSentryContext } from \"./lib/updateSentryContext\";\n\nexport type SliceMachineInitProcessOptions = {\n\trepository?: string;\n\tstarter?: string;\n\tdirectoryName?: string;\n\tpush?: boolean;\n\tpushSlices?: boolean;\n\tpushCustomTypes?: boolean;\n\tpushDocuments?: boolean;\n\tstartSlicemachine?: boolean;\n\tcwd?: string;\n} & Record<string, unknown>;\n\nconst DEFAULT_OPTIONS: SliceMachineInitProcessOptions = {\n\tpush: true,\n\tpushSlices: true,\n\tpushCustomTypes: true,\n\tpushDocuments: true,\n\tstartSlicemachine: true,\n};\n\nexport const createSliceMachineInitProcess = (\n\toptions?: SliceMachineInitProcessOptions,\n): SliceMachineInitProcess => {\n\treturn new SliceMachineInitProcess(options);\n};\n\ntype SliceMachineInitProcessContext = {\n\tframework?: Framework;\n\tpackageManager?: PackageManager;\n\tinstallProcess?: ExecaChildProcess;\n\tuserProfile?: PrismicUserProfile;\n\tuserRepositories?: PrismicRepository[];\n\trepository?: {\n\t\tdomain: string;\n\t\texists: boolean;\n\t};\n\tprojectInitialization?: {\n\t\tpatchedScript?: boolean;\n\t};\n\tstarterId?: StarterId;\n};\n\nexport class SliceMachineInitProcess {\n\tprotected options: SliceMachineInitProcessOptions;\n\tprotected manager: SliceMachineManager;\n\n\tprotected context: SliceMachineInitProcessContext;\n\n\tconstructor(options?: SliceMachineInitProcessOptions) {\n\t\tthis.options = { ...DEFAULT_OPTIONS, ...options };\n\t\tthis.manager = createSliceMachineManager({ cwd: options?.cwd });\n\n\t\tthis.context = {};\n\t}\n\n\tasync run(): Promise<void> {\n\t\t// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(\n\t\t\t`\\n${chalk.bgGray(` ${chalk.bold.white(\"Slice Machine\")} `)} ${chalk.dim(\n\t\t\t\t\"→\",\n\t\t\t)} Initializing\\n`,\n\t\t);\n\n\t\ttry {\n\t\t\tif (this.options.starter) {\n\t\t\t\tawait this.copyStarter();\n\t\t\t} else if (this.options.directoryName) {\n\t\t\t\t// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(\n\t\t\t\t\t`${logSymbols.warning} --directory-name has no effect because --starter is not specified\\n`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (await this.manager.telemetry.checkIsTelemetryEnabled()) {\n\t\t\t\t// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(\n\t\t\t\t\t`${\n\t\t\t\t\t\tlogSymbols.info\n\t\t\t\t\t} We collect telemetry data to improve user experience.\\n Learn more: ${chalk.cyan(\n\t\t\t\t\t\t\"https://prismic.dev/slice-machine/telemetry\",\n\t\t\t\t\t)}\\n`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tawait this.manager.telemetry.initTelemetry({\n\t\t\t\tappName: pkg.name,\n\t\t\t\tappVersion: pkg.version,\n\t\t\t});\n\t\t\tawait setupSentry();\n\t\t\tawait this.manager.telemetry.track({\n\t\t\t\tevent: \"command:init:start\",\n\t\t\t\trepository: this.options.repository,\n\t\t\t});\n\n\t\t\tawait this.detectEnvironment();\n\n\t\t\tassertExists(\n\t\t\t\tthis.context.framework,\n\t\t\t\t\"Project framework must be available through context to proceed\",\n\t\t\t);\n\n\t\t\tawait this.beginCoreDependenciesInstallation();\n\n\t\t\tif (this.options.repository) {\n\t\t\t\tawait this.useRepositoryFlag();\n\t\t\t} else {\n\t\t\t\tawait this.loginAndFetchUserData();\n\t\t\t\tawait this.selectRepository();\n\t\t\t}\n\n\t\t\tassertExists(\n\t\t\t\tthis.context.repository,\n\t\t\t\t\"Repository selection must be available through context to proceed\",\n\t\t\t);\n\n\t\t\tawait this.finishCoreDependenciesInstallation();\n\t\t\tawait this.upsertSliceMachineConfigurationAndStartPluginRunner();\n\n\t\t\tconst isLoginRequired = await this.checkIsLoginRequired();\n\t\t\tif (isLoginRequired) {\n\t\t\t\tawait this.loginAndFetchUserData();\n\t\t\t\tif (this.context.repository.exists) {\n\t\t\t\t\tthis.validateWriteAccess();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!this.context.repository.exists) {\n\t\t\t\tawait this.createNewRepository();\n\t\t\t}\n\n\t\t\tawait this.syncDataWithPrismic();\n\t\t\tawait this.initializeProject();\n\t\t\tawait this.initializePlugins();\n\t\t} catch (error) {\n\t\t\tawait this.trackError(error);\n\n\t\t\tthrow error;\n\t\t}\n\n\t\tawait this.manager.telemetry.track({\n\t\t\tevent: \"command:init:end\",\n\t\t\tframework: this.context.framework.sliceMachineTelemetryID,\n\t\t\trepository: this.context.repository.domain,\n\t\t\tsuccess: true,\n\t\t});\n\n\t\t// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(\n\t\t\t`\\n${chalk.bgGreen(` ${chalk.bold.white(\"Slice Machine\")} `)} ${chalk.dim(\n\t\t\t\t\"→\",\n\t\t\t)} Initialization successful!\n\nContinue with next steps in Slice Machine.\n`,\n\t\t);\n\n\t\ttry {\n\t\t\tif (this.options.startSlicemachine) {\n\t\t\t\tconst runSmCommand = this.context.projectInitialization?.patchedScript\n\t\t\t\t\t? await getRunScriptCommand({\n\t\t\t\t\t\t\tagent: this.context.packageManager || \"npm\",\n\t\t\t\t\t\t\tscript: \"slicemachine\",\n\t\t\t\t\t })\n\t\t\t\t\t: await getExecuteCommand({\n\t\t\t\t\t\t\tagent: this.context.packageManager || \"npm\",\n\t\t\t\t\t\t\tscript: \"start-slicemachine\",\n\t\t\t\t\t });\n\n\t\t\t\tconst { startSlicemachine } = await prompt<\n\t\t\t\t\tboolean,\n\t\t\t\t\t\"startSlicemachine\"\n\t\t\t\t>({\n\t\t\t\t\ttype: \"confirm\",\n\t\t\t\t\tname: \"startSlicemachine\",\n\t\t\t\t\tmessage: `Run Slice Machine (${chalk.cyan(runSmCommand)})?`,\n\t\t\t\t\tinitial: true,\n\t\t\t\t});\n\n\t\t\t\tif (startSlicemachine) {\n\t\t\t\t\tconst commandReturnValue = await execaCommand(runSmCommand, {\n\t\t\t\t\t\tenv: { FORCE_COLOR: \"true\" },\n\t\t\t\t\t}).pipeStdout?.(process.stdout);\n\t\t\t\t\tif (commandReturnValue !== undefined) {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.log(commandReturnValue.stdout);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// Only track this error with Sentry, it's only the final convenience message\n\t\t\tawait this.trackSentryError(error);\n\t\t}\n\t}\n\n\tprotected async checkIsLoginRequired(): Promise<boolean> {\n\t\ttry {\n\t\t\tassertExists(this.context.repository, \"\");\n\t\t\tif (this.context.repository.exists === false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst [slices, ctLibrary, documentsGlob] = await Promise.all([\n\t\t\t\tthis.readAllSlices(),\n\t\t\t\tthis.manager.customTypes.readCustomTypeLibrary(),\n\t\t\t\tthis.readDocuments(),\n\t\t\t]);\n\n\t\t\t// If repository exists, and there's anything to push\n\t\t\tif (\n\t\t\t\tslices.length > 0 ||\n\t\t\t\tctLibrary.ids.length > 0 ||\n\t\t\t\t(documentsGlob !== undefined && documentsGlob.documents.length > 0)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// If repository exists, and there might be things to pull\n\t\t\tif (ctLibrary.ids.length === 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprotected trackError = async (error: unknown): Promise<void> => {\n\t\tawait this.trackSentryError(error);\n\t\tawait this.trackTelemetryError(error);\n\t};\n\n\tprotected trackTelemetryError = async (error: unknown): Promise<void> => {\n\t\t// Transform error to string and prevent hitting Segment 500kb API limit or sending ridiculously long trace\n\t\tconst safeError = (\n\t\t\terror instanceof Error ? error.message : `${error}`\n\t\t).slice(0, 512);\n\t\tawait this.manager.telemetry.track({\n\t\t\tevent: \"command:init:end\",\n\t\t\tframework: this.context.framework?.sliceMachineTelemetryID ?? \"unknown\",\n\t\t\trepository: this.context.repository?.domain || \"\",\n\t\t\tsuccess: false,\n\t\t\terror: safeError,\n\t\t});\n\t};\n\n\tprotected trackSentryError = async (error: unknown): Promise<void> => {\n\t\tawait updateSentryContext({\n\t\t\tmanager: this.manager,\n\t\t\trepositoryName: this.context.repository?.domain || \"\",\n\t\t\tframework: this.context.framework?.sliceMachineTelemetryID ?? \"unknown\",\n\t\t});\n\t\ttrackSentryError(error);\n\t};\n\n\tprotected async copyStarter(): Promise<void> {\n\t\tconst dir = await this.getStarterDirectoryName();\n\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Copying starter...\\n\",\n\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\tconst starter = this.options.starter;\n\n\t\t\t\t\tawait downloadTemplate(\n\t\t\t\t\t\t`${GIGET_PROVIDER}:${GIGET_ORGANIZATION}/${starter}#HEAD`,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdir,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\tprocess.chdir(dir);\n\t\t\t\t\tthis.manager.cwd = process.cwd();\n\n\t\t\t\t\ttask.title = \"Starter copied\\n\";\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected async getStarterDirectoryName(): Promise<string> {\n\t\tlet directoryName: string;\n\t\tconst folderNames = await fs.readdir(process.cwd());\n\n\t\tif (\n\t\t\tthis.options.directoryName &&\n\t\t\t!folderNames.includes(this.options.directoryName)\n\t\t) {\n\t\t\t// Use provided directory\n\t\t\tdirectoryName = this.options.directoryName;\n\t\t} else if (\n\t\t\tthis.options.repository &&\n\t\t\t!folderNames.includes(this.options.repository)\n\t\t) {\n\t\t\t// Use repository name\n\t\t\tdirectoryName = this.options.repository;\n\t\t} else {\n\t\t\t// Use random name\n\t\t\tlet suggestedName: string;\n\t\t\tdo {\n\t\t\t\tsuggestedName = getRandomRepositoryDomain();\n\t\t\t} while (folderNames.includes(suggestedName));\n\n\t\t\tconst { selectedDirectory } = await prompt<string, \"selectedDirectory\">({\n\t\t\t\ttype: \"text\",\n\t\t\t\tname: \"selectedDirectory\",\n\t\t\t\tmessage: \"Your starter directory name\",\n\t\t\t\tinitial: suggestedName,\n\t\t\t\tvalidate: async (rawDirectory: string) => {\n\t\t\t\t\tif (folderNames.includes(rawDirectory)) {\n\t\t\t\t\t\treturn \"Directory name already exists\";\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tdirectoryName = selectedDirectory;\n\t\t}\n\n\t\treturn directoryName;\n\t}\n\n\tprotected detectEnvironment(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Detecting environment...\",\n\t\t\t\ttask: (_, parentTask) =>\n\t\t\t\t\tlistr([\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Detecting framework...\",\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tthis.context.framework = await detectFramework(\n\t\t\t\t\t\t\t\t\tthis.manager.cwd,\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\ttask.title = `Detected framework ${chalk.cyan(\n\t\t\t\t\t\t\t\t\tthis.context.framework.name,\n\t\t\t\t\t\t\t\t)}`;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Detecting package manager...\",\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tthis.context.packageManager =\n\t\t\t\t\t\t\t\t\tawait this.manager.project.detectPackageManager({\n\t\t\t\t\t\t\t\t\t\troot: this.manager.cwd,\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\ttask.title = `Detected package manager ${chalk.cyan(\n\t\t\t\t\t\t\t\t\tthis.context.packageManager,\n\t\t\t\t\t\t\t\t)}`;\n\n\t\t\t\t\t\t\t\tassertExists(\n\t\t\t\t\t\t\t\t\tthis.context.framework,\n\t\t\t\t\t\t\t\t\t\"Project framework must be available through context to proceed\",\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tparentTask.title = `Detected framework ${chalk.cyan(\n\t\t\t\t\t\t\t\t\tthis.context.framework.name,\n\t\t\t\t\t\t\t\t)} and package manager ${chalk.cyan(\n\t\t\t\t\t\t\t\t\tthis.context.packageManager,\n\t\t\t\t\t\t\t\t)}`;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Detecting starter...\",\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tthis.context.starterId = await detectStarterId(\n\t\t\t\t\t\t\t\t\tthis.manager.cwd,\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tif (this.context.starterId) {\n\t\t\t\t\t\t\t\t\ttask.title = `Detected starter ${chalk.cyan(\n\t\t\t\t\t\t\t\t\t\tthis.context.starterId,\n\t\t\t\t\t\t\t\t\t)}`;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttask.title = \"No starter detected\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t]),\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected beginCoreDependenciesInstallation(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Beginning core dependencies installation...\",\n\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.packageManager,\n\t\t\t\t\t\t\"Project package manager must be available through context to run `beginCoreDependenciesInstallation`\",\n\t\t\t\t\t);\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.framework,\n\t\t\t\t\t\t\"Project framework must be available through context to run `beginCoreDependenciesInstallation`\",\n\t\t\t\t\t);\n\n\t\t\t\t\tconst { execaProcess } =\n\t\t\t\t\t\tawait this.manager.project.installDependencies({\n\t\t\t\t\t\t\tpackageManager: this.context.packageManager,\n\t\t\t\t\t\t\tdependencies: this.context.framework.devDependencies,\n\t\t\t\t\t\t\tdev: true,\n\t\t\t\t\t\t\t// Picked up later\n\t\t\t\t\t\t\tlog: () => {\n\t\t\t\t\t\t\t\t/* ... */\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\n\t\t\t\t\t// Fail hard if process fails\n\t\t\t\t\texecaProcess.catch(async (error) => {\n\t\t\t\t\t\tconst [_, ...argv1n] = process.argv;\n\t\t\t\t\t\t// Command the user used\n\t\t\t\t\t\tlet tryAgainCommand = [process.argv0, ...argv1n].join(\" \");\n\n\t\t\t\t\t\t// If the `repository` option wasn't used AND the repository was selected/created\n\t\t\t\t\t\tif (!this.options.repository && this.context.repository) {\n\t\t\t\t\t\t\ttryAgainCommand = `${tryAgainCommand} --repository=${this.context.repository.domain}`;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tawait this.trackError(error);\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t`\\n\\n${error.shortMessage}\\n${error.stderr}\\n\\n${\n\t\t\t\t\t\t\t\tlogSymbols.error\n\t\t\t\t\t\t\t} Dependency installation failed, try again with:\\n\\n ${chalk.gray(\n\t\t\t\t\t\t\t\t\"$\",\n\t\t\t\t\t\t\t)} ${chalk.cyan(tryAgainCommand)}`,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tprocess.exit(1);\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.context.installProcess = execaProcess;\n\n\t\t\t\t\ttask.title = `Began core dependencies installation with ${chalk.cyan(\n\t\t\t\t\t\tthis.context.packageManager,\n\t\t\t\t\t)} ... (running in background)`;\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected async fetchUserProfile(): Promise<void> {\n\t\tthis.context.userProfile = await this.manager.user.getProfile();\n\n\t\tawait this.manager.telemetry.identify({\n\t\t\tuserID: this.context.userProfile.shortId,\n\t\t\tintercomHash: this.context.userProfile.intercomHash,\n\t\t});\n\t\tawait this.manager.telemetry.track({\n\t\t\tevent: \"command:init:identify\",\n\t\t\trepository: this.options.repository,\n\t\t});\n\t}\n\n\tprotected async fetchUserRepositories(): Promise<void> {\n\t\tthis.context.userRepositories =\n\t\t\tawait this.manager.prismicRepository.readAll();\n\t}\n\n\tprotected validateWriteAccess(): void {\n\t\tassertExists(\n\t\t\tthis.context.repository,\n\t\t\t\"Repository selection must be available through context to proceed\",\n\t\t);\n\t\tassertExists(\n\t\t\tthis.context.userRepositories,\n\t\t\t\"User repositories must be available through context to validate write access\",\n\t\t);\n\t\tconst { domain } = this.context.repository;\n\t\tconst maybeRepository = this.context.userRepositories.find(\n\t\t\t(repository) => repository.domain === domain,\n\t\t);\n\n\t\tif (maybeRepository) {\n\t\t\tif (!this.manager.prismicRepository.hasWriteAccess(maybeRepository)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Cannot run init command with repository ${chalk.cyan(\n\t\t\t\t\t\tmaybeRepository.domain,\n\t\t\t\t\t)}: you are not a developer or admin of this repository`,\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot validate write access for repository ${chalk.cyan(\n\t\t\t\t\tdomain,\n\t\t\t\t)}: you are not part of this repository`,\n\t\t\t);\n\t\t}\n\t}\n\n\tprotected loginAndFetchUserData(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Logging in to Prismic...\",\n\t\t\t\ttask: async (_, parentTask) => {\n\t\t\t\t\tparentTask.output = \"Validating session...\";\n\t\t\t\t\tconst isLoggedIn = await this.manager.user.checkIsLoggedIn();\n\n\t\t\t\t\tif (!isLoggedIn) {\n\t\t\t\t\t\tparentTask.output = \"Press any key to open the browser to login...\";\n\t\t\t\t\t\tawait this.pressKeyToLogin();\n\t\t\t\t\t\tparentTask.output = \"Browser opened, waiting for you to login...\";\n\t\t\t\t\t\tawait this.waitingForLogin();\n\t\t\t\t\t}\n\n\t\t\t\t\tparentTask.output = \"\";\n\t\t\t\t\tparentTask.title = `Logged in`;\n\n\t\t\t\t\treturn listr(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle: \"Fetching user profile...\",\n\t\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\t\tawait this.fetchUserProfile();\n\t\t\t\t\t\t\t\t\tparentTask.title = `Logged in as ${chalk.cyan(\n\t\t\t\t\t\t\t\t\t\tthis.context.userProfile?.email,\n\t\t\t\t\t\t\t\t\t)}`;\n\t\t\t\t\t\t\t\t\ttask.title = \"Fetched user profile\";\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle: \"Fetching user repositories...\",\n\t\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\t\tawait this.fetchUserRepositories();\n\t\t\t\t\t\t\t\t\ttask.title = \"Fetched user repositories\";\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\t{ concurrent: true },\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected async pressKeyToLogin(): Promise<void> {\n\t\tawait new Promise((resolve) => {\n\t\t\tconst initialRawMode = !!process.stdin.isRaw;\n\t\t\tprocess.stdin.setRawMode?.(true);\n\t\t\tprocess.stdin.resume();\n\t\t\tprocess.stdin.once(\"data\", (data: Buffer) => {\n\t\t\t\tprocess.stdin.setRawMode?.(initialRawMode);\n\t\t\t\tprocess.stdin.pause();\n\t\t\t\tresolve(data.toString(\"utf-8\"));\n\t\t\t});\n\t\t});\n\t}\n\n\tprotected async waitingForLogin(): Promise<void> {\n\t\tconst { port, url } = await this.manager.user.getLoginSessionInfo();\n\t\tawait this.manager.user.nodeLoginSession({\n\t\t\tport,\n\t\t\tonListenCallback() {\n\t\t\t\topen(url);\n\t\t\t},\n\t\t});\n\t}\n\n\tprotected useRepositoryFlag(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: `Flag ${chalk.cyan(\"repository\")} used, validating input...`,\n\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.options.repository,\n\t\t\t\t\t\t\"Flag `repository` must be set to run `useRepositoryFlag`\",\n\t\t\t\t\t);\n\t\t\t\t\tconst domain = formatRepositoryDomain(this.options.repository);\n\t\t\t\t\tconst validation = await validateRepositoryDomainAndAvailability({\n\t\t\t\t\t\tdomain,\n\t\t\t\t\t\texistsFn: (domain) =>\n\t\t\t\t\t\t\tthis.manager.prismicRepository.checkExists({ domain }),\n\t\t\t\t\t});\n\n\t\t\t\t\tif (validation.LessThanMin || validation.MoreThanMax) {\n\t\t\t\t\t\tconst errorMessage = getErrorMessageForRepositoryDomainValidation({\n\t\t\t\t\t\t\tvalidation: {\n\t\t\t\t\t\t\t\t...validation,\n\t\t\t\t\t\t\t\t// We don't want to throw if repo already exists.\n\t\t\t\t\t\t\t\t// User most probably just created it via their dashboard.\n\t\t\t\t\t\t\t\tAlreadyExists: false,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdisplayDomain: chalk.cyan(domain),\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tif (errorMessage) {\n\t\t\t\t\t\t\tthrow new Error(errorMessage);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttask.title = `Selected repository ${chalk.cyan(\n\t\t\t\t\t\tdomain,\n\t\t\t\t\t)} (flag ${chalk.cyan(\"repository\")} used)`;\n\n\t\t\t\t\tthis.context.repository = {\n\t\t\t\t\t\tdomain,\n\t\t\t\t\t\texists: validation.AlreadyExists ?? false,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected async selectRepository(): Promise<void> {\n\t\tassertExists(\n\t\t\tthis.context.userRepositories,\n\t\t\t\"User repositories must be available through context to run `selectRepository`\",\n\t\t);\n\n\t\tif (this.context.userRepositories.length) {\n\t\t\tawait this.trySelectExistingRepository();\n\t\t}\n\n\t\tif (!this.context.repository) {\n\t\t\tawait this.selectNewRepository();\n\t\t}\n\n\t\tassertExists(\n\t\t\tthis.context.repository,\n\t\t\t\"Repository selection must be available through context to proceed\",\n\t\t);\n\t\t// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(\n\t\t\t`${logSymbols.success} Selected repository ${chalk.cyan(\n\t\t\t\tthis.context.repository.domain,\n\t\t\t)}`,\n\t\t);\n\t}\n\n\tprotected async trySelectExistingRepository(): Promise<void> {\n\t\tassertExists(\n\t\t\tthis.context.userRepositories,\n\t\t\t\"User repositories must be available through context to run `trySelectExistingRepository`\",\n\t\t);\n\n\t\tconst { maybeDomain } = await prompt<string, \"maybeDomain\">({\n\t\t\ttype: \"select\",\n\t\t\tname: \"maybeDomain\",\n\t\t\tmessage: \"Pick a repository to connect to or choose to create a new one\",\n\t\t\twarn: \"You are not a developer or admin of this repository\",\n\t\t\tchoices: [\n\t\t\t\t{\n\t\t\t\t\ttitle: \"CREATE NEW\",\n\t\t\t\t\tdescription: \"Create a new Prismic repository\\n\",\n\t\t\t\t\tvalue: \"\",\n\t\t\t\t},\n\t\t\t\t...this.context.userRepositories\n\t\t\t\t\t.map((repository) => {\n\t\t\t\t\t\tconst hasWriteAccess =\n\t\t\t\t\t\t\tthis.manager.prismicRepository.hasWriteAccess(repository);\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttitle: `${repository.domain}${\n\t\t\t\t\t\t\t\thasWriteAccess ? \"\" : \" (Unauthorized)\"\n\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tdescription: `Connect to ${chalk.cyan(repository.domain)}`,\n\t\t\t\t\t\t\tvalue: repository.domain,\n\t\t\t\t\t\t\tdisabled: !hasWriteAccess,\n\t\t\t\t\t\t};\n\t\t\t\t\t})\n\t\t\t\t\t.sort((a, b) => (a.value > b.value ? 1 : -1)),\n\t\t\t],\n\t\t});\n\n\t\tif (maybeDomain) {\n\t\t\tthis.context.repository = {\n\t\t\t\tdomain: maybeDomain,\n\t\t\t\texists: true,\n\t\t\t};\n\t\t}\n\t}\n\n\tprotected async selectNewRepository(): Promise<void> {\n\t\tlet suggestedName = \"\";\n\n\t\t// TODO: Improve concurrency\n\t\tconst trySuggestName = async (name: string): Promise<string | void> => {\n\t\t\tif (name) {\n\t\t\t\tconst formattedName = formatRepositoryDomain(name);\n\n\t\t\t\tif (\n\t\t\t\t\t!validateRepositoryDomain({ domain: formattedName }).hasErrors &&\n\t\t\t\t\t!(await this.manager.prismicRepository.checkExists({\n\t\t\t\t\t\tdomain: formattedName,\n\t\t\t\t\t}))\n\t\t\t\t) {\n\t\t\t\t\treturn formattedName;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// 1. Try to suggest name after directory name\n\t\tconst maybeSuggestion = await trySuggestName(\n\t\t\tpath.basename(this.manager.cwd),\n\t\t);\n\t\tif (maybeSuggestion) {\n\t\t\tsuggestedName = maybeSuggestion;\n\t\t}\n\n\t\t// 2. Try to suggest name after package name\n\t\tif (!suggestedName) {\n\t\t\ttry {\n\t\t\t\tconst pkgJSONPath = path.join(this.manager.cwd, \"package.json\");\n\t\t\t\tconst pkg = JSON.parse(await fs.readFile(pkgJSONPath, \"utf-8\"));\n\n\t\t\t\tconst maybeSuggestion = await trySuggestName(pkg.name);\n\t\t\t\tif (maybeSuggestion) {\n\t\t\t\t\tsuggestedName = maybeSuggestion;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Noop\n\t\t\t}\n\t\t}\n\n\t\t// 3. Use random name\n\t\tif (!suggestedName) {\n\t\t\tdo {\n\t\t\t\tsuggestedName = getRandomRepositoryDomain();\n\t\t\t} while (\n\t\t\t\tawait this.manager.prismicRepository.checkExists({\n\t\t\t\t\tdomain: suggestedName,\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\n\t\tconst { domain } = await prompt<string, \"domain\">({\n\t\t\ttype: \"text\",\n\t\t\tname: \"domain\",\n\t\t\t// Overriden by the `onRender` function, just used as a fallback\n\t\t\tmessage: \"Choose a name for your Prismic repository\",\n\t\t\tinitial: suggestedName,\n\t\t\tonRender() {\n\t\t\t\tconst rawDomain = this.value || this.initial || \"\";\n\t\t\t\tconst domain = formatRepositoryDomain(rawDomain);\n\t\t\t\tconst validation = validateRepositoryDomain({ domain });\n\n\t\t\t\tconst minRule = validation.LessThanMin\n\t\t\t\t\t? chalk.red(\n\t\t\t\t\t\t\t`1. Name must be ${chalk.bold(\n\t\t\t\t\t\t\t\tREPOSITORY_NAME_VALIDATION.Min + \" characters long or more\",\n\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t )\n\t\t\t\t\t: `1. Name must be ${chalk.cyan(\n\t\t\t\t\t\t\tREPOSITORY_NAME_VALIDATION.Min + \" characters long or more\",\n\t\t\t\t\t )}`;\n\n\t\t\t\tconst maxRule = validation.MoreThanMax\n\t\t\t\t\t? chalk.red(\n\t\t\t\t\t\t\t`1. Name must be ${chalk.bold(\n\t\t\t\t\t\t\t\tREPOSITORY_NAME_VALIDATION.Max + \" characters long or less\",\n\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t )\n\t\t\t\t\t: `1. Name must be ${chalk.cyan(\n\t\t\t\t\t\t\tREPOSITORY_NAME_VALIDATION.Max + \" characters long or less\",\n\t\t\t\t\t )}`;\n\n\t\t\t\tthis.msg = chalk.reset(\n\t\t\t\t\t`\nChoose a name for your Prismic repository\n\n NAMING RULES\n ${minRule}\n ${maxRule}\n 3. Name will be ${chalk.cyan(\"kebab-cased\")} automatically\n\n CONSIDERATIONS\n 1. Once picked, your repository name ${chalk.cyan(\"cannot be changed\")}\n 2. A ${chalk.cyan(\n\t\t\t\"display name\",\n\t\t)} for the repository can be configured later on\n\n PREVIEW\n Dashboard ${chalk.cyan(`https://${domain}.prismic.io`)}\n API ${chalk.cyan(`https://${domain}.cdn.prismic.io/api/v2`)}\n\n${chalk.cyan(\"?\")} Your Prismic repository name`.replace(\"\\n\", \"\"),\n\t\t\t\t);\n\t\t\t},\n\t\t\tvalidate: async (rawDomain: string) => {\n\t\t\t\tconst domain = formatRepositoryDomain(rawDomain);\n\t\t\t\tconst validation = await validateRepositoryDomainAndAvailability({\n\t\t\t\t\tdomain,\n\t\t\t\t\texistsFn: (domain) =>\n\t\t\t\t\t\tthis.manager.prismicRepository.checkExists({ domain }),\n\t\t\t\t});\n\t\t\t\tconst errorMessage = getErrorMessageForRepositoryDomainValidation({\n\t\t\t\t\tvalidation,\n\t\t\t\t\tdisplayDomain: chalk.cyan(domain),\n\t\t\t\t});\n\n\t\t\t\treturn errorMessage || true;\n\t\t\t},\n\t\t\tformat: (value) => {\n\t\t\t\treturn formatRepositoryDomain(value);\n\t\t\t},\n\t\t});\n\n\t\t// Clear extra lines\n\t\tprocess.stdout.moveCursor?.(0, -16);\n\t\tprocess.stdout.clearScreenDown?.();\n\n\t\tthis.context.repository = {\n\t\t\tdomain,\n\t\t\texists: false,\n\t\t};\n\t}\n\n\tprotected createNewRepository(): Promise<void> {\n\t\tassertExists(\n\t\t\tthis.context.repository,\n\t\t\t\"Repository selection must be available through context to run `createNewRepository`\",\n\t\t);\n\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: `Creating new repository ${chalk.cyan(\n\t\t\t\t\tthis.context.repository.domain,\n\t\t\t\t)} ...`,\n\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.repository,\n\t\t\t\t\t\t\"Repository selection must be available through context to run `createNewRepository`\",\n\t\t\t\t\t);\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.framework,\n\t\t\t\t\t\t\"Project framework must be available through context to run `createNewRepository`\",\n\t\t\t\t\t);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.manager.prismicRepository.create({\n\t\t\t\t\t\t\tdomain: this.context.repository.domain,\n\t\t\t\t\t\t\tframework: this.context.framework.wroomTelemetryID,\n\t\t\t\t\t\t\tstarterId: this.context.starterId,\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t// When we have an error here, it's most probably because the user has a stale SESSION cookie\n\n\t\t\t\t\t\t// Ensure to logout user to remove SESSION and prismic-auth cookies\n\t\t\t\t\t\tawait this.manager.user.logout();\n\n\t\t\t\t\t\t// Force a new login to get a brand new cookies value\n\t\t\t\t\t\ttask.output =\n\t\t\t\t\t\t\t\"It seems there is an authentication problem, press any key to open the browser to login again...\";\n\t\t\t\t\t\tawait this.pressKeyToLogin();\n\t\t\t\t\t\ttask.output = \"Browser opened, waiting for you to login...\";\n\t\t\t\t\t\tawait this.waitingForLogin();\n\n\t\t\t\t\t\t// Try to create repository again with the new cookies value\n\t\t\t\t\t\tawait this.manager.prismicRepository.create({\n\t\t\t\t\t\t\tdomain: this.context.repository.domain,\n\t\t\t\t\t\t\tframework: this.context.framework.wroomTelemetryID,\n\t\t\t\t\t\t\tstarterId: this.context.starterId,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.context.repository.exists = true;\n\t\t\t\t\ttask.output = \"\";\n\t\t\t\t\ttask.title = `Created new repository ${chalk.cyan(\n\t\t\t\t\t\tthis.context.repository.domain,\n\t\t\t\t\t)}`;\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected finishCoreDependenciesInstallation(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: `Finishing core dependencies installation with ${chalk.cyan(\n\t\t\t\t\tthis.context.packageManager,\n\t\t\t\t)} ...`,\n\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.installProcess,\n\t\t\t\t\t\t\"Initial dependencies installation process must be available through context to run `finishCoreDependenciesInstallation`\",\n\t\t\t\t\t);\n\n\t\t\t\t\tconst updateOutput = (data: Buffer | null) => {\n\t\t\t\t\t\tif (data instanceof Buffer) {\n\t\t\t\t\t\t\ttask.output = data.toString();\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t// Don't clutter console with logs when process is non TTY (CI, etc.)\n\t\t\t\t\tif (process.stdout.isTTY || process.env.NODE_ENV === \"test\") {\n\t\t\t\t\t\tthis.context.installProcess.stdout?.on(\"data\", updateOutput);\n\t\t\t\t\t}\n\t\t\t\t\tthis.context.installProcess.stderr?.on(\"data\", updateOutput);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.context.installProcess;\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Error catching happens when then process is started ealier so\n\t\t\t\t\t\t * that all install errors, earlier and presents, can be catched.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * Here, we force the task to wait so that it is neither marked as\n\t\t\t\t\t\t * done or has the opportunity to handle the error itself.\n\t\t\t\t\t\t */\n\t\t\t\t\t\t// If for whatever reason the process is not exited by now, we still throw the error\n\t\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, 5000));\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\n\t\t\t\t\ttask.title = `Installed core dependencies with ${chalk.cyan(\n\t\t\t\t\t\tthis.context.packageManager,\n\t\t\t\t\t)}`;\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected upsertSliceMachineConfigurationAndStartPluginRunner(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Resolving Slice Machine configuration...\",\n\t\t\t\ttask: async (_, parentTask) => {\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.framework,\n\t\t\t\t\t\t\"Project framework must be available through context to run `upsertSliceMachineConfiguration`\",\n\t\t\t\t\t);\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.repository,\n\t\t\t\t\t\t\"Repository selection must be available through context to run `upsertSliceMachineConfiguration`\",\n\t\t\t\t\t);\n\n\t\t\t\t\tlet sliceMachineConfigExists = false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.manager.project.getSliceMachineConfigPath();\n\t\t\t\t\t\tsliceMachineConfigExists = true;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// noop, config does not exists, we'll create it\n\t\t\t\t\t}\n\n\t\t\t\t\tif (sliceMachineConfigExists) {\n\t\t\t\t\t\tparentTask.title = \"Updating Slice Machine configuration...\";\n\n\t\t\t\t\t\tconst config = await this.manager.project.getSliceMachineConfig();\n\t\t\t\t\t\tawait this.manager.project.writeSliceMachineConfig({\n\t\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\t\t...config,\n\t\t\t\t\t\t\t\trepositoryName: this.context.repository.domain,\n\t\t\t\t\t\t\t\tadapter: this.context.framework.adapterName,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t\tparentTask.title = \"Updated Slice Machine configuration\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tparentTask.title = \"Creating Slice Machine configuration...\";\n\n\t\t\t\t\t\tconst sliceMachineConfigPath =\n\t\t\t\t\t\t\tawait this.manager.project.suggestSliceMachineConfigPath();\n\n\t\t\t\t\t\tawait this.manager.project.writeSliceMachineConfig({\n\t\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\t\trepositoryName: this.context.repository.domain,\n\t\t\t\t\t\t\t\tadapter: this.context.framework.adapterName,\n\t\t\t\t\t\t\t\tlibraries: [\"./slices\"],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tpath: sliceMachineConfigPath,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tparentTask.title = \"Created Slice Machine configuration\";\n\t\t\t\t\t}\n\n\t\t\t\t\treturn listr([\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO: Revert when plugin are introduced to users\n\t\t\t\t\t\t\t// title: \"Starting plugin runner...\",\n\t\t\t\t\t\t\ttitle: \"Loading adapter...\",\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tawait this.manager.plugins.initPlugins();\n\t\t\t\t\t\t\t\t// TODO: Revert when plugin are introduced to users\n\t\t\t\t\t\t\t\t// task.title = \"Started plugin runner\";\n\t\t\t\t\t\t\t\ttask.title = \"Loaded adapter\";\n\t\t\t\t\t\t\t\t// TODO: Revert when plugin are introduced to users\n\t\t\t\t\t\t\t\t// parentTask.title = `${parentTask.title} and started plugin runner`;\n\t\t\t\t\t\t\t\tparentTask.title = `${parentTask.title} and loaded adapter`;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t]);\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected async readAllSlices(): Promise<\n\t\t{ libraryID: string; sliceID: string }[]\n\t> {\n\t\tconst { libraries, errors } =\n\t\t\tawait this.manager.slices.readAllSliceLibraries();\n\n\t\tif (errors.length > 0) {\n\t\t\t// TODO: Provide better error message.\n\t\t\tthrow new Error(`Failed to read slice libraries: ${errors.join(\", \")}`);\n\t\t}\n\n\t\tconst slices: { libraryID: string; sliceID: string }[] = [];\n\t\tfor (const library of libraries) {\n\t\t\tif (library.sliceIDs) {\n\t\t\t\tfor (const sliceID of library.sliceIDs) {\n\t\t\t\t\tslices.push({\n\t\t\t\t\t\tlibraryID: library.libraryID,\n\t\t\t\t\t\tsliceID,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn slices;\n\t}\n\n\tprotected async readDocuments(): Promise<\n\t\t| {\n\t\t\t\tsignature: string;\n\t\t\t\tdocuments: string[];\n\t\t\t\tdirectoryPath: string;\n\t\t }\n\t\t| undefined\n\t> {\n\t\tconst root = await this.manager.project.getRoot();\n\t\tconst documentsDirectoryPath = path.resolve(root, \"documents\");\n\t\ttry {\n\t\t\tawait fs.access(documentsDirectoryPath);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t\tconst signaturePath = path.resolve(documentsDirectoryPath, \"index.json\");\n\t\tconst rawSignature = await fs.readFile(signaturePath, \"utf-8\");\n\t\tconst signature: string = JSON.parse(rawSignature).signature;\n\n\t\tconst documents = await globby(\"*/*.json\", {\n\t\t\tcwd: documentsDirectoryPath,\n\t\t});\n\n\t\treturn { signature, documents, directoryPath: documentsDirectoryPath };\n\t}\n\n\tprotected syncDataWithPrismic(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Syncing data with Prismic...\",\n\t\t\t\ttask: (_, parentTask) =>\n\t\t\t\t\tlistr([\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Pushing slices...\",\n\t\t\t\t\t\t\tskip: () => {\n\t\t\t\t\t\t\t\tif (!this.options.push) {\n\t\t\t\t\t\t\t\t\treturn `--no-push used`;\n\t\t\t\t\t\t\t\t} else if (!this.options.pushSlices) {\n\t\t\t\t\t\t\t\t\treturn `--no-push-slices used`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tconst slices = await this.readAllSlices();\n\n\t\t\t\t\t\t\t\tif (slices.length === 0) {\n\t\t\t\t\t\t\t\t\ttask.skip(\"No slice to push\");\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttask.title = \"Pushing slices... (initializing ACL)\";\n\t\t\t\t\t\t\t\tawait this.manager.screenshots.initS3ACL();\n\n\t\t\t\t\t\t\t\tlet pushed = 0;\n\t\t\t\t\t\t\t\ttask.title = `Pushing slices... (0/${slices.length})`;\n\t\t\t\t\t\t\t\tawait Promise.all(\n\t\t\t\t\t\t\t\t\tslices.map(async (slice) => {\n\t\t\t\t\t\t\t\t\t\tawait this.manager.slices.pushSlice({\n\t\t\t\t\t\t\t\t\t\t\t...slice,\n\t\t\t\t\t\t\t\t\t\t\tuserAgent: SLICE_MACHINE_INIT_USER_AGENT,\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\tpushed++;\n\t\t\t\t\t\t\t\t\t\ttask.title = `Pushing slices... (${pushed}/${slices.length})`;\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\ttask.title = \"Pushed all slices\";\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Pushing types...\",\n\t\t\t\t\t\t\tskip: () => {\n\t\t\t\t\t\t\t\tif (!this.options.push) {\n\t\t\t\t\t\t\t\t\treturn `--no-push used`;\n\t\t\t\t\t\t\t\t} else if (!this.options.pushCustomTypes) {\n\t\t\t\t\t\t\t\t\treturn `--no-push-custom-types used`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tconst { ids, errors } =\n\t\t\t\t\t\t\t\t\tawait this.manager.customTypes.readCustomTypeLibrary();\n\n\t\t\t\t\t\t\t\tif (errors.length > 0) {\n\t\t\t\t\t\t\t\t\t// TODO: Provide better error message.\n\t\t\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t\t\t`Failed to read custom type libraries: ${errors.join(\n\t\t\t\t\t\t\t\t\t\t\t\", \",\n\t\t\t\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (!ids || ids.length === 0) {\n\t\t\t\t\t\t\t\t\ttask.skip(\"No custom type to push\");\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tlet pushed = 0;\n\t\t\t\t\t\t\t\ttask.title = `Pushing types... (0/${ids.length})`;\n\t\t\t\t\t\t\t\tawait Promise.all(\n\t\t\t\t\t\t\t\t\tids.map(async (id) => {\n\t\t\t\t\t\t\t\t\t\tawait this.manager.customTypes.pushCustomType({\n\t\t\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\t\t\tuserAgent: SLICE_MACHINE_INIT_USER_AGENT,\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\tpushed++;\n\t\t\t\t\t\t\t\t\t\ttask.title = `Pushing types... (${pushed}/${ids.length})`;\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\ttask.title = \"Pushed all types\";\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Pushing documents...\",\n\t\t\t\t\t\t\tskip: () => {\n\t\t\t\t\t\t\t\tif (!this.options.push) {\n\t\t\t\t\t\t\t\t\treturn `--no-push used`;\n\t\t\t\t\t\t\t\t} else if (!this.options.pushDocuments) {\n\t\t\t\t\t\t\t\t\treturn `--no-push-documents used`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tassertExists(\n\t\t\t\t\t\t\t\t\tthis.context.repository,\n\t\t\t\t\t\t\t\t\t\"Repository selection must be available through context to run `syncDataWithPrismic`\",\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tconst documentsRead = await this.readDocuments();\n\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tdocumentsRead === undefined ||\n\t\t\t\t\t\t\t\t\t\tdocumentsRead.documents.length === 0\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\ttask.skip(\"No document to push\");\n\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tconst { signature, documents, directoryPath } = documentsRead;\n\n\t\t\t\t\t\t\t\t\t// TODO: Replace `unknown` with a Prismic document type.\n\t\t\t\t\t\t\t\t\t// The exact format is not know at this time, hence the `unknown`.\n\t\t\t\t\t\t\t\t\tconst recordDocument: Record<string, unknown> = {};\n\n\t\t\t\t\t\t\t\t\tawait Promise.all(\n\t\t\t\t\t\t\t\t\t\tdocuments.map(async (documentPath) => {\n\t\t\t\t\t\t\t\t\t\t\tconst filename = path.basename(documentPath, \".json\");\n\t\t\t\t\t\t\t\t\t\t\tconst fileContent = await fs.readFile(\n\t\t\t\t\t\t\t\t\t\t\t\tpath.resolve(directoryPath, documentPath),\n\t\t\t\t\t\t\t\t\t\t\t\t\"utf-8\",\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t// TOOD: Validate the contents of the JSON file and skip on invalid documents.\n\t\t\t\t\t\t\t\t\t\t\t\tconst parsedContents = JSON.parse(fileContent);\n\n\t\t\t\t\t\t\t\t\t\t\t\trecordDocument[filename] = parsedContents;\n\t\t\t\t\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\t\t\t\t\t// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better\n\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t\t\t\t\t\t`Skipped document due to its invalid format: ${documentPath}`,\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tawait this.manager.prismicRepository.pushDocuments({\n\t\t\t\t\t\t\t\t\t\tdomain: this.context.repository.domain,\n\t\t\t\t\t\t\t\t\t\tdocuments: recordDocument,\n\t\t\t\t\t\t\t\t\t\tsignature,\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\ttask.title = \"Pushed all documents\";\n\t\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\t\ttask.skip(\"No document to push\");\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Cleaning up data push artifacts\",\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tconst root = await this.manager.project.getRoot();\n\t\t\t\t\t\t\t\tconst documentsDirectoryPath = path.resolve(root, \"documents\");\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tawait fs.rm(documentsDirectoryPath, {\n\t\t\t\t\t\t\t\t\t\tforce: true,\n\t\t\t\t\t\t\t\t\t\trecursive: true,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\t\t// Noop, it's not that big of a deal if we cannot delete this directory\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttask.title = \"Cleaned up data push artifacts\";\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Pulling existing types...\",\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tconst { ids, errors } =\n\t\t\t\t\t\t\t\t\tawait this.manager.customTypes.readCustomTypeLibrary();\n\n\t\t\t\t\t\t\t\tif (errors.length > 0) {\n\t\t\t\t\t\t\t\t\t// TODO: Provide better error message.\n\t\t\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t\t\t`Failed to read custom type libraries: ${errors.join(\n\t\t\t\t\t\t\t\t\t\t\t\", \",\n\t\t\t\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (ids && ids.length > 0) {\n\t\t\t\t\t\t\t\t\ttask.skip(\"Types already exist\");\n\t\t\t\t\t\t\t\t\tparentTask.title = \"Synced data with Prismic\";\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconst remoteTypes =\n\t\t\t\t\t\t\t\t\tawait this.manager.customTypes.fetchRemoteCustomTypes();\n\n\t\t\t\t\t\t\t\tconst createCustomTypeLimit = pLimit(8);\n\n\t\t\t\t\t\t\t\tlet pulled = 0;\n\t\t\t\t\t\t\t\ttask.title = `Pulling existing types... (0/${remoteTypes.length})`;\n\t\t\t\t\t\t\t\tawait Promise.all(\n\t\t\t\t\t\t\t\t\tremoteTypes.map(async (model) => {\n\t\t\t\t\t\t\t\t\t\tawait createCustomTypeLimit(() =>\n\t\t\t\t\t\t\t\t\t\t\tthis.manager.customTypes.createCustomType({ model }),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tpulled++;\n\t\t\t\t\t\t\t\t\t\ttask.title = `Pulling existing types... (${pulled}/${remoteTypes.length})`;\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\ttask.title = \"Pulled existing types\";\n\t\t\t\t\t\t\t\tparentTask.title = \"Synced data with Prismic\";\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t]),\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected initializeProject(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Initializing project...\",\n\t\t\t\ttask: async (_, parentTask) =>\n\t\t\t\t\t// We return another Listr instance in the event we have additional task to perform to initialize the project\n\t\t\t\t\tlistr([\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: `Patching ${chalk.cyan(\"package.json\")} scripts...`,\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tconst pkgPath = path.join(this.manager.cwd, \"package.json\");\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tconst pkgRaw = await fs.readFile(pkgPath, \"utf-8\");\n\t\t\t\t\t\t\t\t\tconst pkg = JSON.parse(pkgRaw);\n\n\t\t\t\t\t\t\t\t\tpkg.scripts ||= {};\n\n\t\t\t\t\t\t\t\t\tif (!pkg.scripts[START_SCRIPT_KEY]) {\n\t\t\t\t\t\t\t\t\t\tpkg.scripts[START_SCRIPT_KEY] = START_SCRIPT_VALUE;\n\n\t\t\t\t\t\t\t\t\t\t// Cheap indent detection based on https://github.com/sindresorhus/detect-indent (simplified because we're only dealing with JSON here)\n\t\t\t\t\t\t\t\t\t\tconst firstIndent = pkgRaw\n\t\t\t\t\t\t\t\t\t\t\t.split(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t\t.find((line) => line.match(/^(?:( )+|\\t+)/));\n\t\t\t\t\t\t\t\t\t\tconst indent = firstIndent?.match(/^(?:( )+|\\t+)/)?.[0];\n\n\t\t\t\t\t\t\t\t\t\tawait fs.writeFile(\n\t\t\t\t\t\t\t\t\t\t\tpkgPath,\n\t\t\t\t\t\t\t\t\t\t\tJSON.stringify(\n\t\t\t\t\t\t\t\t\t\t\t\tpkg,\n\t\t\t\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\t\t\t\tindent && indent !== \" \" ? indent : \" \",\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t!pkg.scripts[\"slicemachine\"].startsWith(START_SCRIPT_VALUE)\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tthrow new Error(\"Script already exists\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\t\ttask.title = `Could not patch ${chalk.cyan(\n\t\t\t\t\t\t\t\t\t\t\"package.json\",\n\t\t\t\t\t\t\t\t\t)} scripts (warning)`;\n\t\t\t\t\t\t\t\t\tparentTask.title = `Initialized project (could not patch ${chalk.cyan(\n\t\t\t\t\t\t\t\t\t\t\"package.json\",\n\t\t\t\t\t\t\t\t\t)} scripts)`;\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tthis.context.projectInitialization ||= {};\n\t\t\t\t\t\t\t\tthis.context.projectInitialization.patchedScript = true;\n\n\t\t\t\t\t\t\t\ttask.title = `Patched ${chalk.cyan(\"package.json\")} scripts`;\n\t\t\t\t\t\t\t\tparentTask.title = `Initialized project (patched ${chalk.cyan(\n\t\t\t\t\t\t\t\t\t\"package.json\",\n\t\t\t\t\t\t\t\t)} scripts)`;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t]),\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected initializePlugins(): Promise<void> {\n\t\treturn listrRun(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\t// TODO: Revert when plugin are introduced to users\n\t\t\t\t\t// title: \"Initializing plugins...\",\n\t\t\t\t\ttitle: \"Initializing adapter...\",\n\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\tconst updateOutput = (data: Buffer | string | null) => {\n\t\t\t\t\t\t\tif (data instanceof Buffer) {\n\t\t\t\t\t\t\t\ttask.output = data.toString();\n\t\t\t\t\t\t\t} else if (typeof data === \"string\") {\n\t\t\t\t\t\t\t\ttask.output = data;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tawait this.manager.project.initProject({\n\t\t\t\t\t\t\tlog: updateOutput,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// TODO: Revert when plugin are introduced to users\n\t\t\t\t\t\t// task.title = \"Initialized plugins\";\n\t\t\t\t\t\ttask.title = \"Initialized adapter\";\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\t{ exitOnError: false },\n\t\t).catch(() => void 0);\n\t}\n}\n"],"names":["_","_b","_a","domain","pkg","maybeSuggestion"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,MAAM,kBAAkD;AAAA,EACvD,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,mBAAmB;;AAGP,MAAA,gCAAgC,CAC5C,YAC4B;AACrB,SAAA,IAAI,wBAAwB,OAAO;AAC3C;MAkBa,wBAAuB;AAAA,EAMnC,YAAY,SAAwC;AAL1C;AACA;AAEA;AAsLA,sCAAa,OAAO,UAAiC;AACxD,YAAA,KAAK,iBAAiB,K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BACT,OAAO,SAAS,UAAU;AACpC,mBAAK,SAAS;AAAA,YACd;AAAA,UAAA;AAGI,gBAAA,KAAK,QAAQ,QAAQ,YAAY;AAAA,YACtC,KAAK;AAAA,UAAA,CACL;AAID,eAAK,QAAQ;AAAA,QACd;AAAA,MACA;AAAA,IAAA,GAEF,EAAE,aAAa,MAAO,CAAA,EACrB,MAAM,MAAM,MAAM;AAAA,EACrB;AACA;"}
1
+ {"version":3,"file":"SliceMachineInitProcess.js","sources":["../../src/SliceMachineInitProcess.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport chalk from \"chalk\";\n\nimport { execaCommand, type ExecaChildProcess } from \"execa\";\n\nimport open from \"open\";\nimport logSymbols from \"log-symbols\";\nimport { globby } from \"globby\";\nimport { downloadTemplate } from \"giget\";\nimport pLimit from \"p-limit\";\n\nimport {\n\tcreateSliceMachineManager,\n\tPrismicUserProfile,\n\tPrismicRepository,\n\tSliceMachineManager,\n\tPackageManager,\n\tStarterId,\n\tREPOSITORY_NAME_VALIDATION,\n} from \"@slicemachine/manager\";\n\nimport pkg from \"../package.json\";\nimport { detectFramework, Framework } from \"./lib/framework\";\nimport { getRunScriptCommand } from \"./lib/getRunScriptCommand\";\nimport { getExecuteCommand } from \"./lib/getExecuteCommand\";\nimport {\n\tgetRandomRepositoryDomain,\n\tformatRepositoryDomain,\n\tvalidateRepositoryDomain,\n\tvalidateRepositoryDomainAndAvailability,\n\tgetErrorMessageForRepositoryDomainValidation,\n} from \"./lib/repositoryDomain\";\nimport { listr, listrRun } from \"./lib/listr\";\nimport { prompt } from \"./lib/prompt\";\nimport { assertExists } from \"./lib/assertExists\";\nimport {\n\tGIGET_ORGANIZATION,\n\tGIGET_PROVIDER,\n\tSLICE_MACHINE_INIT_USER_AGENT,\n\tSTART_SCRIPT_KEY,\n\tSTART_SCRIPT_VALUE,\n} from \"./constants\";\nimport { detectStarterId } from \"./lib/starters\";\nimport { setupSentry } from \"./lib/setupSentry\";\nimport { trackSentryError } from \"./lib/sentryErrorHandlers\";\nimport { updateSentryContext } from \"./lib/updateSentryContext\";\n\nexport type SliceMachineInitProcessOptions = {\n\trepository?: string;\n\tstarter?: string;\n\tdirectoryName?: string;\n\tpush?: boolean;\n\tpushSlices?: boolean;\n\tpushCustomTypes?: boolean;\n\tpushDocuments?: boolean;\n\tstartSlicemachine?: boolean;\n\tcwd?: string;\n} & Record<string, unknown>;\n\nconst DEFAULT_OPTIONS: SliceMachineInitProcessOptions = {\n\tpush: true,\n\tpushSlices: true,\n\tpushCustomTypes: true,\n\tpushDocuments: true,\n\tstartSlicemachine: true,\n};\n\nexport const createSliceMachineInitProcess = (\n\toptions?: SliceMachineInitProcessOptions,\n): SliceMachineInitProcess => {\n\treturn new SliceMachineInitProcess(options);\n};\n\ntype SliceMachineInitProcessContext = {\n\tframework?: Framework;\n\tpackageManager?: PackageManager;\n\tinstallProcess?: ExecaChildProcess;\n\tuserProfile?: PrismicUserProfile;\n\tuserRepositories?: PrismicRepository[];\n\trepository?: {\n\t\tdomain: string;\n\t\texists: boolean;\n\t};\n\tprojectInitialization?: {\n\t\tpatchedScript?: boolean;\n\t};\n\tstarterId?: StarterId;\n};\n\nexport class SliceMachineInitProcess {\n\tprotected options: SliceMachineInitProcessOptions;\n\tprotected manager: SliceMachineManager;\n\n\tprotected context: SliceMachineInitProcessContext;\n\n\tconstructor(options?: SliceMachineInitProcessOptions) {\n\t\tthis.options = { ...DEFAULT_OPTIONS, ...options };\n\t\tthis.manager = createSliceMachineManager({ cwd: options?.cwd });\n\n\t\tthis.context = {};\n\t}\n\n\tasync run(): Promise<void> {\n\t\t// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(\n\t\t\t`\\n${chalk.bgGray(` ${chalk.bold.white(\"Slice Machine\")} `)} ${chalk.dim(\n\t\t\t\t\"→\",\n\t\t\t)} Initializing\\n`,\n\t\t);\n\n\t\ttry {\n\t\t\tif (this.options.starter) {\n\t\t\t\tawait this.copyStarter();\n\t\t\t} else if (this.options.directoryName) {\n\t\t\t\t// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(\n\t\t\t\t\t`${logSymbols.warning} --directory-name has no effect because --starter is not specified\\n`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (await this.manager.telemetry.checkIsTelemetryEnabled()) {\n\t\t\t\t// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(\n\t\t\t\t\t`${\n\t\t\t\t\t\tlogSymbols.info\n\t\t\t\t\t} We collect telemetry data to improve user experience.\\n Learn more: ${chalk.cyan(\n\t\t\t\t\t\t\"https://prismic.dev/slice-machine/telemetry\",\n\t\t\t\t\t)}\\n`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tawait this.manager.telemetry.initTelemetry({\n\t\t\t\tappName: pkg.name,\n\t\t\t\tappVersion: pkg.version,\n\t\t\t});\n\t\t\ttry {\n\t\t\t\tawait setupSentry();\n\t\t\t} catch (error) {\n\t\t\t\t// noop - We don't want to stop the user from using Slice Machine\n\t\t\t\t// because of failed tracking set up. We probably couldn't determine the\n\t\t\t\t// Sentry environment.\n\t\t\t}\n\t\t\tawait this.manager.telemetry.track({\n\t\t\t\tevent: \"command:init:start\",\n\t\t\t\trepository: this.options.repository,\n\t\t\t});\n\n\t\t\tawait this.detectEnvironment();\n\n\t\t\tassertExists(\n\t\t\t\tthis.context.framework,\n\t\t\t\t\"Project framework must be available through context to proceed\",\n\t\t\t);\n\n\t\t\tawait this.beginCoreDependenciesInstallation();\n\n\t\t\tif (this.options.repository) {\n\t\t\t\tawait this.useRepositoryFlag();\n\t\t\t} else {\n\t\t\t\tawait this.loginAndFetchUserData();\n\t\t\t\tawait this.selectRepository();\n\t\t\t}\n\n\t\t\tassertExists(\n\t\t\t\tthis.context.repository,\n\t\t\t\t\"Repository selection must be available through context to proceed\",\n\t\t\t);\n\n\t\t\tawait this.finishCoreDependenciesInstallation();\n\t\t\tawait this.upsertSliceMachineConfigurationAndStartPluginRunner();\n\n\t\t\tconst isLoginRequired = await this.checkIsLoginRequired();\n\t\t\tif (isLoginRequired) {\n\t\t\t\tawait this.loginAndFetchUserData();\n\t\t\t\tif (this.context.repository.exists) {\n\t\t\t\t\tthis.validateWriteAccess();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!this.context.repository.exists) {\n\t\t\t\tawait this.createNewRepository();\n\t\t\t}\n\n\t\t\tawait this.syncDataWithPrismic();\n\t\t\tawait this.initializeProject();\n\t\t\tawait this.initializePlugins();\n\t\t} catch (error) {\n\t\t\tawait this.trackError(error);\n\n\t\t\tthrow error;\n\t\t}\n\n\t\tawait this.manager.telemetry.track({\n\t\t\tevent: \"command:init:end\",\n\t\t\tframework: this.context.framework.sliceMachineTelemetryID,\n\t\t\trepository: this.context.repository.domain,\n\t\t\tsuccess: true,\n\t\t});\n\n\t\t// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(\n\t\t\t`\\n${chalk.bgGreen(` ${chalk.bold.white(\"Slice Machine\")} `)} ${chalk.dim(\n\t\t\t\t\"→\",\n\t\t\t)} Initialization successful!\n\nContinue with next steps in Slice Machine.\n`,\n\t\t);\n\n\t\ttry {\n\t\t\tif (this.options.startSlicemachine) {\n\t\t\t\tconst runSmCommand = this.context.projectInitialization?.patchedScript\n\t\t\t\t\t? await getRunScriptCommand({\n\t\t\t\t\t\t\tagent: this.context.packageManager || \"npm\",\n\t\t\t\t\t\t\tscript: \"slicemachine\",\n\t\t\t\t\t })\n\t\t\t\t\t: await getExecuteCommand({\n\t\t\t\t\t\t\tagent: this.context.packageManager || \"npm\",\n\t\t\t\t\t\t\tscript: \"start-slicemachine\",\n\t\t\t\t\t });\n\n\t\t\t\tconst { startSlicemachine } = await prompt<\n\t\t\t\t\tboolean,\n\t\t\t\t\t\"startSlicemachine\"\n\t\t\t\t>({\n\t\t\t\t\ttype: \"confirm\",\n\t\t\t\t\tname: \"startSlicemachine\",\n\t\t\t\t\tmessage: `Run Slice Machine (${chalk.cyan(runSmCommand)})?`,\n\t\t\t\t\tinitial: true,\n\t\t\t\t});\n\n\t\t\t\tif (startSlicemachine) {\n\t\t\t\t\tconst commandReturnValue = await execaCommand(runSmCommand, {\n\t\t\t\t\t\tenv: { FORCE_COLOR: \"true\" },\n\t\t\t\t\t}).pipeStdout?.(process.stdout);\n\t\t\t\t\tif (commandReturnValue !== undefined) {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.log(commandReturnValue.stdout);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// Only track this error with Sentry, it's only the final convenience message\n\t\t\tawait this.trackSentryError(error);\n\t\t}\n\t}\n\n\tprotected async checkIsLoginRequired(): Promise<boolean> {\n\t\ttry {\n\t\t\tassertExists(this.context.repository, \"\");\n\t\t\tif (this.context.repository.exists === false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconst [slices, ctLibrary, documentsGlob] = await Promise.all([\n\t\t\t\tthis.readAllSlices(),\n\t\t\t\tthis.manager.customTypes.readCustomTypeLibrary(),\n\t\t\t\tthis.readDocuments(),\n\t\t\t]);\n\n\t\t\t// If repository exists, and there's anything to push\n\t\t\tif (\n\t\t\t\tslices.length > 0 ||\n\t\t\t\tctLibrary.ids.length > 0 ||\n\t\t\t\t(documentsGlob !== undefined && documentsGlob.documents.length > 0)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// If repository exists, and there might be things to pull\n\t\t\tif (ctLibrary.ids.length === 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprotected trackError = async (error: unknown): Promise<void> => {\n\t\tawait this.trackSentryError(error);\n\t\tawait this.trackTelemetryError(error);\n\t};\n\n\tprotected trackTelemetryError = async (error: unknown): Promise<void> => {\n\t\t// Transform error to string and prevent hitting Segment 500kb API limit or sending ridiculously long trace\n\t\tconst safeError = (\n\t\t\terror instanceof Error ? error.message : `${error}`\n\t\t).slice(0, 512);\n\t\tawait this.manager.telemetry.track({\n\t\t\tevent: \"command:init:end\",\n\t\t\tframework: this.context.framework?.sliceMachineTelemetryID ?? \"unknown\",\n\t\t\trepository: this.context.repository?.domain || \"\",\n\t\t\tsuccess: false,\n\t\t\terror: safeError,\n\t\t});\n\t};\n\n\tprotected trackSentryError = async (error: unknown): Promise<void> => {\n\t\tawait updateSentryContext({\n\t\t\tmanager: this.manager,\n\t\t\trepositoryName: this.context.repository?.domain || \"\",\n\t\t\tframework: this.context.framework?.sliceMachineTelemetryID ?? \"unknown\",\n\t\t});\n\t\ttrackSentryError(error);\n\t};\n\n\tprotected async copyStarter(): Promise<void> {\n\t\tconst dir = await this.getStarterDirectoryName();\n\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Copying starter...\\n\",\n\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\tconst starter = this.options.starter;\n\n\t\t\t\t\tawait downloadTemplate(\n\t\t\t\t\t\t`${GIGET_PROVIDER}:${GIGET_ORGANIZATION}/${starter}#HEAD`,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdir,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\tprocess.chdir(dir);\n\t\t\t\t\tthis.manager.cwd = process.cwd();\n\n\t\t\t\t\ttask.title = \"Starter copied\\n\";\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected async getStarterDirectoryName(): Promise<string> {\n\t\tlet directoryName: string;\n\t\tconst folderNames = await fs.readdir(process.cwd());\n\n\t\tif (\n\t\t\tthis.options.directoryName &&\n\t\t\t!folderNames.includes(this.options.directoryName)\n\t\t) {\n\t\t\t// Use provided directory\n\t\t\tdirectoryName = this.options.directoryName;\n\t\t} else if (\n\t\t\tthis.options.repository &&\n\t\t\t!folderNames.includes(this.options.repository)\n\t\t) {\n\t\t\t// Use repository name\n\t\t\tdirectoryName = this.options.repository;\n\t\t} else {\n\t\t\t// Use random name\n\t\t\tlet suggestedName: string;\n\t\t\tdo {\n\t\t\t\tsuggestedName = getRandomRepositoryDomain();\n\t\t\t} while (folderNames.includes(suggestedName));\n\n\t\t\tconst { selectedDirectory } = await prompt<string, \"selectedDirectory\">({\n\t\t\t\ttype: \"text\",\n\t\t\t\tname: \"selectedDirectory\",\n\t\t\t\tmessage: \"Your starter directory name\",\n\t\t\t\tinitial: suggestedName,\n\t\t\t\tvalidate: async (rawDirectory: string) => {\n\t\t\t\t\tif (folderNames.includes(rawDirectory)) {\n\t\t\t\t\t\treturn \"Directory name already exists\";\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tdirectoryName = selectedDirectory;\n\t\t}\n\n\t\treturn directoryName;\n\t}\n\n\tprotected detectEnvironment(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Detecting environment...\",\n\t\t\t\ttask: (_, parentTask) =>\n\t\t\t\t\tlistr([\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Detecting framework...\",\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tthis.context.framework = await detectFramework(\n\t\t\t\t\t\t\t\t\tthis.manager.cwd,\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\ttask.title = `Detected framework ${chalk.cyan(\n\t\t\t\t\t\t\t\t\tthis.context.framework.name,\n\t\t\t\t\t\t\t\t)}`;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Detecting package manager...\",\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tthis.context.packageManager =\n\t\t\t\t\t\t\t\t\tawait this.manager.project.detectPackageManager({\n\t\t\t\t\t\t\t\t\t\troot: this.manager.cwd,\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\ttask.title = `Detected package manager ${chalk.cyan(\n\t\t\t\t\t\t\t\t\tthis.context.packageManager,\n\t\t\t\t\t\t\t\t)}`;\n\n\t\t\t\t\t\t\t\tassertExists(\n\t\t\t\t\t\t\t\t\tthis.context.framework,\n\t\t\t\t\t\t\t\t\t\"Project framework must be available through context to proceed\",\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tparentTask.title = `Detected framework ${chalk.cyan(\n\t\t\t\t\t\t\t\t\tthis.context.framework.name,\n\t\t\t\t\t\t\t\t)} and package manager ${chalk.cyan(\n\t\t\t\t\t\t\t\t\tthis.context.packageManager,\n\t\t\t\t\t\t\t\t)}`;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Detecting starter...\",\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tthis.context.starterId = await detectStarterId(\n\t\t\t\t\t\t\t\t\tthis.manager.cwd,\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tif (this.context.starterId) {\n\t\t\t\t\t\t\t\t\ttask.title = `Detected starter ${chalk.cyan(\n\t\t\t\t\t\t\t\t\t\tthis.context.starterId,\n\t\t\t\t\t\t\t\t\t)}`;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttask.title = \"No starter detected\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t]),\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected beginCoreDependenciesInstallation(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Beginning core dependencies installation...\",\n\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.packageManager,\n\t\t\t\t\t\t\"Project package manager must be available through context to run `beginCoreDependenciesInstallation`\",\n\t\t\t\t\t);\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.framework,\n\t\t\t\t\t\t\"Project framework must be available through context to run `beginCoreDependenciesInstallation`\",\n\t\t\t\t\t);\n\n\t\t\t\t\tconst { execaProcess } =\n\t\t\t\t\t\tawait this.manager.project.installDependencies({\n\t\t\t\t\t\t\tpackageManager: this.context.packageManager,\n\t\t\t\t\t\t\tdependencies: this.context.framework.devDependencies,\n\t\t\t\t\t\t\tdev: true,\n\t\t\t\t\t\t\t// Picked up later\n\t\t\t\t\t\t\tlog: () => {\n\t\t\t\t\t\t\t\t/* ... */\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\n\t\t\t\t\t// Fail hard if process fails\n\t\t\t\t\texecaProcess.catch(async (error) => {\n\t\t\t\t\t\tconst [_, ...argv1n] = process.argv;\n\t\t\t\t\t\t// Command the user used\n\t\t\t\t\t\tlet tryAgainCommand = [process.argv0, ...argv1n].join(\" \");\n\n\t\t\t\t\t\t// If the `repository` option wasn't used AND the repository was selected/created\n\t\t\t\t\t\tif (!this.options.repository && this.context.repository) {\n\t\t\t\t\t\t\ttryAgainCommand = `${tryAgainCommand} --repository=${this.context.repository.domain}`;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tawait this.trackError(error);\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t`\\n\\n${error.shortMessage}\\n${error.stderr}\\n\\n${\n\t\t\t\t\t\t\t\tlogSymbols.error\n\t\t\t\t\t\t\t} Dependency installation failed, try again with:\\n\\n ${chalk.gray(\n\t\t\t\t\t\t\t\t\"$\",\n\t\t\t\t\t\t\t)} ${chalk.cyan(tryAgainCommand)}`,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tprocess.exit(1);\n\t\t\t\t\t});\n\n\t\t\t\t\tthis.context.installProcess = execaProcess;\n\n\t\t\t\t\ttask.title = `Began core dependencies installation with ${chalk.cyan(\n\t\t\t\t\t\tthis.context.packageManager,\n\t\t\t\t\t)} ... (running in background)`;\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected async fetchUserProfile(): Promise<void> {\n\t\tthis.context.userProfile = await this.manager.user.getProfile();\n\n\t\tawait this.manager.telemetry.identify({\n\t\t\tuserID: this.context.userProfile.shortId,\n\t\t\tintercomHash: this.context.userProfile.intercomHash,\n\t\t});\n\t\tawait this.manager.telemetry.track({\n\t\t\tevent: \"command:init:identify\",\n\t\t\trepository: this.options.repository,\n\t\t});\n\t}\n\n\tprotected async fetchUserRepositories(): Promise<void> {\n\t\tthis.context.userRepositories =\n\t\t\tawait this.manager.prismicRepository.readAll();\n\t}\n\n\tprotected validateWriteAccess(): void {\n\t\tassertExists(\n\t\t\tthis.context.repository,\n\t\t\t\"Repository selection must be available through context to proceed\",\n\t\t);\n\t\tassertExists(\n\t\t\tthis.context.userRepositories,\n\t\t\t\"User repositories must be available through context to validate write access\",\n\t\t);\n\t\tconst { domain } = this.context.repository;\n\t\tconst maybeRepository = this.context.userRepositories.find(\n\t\t\t(repository) => repository.domain === domain,\n\t\t);\n\n\t\tif (maybeRepository) {\n\t\t\tif (!this.manager.prismicRepository.hasWriteAccess(maybeRepository)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Cannot run init command with repository ${chalk.cyan(\n\t\t\t\t\t\tmaybeRepository.domain,\n\t\t\t\t\t)}: you are not a developer or admin of this repository`,\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot validate write access for repository ${chalk.cyan(\n\t\t\t\t\tdomain,\n\t\t\t\t)}: you are not part of this repository`,\n\t\t\t);\n\t\t}\n\t}\n\n\tprotected loginAndFetchUserData(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Logging in to Prismic...\",\n\t\t\t\ttask: async (_, parentTask) => {\n\t\t\t\t\tparentTask.output = \"Validating session...\";\n\t\t\t\t\tconst isLoggedIn = await this.manager.user.checkIsLoggedIn();\n\n\t\t\t\t\tif (!isLoggedIn) {\n\t\t\t\t\t\tparentTask.output = \"Press any key to open the browser to login...\";\n\t\t\t\t\t\tawait this.pressKeyToLogin();\n\t\t\t\t\t\tparentTask.output = \"Browser opened, waiting for you to login...\";\n\t\t\t\t\t\tawait this.waitingForLogin();\n\t\t\t\t\t}\n\n\t\t\t\t\tparentTask.output = \"\";\n\t\t\t\t\tparentTask.title = `Logged in`;\n\n\t\t\t\t\treturn listr(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle: \"Fetching user profile...\",\n\t\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\t\tawait this.fetchUserProfile();\n\t\t\t\t\t\t\t\t\tparentTask.title = `Logged in as ${chalk.cyan(\n\t\t\t\t\t\t\t\t\t\tthis.context.userProfile?.email,\n\t\t\t\t\t\t\t\t\t)}`;\n\t\t\t\t\t\t\t\t\ttask.title = \"Fetched user profile\";\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttitle: \"Fetching user repositories...\",\n\t\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\t\tawait this.fetchUserRepositories();\n\t\t\t\t\t\t\t\t\ttask.title = \"Fetched user repositories\";\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\t{ concurrent: true },\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected async pressKeyToLogin(): Promise<void> {\n\t\tawait new Promise((resolve) => {\n\t\t\tconst initialRawMode = !!process.stdin.isRaw;\n\t\t\tprocess.stdin.setRawMode?.(true);\n\t\t\tprocess.stdin.resume();\n\t\t\tprocess.stdin.once(\"data\", (data: Buffer) => {\n\t\t\t\tprocess.stdin.setRawMode?.(initialRawMode);\n\t\t\t\tprocess.stdin.pause();\n\t\t\t\tresolve(data.toString(\"utf-8\"));\n\t\t\t});\n\t\t});\n\t}\n\n\tprotected async waitingForLogin(): Promise<void> {\n\t\tconst { port, url } = await this.manager.user.getLoginSessionInfo();\n\t\tawait this.manager.user.nodeLoginSession({\n\t\t\tport,\n\t\t\tonListenCallback() {\n\t\t\t\topen(url);\n\t\t\t},\n\t\t});\n\t}\n\n\tprotected useRepositoryFlag(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: `Flag ${chalk.cyan(\"repository\")} used, validating input...`,\n\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.options.repository,\n\t\t\t\t\t\t\"Flag `repository` must be set to run `useRepositoryFlag`\",\n\t\t\t\t\t);\n\t\t\t\t\tconst domain = formatRepositoryDomain(this.options.repository);\n\t\t\t\t\tconst validation = await validateRepositoryDomainAndAvailability({\n\t\t\t\t\t\tdomain,\n\t\t\t\t\t\texistsFn: (domain) =>\n\t\t\t\t\t\t\tthis.manager.prismicRepository.checkExists({ domain }),\n\t\t\t\t\t});\n\n\t\t\t\t\tif (validation.LessThanMin || validation.MoreThanMax) {\n\t\t\t\t\t\tconst errorMessage = getErrorMessageForRepositoryDomainValidation({\n\t\t\t\t\t\t\tvalidation: {\n\t\t\t\t\t\t\t\t...validation,\n\t\t\t\t\t\t\t\t// We don't want to throw if repo already exists.\n\t\t\t\t\t\t\t\t// User most probably just created it via their dashboard.\n\t\t\t\t\t\t\t\tAlreadyExists: false,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tdisplayDomain: chalk.cyan(domain),\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tif (errorMessage) {\n\t\t\t\t\t\t\tthrow new Error(errorMessage);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttask.title = `Selected repository ${chalk.cyan(\n\t\t\t\t\t\tdomain,\n\t\t\t\t\t)} (flag ${chalk.cyan(\"repository\")} used)`;\n\n\t\t\t\t\tthis.context.repository = {\n\t\t\t\t\t\tdomain,\n\t\t\t\t\t\texists: validation.AlreadyExists ?? false,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected async selectRepository(): Promise<void> {\n\t\tassertExists(\n\t\t\tthis.context.userRepositories,\n\t\t\t\"User repositories must be available through context to run `selectRepository`\",\n\t\t);\n\n\t\tif (this.context.userRepositories.length) {\n\t\t\tawait this.trySelectExistingRepository();\n\t\t}\n\n\t\tif (!this.context.repository) {\n\t\t\tawait this.selectNewRepository();\n\t\t}\n\n\t\tassertExists(\n\t\t\tthis.context.repository,\n\t\t\t\"Repository selection must be available through context to proceed\",\n\t\t);\n\t\t// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(\n\t\t\t`${logSymbols.success} Selected repository ${chalk.cyan(\n\t\t\t\tthis.context.repository.domain,\n\t\t\t)}`,\n\t\t);\n\t}\n\n\tprotected async trySelectExistingRepository(): Promise<void> {\n\t\tassertExists(\n\t\t\tthis.context.userRepositories,\n\t\t\t\"User repositories must be available through context to run `trySelectExistingRepository`\",\n\t\t);\n\n\t\tconst { maybeDomain } = await prompt<string, \"maybeDomain\">({\n\t\t\ttype: \"select\",\n\t\t\tname: \"maybeDomain\",\n\t\t\tmessage: \"Pick a repository to connect to or choose to create a new one\",\n\t\t\twarn: \"You are not a developer or admin of this repository\",\n\t\t\tchoices: [\n\t\t\t\t{\n\t\t\t\t\ttitle: \"CREATE NEW\",\n\t\t\t\t\tdescription: \"Create a new Prismic repository\\n\",\n\t\t\t\t\tvalue: \"\",\n\t\t\t\t},\n\t\t\t\t...this.context.userRepositories\n\t\t\t\t\t.map((repository) => {\n\t\t\t\t\t\tconst hasWriteAccess =\n\t\t\t\t\t\t\tthis.manager.prismicRepository.hasWriteAccess(repository);\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttitle: `${repository.domain}${\n\t\t\t\t\t\t\t\thasWriteAccess ? \"\" : \" (Unauthorized)\"\n\t\t\t\t\t\t\t}`,\n\t\t\t\t\t\t\tdescription: `Connect to ${chalk.cyan(repository.domain)}`,\n\t\t\t\t\t\t\tvalue: repository.domain,\n\t\t\t\t\t\t\tdisabled: !hasWriteAccess,\n\t\t\t\t\t\t};\n\t\t\t\t\t})\n\t\t\t\t\t.sort((a, b) => (a.value > b.value ? 1 : -1)),\n\t\t\t],\n\t\t});\n\n\t\tif (maybeDomain) {\n\t\t\tthis.context.repository = {\n\t\t\t\tdomain: maybeDomain,\n\t\t\t\texists: true,\n\t\t\t};\n\t\t}\n\t}\n\n\tprotected async selectNewRepository(): Promise<void> {\n\t\tlet suggestedName = \"\";\n\n\t\t// TODO: Improve concurrency\n\t\tconst trySuggestName = async (name: string): Promise<string | void> => {\n\t\t\tif (name) {\n\t\t\t\tconst formattedName = formatRepositoryDomain(name);\n\n\t\t\t\tif (\n\t\t\t\t\t!validateRepositoryDomain({ domain: formattedName }).hasErrors &&\n\t\t\t\t\t!(await this.manager.prismicRepository.checkExists({\n\t\t\t\t\t\tdomain: formattedName,\n\t\t\t\t\t}))\n\t\t\t\t) {\n\t\t\t\t\treturn formattedName;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// 1. Try to suggest name after directory name\n\t\tconst maybeSuggestion = await trySuggestName(\n\t\t\tpath.basename(this.manager.cwd),\n\t\t);\n\t\tif (maybeSuggestion) {\n\t\t\tsuggestedName = maybeSuggestion;\n\t\t}\n\n\t\t// 2. Try to suggest name after package name\n\t\tif (!suggestedName) {\n\t\t\ttry {\n\t\t\t\tconst pkgJSONPath = path.join(this.manager.cwd, \"package.json\");\n\t\t\t\tconst pkg = JSON.parse(await fs.readFile(pkgJSONPath, \"utf-8\"));\n\n\t\t\t\tconst maybeSuggestion = await trySuggestName(pkg.name);\n\t\t\t\tif (maybeSuggestion) {\n\t\t\t\t\tsuggestedName = maybeSuggestion;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Noop\n\t\t\t}\n\t\t}\n\n\t\t// 3. Use random name\n\t\tif (!suggestedName) {\n\t\t\tdo {\n\t\t\t\tsuggestedName = getRandomRepositoryDomain();\n\t\t\t} while (\n\t\t\t\tawait this.manager.prismicRepository.checkExists({\n\t\t\t\t\tdomain: suggestedName,\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\n\t\tconst { domain } = await prompt<string, \"domain\">({\n\t\t\ttype: \"text\",\n\t\t\tname: \"domain\",\n\t\t\t// Overriden by the `onRender` function, just used as a fallback\n\t\t\tmessage: \"Choose a name for your Prismic repository\",\n\t\t\tinitial: suggestedName,\n\t\t\tonRender() {\n\t\t\t\tconst rawDomain = this.value || this.initial || \"\";\n\t\t\t\tconst domain = formatRepositoryDomain(rawDomain);\n\t\t\t\tconst validation = validateRepositoryDomain({ domain });\n\n\t\t\t\tconst minRule = validation.LessThanMin\n\t\t\t\t\t? chalk.red(\n\t\t\t\t\t\t\t`1. Name must be ${chalk.bold(\n\t\t\t\t\t\t\t\tREPOSITORY_NAME_VALIDATION.Min + \" characters long or more\",\n\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t )\n\t\t\t\t\t: `1. Name must be ${chalk.cyan(\n\t\t\t\t\t\t\tREPOSITORY_NAME_VALIDATION.Min + \" characters long or more\",\n\t\t\t\t\t )}`;\n\n\t\t\t\tconst maxRule = validation.MoreThanMax\n\t\t\t\t\t? chalk.red(\n\t\t\t\t\t\t\t`1. Name must be ${chalk.bold(\n\t\t\t\t\t\t\t\tREPOSITORY_NAME_VALIDATION.Max + \" characters long or less\",\n\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t )\n\t\t\t\t\t: `1. Name must be ${chalk.cyan(\n\t\t\t\t\t\t\tREPOSITORY_NAME_VALIDATION.Max + \" characters long or less\",\n\t\t\t\t\t )}`;\n\n\t\t\t\tthis.msg = chalk.reset(\n\t\t\t\t\t`\nChoose a name for your Prismic repository\n\n NAMING RULES\n ${minRule}\n ${maxRule}\n 3. Name will be ${chalk.cyan(\"kebab-cased\")} automatically\n\n CONSIDERATIONS\n 1. Once picked, your repository name ${chalk.cyan(\"cannot be changed\")}\n 2. A ${chalk.cyan(\n\t\t\t\"display name\",\n\t\t)} for the repository can be configured later on\n\n PREVIEW\n Dashboard ${chalk.cyan(`https://${domain}.prismic.io`)}\n API ${chalk.cyan(`https://${domain}.cdn.prismic.io/api/v2`)}\n\n${chalk.cyan(\"?\")} Your Prismic repository name`.replace(\"\\n\", \"\"),\n\t\t\t\t);\n\t\t\t},\n\t\t\tvalidate: async (rawDomain: string) => {\n\t\t\t\tconst domain = formatRepositoryDomain(rawDomain);\n\t\t\t\tconst validation = await validateRepositoryDomainAndAvailability({\n\t\t\t\t\tdomain,\n\t\t\t\t\texistsFn: (domain) =>\n\t\t\t\t\t\tthis.manager.prismicRepository.checkExists({ domain }),\n\t\t\t\t});\n\t\t\t\tconst errorMessage = getErrorMessageForRepositoryDomainValidation({\n\t\t\t\t\tvalidation,\n\t\t\t\t\tdisplayDomain: chalk.cyan(domain),\n\t\t\t\t});\n\n\t\t\t\treturn errorMessage || true;\n\t\t\t},\n\t\t\tformat: (value) => {\n\t\t\t\treturn formatRepositoryDomain(value);\n\t\t\t},\n\t\t});\n\n\t\t// Clear extra lines\n\t\tprocess.stdout.moveCursor?.(0, -16);\n\t\tprocess.stdout.clearScreenDown?.();\n\n\t\tthis.context.repository = {\n\t\t\tdomain,\n\t\t\texists: false,\n\t\t};\n\t}\n\n\tprotected createNewRepository(): Promise<void> {\n\t\tassertExists(\n\t\t\tthis.context.repository,\n\t\t\t\"Repository selection must be available through context to run `createNewRepository`\",\n\t\t);\n\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: `Creating new repository ${chalk.cyan(\n\t\t\t\t\tthis.context.repository.domain,\n\t\t\t\t)} ...`,\n\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.repository,\n\t\t\t\t\t\t\"Repository selection must be available through context to run `createNewRepository`\",\n\t\t\t\t\t);\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.framework,\n\t\t\t\t\t\t\"Project framework must be available through context to run `createNewRepository`\",\n\t\t\t\t\t);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.manager.prismicRepository.create({\n\t\t\t\t\t\t\tdomain: this.context.repository.domain,\n\t\t\t\t\t\t\tframework: this.context.framework.wroomTelemetryID,\n\t\t\t\t\t\t\tstarterId: this.context.starterId,\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t// When we have an error here, it's most probably because the user has a stale SESSION cookie\n\n\t\t\t\t\t\t// Ensure to logout user to remove SESSION and prismic-auth cookies\n\t\t\t\t\t\tawait this.manager.user.logout();\n\n\t\t\t\t\t\t// Force a new login to get a brand new cookies value\n\t\t\t\t\t\ttask.output =\n\t\t\t\t\t\t\t\"It seems there is an authentication problem, press any key to open the browser to login again...\";\n\t\t\t\t\t\tawait this.pressKeyToLogin();\n\t\t\t\t\t\ttask.output = \"Browser opened, waiting for you to login...\";\n\t\t\t\t\t\tawait this.waitingForLogin();\n\n\t\t\t\t\t\t// Try to create repository again with the new cookies value\n\t\t\t\t\t\tawait this.manager.prismicRepository.create({\n\t\t\t\t\t\t\tdomain: this.context.repository.domain,\n\t\t\t\t\t\t\tframework: this.context.framework.wroomTelemetryID,\n\t\t\t\t\t\t\tstarterId: this.context.starterId,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.context.repository.exists = true;\n\t\t\t\t\ttask.output = \"\";\n\t\t\t\t\ttask.title = `Created new repository ${chalk.cyan(\n\t\t\t\t\t\tthis.context.repository.domain,\n\t\t\t\t\t)}`;\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected finishCoreDependenciesInstallation(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: `Finishing core dependencies installation with ${chalk.cyan(\n\t\t\t\t\tthis.context.packageManager,\n\t\t\t\t)} ...`,\n\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.installProcess,\n\t\t\t\t\t\t\"Initial dependencies installation process must be available through context to run `finishCoreDependenciesInstallation`\",\n\t\t\t\t\t);\n\n\t\t\t\t\tconst updateOutput = (data: Buffer | null) => {\n\t\t\t\t\t\tif (data instanceof Buffer) {\n\t\t\t\t\t\t\ttask.output = data.toString();\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t// Don't clutter console with logs when process is non TTY (CI, etc.)\n\t\t\t\t\tif (process.stdout.isTTY || process.env.NODE_ENV === \"test\") {\n\t\t\t\t\t\tthis.context.installProcess.stdout?.on(\"data\", updateOutput);\n\t\t\t\t\t}\n\t\t\t\t\tthis.context.installProcess.stderr?.on(\"data\", updateOutput);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.context.installProcess;\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Error catching happens when then process is started ealier so\n\t\t\t\t\t\t * that all install errors, earlier and presents, can be catched.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * Here, we force the task to wait so that it is neither marked as\n\t\t\t\t\t\t * done or has the opportunity to handle the error itself.\n\t\t\t\t\t\t */\n\t\t\t\t\t\t// If for whatever reason the process is not exited by now, we still throw the error\n\t\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, 5000));\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\n\t\t\t\t\ttask.title = `Installed core dependencies with ${chalk.cyan(\n\t\t\t\t\t\tthis.context.packageManager,\n\t\t\t\t\t)}`;\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected upsertSliceMachineConfigurationAndStartPluginRunner(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Resolving Slice Machine configuration...\",\n\t\t\t\ttask: async (_, parentTask) => {\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.framework,\n\t\t\t\t\t\t\"Project framework must be available through context to run `upsertSliceMachineConfiguration`\",\n\t\t\t\t\t);\n\t\t\t\t\tassertExists(\n\t\t\t\t\t\tthis.context.repository,\n\t\t\t\t\t\t\"Repository selection must be available through context to run `upsertSliceMachineConfiguration`\",\n\t\t\t\t\t);\n\n\t\t\t\t\tlet sliceMachineConfigExists = false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.manager.project.getSliceMachineConfigPath();\n\t\t\t\t\t\tsliceMachineConfigExists = true;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// noop, config does not exists, we'll create it\n\t\t\t\t\t}\n\n\t\t\t\t\tif (sliceMachineConfigExists) {\n\t\t\t\t\t\tparentTask.title = \"Updating Slice Machine configuration...\";\n\n\t\t\t\t\t\tconst config = await this.manager.project.getSliceMachineConfig();\n\t\t\t\t\t\tawait this.manager.project.writeSliceMachineConfig({\n\t\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\t\t...config,\n\t\t\t\t\t\t\t\trepositoryName: this.context.repository.domain,\n\t\t\t\t\t\t\t\tadapter: this.context.framework.adapterName,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t\tparentTask.title = \"Updated Slice Machine configuration\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tparentTask.title = \"Creating Slice Machine configuration...\";\n\n\t\t\t\t\t\tconst sliceMachineConfigPath =\n\t\t\t\t\t\t\tawait this.manager.project.suggestSliceMachineConfigPath();\n\n\t\t\t\t\t\tawait this.manager.project.writeSliceMachineConfig({\n\t\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\t\trepositoryName: this.context.repository.domain,\n\t\t\t\t\t\t\t\tadapter: this.context.framework.adapterName,\n\t\t\t\t\t\t\t\tlibraries: [\"./slices\"],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tpath: sliceMachineConfigPath,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tparentTask.title = \"Created Slice Machine configuration\";\n\t\t\t\t\t}\n\n\t\t\t\t\treturn listr([\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO: Revert when plugin are introduced to users\n\t\t\t\t\t\t\t// title: \"Starting plugin runner...\",\n\t\t\t\t\t\t\ttitle: \"Loading adapter...\",\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tawait this.manager.plugins.initPlugins();\n\t\t\t\t\t\t\t\t// TODO: Revert when plugin are introduced to users\n\t\t\t\t\t\t\t\t// task.title = \"Started plugin runner\";\n\t\t\t\t\t\t\t\ttask.title = \"Loaded adapter\";\n\t\t\t\t\t\t\t\t// TODO: Revert when plugin are introduced to users\n\t\t\t\t\t\t\t\t// parentTask.title = `${parentTask.title} and started plugin runner`;\n\t\t\t\t\t\t\t\tparentTask.title = `${parentTask.title} and loaded adapter`;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t]);\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected async readAllSlices(): Promise<\n\t\t{ libraryID: string; sliceID: string }[]\n\t> {\n\t\tconst { libraries, errors } =\n\t\t\tawait this.manager.slices.readAllSliceLibraries();\n\n\t\tif (errors.length > 0) {\n\t\t\t// TODO: Provide better error message.\n\t\t\tthrow new Error(`Failed to read slice libraries: ${errors.join(\", \")}`);\n\t\t}\n\n\t\tconst slices: { libraryID: string; sliceID: string }[] = [];\n\t\tfor (const library of libraries) {\n\t\t\tif (library.sliceIDs) {\n\t\t\t\tfor (const sliceID of library.sliceIDs) {\n\t\t\t\t\tslices.push({\n\t\t\t\t\t\tlibraryID: library.libraryID,\n\t\t\t\t\t\tsliceID,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn slices;\n\t}\n\n\tprotected async readDocuments(): Promise<\n\t\t| {\n\t\t\t\tsignature: string;\n\t\t\t\tdocuments: string[];\n\t\t\t\tdirectoryPath: string;\n\t\t }\n\t\t| undefined\n\t> {\n\t\tconst root = await this.manager.project.getRoot();\n\t\tconst documentsDirectoryPath = path.resolve(root, \"documents\");\n\t\ttry {\n\t\t\tawait fs.access(documentsDirectoryPath);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t\tconst signaturePath = path.resolve(documentsDirectoryPath, \"index.json\");\n\t\tconst rawSignature = await fs.readFile(signaturePath, \"utf-8\");\n\t\tconst signature: string = JSON.parse(rawSignature).signature;\n\n\t\tconst documents = await globby(\"*/*.json\", {\n\t\t\tcwd: documentsDirectoryPath,\n\t\t});\n\n\t\treturn { signature, documents, directoryPath: documentsDirectoryPath };\n\t}\n\n\tprotected syncDataWithPrismic(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Syncing data with Prismic...\",\n\t\t\t\ttask: (_, parentTask) =>\n\t\t\t\t\tlistr([\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Pushing slices...\",\n\t\t\t\t\t\t\tskip: () => {\n\t\t\t\t\t\t\t\tif (!this.options.push) {\n\t\t\t\t\t\t\t\t\treturn `--no-push used`;\n\t\t\t\t\t\t\t\t} else if (!this.options.pushSlices) {\n\t\t\t\t\t\t\t\t\treturn `--no-push-slices used`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tconst slices = await this.readAllSlices();\n\n\t\t\t\t\t\t\t\tif (slices.length === 0) {\n\t\t\t\t\t\t\t\t\ttask.skip(\"No slice to push\");\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttask.title = \"Pushing slices... (initializing ACL)\";\n\t\t\t\t\t\t\t\tawait this.manager.screenshots.initS3ACL();\n\n\t\t\t\t\t\t\t\tlet pushed = 0;\n\t\t\t\t\t\t\t\ttask.title = `Pushing slices... (0/${slices.length})`;\n\t\t\t\t\t\t\t\tawait Promise.all(\n\t\t\t\t\t\t\t\t\tslices.map(async (slice) => {\n\t\t\t\t\t\t\t\t\t\tawait this.manager.slices.pushSlice({\n\t\t\t\t\t\t\t\t\t\t\t...slice,\n\t\t\t\t\t\t\t\t\t\t\tuserAgent: SLICE_MACHINE_INIT_USER_AGENT,\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\tpushed++;\n\t\t\t\t\t\t\t\t\t\ttask.title = `Pushing slices... (${pushed}/${slices.length})`;\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\ttask.title = \"Pushed all slices\";\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Pushing types...\",\n\t\t\t\t\t\t\tskip: () => {\n\t\t\t\t\t\t\t\tif (!this.options.push) {\n\t\t\t\t\t\t\t\t\treturn `--no-push used`;\n\t\t\t\t\t\t\t\t} else if (!this.options.pushCustomTypes) {\n\t\t\t\t\t\t\t\t\treturn `--no-push-custom-types used`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tconst { ids, errors } =\n\t\t\t\t\t\t\t\t\tawait this.manager.customTypes.readCustomTypeLibrary();\n\n\t\t\t\t\t\t\t\tif (errors.length > 0) {\n\t\t\t\t\t\t\t\t\t// TODO: Provide better error message.\n\t\t\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t\t\t`Failed to read custom type libraries: ${errors.join(\n\t\t\t\t\t\t\t\t\t\t\t\", \",\n\t\t\t\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (!ids || ids.length === 0) {\n\t\t\t\t\t\t\t\t\ttask.skip(\"No custom type to push\");\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tlet pushed = 0;\n\t\t\t\t\t\t\t\ttask.title = `Pushing types... (0/${ids.length})`;\n\t\t\t\t\t\t\t\tawait Promise.all(\n\t\t\t\t\t\t\t\t\tids.map(async (id) => {\n\t\t\t\t\t\t\t\t\t\tawait this.manager.customTypes.pushCustomType({\n\t\t\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\t\t\tuserAgent: SLICE_MACHINE_INIT_USER_AGENT,\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\tpushed++;\n\t\t\t\t\t\t\t\t\t\ttask.title = `Pushing types... (${pushed}/${ids.length})`;\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\ttask.title = \"Pushed all types\";\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Pushing documents...\",\n\t\t\t\t\t\t\tskip: () => {\n\t\t\t\t\t\t\t\tif (!this.options.push) {\n\t\t\t\t\t\t\t\t\treturn `--no-push used`;\n\t\t\t\t\t\t\t\t} else if (!this.options.pushDocuments) {\n\t\t\t\t\t\t\t\t\treturn `--no-push-documents used`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tassertExists(\n\t\t\t\t\t\t\t\t\tthis.context.repository,\n\t\t\t\t\t\t\t\t\t\"Repository selection must be available through context to run `syncDataWithPrismic`\",\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tconst documentsRead = await this.readDocuments();\n\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tdocumentsRead === undefined ||\n\t\t\t\t\t\t\t\t\t\tdocumentsRead.documents.length === 0\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\ttask.skip(\"No document to push\");\n\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tconst { signature, documents, directoryPath } = documentsRead;\n\n\t\t\t\t\t\t\t\t\t// TODO: Replace `unknown` with a Prismic document type.\n\t\t\t\t\t\t\t\t\t// The exact format is not know at this time, hence the `unknown`.\n\t\t\t\t\t\t\t\t\tconst recordDocument: Record<string, unknown> = {};\n\n\t\t\t\t\t\t\t\t\tawait Promise.all(\n\t\t\t\t\t\t\t\t\t\tdocuments.map(async (documentPath) => {\n\t\t\t\t\t\t\t\t\t\t\tconst filename = path.basename(documentPath, \".json\");\n\t\t\t\t\t\t\t\t\t\t\tconst fileContent = await fs.readFile(\n\t\t\t\t\t\t\t\t\t\t\t\tpath.resolve(directoryPath, documentPath),\n\t\t\t\t\t\t\t\t\t\t\t\t\"utf-8\",\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t// TOOD: Validate the contents of the JSON file and skip on invalid documents.\n\t\t\t\t\t\t\t\t\t\t\t\tconst parsedContents = JSON.parse(fileContent);\n\n\t\t\t\t\t\t\t\t\t\t\t\trecordDocument[filename] = parsedContents;\n\t\t\t\t\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\t\t\t\t\t// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better\n\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t\t\t\t\t\t`Skipped document due to its invalid format: ${documentPath}`,\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tawait this.manager.prismicRepository.pushDocuments({\n\t\t\t\t\t\t\t\t\t\tdomain: this.context.repository.domain,\n\t\t\t\t\t\t\t\t\t\tdocuments: recordDocument,\n\t\t\t\t\t\t\t\t\t\tsignature,\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\ttask.title = \"Pushed all documents\";\n\t\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\t\ttask.skip(\"No document to push\");\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Cleaning up data push artifacts\",\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tconst root = await this.manager.project.getRoot();\n\t\t\t\t\t\t\t\tconst documentsDirectoryPath = path.resolve(root, \"documents\");\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tawait fs.rm(documentsDirectoryPath, {\n\t\t\t\t\t\t\t\t\t\tforce: true,\n\t\t\t\t\t\t\t\t\t\trecursive: true,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\t\t// Noop, it's not that big of a deal if we cannot delete this directory\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttask.title = \"Cleaned up data push artifacts\";\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Pulling existing types...\",\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tconst { ids, errors } =\n\t\t\t\t\t\t\t\t\tawait this.manager.customTypes.readCustomTypeLibrary();\n\n\t\t\t\t\t\t\t\tif (errors.length > 0) {\n\t\t\t\t\t\t\t\t\t// TODO: Provide better error message.\n\t\t\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t\t\t`Failed to read custom type libraries: ${errors.join(\n\t\t\t\t\t\t\t\t\t\t\t\", \",\n\t\t\t\t\t\t\t\t\t\t)}`,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (ids && ids.length > 0) {\n\t\t\t\t\t\t\t\t\ttask.skip(\"Types already exist\");\n\t\t\t\t\t\t\t\t\tparentTask.title = \"Synced data with Prismic\";\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconst remoteTypes =\n\t\t\t\t\t\t\t\t\tawait this.manager.customTypes.fetchRemoteCustomTypes();\n\n\t\t\t\t\t\t\t\tconst createCustomTypeLimit = pLimit(8);\n\n\t\t\t\t\t\t\t\tlet pulled = 0;\n\t\t\t\t\t\t\t\ttask.title = `Pulling existing types... (0/${remoteTypes.length})`;\n\t\t\t\t\t\t\t\tawait Promise.all(\n\t\t\t\t\t\t\t\t\tremoteTypes.map(async (model) => {\n\t\t\t\t\t\t\t\t\t\tawait createCustomTypeLimit(() =>\n\t\t\t\t\t\t\t\t\t\t\tthis.manager.customTypes.createCustomType({ model }),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tpulled++;\n\t\t\t\t\t\t\t\t\t\ttask.title = `Pulling existing types... (${pulled}/${remoteTypes.length})`;\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\ttask.title = \"Pulled existing types\";\n\t\t\t\t\t\t\t\tparentTask.title = \"Synced data with Prismic\";\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t]),\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected initializeProject(): Promise<void> {\n\t\treturn listrRun([\n\t\t\t{\n\t\t\t\ttitle: \"Initializing project...\",\n\t\t\t\ttask: async (_, parentTask) =>\n\t\t\t\t\t// We return another Listr instance in the event we have additional task to perform to initialize the project\n\t\t\t\t\tlistr([\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: `Patching ${chalk.cyan(\"package.json\")} scripts...`,\n\t\t\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\t\t\tconst pkgPath = path.join(this.manager.cwd, \"package.json\");\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tconst pkgRaw = await fs.readFile(pkgPath, \"utf-8\");\n\t\t\t\t\t\t\t\t\tconst pkg = JSON.parse(pkgRaw);\n\n\t\t\t\t\t\t\t\t\tpkg.scripts ||= {};\n\n\t\t\t\t\t\t\t\t\tif (!pkg.scripts[START_SCRIPT_KEY]) {\n\t\t\t\t\t\t\t\t\t\tpkg.scripts[START_SCRIPT_KEY] = START_SCRIPT_VALUE;\n\n\t\t\t\t\t\t\t\t\t\t// Cheap indent detection based on https://github.com/sindresorhus/detect-indent (simplified because we're only dealing with JSON here)\n\t\t\t\t\t\t\t\t\t\tconst firstIndent = pkgRaw\n\t\t\t\t\t\t\t\t\t\t\t.split(\"\\n\")\n\t\t\t\t\t\t\t\t\t\t\t.find((line) => line.match(/^(?:( )+|\\t+)/));\n\t\t\t\t\t\t\t\t\t\tconst indent = firstIndent?.match(/^(?:( )+|\\t+)/)?.[0];\n\n\t\t\t\t\t\t\t\t\t\tawait fs.writeFile(\n\t\t\t\t\t\t\t\t\t\t\tpkgPath,\n\t\t\t\t\t\t\t\t\t\t\tJSON.stringify(\n\t\t\t\t\t\t\t\t\t\t\t\tpkg,\n\t\t\t\t\t\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\t\t\t\t\tindent && indent !== \" \" ? indent : \" \",\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t!pkg.scripts[\"slicemachine\"].startsWith(START_SCRIPT_VALUE)\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tthrow new Error(\"Script already exists\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\t\ttask.title = `Could not patch ${chalk.cyan(\n\t\t\t\t\t\t\t\t\t\t\"package.json\",\n\t\t\t\t\t\t\t\t\t)} scripts (warning)`;\n\t\t\t\t\t\t\t\t\tparentTask.title = `Initialized project (could not patch ${chalk.cyan(\n\t\t\t\t\t\t\t\t\t\t\"package.json\",\n\t\t\t\t\t\t\t\t\t)} scripts)`;\n\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tthis.context.projectInitialization ||= {};\n\t\t\t\t\t\t\t\tthis.context.projectInitialization.patchedScript = true;\n\n\t\t\t\t\t\t\t\ttask.title = `Patched ${chalk.cyan(\"package.json\")} scripts`;\n\t\t\t\t\t\t\t\tparentTask.title = `Initialized project (patched ${chalk.cyan(\n\t\t\t\t\t\t\t\t\t\"package.json\",\n\t\t\t\t\t\t\t\t)} scripts)`;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t]),\n\t\t\t},\n\t\t]);\n\t}\n\n\tprotected initializePlugins(): Promise<void> {\n\t\treturn listrRun(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\t// TODO: Revert when plugin are introduced to users\n\t\t\t\t\t// title: \"Initializing plugins...\",\n\t\t\t\t\ttitle: \"Initializing adapter...\",\n\t\t\t\t\ttask: async (_, task) => {\n\t\t\t\t\t\tconst updateOutput = (data: Buffer | string | null) => {\n\t\t\t\t\t\t\tif (data instanceof Buffer) {\n\t\t\t\t\t\t\t\ttask.output = data.toString();\n\t\t\t\t\t\t\t} else if (typeof data === \"string\") {\n\t\t\t\t\t\t\t\ttask.output = data;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tawait this.manager.project.initProject({\n\t\t\t\t\t\t\tlog: updateOutput,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// TODO: Revert when plugin are introduced to users\n\t\t\t\t\t\t// task.title = \"Initialized plugins\";\n\t\t\t\t\t\ttask.title = \"Initialized adapter\";\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\t{ exitOnError: false },\n\t\t).catch(() => void 0);\n\t}\n}\n"],"names":["_","_b","_a","domain","pkg","maybeSuggestion"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,MAAM,kBAAkD;AAAA,EACvD,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,mBAAmB;;AAGP,MAAA,gCAAgC,CAC5C,YAC4B;AACrB,SAAA,IAAI,wBAAwB,OAAO;AAC3C;MAkBa,wBAAuB;AAAA,EAMnC,YAAY,SAAwC;AAL1C;AACA;AAEA;AA4LA,sCAAa,OAAO,UAAiC;AACxD,YAAA,KAAK,iBAAiB,KAAK;AAC3B,YAAA,KAAK,oBAAoB,KAAK;AAAA,IAAA;AAG3B,+CAAsB,OAAO,UAAiC;;AAEjE,YAAA,aACL,iBAAiB,QAAQ,MAAM,UAAU,GAAG,SAC3C,MAAM,GAAG,GAAG;AACR,YAAA,KAAK,QAAQ,UAAU,MAAM;AAAA,QAClC,OAAO;AAAA,QACP,aAAW,UAAK,QAAQ,cAAb,mBAAwB,4BAA2B;AAAA,QAC9D,cAAY,UAAK,QAAQ,eAAb,mBAAyB,WAAU;AAAA,QAC/C,SAAS;AAAA,QACT,OAAO;AAAA,MAAA,CACP;AAAA,IAAA;AAGQ,4CAAmB,OAAO,UAAiC;;AACpE,YAAM,oBAAoB;AAAA,QACzB,SAAS,KAAK;AAAA,QACd,kBAAgB,UAAK,QAAQ,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SACA,KAAK,UACJA,MACA,MACA,UAAU,WAAW,MAAM,SAAS,IAAI,CACxC;AAAA,kBAAA,WAGF,CAACA,KAAI,QAAQ,cAAc,EAAE,WAAW,kBAAkB,GACzD;AACK,0BAAA,IAAI,MAAM,uBAAuB;AAAA,kBACvC;AAAA,yBACO;AACR,uBAAK,QAAQ,mBAAmB,MAAM,KACrC,cAAc;AAEf,6BAAW,QAAQ,wCAAwC,MAAM,KAChE,cAAc;AAGf;AAAA,gBACA;AAEI,2BAAA,SAAQ,0BAAR,GAAQ,wBAA0B;AAClC,qBAAA,QAAQ,sBAAsB,gBAAgB;AAEnD,qBAAK,QAAQ,WAAW,MAAM,KAAK,cAAc;AACjD,2BAAW,QAAQ,gCAAgC,MAAM,KACxD,cAAc;AAAA,cAEhB;AAAA,YACA;AAAA,UAAA,CACD;AAAA;AAAA,MACF;AAAA,IAAA,CACD;AAAA,EACF;AAAA,EAEU,oBAAiB;AAC1B,WAAO,SACN;AAAA,MACC;AAAA;AAAA;AAAA,QAGC,OAAO;AAAA,QACP,MAAM,OAAO,GAAG,SAAQ;AACjB,gBAAA,eAAe,CAAC,SAAgC;AACrD,gBAAI,gBAAgB,QAAQ;AACtB,mBAAA,SAAS,KAAK;uBACT,OAAO,SAAS,UAAU;AACpC,mBAAK,SAAS;AAAA,YACd;AAAA,UAAA;AAGI,gBAAA,KAAK,QAAQ,QAAQ,YAAY;AAAA,YACtC,KAAK;AAAA,UAAA,CACL;AAID,eAAK,QAAQ;AAAA,QACd;AAAA,MACA;AAAA,IAAA,GAEF,EAAE,aAAa,MAAO,CAAA,EACrB,MAAM,MAAM,MAAM;AAAA,EACrB;AACA;"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buffer-stream.cjs","sources":["../../../../../../../node_modules/execa/node_modules/get-stream/buffer-stream.js"],"sourcesContent":["'use strict';\nconst {PassThrough: PassThroughStream} = require('stream');\n\nmodule.exports = options => {\n\toptions = {...options};\n\n\tconst {array} = options;\n\tlet {encoding} = options;\n\tconst isBuffer = encoding === 'buffer';\n\tlet objectMode = false;\n\n\tif (array) {\n\t\tobjectMode = !(encoding || isBuffer);\n\t} else {\n\t\tencoding = encoding || 'utf8';\n\t}\n\n\tif (isBuffer) {\n\t\tencoding = null;\n\t}\n\n\tconst stream = new PassThroughStream({objectMode});\n\n\tif (encoding) {\n\t\tstream.setEncoding(encoding);\n\t}\n\n\tlet length = 0;\n\tconst chunks = [];\n\n\tstream.on('data', chunk => {\n\t\tchunks.push(chunk);\n\n\t\tif (objectMode) {\n\t\t\tlength = chunks.length;\n\t\t} else {\n\t\t\tlength += chunk.length;\n\t\t}\n\t});\n\n\tstream.getBufferedValue = () => {\n\t\tif (array) {\n\t\t\treturn chunks;\n\t\t}\n\n\t\treturn isBuffer ? Buffer.concat(chunks, length) : chunks.join('');\n\t};\n\n\tstream.getBufferedLength = () => length;\n\n\treturn stream;\n};\n"],"names":[],"mappings":";;;AACA,MAAM,EAAC,aAAa,kBAAiB,IAAI;IAEzC,eAAiB,aAAW;AAC3B,YAAU,EAAC,GAAG,QAAO;AAErB,QAAM,EAAC,MAAK,IAAI;AAChB,MAAI,EAAC,SAAQ,IAAI;AACjB,QAAM,WAAW,aAAa;AAC9B,MAAI,aAAa;AAEjB,MAAI,OAAO;AACV,iBAAa,EAAE,YAAY;AAAA,EAC7B,OAAQ;AACN,eAAW,YAAY;AAAA,EACvB;AAED,MAAI,UAAU;AACb,eAAW;AAAA,EACX;AAED,QAAM,SAAS,IAAI,kBAAkB,EAAC,WAAU,CAAC;AAEjD,MAAI,UAAU;AACb,WAAO,YAAY,QAAQ;AAAA,EAC3B;AAED,MAAI,SAAS;AACb,QAAM,SAAS,CAAA;AAEf,SAAO,GAAG,QAAQ,WAAS;AAC1B,WAAO,KAAK,KAAK;AAEjB,QAAI,YAAY;AACf,eAAS,OAAO;AAAA,IACnB,OAAS;AACN,gBAAU,MAAM;AAAA,IAChB;AAAA,EACH,CAAE;AAED,SAAO,mBAAmB,MAAM;AAC/B,QAAI,OAAO;AACV,aAAO;AAAA,IACP;AAED,WAAO,WAAW,OAAO,OAAO,QAAQ,MAAM,IAAI,OAAO,KAAK,EAAE;AAAA,EAClE;AAEC,SAAO,oBAAoB,MAAM;AAEjC,SAAO;AACR;;","x_google_ignoreList":[0]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buffer-stream.js","sources":["../../../../../../../node_modules/execa/node_modules/get-stream/buffer-stream.js"],"sourcesContent":["'use strict';\nconst {PassThrough: PassThroughStream} = require('stream');\n\nmodule.exports = options => {\n\toptions = {...options};\n\n\tconst {array} = options;\n\tlet {encoding} = options;\n\tconst isBuffer = encoding === 'buffer';\n\tlet objectMode = false;\n\n\tif (array) {\n\t\tobjectMode = !(encoding || isBuffer);\n\t} else {\n\t\tencoding = encoding || 'utf8';\n\t}\n\n\tif (isBuffer) {\n\t\tencoding = null;\n\t}\n\n\tconst stream = new PassThroughStream({objectMode});\n\n\tif (encoding) {\n\t\tstream.setEncoding(encoding);\n\t}\n\n\tlet length = 0;\n\tconst chunks = [];\n\n\tstream.on('data', chunk => {\n\t\tchunks.push(chunk);\n\n\t\tif (objectMode) {\n\t\t\tlength = chunks.length;\n\t\t} else {\n\t\t\tlength += chunk.length;\n\t\t}\n\t});\n\n\tstream.getBufferedValue = () => {\n\t\tif (array) {\n\t\t\treturn chunks;\n\t\t}\n\n\t\treturn isBuffer ? Buffer.concat(chunks, length) : chunks.join('');\n\t};\n\n\tstream.getBufferedLength = () => length;\n\n\treturn stream;\n};\n"],"names":[],"mappings":";AACA,MAAM,EAAC,aAAa,kBAAiB,IAAI;IAEzC,eAAiB,aAAW;AAC3B,YAAU,EAAC,GAAG,QAAO;AAErB,QAAM,EAAC,MAAK,IAAI;AAChB,MAAI,EAAC,SAAQ,IAAI;AACjB,QAAM,WAAW,aAAa;AAC9B,MAAI,aAAa;AAEjB,MAAI,OAAO;AACV,iBAAa,EAAE,YAAY;AAAA,EAC7B,OAAQ;AACN,eAAW,YAAY;AAAA,EACvB;AAED,MAAI,UAAU;AACb,eAAW;AAAA,EACX;AAED,QAAM,SAAS,IAAI,kBAAkB,EAAC,WAAU,CAAC;AAEjD,MAAI,UAAU;AACb,WAAO,YAAY,QAAQ;AAAA,EAC3B;AAED,MAAI,SAAS;AACb,QAAM,SAAS,CAAA;AAEf,SAAO,GAAG,QAAQ,WAAS;AAC1B,WAAO,KAAK,KAAK;AAEjB,QAAI,YAAY;AACf,eAAS,OAAO;AAAA,IACnB,OAAS;AACN,gBAAU,MAAM;AAAA,IAChB;AAAA,EACH,CAAE;AAED,SAAO,mBAAmB,MAAM;AAC/B,QAAI,OAAO;AACV,aAAO;AAAA,IACP;AAED,WAAO,WAAW,OAAO,OAAO,QAAQ,MAAM,IAAI,OAAO,KAAK,EAAE;AAAA,EAClE;AAEC,SAAO,oBAAoB,MAAM;AAEjC,SAAO;AACR;","x_google_ignoreList":[0]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const _commonjsHelpers = require("../../_virtual/_commonjsHelpers.cjs");
3
- const index = require("../../_virtual/index15.cjs");
2
+ const _commonjsHelpers = require("../../../../_virtual/_commonjsHelpers.cjs");
3
+ const index = require("../../../../_virtual/index16.cjs");
4
4
  const require$$0$2 = require("buffer");
5
5
  const require$$0 = require("stream");
6
6
  const require$$0$1 = require("util");
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../../../node_modules/execa/node_modules/get-stream/index.js"],"sourcesContent":["'use strict';\nconst {constants: BufferConstants} = require('buffer');\nconst stream = require('stream');\nconst {promisify} = require('util');\nconst bufferStream = require('./buffer-stream');\n\nconst streamPipelinePromisified = promisify(stream.pipeline);\n\nclass MaxBufferError extends Error {\n\tconstructor() {\n\t\tsuper('maxBuffer exceeded');\n\t\tthis.name = 'MaxBufferError';\n\t}\n}\n\nasync function getStream(inputStream, options) {\n\tif (!inputStream) {\n\t\tthrow new Error('Expected a stream');\n\t}\n\n\toptions = {\n\t\tmaxBuffer: Infinity,\n\t\t...options\n\t};\n\n\tconst {maxBuffer} = options;\n\tconst stream = bufferStream(options);\n\n\tawait new Promise((resolve, reject) => {\n\t\tconst rejectPromise = error => {\n\t\t\t// Don't retrieve an oversized buffer.\n\t\t\tif (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {\n\t\t\t\terror.bufferedData = stream.getBufferedValue();\n\t\t\t}\n\n\t\t\treject(error);\n\t\t};\n\n\t\t(async () => {\n\t\t\ttry {\n\t\t\t\tawait streamPipelinePromisified(inputStream, stream);\n\t\t\t\tresolve();\n\t\t\t} catch (error) {\n\t\t\t\trejectPromise(error);\n\t\t\t}\n\t\t})();\n\n\t\tstream.on('data', () => {\n\t\t\tif (stream.getBufferedLength() > maxBuffer) {\n\t\t\t\trejectPromise(new MaxBufferError());\n\t\t\t}\n\t\t});\n\t});\n\n\treturn stream.getBufferedValue();\n}\n\nmodule.exports = getStream;\nmodule.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'});\nmodule.exports.array = (stream, options) => getStream(stream, {...options, array: true});\nmodule.exports.MaxBufferError = MaxBufferError;\n"],"names":["require$$0","require$$1","require$$2","require$$3","stream","getStreamModule"],"mappings":";;;;;;;AACA,MAAM,EAAC,WAAW,gBAAe,IAAIA;AACrC,MAAM,SAASC;AACf,MAAM,EAAC,UAAS,IAAIC;AACpB,MAAM,eAAeC,eAAAA;AAErB,MAAM,4BAA4B,UAAU,OAAO,QAAQ;AAE3D,MAAM,uBAAuB,MAAM;AAAA,EAClC,cAAc;AACb,UAAM,oBAAoB;AAC1B,SAAK,OAAO;AAAA,EACZ;AACF;AAEA,eAAe,UAAU,aAAa,SAAS;AAC9C,MAAI,CAAC,aAAa;AACjB,UAAM,IAAI,MAAM,mBAAmB;AAAA,EACnC;AAED,YAAU;AAAA,IACT,WAAW;AAAA,IACX,GAAG;AAAA,EACL;AAEC,QAAM,EAAC,UAAS,IAAI;AACpB,QAAMC,UAAS,aAAa,OAAO;AAEnC,QAAM,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,UAAM,gBAAgB,WAAS;AAE9B,UAAI,SAASA,QAAO,kBAAiB,KAAM,gBAAgB,YAAY;AACtE,cAAM,eAAeA,QAAO;MAC5B;AAED,aAAO,KAAK;AAAA,IACf;AAEE,KAAC,YAAY;AACZ,UAAI;AACH,cAAM,0BAA0B,aAAaA,OAAM;AACnD;MACA,SAAQ,OAAP;AACD,sBAAc,KAAK;AAAA,MACnB;AAAA,IACJ;AAEE,IAAAA,QAAO,GAAG,QAAQ,MAAM;AACvB,UAAIA,QAAO,kBAAmB,IAAG,WAAW;AAC3C,sBAAc,IAAI,eAAc,CAAE;AAAA,MAClC;AAAA,IACJ,CAAG;AAAA,EACH,CAAE;AAED,SAAOA,QAAO;AACf;AAEAC,MAAAA,SAAc,UAAG;AACjBA,MAAA,SAAA,QAAA,SAAwB,CAACD,SAAQ,YAAY,UAAUA,SAAQ,EAAC,GAAG,SAAS,UAAU,SAAQ,CAAC;AAC/FC,MAAA,SAAA,QAAA,QAAuB,CAACD,SAAQ,YAAY,UAAUA,SAAQ,EAAC,GAAG,SAAS,OAAO,KAAI,CAAC;AACvFC,MAAAA,SAAA,QAAA,iBAAgC;;;;","x_google_ignoreList":[0]}
@@ -1,5 +1,5 @@
1
- import { getDefaultExportFromCjs } from "../../_virtual/_commonjsHelpers.js";
2
- import { __module as getStream$2 } from "../../_virtual/index15.js";
1
+ import { getDefaultExportFromCjs } from "../../../../_virtual/_commonjsHelpers.js";
2
+ import { __module as getStream$2 } from "../../../../_virtual/index16.js";
3
3
  import require$$0$2 from "buffer";
4
4
  import require$$0 from "stream";
5
5
  import require$$0$1 from "util";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../node_modules/execa/node_modules/get-stream/index.js"],"sourcesContent":["'use strict';\nconst {constants: BufferConstants} = require('buffer');\nconst stream = require('stream');\nconst {promisify} = require('util');\nconst bufferStream = require('./buffer-stream');\n\nconst streamPipelinePromisified = promisify(stream.pipeline);\n\nclass MaxBufferError extends Error {\n\tconstructor() {\n\t\tsuper('maxBuffer exceeded');\n\t\tthis.name = 'MaxBufferError';\n\t}\n}\n\nasync function getStream(inputStream, options) {\n\tif (!inputStream) {\n\t\tthrow new Error('Expected a stream');\n\t}\n\n\toptions = {\n\t\tmaxBuffer: Infinity,\n\t\t...options\n\t};\n\n\tconst {maxBuffer} = options;\n\tconst stream = bufferStream(options);\n\n\tawait new Promise((resolve, reject) => {\n\t\tconst rejectPromise = error => {\n\t\t\t// Don't retrieve an oversized buffer.\n\t\t\tif (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {\n\t\t\t\terror.bufferedData = stream.getBufferedValue();\n\t\t\t}\n\n\t\t\treject(error);\n\t\t};\n\n\t\t(async () => {\n\t\t\ttry {\n\t\t\t\tawait streamPipelinePromisified(inputStream, stream);\n\t\t\t\tresolve();\n\t\t\t} catch (error) {\n\t\t\t\trejectPromise(error);\n\t\t\t}\n\t\t})();\n\n\t\tstream.on('data', () => {\n\t\t\tif (stream.getBufferedLength() > maxBuffer) {\n\t\t\t\trejectPromise(new MaxBufferError());\n\t\t\t}\n\t\t});\n\t});\n\n\treturn stream.getBufferedValue();\n}\n\nmodule.exports = getStream;\nmodule.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'});\nmodule.exports.array = (stream, options) => getStream(stream, {...options, array: true});\nmodule.exports.MaxBufferError = MaxBufferError;\n"],"names":["require$$0","require$$1","require$$2","require$$3","stream","getStreamModule"],"mappings":";;;;;;AACA,MAAM,EAAC,WAAW,gBAAe,IAAIA;AACrC,MAAM,SAASC;AACf,MAAM,EAAC,UAAS,IAAIC;AACpB,MAAM,eAAeC;AAErB,MAAM,4BAA4B,UAAU,OAAO,QAAQ;AAE3D,MAAM,uBAAuB,MAAM;AAAA,EAClC,cAAc;AACb,UAAM,oBAAoB;AAC1B,SAAK,OAAO;AAAA,EACZ;AACF;AAEA,eAAe,UAAU,aAAa,SAAS;AAC9C,MAAI,CAAC,aAAa;AACjB,UAAM,IAAI,MAAM,mBAAmB;AAAA,EACnC;AAED,YAAU;AAAA,IACT,WAAW;AAAA,IACX,GAAG;AAAA,EACL;AAEC,QAAM,EAAC,UAAS,IAAI;AACpB,QAAMC,UAAS,aAAa,OAAO;AAEnC,QAAM,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,UAAM,gBAAgB,WAAS;AAE9B,UAAI,SAASA,QAAO,kBAAiB,KAAM,gBAAgB,YAAY;AACtE,cAAM,eAAeA,QAAO;MAC5B;AAED,aAAO,KAAK;AAAA,IACf;AAEE,KAAC,YAAY;AACZ,UAAI;AACH,cAAM,0BAA0B,aAAaA,OAAM;AACnD;MACA,SAAQ,OAAP;AACD,sBAAc,KAAK;AAAA,MACnB;AAAA,IACJ;AAEE,IAAAA,QAAO,GAAG,QAAQ,MAAM;AACvB,UAAIA,QAAO,kBAAmB,IAAG,WAAW;AAC3C,sBAAc,IAAI,eAAc,CAAE;AAAA,MAClC;AAAA,IACJ,CAAG;AAAA,EACH,CAAE;AAED,SAAOA,QAAO;AACf;AAEAC,YAAc,UAAG;AACjBA,YAAA,QAAA,SAAwB,CAACD,SAAQ,YAAY,UAAUA,SAAQ,EAAC,GAAG,SAAS,UAAU,SAAQ,CAAC;AAC/FC,YAAA,QAAA,QAAuB,CAACD,SAAQ,YAAY,UAAUA,SAAQ,EAAC,GAAG,SAAS,OAAO,KAAI,CAAC;AACvFC,YAAA,QAAA,iBAAgC;;;","x_google_ignoreList":[0]}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const fs = require("node:fs");
4
4
  const index = require('./../_node_modules/is-stream/index.cjs');
5
- const index$2 = require("../../get-stream/index.cjs");
5
+ const index$2 = require('./../_node_modules/get-stream/index.cjs');
6
6
  const index$1 = require("../../merge-stream/index.cjs");
7
7
  const validateInputOptions = (input) => {
8
8
  if (input !== void 0) {
@@ -1,6 +1,6 @@
1
1
  import { createReadStream } from "node:fs";
2
2
  import { isStream } from './../_node_modules/is-stream/index.js';
3
- import getStream from "../../get-stream/index.js";
3
+ import getStream from './../_node_modules/get-stream/index.js';
4
4
  import mergeStream from "../../merge-stream/index.js";
5
5
  const validateInputOptions = (input) => {
6
6
  if (input !== void 0) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../is-glob/index.cjs");
3
+ const index = require("../../../is-glob/index.cjs");
4
4
  const require$$0 = require("path");
5
5
  const require$$2 = require("os");
6
6
  var isGlob = index.isGlob;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../../../node_modules/fast-glob/node_modules/glob-parent/index.js"],"sourcesContent":["'use strict';\n\nvar isGlob = require('is-glob');\nvar pathPosixDirname = require('path').posix.dirname;\nvar isWin32 = require('os').platform() === 'win32';\n\nvar slash = '/';\nvar backslash = /\\\\/g;\nvar enclosure = /[\\{\\[].*[\\}\\]]$/;\nvar globby = /(^|[^\\\\])([\\{\\[]|\\([^\\)]+$)/;\nvar escaped = /\\\\([\\!\\*\\?\\|\\[\\]\\(\\)\\{\\}])/g;\n\n/**\n * @param {string} str\n * @param {Object} opts\n * @param {boolean} [opts.flipBackslashes=true]\n * @returns {string}\n */\nmodule.exports = function globParent(str, opts) {\n var options = Object.assign({ flipBackslashes: true }, opts);\n\n // flip windows path separators\n if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {\n str = str.replace(backslash, slash);\n }\n\n // special case for strings ending in enclosure containing path separator\n if (enclosure.test(str)) {\n str += slash;\n }\n\n // preserves full path in case of trailing path separator\n str += 'a';\n\n // remove path parts that are globby\n do {\n str = pathPosixDirname(str);\n } while (isGlob(str) || globby.test(str));\n\n // remove escape chars and return result\n return str.replace(escaped, '$1');\n};\n"],"names":["require$$0","require$$1","globParent"],"mappings":";;;;;AAEA,IAAI,SAASA,MAAAA;AACb,IAAI,mBAAmBC,WAAgB,MAAM;AAC7C,IAAI,UAAU,WAAc,SAAU,MAAK;AAE3C,IAAI,QAAQ;AACZ,IAAI,YAAY;AAChB,IAAI,YAAY;AAChB,IAAI,SAAS;AACb,IAAI,UAAU;AAQd,IAAA,aAAiB,SAASC,YAAW,KAAK,MAAM;AAC9C,MAAI,UAAU,OAAO,OAAO,EAAE,iBAAiB,KAAI,GAAI,IAAI;AAG3D,MAAI,QAAQ,mBAAmB,WAAW,IAAI,QAAQ,KAAK,IAAI,GAAG;AAChE,UAAM,IAAI,QAAQ,WAAW,KAAK;AAAA,EACnC;AAGD,MAAI,UAAU,KAAK,GAAG,GAAG;AACvB,WAAO;AAAA,EACR;AAGD,SAAO;AAGP,KAAG;AACD,UAAM,iBAAiB,GAAG;AAAA,EAC9B,SAAW,OAAO,GAAG,KAAK,OAAO,KAAK,GAAG;AAGvC,SAAO,IAAI,QAAQ,SAAS,IAAI;AAClC;;","x_google_ignoreList":[0]}
@@ -1,4 +1,4 @@
1
- import { i as isGlob$1 } from "../is-glob/index.js";
1
+ import { i as isGlob$1 } from "../../../is-glob/index.js";
2
2
  import require$$0 from "path";
3
3
  import require$$2 from "os";
4
4
  var isGlob = isGlob$1;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../node_modules/fast-glob/node_modules/glob-parent/index.js"],"sourcesContent":["'use strict';\n\nvar isGlob = require('is-glob');\nvar pathPosixDirname = require('path').posix.dirname;\nvar isWin32 = require('os').platform() === 'win32';\n\nvar slash = '/';\nvar backslash = /\\\\/g;\nvar enclosure = /[\\{\\[].*[\\}\\]]$/;\nvar globby = /(^|[^\\\\])([\\{\\[]|\\([^\\)]+$)/;\nvar escaped = /\\\\([\\!\\*\\?\\|\\[\\]\\(\\)\\{\\}])/g;\n\n/**\n * @param {string} str\n * @param {Object} opts\n * @param {boolean} [opts.flipBackslashes=true]\n * @returns {string}\n */\nmodule.exports = function globParent(str, opts) {\n var options = Object.assign({ flipBackslashes: true }, opts);\n\n // flip windows path separators\n if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {\n str = str.replace(backslash, slash);\n }\n\n // special case for strings ending in enclosure containing path separator\n if (enclosure.test(str)) {\n str += slash;\n }\n\n // preserves full path in case of trailing path separator\n str += 'a';\n\n // remove path parts that are globby\n do {\n str = pathPosixDirname(str);\n } while (isGlob(str) || globby.test(str));\n\n // remove escape chars and return result\n return str.replace(escaped, '$1');\n};\n"],"names":["require$$0","require$$1","globParent"],"mappings":";;;AAEA,IAAI,SAASA;AACb,IAAI,mBAAmBC,WAAgB,MAAM;AAC7C,IAAI,UAAU,WAAc,SAAU,MAAK;AAE3C,IAAI,QAAQ;AACZ,IAAI,YAAY;AAChB,IAAI,YAAY;AAChB,IAAI,SAAS;AACb,IAAI,UAAU;AAQd,IAAA,aAAiB,SAASC,YAAW,KAAK,MAAM;AAC9C,MAAI,UAAU,OAAO,OAAO,EAAE,iBAAiB,KAAI,GAAI,IAAI;AAG3D,MAAI,QAAQ,mBAAmB,WAAW,IAAI,QAAQ,KAAK,IAAI,GAAG;AAChE,UAAM,IAAI,QAAQ,WAAW,KAAK;AAAA,EACnC;AAGD,MAAI,UAAU,KAAK,GAAG,GAAG;AACvB,WAAO;AAAA,EACR;AAGD,SAAO;AAGP,KAAG;AACD,UAAM,iBAAiB,GAAG;AAAA,EAC9B,SAAW,OAAO,GAAG,KAAK,OAAO,KAAK,GAAG;AAGvC,SAAO,IAAI,QAAQ,SAAS,IAAI;AAClC;","x_google_ignoreList":[0]}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const pattern = require("../../../../_virtual/pattern.cjs");
3
3
  const require$$0 = require("path");
4
- const index = require("../../../glob-parent/index.cjs");
4
+ const index = require('./../../_node_modules/glob-parent/index.cjs');
5
5
  const index$1 = require("../../../micromatch/index.cjs");
6
6
  Object.defineProperty(pattern.__exports, "__esModule", { value: true });
7
7
  pattern.__exports.matchAny = pattern.__exports.convertPatternsToRe = pattern.__exports.makeRe = pattern.__exports.getPatternParts = pattern.__exports.expandBraceExpansion = pattern.__exports.expandPatternsWithBraceExpansion = pattern.__exports.isAffectDepthOfReadingPattern = pattern.__exports.endsWithSlashGlobStar = pattern.__exports.hasGlobStar = pattern.__exports.getBaseDirectory = pattern.__exports.isPatternRelatedToParentDirectory = pattern.__exports.getPatternsOutsideCurrentDirectory = pattern.__exports.getPatternsInsideCurrentDirectory = pattern.__exports.getPositivePatterns = pattern.__exports.getNegativePatterns = pattern.__exports.isPositivePattern = pattern.__exports.isNegativePattern = pattern.__exports.convertToNegativePattern = pattern.__exports.convertToPositivePattern = pattern.__exports.isDynamicPattern = pattern.__exports.isStaticPattern = void 0;
@@ -1,6 +1,6 @@
1
1
  import { __exports as pattern } from "../../../../_virtual/pattern.js";
2
2
  import require$$0 from "path";
3
- import { g as globParent$1 } from "../../../glob-parent/index.js";
3
+ import { g as globParent$1 } from './../../_node_modules/glob-parent/index.js';
4
4
  import { m as micromatch_1 } from "../../../micromatch/index.js";
5
5
  Object.defineProperty(pattern, "__esModule", { value: true });
6
6
  pattern.matchAny = pattern.convertPatternsToRe = pattern.makeRe = pattern.getPatternParts = pattern.expandBraceExpansion = pattern.expandPatternsWithBraceExpansion = pattern.isAffectDepthOfReadingPattern = pattern.endsWithSlashGlobStar = pattern.hasGlobStar = pattern.getBaseDirectory = pattern.isPatternRelatedToParentDirectory = pattern.getPatternsOutsideCurrentDirectory = pattern.getPatternsInsideCurrentDirectory = pattern.getPositivePatterns = pattern.getNegativePatterns = pattern.isPositivePattern = pattern.isNegativePattern = pattern.convertToNegativePattern = pattern.convertToPositivePattern = pattern.isDynamicPattern = pattern.isStaticPattern = void 0;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../node_modules/json-parse-even-better-errors/index.js"],"sourcesContent":["'use strict'\n\nconst hexify = char => {\n const h = char.charCodeAt(0).toString(16).toUpperCase()\n return '0x' + (h.length % 2 ? '0' : '') + h\n}\n\nconst parseError = (e, txt, context) => {\n if (!txt) {\n return {\n message: e.message + ' while parsing empty string',\n position: 0,\n }\n }\n const badToken = e.message.match(/^Unexpected token (.) .*position\\s+(\\d+)/i)\n const errIdx = badToken ? +badToken[2]\n : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1\n : null\n\n const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${\n JSON.stringify(badToken[1])\n } (${hexify(badToken[1])})`)\n : e.message\n\n if (errIdx !== null && errIdx !== undefined) {\n const start = errIdx <= context ? 0\n : errIdx - context\n\n const end = errIdx + context >= txt.length ? txt.length\n : errIdx + context\n\n const slice = (start === 0 ? '' : '...') +\n txt.slice(start, end) +\n (end === txt.length ? '' : '...')\n\n const near = txt === slice ? '' : 'near '\n\n return {\n message: msg + ` while parsing ${near}${JSON.stringify(slice)}`,\n position: errIdx,\n }\n } else {\n return {\n message: msg + ` while parsing '${txt.slice(0, context * 2)}'`,\n position: 0,\n }\n }\n}\n\nclass JSONParseError extends SyntaxError {\n constructor (er, txt, context, caller) {\n context = context || 20\n const metadata = parseError(er, txt, context)\n super(metadata.message)\n Object.assign(this, metadata)\n this.code = 'EJSONPARSE'\n this.systemError = er\n Error.captureStackTrace(this, caller || this.constructor)\n }\n get name () { return this.constructor.name }\n set name (n) {}\n get [Symbol.toStringTag] () { return this.constructor.name }\n}\n\nconst kIndent = Symbol.for('indent')\nconst kNewline = Symbol.for('newline')\n// only respect indentation if we got a line break, otherwise squash it\n// things other than objects and arrays aren't indented, so ignore those\n// Important: in both of these regexps, the $1 capture group is the newline\n// or undefined, and the $2 capture group is the indent, or undefined.\nconst formatRE = /^\\s*[{\\[]((?:\\r?\\n)+)([\\s\\t]*)/\nconst emptyRE = /^(?:\\{\\}|\\[\\])((?:\\r?\\n)+)?$/\n\nconst parseJson = (txt, reviver, context) => {\n const parseText = stripBOM(txt)\n context = context || 20\n try {\n // get the indentation so that we can save it back nicely\n // if the file starts with {\" then we have an indent of '', ie, none\n // otherwise, pick the indentation of the next line after the first \\n\n // If the pattern doesn't match, then it means no indentation.\n // JSON.stringify ignores symbols, so this is reasonably safe.\n // if the string is '{}' or '[]', then use the default 2-space indent.\n const [, newline = '\\n', indent = ' '] = parseText.match(emptyRE) ||\n parseText.match(formatRE) ||\n [, '', '']\n\n const result = JSON.parse(parseText, reviver)\n if (result && typeof result === 'object') {\n result[kNewline] = newline\n result[kIndent] = indent\n }\n return result\n } catch (e) {\n if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) {\n const isEmptyArray = Array.isArray(txt) && txt.length === 0\n throw Object.assign(new TypeError(\n `Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}`\n ), {\n code: 'EJSONPARSE',\n systemError: e,\n })\n }\n\n throw new JSONParseError(e, parseText, context, parseJson)\n }\n}\n\n// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n// because the buffer-to-string conversion in `fs.readFileSync()`\n// translates it to FEFF, the UTF-16 BOM.\nconst stripBOM = txt => String(txt).replace(/^\\uFEFF/, '')\n\nmodule.exports = parseJson\nparseJson.JSONParseError = JSONParseError\n\nparseJson.noExceptions = (txt, reviver) => {\n try {\n return JSON.parse(stripBOM(txt), reviver)\n } catch (e) {}\n}\n"],"names":[],"mappings":";;AAEA,MAAM,SAAS,UAAQ;AACrB,QAAM,IAAI,KAAK,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,YAAa;AACvD,SAAO,QAAQ,EAAE,SAAS,IAAI,MAAM,MAAM;AAC5C;AAEA,MAAM,aAAa,CAAC,GAAG,KAAK,YAAY;AACtC,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,MACL,SAAS,EAAE,UAAU;AAAA,MACrB,UAAU;AAAA,IACX;AAAA,EACF;AACD,QAAM,WAAW,EAAE,QAAQ,MAAM,2CAA2C;AAC5E,QAAM,SAAS,WAAW,CAAC,SAAS,CAAC,IACjC,EAAE,QAAQ,MAAM,4BAA4B,IAAI,IAAI,SAAS,IAC7D;AAEJ,QAAM,MAAM,WAAW,EAAE,QAAQ,QAAQ,uBAAuB,oBAC5D,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,GAAG;AAC9B,YAAU,WAAW;AACrB,MAAI;AAOF,UAAM,CAAG,EAAA,UAAU,MAAM,SAAS,IAAI,IAAI,UAAU,MAAM,OAAO,KAC/D,UAAU,MAAM,QAAQ,KACxB,CAAG,EAAA,IAAI,EAAE;AAEX,UAAM,SAAS,KAAK,MAAM,WAAW,OAAO;AAC5C,QAAI,UAAU,OAAO,WAAW,UAAU;AACxC,aAAO,QAAQ,IAAI;AACnB,aAAO,OAAO,IAAI;AAAA,IACnB;AACD,WAAO;AAAA,EACR,SAAQ,GAAP;AACA,QAAI,OAAO,QAAQ,YAAY,CAAC,OAAO,SAAS,GAAG,GAAG;AACpD,YAAM,eAAe,MAAM,QAAQ,GAAG,KAAK,IAAI,WAAW;AAC1D,YAAM,OAAO,OAAO,IAAI;AAAA,QACtB,gBAAgB,eAAe,mBAAmB,OAAO,GAAG;AAAA,MACpE,GAAS;AAAA,QACD,MAAM;AAAA,QACN,aAAa;AAAA,MACrB,CAAO;AAAA,IACF;AAED,UAAM,IAAI,eAAe,GAAG,WAAW,SAAS,SAAS;AAAA,EAC1D;AACH;AAKA,MAAM,WAAW,SAAO,OAAO,GAAG,EAAE,QAAQ,WAAW,EAAE;AAEzD,IAAA,4BAAiB;AACjB,UAAU,iBAAiB;AAE3B,UAAU,eAAe,CAAC,KAAK,YAAY;AACzC,MAAI;AACF,WAAO,KAAK,MAAM,SAAS,GAAG,GAAG,OAAO;AAAA,EAC5C,SAAW,GAAP;AAAA,EAAY;AAChB;;","x_google_ignoreList":[0]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../node_modules/json-parse-even-better-errors/index.js"],"sourcesContent":["'use strict'\n\nconst hexify = char => {\n const h = char.charCodeAt(0).toString(16).toUpperCase()\n return '0x' + (h.length % 2 ? '0' : '') + h\n}\n\nconst parseError = (e, txt, context) => {\n if (!txt) {\n return {\n message: e.message + ' while parsing empty string',\n position: 0,\n }\n }\n const badToken = e.message.match(/^Unexpected token (.) .*position\\s+(\\d+)/i)\n const errIdx = badToken ? +badToken[2]\n : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1\n : null\n\n const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${\n JSON.stringify(badToken[1])\n } (${hexify(badToken[1])})`)\n : e.message\n\n if (errIdx !== null && errIdx !== undefined) {\n const start = errIdx <= context ? 0\n : errIdx - context\n\n const end = errIdx + context >= txt.length ? txt.length\n : errIdx + context\n\n const slice = (start === 0 ? '' : '...') +\n txt.slice(start, end) +\n (end === txt.length ? '' : '...')\n\n const near = txt === slice ? '' : 'near '\n\n return {\n message: msg + ` while parsing ${near}${JSON.stringify(slice)}`,\n position: errIdx,\n }\n } else {\n return {\n message: msg + ` while parsing '${txt.slice(0, context * 2)}'`,\n position: 0,\n }\n }\n}\n\nclass JSONParseError extends SyntaxError {\n constructor (er, txt, context, caller) {\n context = context || 20\n const metadata = parseError(er, txt, context)\n super(metadata.message)\n Object.assign(this, metadata)\n this.code = 'EJSONPARSE'\n this.systemError = er\n Error.captureStackTrace(this, caller || this.constructor)\n }\n get name () { return this.constructor.name }\n set name (n) {}\n get [Symbol.toStringTag] () { return this.constructor.name }\n}\n\nconst kIndent = Symbol.for('indent')\nconst kNewline = Symbol.for('newline')\n// only respect indentation if we got a line break, otherwise squash it\n// things other than objects and arrays aren't indented, so ignore those\n// Important: in both of these regexps, the $1 capture group is the newline\n// or undefined, and the $2 capture group is the indent, or undefined.\nconst formatRE = /^\\s*[{\\[]((?:\\r?\\n)+)([\\s\\t]*)/\nconst emptyRE = /^(?:\\{\\}|\\[\\])((?:\\r?\\n)+)?$/\n\nconst parseJson = (txt, reviver, context) => {\n const parseText = stripBOM(txt)\n context = context || 20\n try {\n // get the indentation so that we can save it back nicely\n // if the file starts with {\" then we have an indent of '', ie, none\n // otherwise, pick the indentation of the next line after the first \\n\n // If the pattern doesn't match, then it means no indentation.\n // JSON.stringify ignores symbols, so this is reasonably safe.\n // if the string is '{}' or '[]', then use the default 2-space indent.\n const [, newline = '\\n', indent = ' '] = parseText.match(emptyRE) ||\n parseText.match(formatRE) ||\n [, '', '']\n\n const result = JSON.parse(parseText, reviver)\n if (result && typeof result === 'object') {\n result[kNewline] = newline\n result[kIndent] = indent\n }\n return result\n } catch (e) {\n if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) {\n const isEmptyArray = Array.isArray(txt) && txt.length === 0\n throw Object.assign(new TypeError(\n `Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}`\n ), {\n code: 'EJSONPARSE',\n systemError: e,\n })\n }\n\n throw new JSONParseError(e, parseText, context, parseJson)\n }\n}\n\n// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n// because the buffer-to-string conversion in `fs.readFileSync()`\n// translates it to FEFF, the UTF-16 BOM.\nconst stripBOM = txt => String(txt).replace(/^\\uFEFF/, '')\n\nmodule.exports = parseJson\nparseJson.JSONParseError = JSONParseError\n\nparseJson.noExceptions = (txt, reviver) => {\n try {\n return JSON.parse(stripBOM(txt), reviver)\n } catch (e) {}\n}\n"],"names":[],"mappings":"AAEA,MAAM,SAAS,UAAQ;AACrB,QAAM,IAAI,KAAK,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,YAAa;AACvD,SAAO,QAAQ,EAAE,SAAS,IAAI,MAAM,MAAM;AAC5C;AAEA,MAAM,aAAa,CAAC,GAAG,KAAK,YAAY;AACtC,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,MACL,SAAS,EAAE,UAAU;AAAA,MACrB,UAAU;AAAA,IACX;AAAA,EACF;AACD,QAAM,WAAW,EAAE,QAAQ,MAAM,2CAA2C;AAC5E,QAAM,SAAS,WAAW,CAAC,SAAS,CAAC,IACjC,EAAE,QAAQ,MAAM,4BAA4B,IAAI,IAAI,SAAS,IAC7D;AAEJ,QAAM,MAAM,WAAW,EAAE,QAAQ,QAAQ,uBAAuB,oBAC5D,KAAK,UAAU,SAAS,CAAC,CAAC,MACvB,OAAO,SAAS,CAAC,CAAC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AA,UAAU,MAAM,SAAS,IAAI,IAAI,UAAU,MAAM,OAAO,KAC/D,UAAU,MAAM,QAAQ,KACxB,CAAG,EAAA,IAAI,EAAE;AAEX,UAAM,SAAS,KAAK,MAAM,WAAW,OAAO;AAC5C,QAAI,UAAU,OAAO,WAAW,UAAU;AACxC,aAAO,QAAQ,IAAI;AACnB,aAAO,OAAO,IAAI;AAAA,IACnB;AACD,WAAO;AAAA,EACR,SAAQ,GAAP;AACA,QAAI,OAAO,QAAQ,YAAY,CAAC,OAAO,SAAS,GAAG,GAAG;AACpD,YAAM,eAAe,MAAM,QAAQ,GAAG,KAAK,IAAI,WAAW;AAC1D,YAAM,OAAO,OAAO,IAAI;AAAA,QACtB,gBAAgB,eAAe,mBAAmB,OAAO,GAAG;AAAA,MACpE,GAAS;AAAA,QACD,MAAM;AAAA,QACN,aAAa;AAAA,MACrB,CAAO;AAAA,IACF;AAED,UAAM,IAAI,eAAe,GAAG,WAAW,SAAS,SAAS;AAAA,EAC1D;AACH;AAKA,MAAM,WAAW,SAAO,OAAO,GAAG,EAAE,QAAQ,WAAW,EAAE;AAEzD,IAAA,4BAAiB;AACjB,UAAU,iBAAiB;AAE3B,UAAU,eAAe,CAAC,KAAK,YAAY;AACzC,MAAI;AACF,WAAO,KAAK,MAAM,SAAS,GAAG,GAAG,OAAO;AAAA,EAC5C,SAAW,GAAP;AAAA,EAAY;AAChB;","x_google_ignoreList":[0]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../../../../../node_modules/meow/node_modules/decamelize-keys/node_modules/decamelize/index.js"],"sourcesContent":["'use strict';\nmodule.exports = function (str, sep) {\n\tif (typeof str !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\tsep = typeof sep === 'undefined' ? '_' : sep;\n\n\treturn str\n\t\t.replace(/([a-z\\d])([A-Z])/g, '$1' + sep + '$2')\n\t\t.replace(/([A-Z]+)([A-Z][a-z\\d]+)/g, '$1' + sep + '$2')\n\t\t.toLowerCase();\n};\n"],"names":[],"mappings":";;AACA,IAAA,aAAiB,SAAU,KAAK,KAAK;AACpC,MAAI,OAAO,QAAQ,UAAU;AAC5B,UAAM,IAAI,UAAU,mBAAmB;AAAA,EACvC;AAED,QAAM,OAAO,QAAQ,cAAc,MAAM;AAEzC,SAAO,IACL,QAAQ,qBAAqB,OAAO,MAAM,IAAI,EAC9C,QAAQ,4BAA4B,OAAO,MAAM,IAAI,EACrD;AACH;;","x_google_ignoreList":[0]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../../node_modules/meow/node_modules/decamelize-keys/node_modules/decamelize/index.js"],"sourcesContent":["'use strict';\nmodule.exports = function (str, sep) {\n\tif (typeof str !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\tsep = typeof sep === 'undefined' ? '_' : sep;\n\n\treturn str\n\t\t.replace(/([a-z\\d])([A-Z])/g, '$1' + sep + '$2')\n\t\t.replace(/([A-Z]+)([A-Z][a-z\\d]+)/g, '$1' + sep + '$2')\n\t\t.toLowerCase();\n};\n"],"names":[],"mappings":"AACA,IAAA,aAAiB,SAAU,KAAK,KAAK;AACpC,MAAI,OAAO,QAAQ,UAAU;AAC5B,UAAM,IAAI,UAAU,mBAAmB;AAAA,EACvC;AAED,QAAM,OAAO,QAAQ,cAAc,MAAM;AAEzC,SAAO,IACL,QAAQ,qBAAqB,OAAO,MAAM,IAAI,EAC9C,QAAQ,4BAA4B,OAAO,MAAM,IAAI,EACrD;AACH;","x_google_ignoreList":[0]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const _commonjsHelpers = require("../../_virtual/_commonjsHelpers.cjs");
3
- const index = require('./_node_modules/map-obj/index.cjs');
2
+ const _commonjsHelpers = require("../../../../_virtual/_commonjsHelpers.cjs");
3
+ const index = require("../map-obj/index.cjs");
4
4
  const index$1 = require('./_node_modules/decamelize/index.cjs');
5
5
  var mapObj = index.mapObj;
6
6
  var decamelize = index$1.decamelize;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../../../node_modules/meow/node_modules/decamelize-keys/index.js"],"sourcesContent":["'use strict';\nvar mapObj = require('map-obj');\nvar decamelize = require('decamelize');\n\nmodule.exports = function (input, separator, options) {\n\tif (typeof separator !== 'string') {\n\t\toptions = separator;\n\t\tseparator = null;\n\t}\n\n\toptions = options || {};\n\tseparator = separator || options.separator;\n\tvar exclude = options.exclude || [];\n\n\treturn mapObj(input, function (key, val) {\n\t\tkey = exclude.indexOf(key) === -1 ? decamelize(key, separator) : key;\n\t\treturn [key, val];\n\t});\n};\n"],"names":["require$$0","require$$1"],"mappings":";;;;AACA,IAAI,SAASA,MAAAA;AACb,IAAI,aAAaC,QAAAA;AAEjB,IAAA,iBAAiB,SAAU,OAAO,WAAW,SAAS;AACrD,MAAI,OAAO,cAAc,UAAU;AAClC,cAAU;AACV,gBAAY;AAAA,EACZ;AAED,YAAU,WAAW;AACrB,cAAY,aAAa,QAAQ;AACjC,MAAI,UAAU,QAAQ,WAAW;AAEjC,SAAO,OAAO,OAAO,SAAU,KAAK,KAAK;AACxC,UAAM,QAAQ,QAAQ,GAAG,MAAM,KAAK,WAAW,KAAK,SAAS,IAAI;AACjE,WAAO,CAAC,KAAK,GAAG;AAAA,EAClB,CAAE;AACF;;;","x_google_ignoreList":[0]}
@@ -1,5 +1,5 @@
1
- import { getDefaultExportFromCjs } from "../../_virtual/_commonjsHelpers.js";
2
- import { m as mapObj$1 } from './_node_modules/map-obj/index.js';
1
+ import { getDefaultExportFromCjs } from "../../../../_virtual/_commonjsHelpers.js";
2
+ import { m as mapObj$1 } from "../map-obj/index.js";
3
3
  import { d as decamelize$1 } from './_node_modules/decamelize/index.js';
4
4
  var mapObj = mapObj$1;
5
5
  var decamelize = decamelize$1;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../node_modules/meow/node_modules/decamelize-keys/index.js"],"sourcesContent":["'use strict';\nvar mapObj = require('map-obj');\nvar decamelize = require('decamelize');\n\nmodule.exports = function (input, separator, options) {\n\tif (typeof separator !== 'string') {\n\t\toptions = separator;\n\t\tseparator = null;\n\t}\n\n\toptions = options || {};\n\tseparator = separator || options.separator;\n\tvar exclude = options.exclude || [];\n\n\treturn mapObj(input, function (key, val) {\n\t\tkey = exclude.indexOf(key) === -1 ? decamelize(key, separator) : key;\n\t\treturn [key, val];\n\t});\n};\n"],"names":["require$$0","require$$1"],"mappings":";;;AACA,IAAI,SAASA;AACb,IAAI,aAAaC;AAEjB,IAAA,iBAAiB,SAAU,OAAO,WAAW,SAAS;AACrD,MAAI,OAAO,cAAc,UAAU;AAClC,cAAU;AACV,gBAAY;AAAA,EACZ;AAED,YAAU,WAAW;AACrB,cAAY,aAAa,QAAQ;AACjC,MAAI,UAAU,QAAQ,WAAW;AAEjC,SAAO,OAAO,OAAO,SAAU,KAAK,KAAK;AACxC,UAAM,QAAQ,QAAQ,GAAG,MAAM,KAAK,WAAW,KAAK,SAAS,IAAI;AACjE,WAAO,CAAC,KAAK,GAAG;AAAA,EAClB,CAAE;AACF;;","x_google_ignoreList":[0]}