@settlemint/sdk-cli 1.1.14-preff51751 → 1.1.15-pr3e70f2f9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -249,7 +249,7 @@ settlemint scs subgraph deploy --accept-defaults <subgraph-name>
249
249
 
250
250
  ## API Reference
251
251
 
252
- See the [documentation](https://github.com/settlemint/sdk/tree/v1.1.14/sdk/cli/docs/settlemint.md) for available commands.
252
+ See the [documentation](https://github.com/settlemint/sdk/tree/v1.1.15/sdk/cli/docs/settlemint.md) for available commands.
253
253
 
254
254
  ## Contributing
255
255
 
package/dist/cli.js CHANGED
@@ -259683,7 +259683,7 @@ function pruneCurrentEnv(currentEnv, env2) {
259683
259683
  var package_default = {
259684
259684
  name: "@settlemint/sdk-cli",
259685
259685
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
259686
- version: "1.1.14-preff51751",
259686
+ version: "1.1.15-pr3e70f2f9",
259687
259687
  type: "module",
259688
259688
  private: false,
259689
259689
  license: "FSL-1.1-MIT",
@@ -259731,8 +259731,8 @@ var package_default = {
259731
259731
  "@inquirer/input": "4.1.6",
259732
259732
  "@inquirer/password": "4.0.9",
259733
259733
  "@inquirer/select": "4.0.9",
259734
- "@settlemint/sdk-js": "1.1.14-preff51751",
259735
- "@settlemint/sdk-utils": "1.1.14-preff51751",
259734
+ "@settlemint/sdk-js": "1.1.15-pr3e70f2f9",
259735
+ "@settlemint/sdk-utils": "1.1.15-pr3e70f2f9",
259736
259736
  "@types/node": "22.13.9",
259737
259737
  "@types/semver": "7.5.8",
259738
259738
  "@types/which": "3.0.4",
@@ -262965,6 +262965,7 @@ var getPlatformConfigQuery = graphql(`
262965
262965
  kits {
262966
262966
  id
262967
262967
  name
262968
+ description
262968
262969
  npmPackageName
262969
262970
  }
262970
262971
  }
@@ -266553,22 +266554,22 @@ async function templatePrompt(platformConfig, argument) {
266553
266554
  }
266554
266555
  const defaultInstance = argument;
266555
266556
  if (defaultInstance) {
266556
- const template = kits.find((kit) => kit.id === argument);
266557
- if (!template) {
266557
+ const template2 = kits.find((kit) => kit.id === argument);
266558
+ if (!template2) {
266558
266559
  cancel2(`No template found with name '${argument}'`);
266559
266560
  }
266560
- return template;
266561
+ return template2;
266561
266562
  }
266562
- const selectedValue = await esm_default2({
266563
+ const template = await esm_default2({
266563
266564
  message: "Which template do you want to use?",
266564
266565
  choices: [
266565
- ...kits.map((template) => ({
266566
- name: template.name,
266567
- value: template
266566
+ ...kits.map((template2) => ({
266567
+ name: template2.name,
266568
+ value: template2
266568
266569
  })).sort((a7, b4) => a7.name.localeCompare(b4.name))
266569
266570
  ]
266570
266571
  });
266571
- return selectedValue;
266572
+ return template;
266572
266573
  }
266573
266574
 
266574
266575
  // src/utils/download-extract.ts
@@ -269767,7 +269768,11 @@ async function downloadTemplate(input, options = {}) {
269767
269768
  var import_proxy2 = __toESM(require_proxy(), 1);
269768
269769
 
269769
269770
  // src/utils/download-extract.ts
269770
- async function downloadAndExtractNpmPackage(template, targetDir) {
269771
+ async function downloadAndExtractNpmPackage({
269772
+ template,
269773
+ version,
269774
+ targetDir
269775
+ }) {
269771
269776
  await mkdir5(targetDir, { recursive: true });
269772
269777
  const response = await fetch(`https://registry.npmjs.org/${template}`);
269773
269778
  if (!response.ok) {
@@ -269775,7 +269780,7 @@ async function downloadAndExtractNpmPackage(template, targetDir) {
269775
269780
  }
269776
269781
  const data = await response.json();
269777
269782
  const latestVersion = data["dist-tags"].latest;
269778
- const tarball = data.versions[latestVersion].dist.tarball;
269783
+ const tarball = data.versions[version ?? latestVersion].dist.tarball;
269779
269784
  await downloadTemplate(tarball, {
269780
269785
  dir: targetDir,
269781
269786
  force: true
@@ -269784,9 +269789,12 @@ async function downloadAndExtractNpmPackage(template, targetDir) {
269784
269789
 
269785
269790
  // src/commands/create.ts
269786
269791
  function createCommand2() {
269787
- return new Command("create").description("Bootstrap your SettleMint project").option("-n, --project-name <name>", "The name for your SettleMint project").option("-t, --template <template>", "The template for your SettleMint project (run `settlemint platform config` to see available templates)").option("-i, --instance <instance>", "The instance to connect to").action(async ({ projectName, template, instance }) => {
269792
+ return new Command("create").description("Bootstrap your SettleMint project").option("-n, --project-name <name>", "The name for your SettleMint project").option("-t, --template <template>", "The template for your SettleMint project (run `settlemint platform config` to see available templates)").option("-v, --version <version>", "Specify the template version to use (defaults to latest stable version)").option("-i, --instance <instance>", "The instance to connect to").action(async ({ projectName, template, version, instance }) => {
269788
269793
  intro("Creating a new SettleMint project");
269789
269794
  const env2 = await loadEnv(false, false);
269795
+ if (version && !template) {
269796
+ cancel2("The --version option requires the --template option to be set");
269797
+ }
269790
269798
  const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
269791
269799
  const settlemint = createSettleMintClient({
269792
269800
  instance: selectedInstance,
@@ -269817,7 +269825,11 @@ function createCommand2() {
269817
269825
  await spinner({
269818
269826
  startMessage: "Scaffolding the project",
269819
269827
  task: async () => {
269820
- await downloadAndExtractNpmPackage(selectedTemplate.npmPackageName, projectDir);
269828
+ await downloadAndExtractNpmPackage({
269829
+ template: selectedTemplate.npmPackageName,
269830
+ version,
269831
+ targetDir: projectDir
269832
+ });
269821
269833
  await setName(name3, projectDir);
269822
269834
  },
269823
269835
  stopMessage: "Project fully scaffolded"
@@ -271833,7 +271845,9 @@ function configCommand() {
271833
271845
  })).sort((a8, b4) => a8.name.localeCompare(b4.name)),
271834
271846
  kits: kits.map((kit) => ({
271835
271847
  id: kit.id,
271836
- name: kit.name
271848
+ name: kit.name,
271849
+ description: kit.description,
271850
+ npmPackage: kit.npmPackageName
271837
271851
  })).sort((a8, b4) => a8.name.localeCompare(b4.name)),
271838
271852
  deploymentEngineTargets: platformConfig.deploymentEngineTargets.filter((provider) => !provider.disabled).flatMap((provider) => provider.clusters.filter((cluster) => !cluster.disabled).map((region) => ({
271839
271853
  providerId: provider.id,
@@ -273387,4 +273401,4 @@ async function sdkCliCommand(argv = process.argv) {
273387
273401
  // src/cli.ts
273388
273402
  sdkCliCommand();
273389
273403
 
273390
- //# debugId=B5325EE65B66B31264756E2164756E21
273404
+ //# debugId=DF68DCA98A86439564756E2164756E21