Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@settlemint/sdk-utils

Package Overview
Dependencies
Maintainers
0
Versions
1661
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@settlemint/sdk-utils - npm Package Compare versions

Comparing version 0.5.36 to 0.5.37-pr72454cd

6

dist/environment.d.ts

@@ -32,2 +32,3 @@ import { z } from 'zod';

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: z.ZodOptional<z.ZodString>;
SETTLEMINT_NEW_PROJECT_NAME: z.ZodOptional<z.ZodString>;
NEXTAUTH_URL: z.ZodString;

@@ -65,2 +66,3 @@ SETTLEMINT_PREDEPLOYED_CONTRACT_ERC20_REGISTRY: z.ZodLiteral<"0x5e771e1417100000000000000000000000000001">;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT?: string | undefined;
SETTLEMINT_NEW_PROJECT_NAME?: string | undefined;
}, {

@@ -95,2 +97,3 @@ SETTLEMINT_INSTANCE: string;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT?: string | undefined;
SETTLEMINT_NEW_PROJECT_NAME?: string | undefined;
}>;

@@ -124,2 +127,3 @@ type DotEnv = z.infer<typeof DotEnvSchema>;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: z.ZodOptional<z.ZodOptional<z.ZodString>>;
SETTLEMINT_NEW_PROJECT_NAME: z.ZodOptional<z.ZodOptional<z.ZodString>>;
NEXTAUTH_URL: z.ZodOptional<z.ZodString>;

@@ -154,2 +158,3 @@ SETTLEMINT_PREDEPLOYED_CONTRACT_ERC20_REGISTRY: z.ZodOptional<z.ZodLiteral<"0x5e771e1417100000000000000000000000000001">>;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT?: string | undefined;
SETTLEMINT_NEW_PROJECT_NAME?: string | undefined;
NEXTAUTH_URL?: string | undefined;

@@ -184,2 +189,3 @@ SETTLEMINT_PREDEPLOYED_CONTRACT_ERC20_REGISTRY?: "0x5e771e1417100000000000000000000000000001" | undefined;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT?: string | undefined;
SETTLEMINT_NEW_PROJECT_NAME?: string | undefined;
NEXTAUTH_URL?: string | undefined;

@@ -186,0 +192,0 @@ SETTLEMINT_PREDEPLOYED_CONTRACT_ERC20_REGISTRY?: "0x5e771e1417100000000000000000000000000001" | undefined;

107

dist/index.d.ts

@@ -38,2 +38,3 @@ import { ZodString, z, ZodSchema } from 'zod';

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: z.ZodOptional<z.ZodString>;
SETTLEMINT_NEW_PROJECT_NAME: z.ZodOptional<z.ZodString>;
NEXTAUTH_URL: z.ZodString;

@@ -71,2 +72,3 @@ SETTLEMINT_PREDEPLOYED_CONTRACT_ERC20_REGISTRY: z.ZodLiteral<"0x5e771e1417100000000000000000000000000001">;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT?: string | undefined;
SETTLEMINT_NEW_PROJECT_NAME?: string | undefined;
}, {

@@ -101,2 +103,3 @@ SETTLEMINT_INSTANCE: string;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT?: string | undefined;
SETTLEMINT_NEW_PROJECT_NAME?: string | undefined;
}>;

@@ -130,2 +133,3 @@ type DotEnv = z.infer<typeof DotEnvSchema>;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: z.ZodOptional<z.ZodOptional<z.ZodString>>;
SETTLEMINT_NEW_PROJECT_NAME: z.ZodOptional<z.ZodOptional<z.ZodString>>;
NEXTAUTH_URL: z.ZodOptional<z.ZodString>;

@@ -160,2 +164,3 @@ SETTLEMINT_PREDEPLOYED_CONTRACT_ERC20_REGISTRY: z.ZodOptional<z.ZodLiteral<"0x5e771e1417100000000000000000000000000001">>;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT?: string | undefined;
SETTLEMINT_NEW_PROJECT_NAME?: string | undefined;
NEXTAUTH_URL?: string | undefined;

@@ -190,2 +195,3 @@ SETTLEMINT_PREDEPLOYED_CONTRACT_ERC20_REGISTRY?: "0x5e771e1417100000000000000000000000000001" | undefined;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT?: string | undefined;
SETTLEMINT_NEW_PROJECT_NAME?: string | undefined;
NEXTAUTH_URL?: string | undefined;

@@ -257,2 +263,88 @@ SETTLEMINT_PREDEPLOYED_CONTRACT_ERC20_REGISTRY?: "0x5e771e1417100000000000000000000000000001" | undefined;

/**
* Array of available templates for project creation.
*/
type Template = {
value: string;
label: string;
};
declare const templates: Template[];
/**
* Checks if the given project name is a valid package name.
*
* @param projectName - The project name to validate
* @returns True if the project name is valid, false otherwise
*
* @example
* ```typescript
* const isValid = isValidPackageName("my-project");
* console.log(isValid); // true
* ```
*/
declare function isValidPackageName(projectName: string): boolean;
/**
* Converts a project name to a valid package name.
*
* @param projectName - The project name to convert
* @returns A valid package name
*
* @example
* ```typescript
* const validName = toValidPackageName("My Project Name");
* console.log(validName); // "my-project-name"
* ```
*/
declare function toValidPackageName(projectName: string): string;
/**
* Formats the target directory string by trimming and removing trailing slashes.
*
* @param targetDir - The target directory path to format
* @returns The formatted target directory path
*
* @example
* ```typescript
* const formattedDir = formatTargetDir("/path/to/directory/");
* console.log(formattedDir); // "/path/to/directory"
* ```
*/
declare function formatTargetDir(targetDir: string): string;
/**
* Checks if a directory is empty (contains no files or only a .git directory).
*
* @param path - The path to check
* @returns True if the directory is empty, false otherwise
*
* @example
* ```typescript
* const dirIsEmpty = isEmpty("/path/to/directory");
* console.log(dirIsEmpty);
* ```
*/
declare function isEmpty(path: string): boolean;
/**
* Empties a directory by removing all its contents except for the .git directory.
*
* @param dir - The directory to empty
*
* @example
* ```typescript
* emptyDir("/path/to/directory");
* ```
*/
declare function emptyDir(dir: string): void;
/**
* Downloads and extracts an npm package template to the specified target directory.
*
* @param template - The template to download
* @param targetDir - The directory to extract the template to
* @returns A Promise that resolves when the download and extraction are complete
* @throws Will throw an error if the download or extraction fails
*
* @example
* ```typescript
* await downloadAndExtractNpmPackage("asset-tokenization", "/path/to/project");
* ```
*/
declare function downloadAndExtractNpmPackage(template: Template["value"], targetDir: string): Promise<void>;
declare function getPackageManager(targetDir: string): Promise<"yarn" | "pnpm" | "bun" | "npm">;

@@ -262,4 +354,17 @@

/**
* Sets the name field in the package.json file.
* @param name - The new name to set in the package.json file.
* @param path - Optional path to the project root. If not provided, it will be determined automatically.
* @throws {Error} If there's an issue reading, updating, or saving the package.json file.
*
* @example
* ```typescript
* await setName("my-new-project-name");
* ```
*/
declare function setName(name: string, path?: string): Promise<void>;
declare function ensureServer(): void;
export { type AccessToken, AccessTokenSchema, type DotEnv, type DotEnvPartial, DotEnvSchema, DotEnvSchemaPartial, type Id, IdSchema, type Url, type UrlOrPath, UrlOrPathSchema, type UrlPath, UrlPathSchema, UrlSchema, ensureFolder, ensureServer, getPackageManager, installDependencies, loadEnv, projectRoot, validate, writeEnv };
export { type AccessToken, AccessTokenSchema, type DotEnv, type DotEnvPartial, DotEnvSchema, DotEnvSchemaPartial, type Id, IdSchema, type Template, type Url, type UrlOrPath, UrlOrPathSchema, type UrlPath, UrlPathSchema, UrlSchema, downloadAndExtractNpmPackage, emptyDir, ensureFolder, ensureServer, formatTargetDir, getPackageManager, installDependencies, isEmpty, isValidPackageName, loadEnv, projectRoot, setName, templates, toValidPackageName, validate, writeEnv };

@@ -0,1 +1,87 @@

/**
* Array of available templates for project creation.
*/
type Template = {
value: string;
label: string;
};
declare const templates: Template[];
/**
* Checks if the given project name is a valid package name.
*
* @param projectName - The project name to validate
* @returns True if the project name is valid, false otherwise
*
* @example
* ```typescript
* const isValid = isValidPackageName("my-project");
* console.log(isValid); // true
* ```
*/
declare function isValidPackageName(projectName: string): boolean;
/**
* Converts a project name to a valid package name.
*
* @param projectName - The project name to convert
* @returns A valid package name
*
* @example
* ```typescript
* const validName = toValidPackageName("My Project Name");
* console.log(validName); // "my-project-name"
* ```
*/
declare function toValidPackageName(projectName: string): string;
/**
* Formats the target directory string by trimming and removing trailing slashes.
*
* @param targetDir - The target directory path to format
* @returns The formatted target directory path
*
* @example
* ```typescript
* const formattedDir = formatTargetDir("/path/to/directory/");
* console.log(formattedDir); // "/path/to/directory"
* ```
*/
declare function formatTargetDir(targetDir: string): string;
/**
* Checks if a directory is empty (contains no files or only a .git directory).
*
* @param path - The path to check
* @returns True if the directory is empty, false otherwise
*
* @example
* ```typescript
* const dirIsEmpty = isEmpty("/path/to/directory");
* console.log(dirIsEmpty);
* ```
*/
declare function isEmpty(path: string): boolean;
/**
* Empties a directory by removing all its contents except for the .git directory.
*
* @param dir - The directory to empty
*
* @example
* ```typescript
* emptyDir("/path/to/directory");
* ```
*/
declare function emptyDir(dir: string): void;
/**
* Downloads and extracts an npm package template to the specified target directory.
*
* @param template - The template to download
* @param targetDir - The directory to extract the template to
* @returns A Promise that resolves when the download and extraction are complete
* @throws Will throw an error if the download or extraction fails
*
* @example
* ```typescript
* await downloadAndExtractNpmPackage("asset-tokenization", "/path/to/project");
* ```
*/
declare function downloadAndExtractNpmPackage(template: Template["value"], targetDir: string): Promise<void>;
declare function getPackageManager(targetDir: string): Promise<"yarn" | "pnpm" | "bun" | "npm">;

@@ -5,2 +91,15 @@

export { getPackageManager, installDependencies };
/**
* Sets the name field in the package.json file.
* @param name - The new name to set in the package.json file.
* @param path - Optional path to the project root. If not provided, it will be determined automatically.
* @throws {Error} If there's an issue reading, updating, or saving the package.json file.
*
* @example
* ```typescript
* await setName("my-new-project-name");
* ```
*/
declare function setName(name: string, path?: string): Promise<void>;
export { type Template, downloadAndExtractNpmPackage, emptyDir, formatTargetDir, getPackageManager, installDependencies, isEmpty, isValidPackageName, setName, templates, toValidPackageName };

@@ -38,2 +38,3 @@ import { ZodString, z, ZodSchema } from 'zod';

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: z.ZodOptional<z.ZodString>;
SETTLEMINT_NEW_PROJECT_NAME: z.ZodOptional<z.ZodString>;
NEXTAUTH_URL: z.ZodString;

@@ -71,2 +72,3 @@ SETTLEMINT_PREDEPLOYED_CONTRACT_ERC20_REGISTRY: z.ZodLiteral<"0x5e771e1417100000000000000000000000000001">;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT?: string | undefined;
SETTLEMINT_NEW_PROJECT_NAME?: string | undefined;
}, {

@@ -101,2 +103,3 @@ SETTLEMINT_INSTANCE: string;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT?: string | undefined;
SETTLEMINT_NEW_PROJECT_NAME?: string | undefined;
}>;

@@ -130,2 +133,3 @@ type DotEnv = z.infer<typeof DotEnvSchema>;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: z.ZodOptional<z.ZodOptional<z.ZodString>>;
SETTLEMINT_NEW_PROJECT_NAME: z.ZodOptional<z.ZodOptional<z.ZodString>>;
NEXTAUTH_URL: z.ZodOptional<z.ZodString>;

@@ -160,2 +164,3 @@ SETTLEMINT_PREDEPLOYED_CONTRACT_ERC20_REGISTRY: z.ZodOptional<z.ZodLiteral<"0x5e771e1417100000000000000000000000000001">>;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT?: string | undefined;
SETTLEMINT_NEW_PROJECT_NAME?: string | undefined;
NEXTAUTH_URL?: string | undefined;

@@ -190,2 +195,3 @@ SETTLEMINT_PREDEPLOYED_CONTRACT_ERC20_REGISTRY?: "0x5e771e1417100000000000000000000000000001" | undefined;

SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT?: string | undefined;
SETTLEMINT_NEW_PROJECT_NAME?: string | undefined;
NEXTAUTH_URL?: string | undefined;

@@ -192,0 +198,0 @@ SETTLEMINT_PREDEPLOYED_CONTRACT_ERC20_REGISTRY?: "0x5e771e1417100000000000000000000000000001" | undefined;

8

package.json
{
"name": "@settlemint/sdk-utils",
"description": "SettleMint SDK, integrate SettleMint into your application with ease.",
"version": "0.5.36",
"version": "0.5.37-pr72454cd",
"type": "module",

@@ -59,9 +59,13 @@ "private": false,

},
"devDependencies": {},
"devDependencies": {
"@types/npmcli__package-json": "^4"
},
"dependencies": {
"@antfu/install-pkg": "^0.4",
"@dotenvx/dotenvx": "^1",
"@npmcli/package-json": "^6",
"deepmerge-ts": "^7",
"environment": "^1",
"find-up": "^7",
"giget": "^1",
"nano-spawn": "^0.1",

@@ -68,0 +72,0 @@ "package-manager-detector": "^0.2",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc