Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
Replace minimist with parseArgs (#1868)
Bogdan Chadkin5be5abf8b337
diff --git a/packages/css-data/bin/mdn-data.ts b/packages/css-data/bin/mdn-data.tsindex b97c8aaa0a..12083aa873 100755--- a/packages/css-data/bin/mdn-data.ts+++ b/packages/css-data/bin/mdn-data.ts@@ -315,7 +315,10 @@ for (property in filteredProperties) {};}-const targetDir = path.join(process.cwd(), process.argv.pop() as string);+const targetDir = path.join(+ process.cwd(),+ process.argv.slice(2).pop() as string+);if (!fs.existsSync(targetDir)) {fs.mkdirSync(targetDir, { recursive: true });diff --git a/packages/generate-arg-types/src/cli.ts b/packages/generate-arg-types/src/cli.tsindex eebc68146c..b10127e878 100755--- a/packages/generate-arg-types/src/cli.ts+++ b/packages/generate-arg-types/src/cli.ts@@ -14,7 +14,7 @@ const options = {shouldRemoveUndefinedFromOptional: true,};-const componentsGlobString = process.argv.pop();+const componentsGlobString = process.argv.slice(2).pop();const tsConfigPath = path.resolve(process.cwd(), "./tsconfig.json");if (typeof componentsGlobString === "undefined") {diff --git a/packages/prisma-client/migrations-cli/args.ts b/packages/prisma-client/migrations-cli/args.tsindex 172edda3b6..775f9a179b 100644--- a/packages/prisma-client/migrations-cli/args.ts+++ b/packages/prisma-client/migrations-cli/args.ts@@ -1,5 +1,14 @@-import minimist from "minimist";+import { parseArgs } from "node:util";-export default minimist(process.argv.slice(2), {- boolean: ["dev", "force"],-}) as { _: string[]; dev: boolean; force: boolean };+export const { values, positionals } = parseArgs({+ args: process.argv.slice(2),+ allowPositionals: true,+ options: {+ dev: {+ type: "boolean",+ },+ force: {+ type: "boolean",+ },+ },+});diff --git a/packages/prisma-client/migrations-cli/cli.ts b/packages/prisma-client/migrations-cli/cli.tsindex b5bb3bc2f4..6cb0e672db 100755--- a/packages/prisma-client/migrations-cli/cli.ts+++ b/packages/prisma-client/migrations-cli/cli.ts@@ -3,7 +3,7 @@import * as dotenv from "dotenv";import * as commands from "./commands";import * as logger from "./logger";-import args from "./args";+import * as args from "./args";import { UserError } from "./errors";const USAGE = `Usage: migrations <command> [--dev]@@ -22,11 +22,11 @@ Arguments`;const main = async () => {- if (args.dev) {+ if (args.values.dev) {dotenv.config();}- const command = args._[0];+ const command = args.positionals[0];if (command === undefined) {logger.info(USAGE);@@ -34,7 +34,7 @@ const main = async () => {}if (command === "create-schema") {- const name = args._[1];+ const name = args.positionals[1];if (name === undefined) {throw new UserError("Missing name for migration.\nUsage: migrations create-schema <name>"@@ -45,7 +45,7 @@ const main = async () => {}if (command === "create-data") {- const name = args._[1];+ const name = args.positionals[1];if (name === undefined) {throw new UserError("Missing name for migration.\nUsage: migrations create-data <name>"@@ -66,7 +66,7 @@ const main = async () => {}if (command === "resolve") {- const type = args._[1];+ const type = args.positionals[1];if (type === undefined || (type !== "applied" && type !== "rolled-back")) {throw new UserError(@@ -74,7 +74,7 @@ const main = async () => {);}- const name = args._[2];+ const name = args.positionals[2];if (name === undefined) {throw new UserError("Missing name of migration.\nUsage: migrations resolve <applied|rolled-back> <migration-name>"diff --git a/packages/prisma-client/migrations-cli/commands.ts b/packages/prisma-client/migrations-cli/commands.tsindex 4538f5a6bb..cfa7cdca1e 100644--- a/packages/prisma-client/migrations-cli/commands.ts+++ b/packages/prisma-client/migrations-cli/commands.ts@@ -6,7 +6,7 @@ import { inspect } from "node:util";import * as prismaMigrations from "./prisma-migrations";import { umzug } from "./umzug";import * as logger from "./logger";-import args from "./args";+import * as args from "./args";import { UserError } from "./errors";const templateFilePath = path.join(@@ -16,7 +16,7 @@ const templateFilePath = path.join(const lockfilePath = path.join(prismaMigrations.migrationsDir, "lockfile");const ensureUserWantsToContinue = async (defaultResult = false) => {- if (args.force) {+ if (args.values.force) {return;}@@ -237,7 +237,7 @@ ${schemaContent}`;const up = async () => {let locker: FileLocker | undefined;- if (args.dev) {+ if (args.values.dev) {locker = new FileLocker({ path: lockfilePath });}@@ -289,7 +289,7 @@ export const migrate = async () => {process.exit(0);}- if (args.dev) {+ if (args.values.dev) {logger.info("You're about to apply the following migration(s):");logger.info("");for (const migration of status.pending) {diff --git a/packages/prisma-client/package.json b/packages/prisma-client/package.jsonindex 61711363ed..360a62bf92 100644--- a/packages/prisma-client/package.json+++ b/packages/prisma-client/package.json@@ -19,7 +19,6 @@"devDependencies": {"@prisma/client": "^4.14.0","@types/node": "^18.11.18",- "@types/uuid": "^8.3.4","@webstudio-is/scripts": "workspace:^","@webstudio-is/tsconfig": "workspace:^","prisma": "^4.14.0",@@ -37,13 +36,10 @@"private": false,"dependencies": {"@inquirer/confirm": "^0.0.25-alpha.0",- "@types/minimist": "^1.2.2","dotenv": "^16.0.0","execa": "^6.1.0",- "minimist": "^1.2.6","nanoid": "^3.3.6",- "umzug": "^3.2.1",- "uuid": "^9.0.0"+ "umzug": "^3.2.1"},"peerDependencies": {"zod": "^3.19.1"diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 144f137bc2..09891bba28 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1074,27 +1074,18 @@ importers:'@inquirer/confirm':specifier: ^0.0.25-alpha.0version: 0.0.25-alpha.0- '@types/minimist':- specifier: ^1.2.2- version: 1.2.2dotenv:specifier: ^16.0.0version: 16.0.1execa:specifier: ^6.1.0version: 6.1.0- minimist:- specifier: ^1.2.6- version: 1.2.6nanoid:specifier: ^3.3.6version: 3.3.6umzug:specifier: ^3.2.1version: 3.2.1- uuid:- specifier: ^9.0.0- version: 9.0.0devDependencies:'@prisma/client':specifier: ^4.14.0@@ -1102,9 +1093,6 @@ importers:'@types/node':specifier: ^18.11.18version: 18.11.18- '@types/uuid':- specifier: ^8.3.4- version: 8.3.4'@webstudio-is/scripts':specifier: workspace:^version: link:../scripts@@ -8454,10 +8442,6 @@ packages:/@types/[email protected]:resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==}- /@types/[email protected]:- resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==}- dev: false-/@types/[email protected]:resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==}@@ -14085,10 +14069,6 @@ packages:dependencies:brace-expansion: 2.0.1- resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==}- dev: false-resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==}