@settlemint/sdk-cli 1.1.15-pr9a3d08da → 1.1.15-prfbd7e3e2

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
@@ -35,7 +35,7 @@
35
35
  - [Get the version of the CLI](#get-the-version-of-the-cli)
36
36
  - [Get help for a command](#get-help-for-a-command)
37
37
  - [Login to the platform](#login-to-the-platform)
38
- - [Creating a new project from a starter kit template](#creating-a-new-project-from-a-starter-kit-template)
38
+ - [Creating a new project from a template](#creating-a-new-project-from-a-template)
39
39
  - [Installing dependencies](#installing-dependencies)
40
40
  - [Connecting to your SettleMint infrastructure](#connecting-to-your-settlemint-infrastructure)
41
41
  - [Deploying your smart contracts and subgraphs](#deploying-your-smart-contracts-and-subgraphs)
@@ -139,9 +139,9 @@ Then run the login command and paste your token when prompted:
139
139
  settlemint login
140
140
  ```
141
141
 
142
- ### Creating a new project from a starter kit template
142
+ ### Creating a new project from a template
143
143
 
144
- To create a new project from a starter kit template, use the `create` command with the `--template` flag:
144
+ To create a new project from a template, use the `create` command with the `--template` flag:
145
145
 
146
146
  ```bash
147
147
  settlemint create --project-name <project-name> --template <template-name>
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.15-pr9a3d08da",
259686
+ version: "1.1.15-prfbd7e3e2",
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.15-pr9a3d08da",
259735
- "@settlemint/sdk-utils": "1.1.15-pr9a3d08da",
259734
+ "@settlemint/sdk-js": "1.1.15-prfbd7e3e2",
259735
+ "@settlemint/sdk-utils": "1.1.15-prfbd7e3e2",
259736
259736
  "@types/node": "22.13.9",
259737
259737
  "@types/semver": "7.5.8",
259738
259738
  "@types/which": "3.0.4",
@@ -266607,27 +266607,6 @@ function connectCommand() {
266607
266607
  import { mkdir as mkdir6 } from "node:fs/promises";
266608
266608
  import { join as join9 } from "node:path";
266609
266609
 
266610
- // src/prompts/project-name.prompt.ts
266611
- async function projectNamePrompt(env2, argument) {
266612
- const defaultInstance = env2.SETTLEMINT_NEW_PROJECT_NAME ?? argument;
266613
- if (defaultInstance) {
266614
- return defaultInstance;
266615
- }
266616
- return esm_default2({
266617
- message: "What is the name of your new SettleMint project?",
266618
- default: defaultInstance,
266619
- required: true,
266620
- validate(value4) {
266621
- try {
266622
- validate2(z.string(), value4);
266623
- return true;
266624
- } catch (error5) {
266625
- return "Invalid projectname";
266626
- }
266627
- }
266628
- });
266629
- }
266630
-
266631
266610
  // src/utils/platform-utils.ts
266632
266611
  function getUseCases(platformConfig) {
266633
266612
  return platformConfig.smartContractSets.sets.filter((useCase) => !useCase.featureflagged);
@@ -266636,7 +266615,7 @@ function getKits(platformConfig) {
266636
266615
  return platformConfig.kits ?? [];
266637
266616
  }
266638
266617
 
266639
- // src/prompts/starter-kit/template.prompt.ts
266618
+ // src/prompts/kit/template.prompt.ts
266640
266619
  async function templatePrompt(platformConfig, argument) {
266641
266620
  const kits = getKits(platformConfig);
266642
266621
  if (kits.length === 0) {
@@ -266662,6 +266641,27 @@ async function templatePrompt(platformConfig, argument) {
266662
266641
  return template;
266663
266642
  }
266664
266643
 
266644
+ // src/prompts/project-name.prompt.ts
266645
+ async function projectNamePrompt(env2, argument) {
266646
+ const defaultInstance = env2.SETTLEMINT_NEW_PROJECT_NAME ?? argument;
266647
+ if (defaultInstance) {
266648
+ return defaultInstance;
266649
+ }
266650
+ return esm_default2({
266651
+ message: "What is the name of your new SettleMint project?",
266652
+ default: defaultInstance,
266653
+ required: true,
266654
+ validate(value4) {
266655
+ try {
266656
+ validate2(z.string(), value4);
266657
+ return true;
266658
+ } catch (error5) {
266659
+ return "Invalid projectname";
266660
+ }
266661
+ }
266662
+ });
266663
+ }
266664
+
266665
266665
  // src/utils/download-extract.ts
266666
266666
  import { mkdir as mkdir5 } from "node:fs/promises";
266667
266667
 
@@ -269858,7 +269858,11 @@ async function downloadTemplate(input, options = {}) {
269858
269858
  var import_proxy2 = __toESM(require_proxy(), 1);
269859
269859
 
269860
269860
  // src/utils/download-extract.ts
269861
- async function downloadAndExtractNpmPackage(template, targetDir) {
269861
+ async function downloadAndExtractNpmPackage({
269862
+ template,
269863
+ version,
269864
+ targetDir
269865
+ }) {
269862
269866
  await mkdir5(targetDir, { recursive: true });
269863
269867
  const response = await fetch(`https://registry.npmjs.org/${template}`);
269864
269868
  if (!response.ok) {
@@ -269866,7 +269870,7 @@ async function downloadAndExtractNpmPackage(template, targetDir) {
269866
269870
  }
269867
269871
  const data = await response.json();
269868
269872
  const latestVersion = data["dist-tags"].latest;
269869
- const tarball = data.versions[latestVersion].dist.tarball;
269873
+ const tarball = data.versions[version ?? latestVersion].dist.tarball;
269870
269874
  await downloadTemplate(tarball, {
269871
269875
  dir: targetDir,
269872
269876
  force: true
@@ -269875,9 +269879,12 @@ async function downloadAndExtractNpmPackage(template, targetDir) {
269875
269879
 
269876
269880
  // src/commands/create.ts
269877
269881
  function createCommand2() {
269878
- 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 }) => {
269882
+ 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 }) => {
269879
269883
  intro("Creating a new SettleMint project");
269880
269884
  const env2 = await loadEnv(false, false);
269885
+ if (version && !template) {
269886
+ cancel2("The --version option requires the --template option to be set");
269887
+ }
269881
269888
  const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
269882
269889
  const settlemint = createSettleMintClient({
269883
269890
  instance: selectedInstance,
@@ -269908,7 +269915,11 @@ function createCommand2() {
269908
269915
  await spinner({
269909
269916
  startMessage: "Scaffolding the project",
269910
269917
  task: async () => {
269911
- await downloadAndExtractNpmPackage(selectedTemplate.npmPackageName, projectDir);
269918
+ await downloadAndExtractNpmPackage({
269919
+ template: selectedTemplate.npmPackageName,
269920
+ version,
269921
+ targetDir: projectDir
269922
+ });
269912
269923
  await setName(name3, projectDir);
269913
269924
  },
269914
269925
  stopMessage: "Project fully scaffolded"
@@ -271924,7 +271935,9 @@ function configCommand() {
271924
271935
  })).sort((a8, b4) => a8.name.localeCompare(b4.name)),
271925
271936
  kits: kits.map((kit) => ({
271926
271937
  id: kit.id,
271927
- name: kit.name
271938
+ name: kit.name,
271939
+ description: kit.description,
271940
+ npmPackage: kit.npmPackageName
271928
271941
  })).sort((a8, b4) => a8.name.localeCompare(b4.name)),
271929
271942
  deploymentEngineTargets: platformConfig.deploymentEngineTargets.filter((provider) => !provider.disabled).flatMap((provider) => provider.clusters.filter((cluster) => !cluster.disabled).map((region) => ({
271930
271943
  providerId: provider.id,
@@ -273460,4 +273473,4 @@ async function sdkCliCommand(argv = process.argv) {
273460
273473
  // src/cli.ts
273461
273474
  sdkCliCommand();
273462
273475
 
273463
- //# debugId=BC0E55790020BD2764756E2164756E21
273476
+ //# debugId=103A902C1438921F64756E2164756E21