@osdk/create-widget 2.0.0-beta.8 → 2.1.0-beta.1

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 (118) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/build/{browser/esm-VPCD3XBG.js → esm/esm-C6MU7DAZ.js} +104 -82
  3. package/build/esm/esm-C6MU7DAZ.js.map +1 -0
  4. package/build/esm/esm-ENH745KN.js +240 -0
  5. package/build/esm/esm-ENH745KN.js.map +1 -0
  6. package/build/esm/index.js +42 -51
  7. package/build/esm/index.js.map +1 -1
  8. package/build/{esm → types}/cli.d.ts +0 -1
  9. package/build/types/cli.d.ts.map +1 -0
  10. package/build/types/cli.test.d.ts +1 -0
  11. package/build/types/cli.test.d.ts.map +1 -0
  12. package/build/{esm → types}/consola.d.ts +0 -1
  13. package/build/types/consola.d.ts.map +1 -0
  14. package/build/types/generate/generateFoundryConfigJson.d.ts +5 -0
  15. package/build/types/generate/generateFoundryConfigJson.d.ts.map +1 -0
  16. package/build/types/generate/generateFoundryConfigJson.test.d.ts +1 -0
  17. package/build/types/generate/generateFoundryConfigJson.test.d.ts.map +1 -0
  18. package/build/types/generate/generateNpmRc.d.ts +4 -0
  19. package/build/types/generate/generateNpmRc.d.ts.map +1 -0
  20. package/build/types/generate/generateNpmRc.test.d.ts +1 -0
  21. package/build/types/generate/generateNpmRc.test.d.ts.map +1 -0
  22. package/build/{esm → types}/generatedNoCheck/templates.d.ts +0 -1
  23. package/build/types/generatedNoCheck/templates.d.ts.map +1 -0
  24. package/build/{esm → types}/getPackageFiles.d.ts +1 -2
  25. package/build/types/getPackageFiles.d.ts.map +1 -0
  26. package/build/{esm → types}/highlight.d.ts +0 -1
  27. package/build/types/highlight.d.ts.map +1 -0
  28. package/build/{esm → types}/index.d.ts +1 -2
  29. package/build/types/index.d.ts.map +1 -0
  30. package/build/types/prompts/promptFoundryUrl.d.ts +3 -0
  31. package/build/types/prompts/promptFoundryUrl.d.ts.map +1 -0
  32. package/build/types/prompts/promptFoundryUrl.test.d.ts +1 -0
  33. package/build/types/prompts/promptFoundryUrl.test.d.ts.map +1 -0
  34. package/build/types/prompts/promptOsdkPackage.d.ts +3 -0
  35. package/build/types/prompts/promptOsdkPackage.d.ts.map +1 -0
  36. package/build/types/prompts/promptOsdkPackage.test.d.ts +1 -0
  37. package/build/types/prompts/promptOsdkPackage.test.d.ts.map +1 -0
  38. package/build/types/prompts/promptOsdkRegistryUrl.d.ts +3 -0
  39. package/build/types/prompts/promptOsdkRegistryUrl.d.ts.map +1 -0
  40. package/build/types/prompts/promptOsdkRegistryUrl.test.d.ts +1 -0
  41. package/build/types/prompts/promptOsdkRegistryUrl.test.d.ts.map +1 -0
  42. package/build/types/prompts/promptOverwrite.d.ts +4 -0
  43. package/build/types/prompts/promptOverwrite.d.ts.map +1 -0
  44. package/build/types/prompts/promptOverwrite.test.d.ts +1 -0
  45. package/build/types/prompts/promptOverwrite.test.d.ts.map +1 -0
  46. package/build/types/prompts/promptProject.d.ts +3 -0
  47. package/build/types/prompts/promptProject.d.ts.map +1 -0
  48. package/build/types/prompts/promptProject.test.d.ts +1 -0
  49. package/build/types/prompts/promptProject.test.d.ts.map +1 -0
  50. package/build/types/prompts/promptSdkVersion.d.ts +5 -0
  51. package/build/types/prompts/promptSdkVersion.d.ts.map +1 -0
  52. package/build/{esm → types}/prompts/promptTemplate.d.ts +2 -3
  53. package/build/types/prompts/promptTemplate.d.ts.map +1 -0
  54. package/build/types/prompts/promptTemplate.test.d.ts +1 -0
  55. package/build/types/prompts/promptTemplate.test.d.ts.map +1 -0
  56. package/build/types/prompts/promptWidgetSetRid.d.ts +3 -0
  57. package/build/types/prompts/promptWidgetSetRid.d.ts.map +1 -0
  58. package/build/types/prompts/promptWidgetSetRid.test.d.ts +1 -0
  59. package/build/types/prompts/promptWidgetSetRid.test.d.ts.map +1 -0
  60. package/build/types/run.d.ts +13 -0
  61. package/build/types/run.d.ts.map +1 -0
  62. package/build/types/templates.d.ts +22 -0
  63. package/build/types/templates.d.ts.map +1 -0
  64. package/package.json +25 -20
  65. package/build/browser/esm-VPCD3XBG.js.map +0 -1
  66. package/build/browser/index.js +0 -432
  67. package/build/browser/index.js.map +0 -1
  68. package/build/esm/cli.d.ts.map +0 -1
  69. package/build/esm/cli.test.d.ts +0 -2
  70. package/build/esm/cli.test.d.ts.map +0 -1
  71. package/build/esm/consola.d.ts.map +0 -1
  72. package/build/esm/esm-VPCD3XBG.js +0 -365
  73. package/build/esm/esm-VPCD3XBG.js.map +0 -1
  74. package/build/esm/generate/generateFoundryConfigJson.d.ts +0 -6
  75. package/build/esm/generate/generateFoundryConfigJson.d.ts.map +0 -1
  76. package/build/esm/generate/generateFoundryConfigJson.test.d.ts +0 -2
  77. package/build/esm/generate/generateFoundryConfigJson.test.d.ts.map +0 -1
  78. package/build/esm/generate/generateNpmRc.d.ts +0 -5
  79. package/build/esm/generate/generateNpmRc.d.ts.map +0 -1
  80. package/build/esm/generate/generateNpmRc.test.d.ts +0 -2
  81. package/build/esm/generate/generateNpmRc.test.d.ts.map +0 -1
  82. package/build/esm/generatedNoCheck/templates.d.ts.map +0 -1
  83. package/build/esm/getPackageFiles.d.ts.map +0 -1
  84. package/build/esm/highlight.d.ts.map +0 -1
  85. package/build/esm/index.d.ts.map +0 -1
  86. package/build/esm/prompts/promptFoundryUrl.d.ts +0 -4
  87. package/build/esm/prompts/promptFoundryUrl.d.ts.map +0 -1
  88. package/build/esm/prompts/promptFoundryUrl.test.d.ts +0 -2
  89. package/build/esm/prompts/promptFoundryUrl.test.d.ts.map +0 -1
  90. package/build/esm/prompts/promptOsdkPackage.d.ts +0 -4
  91. package/build/esm/prompts/promptOsdkPackage.d.ts.map +0 -1
  92. package/build/esm/prompts/promptOsdkPackage.test.d.ts +0 -2
  93. package/build/esm/prompts/promptOsdkPackage.test.d.ts.map +0 -1
  94. package/build/esm/prompts/promptOsdkRegistryUrl.d.ts +0 -4
  95. package/build/esm/prompts/promptOsdkRegistryUrl.d.ts.map +0 -1
  96. package/build/esm/prompts/promptOsdkRegistryUrl.test.d.ts +0 -2
  97. package/build/esm/prompts/promptOsdkRegistryUrl.test.d.ts.map +0 -1
  98. package/build/esm/prompts/promptOverwrite.d.ts +0 -5
  99. package/build/esm/prompts/promptOverwrite.d.ts.map +0 -1
  100. package/build/esm/prompts/promptOverwrite.test.d.ts +0 -2
  101. package/build/esm/prompts/promptOverwrite.test.d.ts.map +0 -1
  102. package/build/esm/prompts/promptProject.d.ts +0 -4
  103. package/build/esm/prompts/promptProject.d.ts.map +0 -1
  104. package/build/esm/prompts/promptProject.test.d.ts +0 -2
  105. package/build/esm/prompts/promptProject.test.d.ts.map +0 -1
  106. package/build/esm/prompts/promptSdkVersion.d.ts +0 -6
  107. package/build/esm/prompts/promptSdkVersion.d.ts.map +0 -1
  108. package/build/esm/prompts/promptTemplate.d.ts.map +0 -1
  109. package/build/esm/prompts/promptTemplate.test.d.ts +0 -2
  110. package/build/esm/prompts/promptTemplate.test.d.ts.map +0 -1
  111. package/build/esm/prompts/promptWidgetSetRid.d.ts +0 -4
  112. package/build/esm/prompts/promptWidgetSetRid.d.ts.map +0 -1
  113. package/build/esm/prompts/promptWidgetSetRid.test.d.ts +0 -2
  114. package/build/esm/prompts/promptWidgetSetRid.test.d.ts.map +0 -1
  115. package/build/esm/run.d.ts +0 -14
  116. package/build/esm/run.d.ts.map +0 -1
  117. package/build/esm/templates.d.ts +0 -27
  118. package/build/esm/templates.d.ts.map +0 -1
@@ -4,9 +4,7 @@ import { createConsola, consola as consola$1 } from 'consola';
4
4
  import { colorize } from 'consola/utils';
5
5
  import fs2 from 'fs';
6
6
  import path2 from 'path';
7
- import { findUpSync } from 'find-up';
8
7
  import Handlebars from 'handlebars';
9
- import { fileURLToPath } from 'url';
10
8
 
11
9
  // src/cli.ts
12
10
  var consola = createConsola({
@@ -161,14 +159,26 @@ var getPackageFiles = (importPromise) => async () => (await importPromise).files
161
159
 
162
160
  // src/generatedNoCheck/templates.ts
163
161
  var TEMPLATES = [
164
- // React
162
+ // OSDK React
165
163
  {
166
164
  id: "template-widget-react",
167
- label: "React",
165
+ label: "OSDK React",
168
166
  envPrefix: "VITE_",
169
167
  buildDirectory: "./dist",
168
+ requiresOsdk: true,
170
169
  files: {
171
- "2.x": getPackageFiles(import('./esm-VPCD3XBG.js'))
170
+ "2.x": getPackageFiles(import('./esm-C6MU7DAZ.js'))
171
+ }
172
+ },
173
+ // Minimal React
174
+ {
175
+ id: "template-widget-minimal-react",
176
+ label: "Minimal React",
177
+ envPrefix: "VITE_",
178
+ buildDirectory: "./dist",
179
+ requiresOsdk: false,
180
+ files: {
181
+ "2.x": getPackageFiles(import('./esm-ENH745KN.js'))
172
182
  }
173
183
  }
174
184
  ];
@@ -201,49 +211,33 @@ async function promptTemplate(parsed) {
201
211
 
202
212
  // src/prompts/promptWidgetSetRid.ts
203
213
  async function promptWidgetSetRid({
204
- widgetSetRid
214
+ widgetSet
205
215
  }) {
206
- while (widgetSetRid == null || !/^ri\.widgetregistry\.\.widget-set\.[^.]+$/.test(widgetSetRid)) {
207
- if (widgetSetRid != null) {
216
+ while (widgetSet == null || !/^ri\.widgetregistry\.\.widget-set\.[^.]+$/.test(widgetSet)) {
217
+ if (widgetSet != null) {
208
218
  consola.fail("Please enter a valid widget resource identifier (rid)");
209
219
  }
210
- widgetSetRid = await consola.prompt(`Enter the resource identifier (rid) for your widget set:
220
+ widgetSet = await consola.prompt(`Enter the resource identifier (rid) for your widget set:
211
221
  ${italic("(Example: ri.widgetregistry..widget-set.1c66b352-4e00-40d2-995d-061c9d533ace)")}`, {
212
222
  type: "text"
213
223
  });
214
224
  }
215
- return widgetSetRid;
225
+ return widgetSet;
216
226
  }
217
227
 
218
- // ../generator-utils/build/esm/changeVersionPrefix.js
219
- function changeVersionPrefix(version, prefix) {
220
- const isWorkspaceProtocol = version.startsWith("workspace:");
221
- if (isWorkspaceProtocol) {
222
- version = version.slice("workspace:".length);
223
- }
224
- if (version[0] === "^" || version[0] === "~" || version[0] === "*") {
225
- version = version.slice(1);
226
- }
227
- return `${isWorkspaceProtocol ? "workspace:" : ""}${prefix}${version}`;
228
- }
229
-
230
- // ../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js
231
- process.env.NODE_ENV === "production";
232
-
233
228
  // src/generate/generateFoundryConfigJson.ts
234
229
  function generateFoundryConfigJson({
235
230
  foundryUrl,
236
- widgetSetRid,
231
+ widgetSet,
237
232
  directory
238
233
  }) {
239
234
  return JSON.stringify({
240
235
  foundryUrl,
241
236
  widgetSet: {
242
- rid: widgetSetRid,
237
+ rid: widgetSet,
243
238
  directory,
244
239
  autoVersion: {
245
- type: "git-describe",
246
- tagPrefix: ""
240
+ type: "package-json"
247
241
  }
248
242
  }
249
243
  }, null, 2) + "\n";
@@ -269,7 +263,7 @@ async function run({
269
263
  template,
270
264
  sdkVersion,
271
265
  foundryUrl,
272
- widgetSetRid,
266
+ widgetSet,
273
267
  osdkPackage,
274
268
  osdkRegistryUrl
275
269
  }) {
@@ -309,17 +303,9 @@ async function run({
309
303
  });
310
304
  await fs2.promises.writeFile(finalPath, Buffer.from(contents.body, contents.type === "raw" ? "utf-8" : "base64"));
311
305
  }
312
- const ourPackageJsonPath = findUpSync("package.json", {
313
- cwd: fileURLToPath(import.meta.url)
314
- });
315
- ourPackageJsonPath ? JSON.parse(fs2.readFileSync(ourPackageJsonPath, "utf-8")).version : void 0;
316
- const clientVersion = "2.1.0-beta.23";
317
306
  const templateContext = {
318
307
  project,
319
- foundryUrl,
320
- widgetSetRid,
321
- osdkPackage,
322
- clientVersion: changeVersionPrefix(clientVersion, "^")
308
+ osdkPackage
323
309
  };
324
310
  const processFiles = function(dir) {
325
311
  fs2.readdirSync(dir).forEach(function(file) {
@@ -342,14 +328,19 @@ async function run({
342
328
  });
343
329
  };
344
330
  processFiles(root);
345
- const npmRc = generateNpmRc({
346
- osdkPackage,
347
- osdkRegistryUrl
348
- });
349
- fs2.writeFileSync(path2.join(root, ".npmrc"), npmRc);
331
+ if (template.requiresOsdk) {
332
+ if (osdkPackage == null || osdkRegistryUrl == null) {
333
+ throw new Error(`Template ${template.id} requires OSDK package and registry URL`);
334
+ }
335
+ const npmRc = generateNpmRc({
336
+ osdkPackage,
337
+ osdkRegistryUrl
338
+ });
339
+ fs2.writeFileSync(path2.join(root, ".npmrc"), npmRc);
340
+ }
350
341
  const foundryConfigJson = generateFoundryConfigJson({
351
342
  foundryUrl,
352
- widgetSetRid,
343
+ widgetSet,
353
344
  directory: template.buildDirectory
354
345
  });
355
346
  fs2.writeFileSync(path2.join(root, "foundry.config.json"), foundryConfigJson);
@@ -372,7 +363,7 @@ async function run({
372
363
 
373
364
  // src/cli.ts
374
365
  async function cli(args = process.argv) {
375
- const base = yargs(hideBin(args)).version("2.0.0-beta.8").wrap(Math.min(150, yargs().terminalWidth())).strict().help().command("$0 [project] [--<option>]", "Create a new OSDK widget set based on framework templates. Information may be provided through options to skip interactive prompts.", (yargs2) => yargs2.positional("project", {
366
+ const base = yargs(hideBin(args)).version("2.1.0-beta.1").wrap(Math.min(150, yargs().terminalWidth())).strict().help().command("$0 [project] [--<option>]", "Create a new OSDK widget set based on framework templates. Information may be provided through options to skip interactive prompts.", (yargs2) => yargs2.positional("project", {
376
367
  type: "string",
377
368
  describe: "Project name to create"
378
369
  }).option("overwrite", {
@@ -390,7 +381,7 @@ async function cli(args = process.argv) {
390
381
  }).option("foundryUrl", {
391
382
  type: "string",
392
383
  describe: "URL for the Foundry stack"
393
- }).option("widgetSetRid", {
384
+ }).option("widgetSet", {
394
385
  type: "string",
395
386
  describe: "Widget set resource identifier (rid)"
396
387
  }).option("osdkPackage", {
@@ -412,16 +403,16 @@ async function cli(args = process.argv) {
412
403
  template
413
404
  });
414
405
  const foundryUrl = await promptFoundryUrl(parsed);
415
- const osdkPackage = await promptOsdkPackage(parsed);
416
- const osdkRegistryUrl = await promptOsdkRegistryUrl(parsed);
417
- const widgetSetRid = await promptWidgetSetRid(parsed);
406
+ const osdkPackage = template.requiresOsdk ? await promptOsdkPackage(parsed) : undefined;
407
+ const osdkRegistryUrl = template.requiresOsdk ? await promptOsdkRegistryUrl(parsed) : undefined;
408
+ const widgetSet = await promptWidgetSetRid(parsed);
418
409
  await run({
419
410
  project,
420
411
  overwrite,
421
412
  template,
422
413
  sdkVersion,
423
414
  foundryUrl,
424
- widgetSetRid,
415
+ widgetSet,
425
416
  osdkPackage,
426
417
  osdkRegistryUrl
427
418
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/consola.ts","../../src/highlight.ts","../../src/prompts/promptFoundryUrl.ts","../../src/prompts/promptOsdkPackage.ts","../../src/prompts/promptOsdkRegistryUrl.ts","../../src/prompts/promptOverwrite.ts","../../src/prompts/promptProject.ts","../../src/prompts/promptSdkVersion.ts","../../src/getPackageFiles.ts","../../src/generatedNoCheck/templates.ts","../../src/prompts/promptTemplate.ts","../../src/prompts/promptWidgetSetRid.ts","../../../generator-utils/build/esm/changeVersionPrefix.js","../../../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../../src/generate/generateFoundryConfigJson.ts","../../src/generate/generateNpmRc.ts","../../src/run.ts","../../src/cli.ts"],"names":["defaultConsola","fs","path","sdkVersion","template","yargs"],"mappings":";;;;;;;;;;;AAiBO,IAAM,UAAU,aAAc,CAAA;AAAA;AAAA,EAEnC,MAAM,UAAU,MAAQ,EAAA;AACtB,IAAA,MAAM,QAAW,GAAA,MAAMA,SAAe,CAAA,MAAA,CAAO,GAAG,MAAM,CAAA,CAAA;AACtD,IAAA,IAAI,OAAO,QAAa,KAAA,QAAA,IAAY,QAAS,CAAA,QAAA,OAAe,sBAAwB,EAAA;AAClF,MAAAA,SAAA,CAAe,KAAK,qBAAqB,CAAA,CAAA;AACzC,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA,CAAA;AAAA,KAChB;AACA,IAAO,OAAA,QAAA,CAAA;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mB,EAAA;AAAA,IAC3B,IAAM,EAAA,QAAA;AAAA,IACN,QAAU,EAAA,8CAAA;AAAA,GACX,CAAC,CAAA,CAAA;AACF,EAAM,MAAA,MAAA,GAAS,KAAK,SAAU,EAAA,CAAA;AAC9B,EAAM,MAAA,OAAA,GAAU,MAAM,aAAA,CAAc,MAAM,CAAA,CAAA;AAC1C,EAAM,MAAA,SAAA,GAAY,MAAM,eAAgB,CAAA;AAAA,IACtC,GAAG,MAAA;AAAA,IACH,OAAA;AAAA,GACD,CAAA,CAAA;AACD,EAAM,MAAA,QAAA,GAAW,MAAM,cAAA,CAAe,MAAM,CAAA,CAAA;AAC5C,EAAM,MAAA,UAAA,GAAa,MAAM,gBAAiB,CAAA;AAAA,IACxC,GAAG,MAAA;AAAA,IACH,QAAA;AAAA,GACD,CAAA,CAAA;AACD,EAAM,MAAA,UAAA,GAAa,MAAM,gBAAA,CAAiB,MAAM,CAAA,CAAA;AAChD,EAAM,MAAA,WAAA,GAAc,MAAM,iBAAA,CAAkB,MAAM,CAAA,CAAA;AAClD,EAAM,MAAA,eAAA,GAAkB,MAAM,qBAAA,CAAsB,MAAM,CAAA,CAAA;AAC1D,EAAM,MAAA,YAAA,GAAe,MAAM,kBAAA,CAAmB,MAAM,CAAA,CAAA;AACpD,EAAA,MAAM,GAAI,CAAA;AAAA,IACR,OAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,WAAA;AAAA,IACA,eAAA;AAAA,GACD,CAAA,CAAA;AACH","file":"index.js","sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola as defaultConsola, createConsola } from \"consola\";\nexport const consola = createConsola({\n // https://github.com/unjs/consola/issues/251\n async prompt(...params) {\n const response = await defaultConsola.prompt(...params);\n if (typeof response === \"symbol\" && response.toString() === \"Symbol(clack:cancel)\") {\n defaultConsola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n return response;\n }\n});","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { colorize } from \"consola/utils\";\nexport function green(text) {\n return colorize(\"green\", text);\n}\nexport function italic(text) {\n return colorize(\"italic\", text);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptFoundryUrl({\n foundryUrl\n}) {\n while (foundryUrl == null || !foundryUrl.startsWith(\"https://\")) {\n if (foundryUrl != null) {\n consola.fail(\"Please enter a valid Foundry URL\");\n }\n foundryUrl = await consola.prompt(`Enter the URL for your Foundry stack:\\n${italic(\"(Example: https://example.palantirfoundry.com)\")}`, {\n type: \"text\"\n });\n }\n return foundryUrl.replace(/\\/$/, \"\");\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptOsdkPackage({\n osdkPackage\n}) {\n while (osdkPackage == null || !/^@[a-z0-9-]+\\/sdk$/.test(osdkPackage)) {\n if (osdkPackage != null) {\n consola.fail(\"Please enter a valid OSDK package name\");\n }\n osdkPackage = await consola.prompt(`Enter the OSDK package name for your widget set:\\n${italic(\"(Example: @my-widget/sdk)\")}`, {\n type: \"text\"\n });\n }\n return osdkPackage;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptOsdkRegistryUrl({\n osdkRegistryUrl\n}) {\n while (osdkRegistryUrl == null || !/^https:\\/\\/[^/]+\\/artifacts\\/api\\/repositories\\/ri\\.[^/]+\\/contents\\/release\\/npm\\/?$/.test(osdkRegistryUrl)) {\n if (osdkRegistryUrl != null) {\n consola.fail(\"Please enter a valid NPM registry URL to install your OSDK package\");\n }\n osdkRegistryUrl = await consola.prompt(`Enter the NPM registry URL to install your OSDK package:\\n${italic(\"(Example: https://example.palantirfoundry.com/artifacts/api/repositories/ri.artifacts.main.repository.a4a7fe1c-486f-4226-b706-7b90005f527d/contents/release/npm)\")}`, {\n type: \"text\"\n });\n }\n return osdkRegistryUrl.replace(/\\/$/, \"\");\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { consola } from \"../consola.js\";\nimport { green } from \"../highlight.js\";\nexport async function promptOverwrite({\n project,\n overwrite\n}) {\n if (overwrite != null) {\n return overwrite;\n }\n if (!fs.existsSync(path.join(process.cwd(), project))) {\n return true;\n }\n const result = await consola.prompt(`The directory ${green(project)} already exists do you want to overwrite or ignore it?`, {\n type: \"select\",\n options: [{\n label: \"Remove existing files and continue\",\n value: \"overwrite\"\n }, {\n label: \"Ignore files and continue\",\n value: \"ignore\"\n }, {\n label: \"Cancel\",\n value: \"cancel\"\n }]\n }\n // Types for \"select\" are wrong the value is returned rather than the option object\n // https://github.com/unjs/consola/pull/238\n );\n switch (result) {\n case \"overwrite\":\n return true;\n case \"ignore\":\n return false;\n case \"cancel\":\n consola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nexport async function promptProject({\n project\n}) {\n while (project == null || !/^[a-zA-Z0-9-_]+$/.test(project)) {\n if (project != null) {\n consola.fail(\"Project name can only contain alphanumeric characters, hyphens and underscores\");\n }\n project = await consola.prompt(\"Project name:\", {\n type: \"text\",\n placeholder: \"my-osdk-widget\",\n default: \"my-osdk-widget\"\n });\n }\n return project;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nexport async function promptSdkVersion({\n sdkVersion,\n template\n}) {\n if (sdkVersion == null) {\n // If the SDK version is not provided, default to the earliest template version for backwards-compatibility\n return Object.keys(template.files)[0];\n }\n if (template.files[sdkVersion] == null) {\n consola.fail(`The ${template.label} template does not support a \"${sdkVersion}\" SDK version.`);\n sdkVersion = await consola.prompt(`Please choose which version of the OSDK you'd like to use for the ${template.label} template:`, {\n type: \"select\",\n options: Object.keys(template.files).reverse().map(sdkVersion => ({\n label: sdkVersion,\n value: sdkVersion\n }))\n }\n // Types for \"select\" are wrong the value is returned rather than the option object\n // https://github.com/unjs/consola/pull/238\n );\n }\n return sdkVersion;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const getPackageFiles = importPromise => async () => (await importPromise).files;","// THIS FILE IS GENERATED. DO NOT MODIFY.\n// You probably want to modify ../../../codegen.mjs instead.\n\nimport { getPackageFiles } from \"../getPackageFiles.js\";\nexport const TEMPLATES = [\n// React\n{\n id: \"template-widget-react\",\n label: \"React\",\n envPrefix: \"VITE_\",\n buildDirectory: \"./dist\",\n files: {\n \"2.x\": getPackageFiles(import(\"@osdk/create-widget.template.react.v2\"))\n }\n}];","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { TEMPLATES } from \"../generatedNoCheck/templates.js\";\nimport { green } from \"../highlight.js\";\nexport async function promptTemplate(parsed) {\n let useBeta = parsed.beta ?? false;\n let template = TEMPLATES.find(t => t.id === parsed.template || t.id === `template-${parsed.template}`);\n if (template == null) {\n const availableTemplates = TEMPLATES.filter(template => !template.hidden && (useBeta ? template.isBeta === true\n // isBeta could be null\n : !template.isBeta));\n if (availableTemplates.length === 0) {\n throw new Error(\"No available templates found for the selected options.\");\n }\n const templateId = await consola.prompt(parsed.template != null ? `The provided template ${green(parsed.template)} is invalid please select a framework:` : \"Select a framework:\", {\n type: \"select\",\n options: availableTemplates.map(template => ({\n value: template.id,\n label: template.label\n }))\n // Types for \"select\" are wrong the value is returned rather than the option object\n // https://github.com/unjs/consola/pull/238\n });\n template = TEMPLATES.find(t => t.id === templateId);\n if (template == null) {\n throw new Error(`Template ${templateId} should be found`);\n }\n }\n return template;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptWidgetSetRid({\n widgetSetRid\n}) {\n while (widgetSetRid == null || !/^ri\\.widgetregistry\\.\\.widget-set\\.[^.]+$/.test(widgetSetRid)) {\n if (widgetSetRid != null) {\n consola.fail(\"Please enter a valid widget resource identifier (rid)\");\n }\n widgetSetRid = await consola.prompt(`Enter the resource identifier (rid) for your widget set:\\n${italic(\"(Example: ri.widgetregistry..widget-set.1c66b352-4e00-40d2-995d-061c9d533ace)\")}`, {\n type: \"text\"\n });\n }\n return widgetSetRid;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function changeVersionPrefix(version, prefix) {\n const isWorkspaceProtocol = version.startsWith(\"workspace:\");\n if (isWorkspaceProtocol) {\n version = version.slice(\"workspace:\".length);\n }\n if (version[0] === \"^\" || version[0] === \"~\" || version[0] === \"*\") {\n version = version.slice(1);\n }\n return `${isWorkspaceProtocol ? \"workspace:\" : \"\"}${prefix}${version}`;\n}","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\nexport { invariant as default };","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function generateFoundryConfigJson({\n foundryUrl,\n widgetSetRid,\n directory\n}) {\n return JSON.stringify({\n foundryUrl,\n widgetSet: {\n rid: widgetSetRid,\n directory,\n autoVersion: {\n type: \"git-describe\",\n tagPrefix: \"\"\n }\n }\n }, null, 2) + \"\\n\";\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function generateNpmRc({\n osdkPackage,\n osdkRegistryUrl\n}) {\n // pnpm requires a trailing slash in .npmrc\n // https://github.com/pnpm/pnpm/issues/5941\n const withTrailingSlash = osdkRegistryUrl.endsWith(\"/\") ? osdkRegistryUrl : osdkRegistryUrl + \"/\";\n const withoutProtocol = withTrailingSlash.replace(/^https:\\/\\//, \"\");\n const packageScope = osdkPackage.split(\"/\")[0];\n return `//${withoutProtocol}:_authToken=\\${FOUNDRY_TOKEN}\\n` + `${packageScope}:registry=${withTrailingSlash}\\n`;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { changeVersionPrefix } from \"@osdk/generator-utils\";\nimport { findUpSync } from \"find-up\";\nimport Handlebars from \"handlebars\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { consola } from \"./consola.js\";\nimport { generateFoundryConfigJson } from \"./generate/generateFoundryConfigJson.js\";\nimport { generateNpmRc } from \"./generate/generateNpmRc.js\";\nimport { green } from \"./highlight.js\";\nexport async function run({\n project,\n overwrite,\n template,\n sdkVersion,\n foundryUrl,\n widgetSetRid,\n osdkPackage,\n osdkRegistryUrl\n}) {\n consola.log(\"\");\n consola.start(`Creating project ${green(project)} using template ${green(template.id)}`);\n const cwd = process.cwd();\n const root = path.join(cwd, project);\n if (fs.existsSync(root)) {\n if (overwrite) {\n consola.info(`Overwriting existing project directory`);\n fs.rmSync(root, {\n recursive: true,\n force: true\n });\n fs.mkdirSync(root, {\n recursive: true\n });\n } else {\n consola.info(`Reusing existing project directory`);\n }\n } else {\n consola.info(`Creating project directory`);\n fs.mkdirSync(root, {\n recursive: true\n });\n }\n consola.info(`Copying files into project directory`);\n if (template.files[sdkVersion] == null) {\n throw new Error(`The ${template.label} template does not support a \"${sdkVersion}\" SDK version.`);\n }\n const files = await template.files[sdkVersion]();\n for (const [filePath, contents] of files) {\n const finalPath = path.join(root, filePath);\n const dirPath = path.dirname(finalPath);\n await fs.promises.mkdir(dirPath, {\n recursive: true\n });\n await fs.promises.writeFile(finalPath, Buffer.from(contents.body, contents.type === \"raw\" ? \"utf-8\" : \"base64\"));\n }\n const ourPackageJsonPath = findUpSync(\"package.json\", {\n cwd: fileURLToPath(import.meta.url)\n });\n const ourPackageJsonVersion = ourPackageJsonPath ? JSON.parse(fs.readFileSync(ourPackageJsonPath, \"utf-8\")).version : undefined;\n const clientVersion = process.env.PACKAGE_CLIENT_VERSION ?? ourPackageJsonVersion;\n if (clientVersion === undefined) {\n throw new Error(\"Could not determine current @osdk/client version\");\n }\n const templateContext = {\n project,\n foundryUrl,\n widgetSetRid,\n osdkPackage,\n clientVersion: changeVersionPrefix(clientVersion, \"^\")\n };\n const processFiles = function (dir) {\n fs.readdirSync(dir).forEach(function (file) {\n file = dir + \"/\" + file;\n const stat = fs.statSync(file);\n if (stat.isDirectory()) {\n processFiles(file);\n return;\n }\n if (file.endsWith(\"/_gitignore\")) {\n fs.renameSync(file, file.replace(/\\/_gitignore$/, \"/.gitignore\"));\n return;\n }\n if (!file.endsWith(\".hbs\")) {\n return;\n }\n const templated = Handlebars.compile(fs.readFileSync(file, \"utf-8\"))(templateContext);\n fs.writeFileSync(file.replace(/.hbs$/, \"\"), templated);\n fs.rmSync(file);\n });\n };\n processFiles(root);\n const npmRc = generateNpmRc({\n osdkPackage,\n osdkRegistryUrl\n });\n fs.writeFileSync(path.join(root, \".npmrc\"), npmRc);\n const foundryConfigJson = generateFoundryConfigJson({\n foundryUrl,\n widgetSetRid,\n directory: template.buildDirectory\n });\n fs.writeFileSync(path.join(root, \"foundry.config.json\"), foundryConfigJson);\n consola.success(\"Success\");\n const cdRelative = path.relative(cwd, root);\n consola.box({\n message: `Done! Run the following commands to get started:\\n` + `\\n` + ` \\`cd ${cdRelative}\\`\\n` + ` \\`export FOUNDRY_TOKEN=<token>\\`\\n` + ` \\`npm install\\`\\n` + ` \\`npm run dev\\``,\n style: {\n padding: 2,\n borderColor: \"green\",\n borderStyle: \"rounded\"\n }\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { promptFoundryUrl } from \"./prompts/promptFoundryUrl.js\";\nimport { promptOsdkPackage } from \"./prompts/promptOsdkPackage.js\";\nimport { promptOsdkRegistryUrl } from \"./prompts/promptOsdkRegistryUrl.js\";\nimport { promptOverwrite } from \"./prompts/promptOverwrite.js\";\nimport { promptProject } from \"./prompts/promptProject.js\";\nimport { promptSdkVersion } from \"./prompts/promptSdkVersion.js\";\nimport { promptTemplate } from \"./prompts/promptTemplate.js\";\nimport { promptWidgetSetRid } from \"./prompts/promptWidgetSetRid.js\";\nimport { run } from \"./run.js\";\nexport async function cli(args = process.argv) {\n const base = yargs(hideBin(args)).version(process.env.PACKAGE_VERSION ?? \"\").wrap(Math.min(150, yargs().terminalWidth())).strict().help().command(\"$0 [project] [--<option>]\", \"Create a new OSDK widget set based on framework templates. Information may be provided through options to skip interactive prompts.\", yargs => yargs.positional(\"project\", {\n type: \"string\",\n describe: \"Project name to create\"\n }).option(\"overwrite\", {\n type: \"boolean\",\n describe: \"Overwrite project directory if already exists\"\n }).option(\"beta\", {\n type: \"boolean\",\n describe: \"Use templates compatible with the Beta version of the SDK\"\n }).option(\"template\", {\n type: \"string\",\n describe: \"Template name to use\"\n }).option(\"sdkVersion\", {\n type: \"string\",\n describe: \"The OSDK version to use\"\n }).option(\"foundryUrl\", {\n type: \"string\",\n describe: \"URL for the Foundry stack\"\n }).option(\"widgetSetRid\", {\n type: \"string\",\n describe: \"Widget set resource identifier (rid)\"\n }).option(\"osdkPackage\", {\n type: \"string\",\n describe: \"OSDK package name for application\"\n }).option(\"osdkRegistryUrl\", {\n type: \"string\",\n describe: \"URL for NPM registry to install OSDK package\"\n }));\n const parsed = base.parseSync();\n const project = await promptProject(parsed);\n const overwrite = await promptOverwrite({\n ...parsed,\n project\n });\n const template = await promptTemplate(parsed);\n const sdkVersion = await promptSdkVersion({\n ...parsed,\n template\n });\n const foundryUrl = await promptFoundryUrl(parsed);\n const osdkPackage = await promptOsdkPackage(parsed);\n const osdkRegistryUrl = await promptOsdkRegistryUrl(parsed);\n const widgetSetRid = await promptWidgetSetRid(parsed);\n await run({\n project,\n overwrite,\n template,\n sdkVersion,\n foundryUrl,\n widgetSetRid,\n osdkPackage,\n osdkRegistryUrl\n });\n}"]}
1
+ {"version":3,"sources":["../../src/consola.ts","../../src/highlight.ts","../../src/prompts/promptFoundryUrl.ts","../../src/prompts/promptOsdkPackage.ts","../../src/prompts/promptOsdkRegistryUrl.ts","../../src/prompts/promptOverwrite.ts","../../src/prompts/promptProject.ts","../../src/prompts/promptSdkVersion.ts","../../src/getPackageFiles.ts","../../src/generatedNoCheck/templates.ts","../../src/prompts/promptTemplate.ts","../../src/prompts/promptWidgetSetRid.ts","../../src/generate/generateFoundryConfigJson.ts","../../src/generate/generateNpmRc.ts","../../src/run.ts","../../src/cli.ts"],"names":["defaultConsola","fs","path","sdkVersion","template","yargs"],"mappings":";;;;;;;;;AAiBO,IAAM,UAAU,aAAc,CAAA;AAAA;AAAA,EAEnC,MAAM,UAAU,MAAQ,EAAA;AACtB,IAAA,MAAM,QAAW,GAAA,MAAMA,SAAe,CAAA,MAAA,CAAO,GAAG,MAAM,CAAA;AACtD,IAAA,IAAI,OAAO,QAAa,KAAA,QAAA,IAAY,QAAS,CAAA,QAAA,OAAe,sBAAwB,EAAA;AAClF,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gB,CAAA;AAAA,IACtC,GAAG,MAAA;AAAA,IACH;AAAA,GACD,CAAA;AACD,EAAM,MAAA,QAAA,GAAW,MAAM,cAAA,CAAe,MAAM,CAAA;AAC5C,EAAM,MAAA,UAAA,GAAa,MAAM,gBAAiB,CAAA;AAAA,IACxC,GAAG,MAAA;AAAA,IACH;AAAA,GACD,CAAA;AACD,EAAM,MAAA,UAAA,GAAa,MAAM,gBAAA,CAAiB,MAAM,CAAA;AAChD,EAAA,MAAM,cAAc,QAAS,CAAA,YAAA,GAAe,MAAM,iBAAA,CAAkB,MAAM,CAAI,GAAA,SAAA;AAC9E,EAAA,MAAM,kBAAkB,QAAS,CAAA,YAAA,GAAe,MAAM,qBAAA,CAAsB,MAAM,CAAI,GAAA,SAAA;AACtF,EAAM,MAAA,SAAA,GAAY,MAAM,kBAAA,CAAmB,MAAM,CAAA;AACjD,EAAA,MAAM,GAAI,CAAA;AAAA,IACR,OAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACD,CAAA;AACH","file":"index.js","sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola as defaultConsola, createConsola } from \"consola\";\nexport const consola = createConsola({\n // https://github.com/unjs/consola/issues/251\n async prompt(...params) {\n const response = await defaultConsola.prompt(...params);\n if (typeof response === \"symbol\" && response.toString() === \"Symbol(clack:cancel)\") {\n defaultConsola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n return response;\n }\n});","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { colorize } from \"consola/utils\";\nexport function green(text) {\n return colorize(\"green\", text);\n}\nexport function italic(text) {\n return colorize(\"italic\", text);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptFoundryUrl({\n foundryUrl\n}) {\n while (foundryUrl == null || !foundryUrl.startsWith(\"https://\")) {\n if (foundryUrl != null) {\n consola.fail(\"Please enter a valid Foundry URL\");\n }\n foundryUrl = await consola.prompt(`Enter the URL for your Foundry stack:\\n${italic(\"(Example: https://example.palantirfoundry.com)\")}`, {\n type: \"text\"\n });\n }\n return foundryUrl.replace(/\\/$/, \"\");\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptOsdkPackage({\n osdkPackage\n}) {\n while (osdkPackage == null || !/^@[a-z0-9-]+\\/sdk$/.test(osdkPackage)) {\n if (osdkPackage != null) {\n consola.fail(\"Please enter a valid OSDK package name\");\n }\n osdkPackage = await consola.prompt(`Enter the OSDK package name for your widget set:\\n${italic(\"(Example: @my-widget/sdk)\")}`, {\n type: \"text\"\n });\n }\n return osdkPackage;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptOsdkRegistryUrl({\n osdkRegistryUrl\n}) {\n while (osdkRegistryUrl == null || !/^https:\\/\\/[^/]+\\/artifacts\\/api\\/repositories\\/ri\\.[^/]+\\/contents\\/release\\/npm\\/?$/.test(osdkRegistryUrl)) {\n if (osdkRegistryUrl != null) {\n consola.fail(\"Please enter a valid NPM registry URL to install your OSDK package\");\n }\n osdkRegistryUrl = await consola.prompt(`Enter the NPM registry URL to install your OSDK package:\\n${italic(\"(Example: https://example.palantirfoundry.com/artifacts/api/repositories/ri.artifacts.main.repository.a4a7fe1c-486f-4226-b706-7b90005f527d/contents/release/npm)\")}`, {\n type: \"text\"\n });\n }\n return osdkRegistryUrl.replace(/\\/$/, \"\");\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { consola } from \"../consola.js\";\nimport { green } from \"../highlight.js\";\nexport async function promptOverwrite({\n project,\n overwrite\n}) {\n if (overwrite != null) {\n return overwrite;\n }\n if (!fs.existsSync(path.join(process.cwd(), project))) {\n return true;\n }\n const result = await consola.prompt(`The directory ${green(project)} already exists do you want to overwrite or ignore it?`, {\n type: \"select\",\n options: [{\n label: \"Remove existing files and continue\",\n value: \"overwrite\"\n }, {\n label: \"Ignore files and continue\",\n value: \"ignore\"\n }, {\n label: \"Cancel\",\n value: \"cancel\"\n }]\n }\n // Types for \"select\" are wrong the value is returned rather than the option object\n // https://github.com/unjs/consola/pull/238\n );\n switch (result) {\n case \"overwrite\":\n return true;\n case \"ignore\":\n return false;\n case \"cancel\":\n consola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nexport async function promptProject({\n project\n}) {\n while (project == null || !/^[a-zA-Z0-9-_]+$/.test(project)) {\n if (project != null) {\n consola.fail(\"Project name can only contain alphanumeric characters, hyphens and underscores\");\n }\n project = await consola.prompt(\"Project name:\", {\n type: \"text\",\n placeholder: \"my-osdk-widget\",\n default: \"my-osdk-widget\"\n });\n }\n return project;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nexport async function promptSdkVersion({\n sdkVersion,\n template\n}) {\n if (sdkVersion == null) {\n // If the SDK version is not provided, default to the earliest template version for backwards-compatibility\n return Object.keys(template.files)[0];\n }\n if (template.files[sdkVersion] == null) {\n consola.fail(`The ${template.label} template does not support a \"${sdkVersion}\" SDK version.`);\n sdkVersion = await consola.prompt(`Please choose which version of the OSDK you'd like to use for the ${template.label} template:`, {\n type: \"select\",\n options: Object.keys(template.files).reverse().map(sdkVersion => ({\n label: sdkVersion,\n value: sdkVersion\n }))\n }\n // Types for \"select\" are wrong the value is returned rather than the option object\n // https://github.com/unjs/consola/pull/238\n );\n }\n return sdkVersion;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const getPackageFiles = importPromise => async () => (await importPromise).files;","// THIS FILE IS GENERATED. DO NOT MODIFY.\n// You probably want to modify ../../../codegen.mjs instead.\n\nimport { getPackageFiles } from \"../getPackageFiles.js\";\nexport const TEMPLATES = [\n// OSDK React\n{\n id: \"template-widget-react\",\n label: \"OSDK React\",\n envPrefix: \"VITE_\",\n buildDirectory: \"./dist\",\n requiresOsdk: true,\n files: {\n \"2.x\": getPackageFiles(import(\"@osdk/create-widget.template.react.v2\"))\n }\n},\n// Minimal React\n{\n id: \"template-widget-minimal-react\",\n label: \"Minimal React\",\n envPrefix: \"VITE_\",\n buildDirectory: \"./dist\",\n requiresOsdk: false,\n files: {\n \"2.x\": getPackageFiles(import(\"@osdk/create-widget.template.minimal-react.v2\"))\n }\n}];","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { TEMPLATES } from \"../generatedNoCheck/templates.js\";\nimport { green } from \"../highlight.js\";\nexport async function promptTemplate(parsed) {\n let useBeta = parsed.beta ?? false;\n let template = TEMPLATES.find(t => t.id === parsed.template || t.id === `template-${parsed.template}`);\n if (template == null) {\n const availableTemplates = TEMPLATES.filter(template => !template.hidden && (useBeta ? template.isBeta === true\n // isBeta could be null\n : !template.isBeta));\n if (availableTemplates.length === 0) {\n throw new Error(\"No available templates found for the selected options.\");\n }\n const templateId = await consola.prompt(parsed.template != null ? `The provided template ${green(parsed.template)} is invalid please select a framework:` : \"Select a framework:\", {\n type: \"select\",\n options: availableTemplates.map(template => ({\n value: template.id,\n label: template.label\n }))\n // Types for \"select\" are wrong the value is returned rather than the option object\n // https://github.com/unjs/consola/pull/238\n });\n template = TEMPLATES.find(t => t.id === templateId);\n if (template == null) {\n throw new Error(`Template ${templateId} should be found`);\n }\n }\n return template;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptWidgetSetRid({\n widgetSet\n}) {\n while (widgetSet == null || !/^ri\\.widgetregistry\\.\\.widget-set\\.[^.]+$/.test(widgetSet)) {\n if (widgetSet != null) {\n consola.fail(\"Please enter a valid widget resource identifier (rid)\");\n }\n widgetSet = await consola.prompt(`Enter the resource identifier (rid) for your widget set:\\n${italic(\"(Example: ri.widgetregistry..widget-set.1c66b352-4e00-40d2-995d-061c9d533ace)\")}`, {\n type: \"text\"\n });\n }\n return widgetSet;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function generateFoundryConfigJson({\n foundryUrl,\n widgetSet,\n directory\n}) {\n return JSON.stringify({\n foundryUrl,\n widgetSet: {\n rid: widgetSet,\n directory,\n autoVersion: {\n type: \"package-json\"\n }\n }\n }, null, 2) + \"\\n\";\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function generateNpmRc({\n osdkPackage,\n osdkRegistryUrl\n}) {\n // pnpm requires a trailing slash in .npmrc\n // https://github.com/pnpm/pnpm/issues/5941\n const withTrailingSlash = osdkRegistryUrl.endsWith(\"/\") ? osdkRegistryUrl : osdkRegistryUrl + \"/\";\n const withoutProtocol = withTrailingSlash.replace(/^https:\\/\\//, \"\");\n const packageScope = osdkPackage.split(\"/\")[0];\n return `//${withoutProtocol}:_authToken=\\${FOUNDRY_TOKEN}\\n` + `${packageScope}:registry=${withTrailingSlash}\\n`;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Handlebars from \"handlebars\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { consola } from \"./consola.js\";\nimport { generateFoundryConfigJson } from \"./generate/generateFoundryConfigJson.js\";\nimport { generateNpmRc } from \"./generate/generateNpmRc.js\";\nimport { green } from \"./highlight.js\";\nexport async function run({\n project,\n overwrite,\n template,\n sdkVersion,\n foundryUrl,\n widgetSet,\n osdkPackage,\n osdkRegistryUrl\n}) {\n consola.log(\"\");\n consola.start(`Creating project ${green(project)} using template ${green(template.id)}`);\n const cwd = process.cwd();\n const root = path.join(cwd, project);\n if (fs.existsSync(root)) {\n if (overwrite) {\n consola.info(`Overwriting existing project directory`);\n fs.rmSync(root, {\n recursive: true,\n force: true\n });\n fs.mkdirSync(root, {\n recursive: true\n });\n } else {\n consola.info(`Reusing existing project directory`);\n }\n } else {\n consola.info(`Creating project directory`);\n fs.mkdirSync(root, {\n recursive: true\n });\n }\n consola.info(`Copying files into project directory`);\n if (template.files[sdkVersion] == null) {\n throw new Error(`The ${template.label} template does not support a \"${sdkVersion}\" SDK version.`);\n }\n const files = await template.files[sdkVersion]();\n for (const [filePath, contents] of files) {\n const finalPath = path.join(root, filePath);\n const dirPath = path.dirname(finalPath);\n await fs.promises.mkdir(dirPath, {\n recursive: true\n });\n await fs.promises.writeFile(finalPath, Buffer.from(contents.body, contents.type === \"raw\" ? \"utf-8\" : \"base64\"));\n }\n const templateContext = {\n project,\n osdkPackage\n };\n const processFiles = function (dir) {\n fs.readdirSync(dir).forEach(function (file) {\n file = dir + \"/\" + file;\n const stat = fs.statSync(file);\n if (stat.isDirectory()) {\n processFiles(file);\n return;\n }\n if (file.endsWith(\"/_gitignore\")) {\n fs.renameSync(file, file.replace(/\\/_gitignore$/, \"/.gitignore\"));\n return;\n }\n if (!file.endsWith(\".hbs\")) {\n return;\n }\n const templated = Handlebars.compile(fs.readFileSync(file, \"utf-8\"))(templateContext);\n fs.writeFileSync(file.replace(/.hbs$/, \"\"), templated);\n fs.rmSync(file);\n });\n };\n processFiles(root);\n if (template.requiresOsdk) {\n if (osdkPackage == null || osdkRegistryUrl == null) {\n throw new Error(`Template ${template.id} requires OSDK package and registry URL`);\n }\n const npmRc = generateNpmRc({\n osdkPackage,\n osdkRegistryUrl\n });\n fs.writeFileSync(path.join(root, \".npmrc\"), npmRc);\n }\n const foundryConfigJson = generateFoundryConfigJson({\n foundryUrl,\n widgetSet,\n directory: template.buildDirectory\n });\n fs.writeFileSync(path.join(root, \"foundry.config.json\"), foundryConfigJson);\n consola.success(\"Success\");\n const cdRelative = path.relative(cwd, root);\n consola.box({\n message: `Done! Run the following commands to get started:\\n` + `\\n` + ` \\`cd ${cdRelative}\\`\\n` + ` \\`export FOUNDRY_TOKEN=<token>\\`\\n` + ` \\`npm install\\`\\n` + ` \\`npm run dev\\``,\n style: {\n padding: 2,\n borderColor: \"green\",\n borderStyle: \"rounded\"\n }\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { promptFoundryUrl } from \"./prompts/promptFoundryUrl.js\";\nimport { promptOsdkPackage } from \"./prompts/promptOsdkPackage.js\";\nimport { promptOsdkRegistryUrl } from \"./prompts/promptOsdkRegistryUrl.js\";\nimport { promptOverwrite } from \"./prompts/promptOverwrite.js\";\nimport { promptProject } from \"./prompts/promptProject.js\";\nimport { promptSdkVersion } from \"./prompts/promptSdkVersion.js\";\nimport { promptTemplate } from \"./prompts/promptTemplate.js\";\nimport { promptWidgetSetRid } from \"./prompts/promptWidgetSetRid.js\";\nimport { run } from \"./run.js\";\nexport async function cli(args = process.argv) {\n const base = yargs(hideBin(args)).version(process.env.PACKAGE_VERSION ?? \"\").wrap(Math.min(150, yargs().terminalWidth())).strict().help().command(\"$0 [project] [--<option>]\", \"Create a new OSDK widget set based on framework templates. Information may be provided through options to skip interactive prompts.\", yargs => yargs.positional(\"project\", {\n type: \"string\",\n describe: \"Project name to create\"\n }).option(\"overwrite\", {\n type: \"boolean\",\n describe: \"Overwrite project directory if already exists\"\n }).option(\"beta\", {\n type: \"boolean\",\n describe: \"Use templates compatible with the Beta version of the SDK\"\n }).option(\"template\", {\n type: \"string\",\n describe: \"Template name to use\"\n }).option(\"sdkVersion\", {\n type: \"string\",\n describe: \"The OSDK version to use\"\n }).option(\"foundryUrl\", {\n type: \"string\",\n describe: \"URL for the Foundry stack\"\n }).option(\"widgetSet\", {\n type: \"string\",\n describe: \"Widget set resource identifier (rid)\"\n }).option(\"osdkPackage\", {\n type: \"string\",\n describe: \"OSDK package name for application\"\n }).option(\"osdkRegistryUrl\", {\n type: \"string\",\n describe: \"URL for NPM registry to install OSDK package\"\n }));\n const parsed = base.parseSync();\n const project = await promptProject(parsed);\n const overwrite = await promptOverwrite({\n ...parsed,\n project\n });\n const template = await promptTemplate(parsed);\n const sdkVersion = await promptSdkVersion({\n ...parsed,\n template\n });\n const foundryUrl = await promptFoundryUrl(parsed);\n const osdkPackage = template.requiresOsdk ? await promptOsdkPackage(parsed) : undefined;\n const osdkRegistryUrl = template.requiresOsdk ? await promptOsdkRegistryUrl(parsed) : undefined;\n const widgetSet = await promptWidgetSetRid(parsed);\n await run({\n project,\n overwrite,\n template,\n sdkVersion,\n foundryUrl,\n widgetSet,\n osdkPackage,\n osdkRegistryUrl\n });\n}"]}
@@ -1,2 +1 @@
1
1
  export declare function cli(args?: string[]): Promise<void>;
2
- //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"mappings":"AA2CA,OAAO,iBAAe,IAAIA,kBAAgC","names":["args: string[]"],"sources":["../../src/cli.ts"],"version":3,"file":"cli.d.ts"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"mappings":"","names":[],"sources":["../../src/cli.test.ts"],"version":3,"file":"cli.test.d.ts"}
@@ -1,3 +1,2 @@
1
1
  import type { ConsolaInstance } from "consola";
2
2
  export declare const consola: ConsolaInstance;
3
- //# sourceMappingURL=consola.d.ts.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,cAAc,uBAAuB,SAAU;AAG/C,OAAO,cAAMA,SAAS","names":["consola: ConsolaInstance"],"sources":["../../src/consola.ts"],"version":3,"file":"consola.d.ts"}
@@ -0,0 +1,5 @@
1
+ export declare function generateFoundryConfigJson({ foundryUrl, widgetSet, directory }: {
2
+ foundryUrl: string
3
+ widgetSet: string
4
+ directory: string
5
+ }): string;
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,OAAO,iBAAS,0BAA0B,EACxC,YACA,WACA,WAKD,EAJE;CACD;CACA;CACA;AACD","names":[],"sources":["../../../src/generate/generateFoundryConfigJson.ts"],"version":3,"file":"generateFoundryConfigJson.d.ts"}
@@ -0,0 +1 @@
1
+ {"mappings":"","names":[],"sources":["../../../src/generate/generateFoundryConfigJson.test.ts"],"version":3,"file":"generateFoundryConfigJson.test.d.ts"}
@@ -0,0 +1,4 @@
1
+ export declare function generateNpmRc({ osdkPackage, osdkRegistryUrl }: {
2
+ osdkPackage: string
3
+ osdkRegistryUrl: string
4
+ }): string;
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,OAAO,iBAAS,cAAc,EAC5B,aACA,iBAID,EAHE;CACD;CACA;AACD","names":[],"sources":["../../../src/generate/generateNpmRc.ts"],"version":3,"file":"generateNpmRc.d.ts"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"mappings":"","names":[],"sources":["../../../src/generate/generateNpmRc.test.ts"],"version":3,"file":"generateNpmRc.test.d.ts"}
@@ -1,3 +1,2 @@
1
1
  import type { Template } from "../templates.js";
2
2
  export declare const TEMPLATES: readonly Template[];
3
- //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAEA,cAAc,gBAAgB,iBAAkB;AAGhD,OAAO,cAAMA,oBAAoB","names":["TEMPLATES: readonly Template[]"],"sources":["../../../src/generatedNoCheck/templates.ts"],"version":3,"file":"templates.d.ts"}
@@ -1,5 +1,4 @@
1
1
  import type { ModuleImportFiles } from "./templates.js";
2
2
  export declare const getPackageFiles: (importPromise: Promise<{
3
- files: ModuleImportFiles;
3
+ files: ModuleImportFiles
4
4
  }>) => () => Promise<ModuleImportFiles>;
5
- //# sourceMappingURL=getPackageFiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,cAAc,yBAAyB,gBAAiB;AAExD,OAAO,cAAM,kBACXA,eAAe,QAAQ;CAAE,OAAO;AAAmB,aAC5C,QAAQ","names":["importPromise: Promise<{ files: ModuleImportFiles }>"],"sources":["../../src/getPackageFiles.ts"],"version":3,"file":"getPackageFiles.d.ts"}
@@ -1,3 +1,2 @@
1
1
  export declare function green(text: string): string;
2
2
  export declare function italic(text: string): string;
3
- //# sourceMappingURL=highlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAkBA,OAAO,iBAAS,MAAMA;AAItB,OAAO,iBAAS,OAAOA","names":["text: string"],"sources":["../../src/highlight.ts"],"version":3,"file":"highlight.d.ts"}
@@ -1,5 +1,4 @@
1
1
  export { cli } from "./cli.js";
2
2
  export { TEMPLATES } from "./generatedNoCheck/templates.js";
3
3
  export { run } from "./run.js";
4
- export type { Template } from "./templates.js";
5
- //# sourceMappingURL=index.d.ts.map
4
+ export type { Template } from "./templates.js";
@@ -0,0 +1 @@
1
+ {"mappings":"AAgBA,SAAS,WAAW;AACpB,SAAS,iBAAiB;AAC1B,SAAS,WAAW;AACpB,eAAc,gBAAgB","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
@@ -0,0 +1,3 @@
1
+ export declare function promptFoundryUrl({ foundryUrl }: {
2
+ foundryUrl?: string
3
+ }): Promise<string>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAmBA,OAAO,iBAAe,iBAAiB,EACrC,YAGD,EAFE;CACD;AACD,IAAG","names":[],"sources":["../../../src/prompts/promptFoundryUrl.ts"],"version":3,"file":"promptFoundryUrl.d.ts"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"mappings":"","names":[],"sources":["../../../src/prompts/promptFoundryUrl.test.ts"],"version":3,"file":"promptFoundryUrl.test.d.ts"}
@@ -0,0 +1,3 @@
1
+ export declare function promptOsdkPackage({ osdkPackage }: {
2
+ osdkPackage?: string
3
+ }): Promise<string>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAmBA,OAAO,iBAAe,kBAAkB,EACtC,aAGD,EAFE;CACD;AACD,IAAG","names":[],"sources":["../../../src/prompts/promptOsdkPackage.ts"],"version":3,"file":"promptOsdkPackage.d.ts"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"mappings":"","names":[],"sources":["../../../src/prompts/promptOsdkPackage.test.ts"],"version":3,"file":"promptOsdkPackage.test.d.ts"}
@@ -0,0 +1,3 @@
1
+ export declare function promptOsdkRegistryUrl({ osdkRegistryUrl }: {
2
+ osdkRegistryUrl?: string
3
+ }): Promise<string>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAmBA,OAAO,iBAAe,sBAAsB,EAC1C,iBAGD,EAFE;CACD;AACD,IAAG","names":[],"sources":["../../../src/prompts/promptOsdkRegistryUrl.ts"],"version":3,"file":"promptOsdkRegistryUrl.d.ts"}
@@ -0,0 +1 @@
1
+ {"mappings":"","names":[],"sources":["../../../src/prompts/promptOsdkRegistryUrl.test.ts"],"version":3,"file":"promptOsdkRegistryUrl.test.d.ts"}
@@ -0,0 +1,4 @@
1
+ export declare function promptOverwrite({ project, overwrite }: {
2
+ project: string
3
+ overwrite?: boolean
4
+ }): Promise<boolean>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAqBA,OAAO,iBAAe,gBAAgB,EACpC,SACA,WAID,EAHE;CACD;CACA;AACD,IAAG","names":[],"sources":["../../../src/prompts/promptOverwrite.ts"],"version":3,"file":"promptOverwrite.d.ts"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"mappings":"","names":[],"sources":["../../../src/prompts/promptOverwrite.test.ts"],"version":3,"file":"promptOverwrite.test.d.ts"}
@@ -0,0 +1,3 @@
1
+ export declare function promptProject({ project }: {
2
+ project?: string
3
+ }): Promise<string>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAkBA,OAAO,iBAAe,cAAc,EAClC,SAGD,EAFE;CACD;AACD,IAAG","names":[],"sources":["../../../src/prompts/promptProject.ts"],"version":3,"file":"promptProject.d.ts"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"mappings":"","names":[],"sources":["../../../src/prompts/promptProject.test.ts"],"version":3,"file":"promptProject.test.d.ts"}
@@ -0,0 +1,5 @@
1
+ import type { SdkVersion, Template } from "../templates.js";
2
+ export declare function promptSdkVersion({ sdkVersion, template }: {
3
+ sdkVersion?: string
4
+ template: Template
5
+ }): Promise<SdkVersion>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAiBA,cAAc,YAAY,gBAAgB,iBAAkB;AAE5D,OAAO,iBAAe,iBAAiB,EACrC,YACA,UAID,EAHE;CACD;CACA,UAAU;AACX,IAAG,QAAQ","names":[],"sources":["../../../src/prompts/promptSdkVersion.ts"],"version":3,"file":"promptSdkVersion.d.ts"}
@@ -1,6 +1,5 @@
1
1
  import type { Template } from "../templates.js";
2
2
  export declare function promptTemplate(parsed: {
3
- template?: string;
4
- beta?: boolean;
3
+ template?: string
4
+ beta?: boolean
5
5
  }): Promise<Template>;
6
- //# sourceMappingURL=promptTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAmBA,cAAc,gBAAgB,iBAAkB;AAEhD,OAAO,iBAAe,eAAeA,QAAQ;CAC3C;CACA;AACD,IAAG,QAAQ","names":["parsed: {\n template?: string;\n beta?: boolean;\n}"],"sources":["../../../src/prompts/promptTemplate.ts"],"version":3,"file":"promptTemplate.d.ts"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"mappings":"","names":[],"sources":["../../../src/prompts/promptTemplate.test.ts"],"version":3,"file":"promptTemplate.test.d.ts"}
@@ -0,0 +1,3 @@
1
+ export declare function promptWidgetSetRid({ widgetSet }: {
2
+ widgetSet?: string
3
+ }): Promise<string>;
@@ -0,0 +1 @@
1
+ {"mappings":"AAmBA,OAAO,iBAAe,mBACpB,EAAE,WAAmC,EAAtB;CAAE;AAAoB,IACpC","names":[],"sources":["../../../src/prompts/promptWidgetSetRid.ts"],"version":3,"file":"promptWidgetSetRid.d.ts"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"mappings":"","names":[],"sources":["../../../src/prompts/promptWidgetSetRid.test.ts"],"version":3,"file":"promptWidgetSetRid.test.d.ts"}