From e5f65999f157b6ec7b9809de46667621a47d0213 Mon Sep 17 00:00:00 2001 From: Victor Genaev Date: Mon, 11 Dec 2023 13:05:47 +0100 Subject: [PATCH] chore(tokens): fix node issue with ts-node --- package.json | 2 +- .../config/build/generateDeclarations.mts | 2 +- packages/orbit-components/config/build/index.mts | 4 ++-- packages/orbit-components/package.json | 12 ++++++------ packages/orbit-design-tokens/package.json | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index a49698a2c6..58248670d3 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "build-ci": "yarn size:build", "components": "yarn workspace @kiwicom/orbit-components", - "checks": "ts-node --esm scripts/checks.mts", + "checks": "node --loader ts-node/esm scripts/checks.mts", "check:types": "yarn checks --types", "check:links": "yarn checks --links", "check:css": "yarn checks --css", diff --git a/packages/orbit-components/config/build/generateDeclarations.mts b/packages/orbit-components/config/build/generateDeclarations.mts index 0c7ed804e1..c6d13357fa 100644 --- a/packages/orbit-components/config/build/generateDeclarations.mts +++ b/packages/orbit-components/config/build/generateDeclarations.mts @@ -8,7 +8,7 @@ import { DECLARATIONS_IGNORE_PATTERN } from "./consts.mjs"; const [, __dirname] = filedirname(); export default async function generateTypeDeclarations() { - await $`ts-node --esm config/typeFiles.mts`; + await $`node --loader ts-node/esm config/typeFiles.mts`; console.log(chalk.greenBright.bold("Generating type declarations...")); await $`cpy "**/*.js.flow" ../lib --cwd src --parents`; diff --git a/packages/orbit-components/config/build/index.mts b/packages/orbit-components/config/build/index.mts index 58337272e5..5237e03f0c 100644 --- a/packages/orbit-components/config/build/index.mts +++ b/packages/orbit-components/config/build/index.mts @@ -17,7 +17,7 @@ import buildSize from "./buildSize.mjs"; logStep("Building icons"); - await $`ts-node --esm config/build/buildIcons.mts`; + await $`node --loader ts-node/esm config/build/buildIcons.mts`; if (argv.size) { console.log( @@ -28,7 +28,7 @@ import buildSize from "./buildSize.mjs"; } if (!argv.size) { - await $`ts-node --esm config/createSVGFont.mts`; + await $`node --loader ts-node/esm config/createSVGFont.mts`; await $`cd src/icons; zip -r ../../orbit-svgs.zip ./svg; cd -`; await $`zip -j orbit-svgs.zip orbit-icons-font/orbit-icons.svg`; await $`zip -r orbit-icons-font.zip orbit-icons-font`; diff --git a/packages/orbit-components/package.json b/packages/orbit-components/package.json index f102e38cd7..7c896b8965 100644 --- a/packages/orbit-components/package.json +++ b/packages/orbit-components/package.json @@ -14,23 +14,23 @@ "cy:dev": "vite cypress/integration --logLevel silent", "cy:run": "start-server-and-test cy:dev http-get://localhost:3000 'cypress run'", "cy:open": "start-server-and-test cy:dev http-get://localhost:3000 'cypress open'", - "build": "ts-node --esm config/build/index.mts", + "build": "node --loader ts-node/esm config/build/index.mts", "tailwind": "cross-env NODE_ENV=test npx tailwindcss -i ./src/tailwind.css -o ./lib/tailwind.css", "prepublishOnly": "yarn build", "size:build": "yarn build --size", "size": "size-limit", "size:why": "size-limit --why", - "fetch:icons": "ts-node --esm config/fetchIcons.mts", - "check:icons": "ts-node --esm config/checkIconsCli.mts", + "fetch:icons": "node --loader ts-node/esm config/fetchIcons.mts", + "check:icons": "node --loader ts-node/esm config/checkIconsCli.mts", "check:types": "tsc --p tsconfig.json", "flow:ci": "flow check", - "build:iconsPng": "ts-node --esm config/generatePngIcons.mts", - "build:storybook": "ts-node --esm config/build/buildIcons.mts && storybook build -c .storybook -o .out", + "build:iconsPng": "node --loader ts-node/esm config/generatePngIcons.mts", + "build:storybook": "node --loader ts-node/esm config/build/buildIcons.mts && storybook build -c .storybook -o .out", "eslint:check": "eslint . --report-unused-disable-directives", "test-ct": "playwright test -c playwright-ct.config.ts", "deploy:storybook": "yarn storybook-to-ghpages -e ./.out", "deploy:surge": "yarn surge .out/", - "deploy:updateURL": "ts-node --esm config/deploymentUtils.mts updateLiveURL", + "deploy:updateURL": "node --loader ts-node/esm config/deploymentUtils.mts updateLiveURL", "docs-gen": "monstra docs" }, "storybook-deployer": { diff --git a/packages/orbit-design-tokens/package.json b/packages/orbit-design-tokens/package.json index 2a97ccb420..20686cbfd3 100644 --- a/packages/orbit-design-tokens/package.json +++ b/packages/orbit-design-tokens/package.json @@ -24,7 +24,7 @@ "check:types": "tsc", "test": "jest", "build": "yarn clean && yarn build:dictionary && tsup && yarn generate:flow && yarn eslint --fix src/js/*.ts", - "build:dictionary": "ts-node --esm ./src/dictionary/build.ts", + "build:dictionary": "node --loader ts-node/esm ./src/dictionary/build.ts", "generate:flow": "npx flowgen --output-file ./dist/index.js.flow ./dist/index.d.ts --add-flow-header", "prepublishOnly": "yarn build", "clean": "del-cli dist output src/js/createTokens.* src/js/defaultFoundation.*"