diff --git a/.changeset/spicy-games-arrive.md b/.changeset/spicy-games-arrive.md new file mode 100644 index 0000000000..aaee5b1b3a --- /dev/null +++ b/.changeset/spicy-games-arrive.md @@ -0,0 +1,5 @@ +--- +"shadcn-ui": minor +--- + +add support for jsx diff --git a/apps/www/config/docs.ts b/apps/www/config/docs.ts index c5a6180171..e41fdf49d8 100644 --- a/apps/www/config/docs.ts +++ b/apps/www/config/docs.ts @@ -78,6 +78,11 @@ export const docsConfig: DocsConfig = { href: "/docs/changelog", items: [], }, + { + title: "About", + href: "/docs/about", + items: [], + }, ], }, { diff --git a/apps/www/content/docs/about.mdx b/apps/www/content/docs/about.mdx new file mode 100644 index 0000000000..ab523185c5 --- /dev/null +++ b/apps/www/content/docs/about.mdx @@ -0,0 +1,20 @@ +--- +title: About +description: Powered by amazing open source projects. +--- + +## About + +[ui.shadcn.com](https://ui.shadcn.com) is a project by [shadcn](https://shadcn.com). + +## Credits + +- [Radix UI](https://radix-ui.com) - For the primitives. +- [Vercel](https://vercel.com) - Where I host all my projects. +- [Shu Ding](https://shud.in) - The typography style is adapted from his work on Nextra. +- [Cal](https://cal.com) - Where I copied the styles for the first component: the `Button`. +- [cmdk](https://cmdk.paco.me) - For the `` component. + +## License + +MIT © [shadcn](https://shadcn.com) diff --git a/apps/www/content/docs/changelog.mdx b/apps/www/content/docs/changelog.mdx index 000d41bd7d..0d08561294 100644 --- a/apps/www/content/docs/changelog.mdx +++ b/apps/www/content/docs/changelog.mdx @@ -4,6 +4,48 @@ description: Latest updates and announcements. toc: false --- +## July 2023 - JavaScript + +This project and the components are written in TypeScript. We recommend using TypeScript for your project as well. + +However we provide a JavaScript version of the components as well. The JavaScript version is available via the [cli](/docs/cli). + +```txt +Would you like to use TypeScript (recommended)? no +``` + +To opt-out of TypeScript, you can use the `tsx` flag in your `components.json` file. + +```json {10} title="components.json" +{ + "style": "default", + "tailwind": { + "config": "tailwind.config.js", + "css": "src/app/globals.css", + "baseColor": "zinc", + "cssVariables": true + }, + "rsc": false, + "tsx": false, + "aliases": { + "utils": "~/lib/utils", + "components": "~/components" + } +} +``` + +To configure import aliases, you can use the following `jsconfig.json`: + +```json {4} title="jsconfig.json" +{ + "compilerOptions": { + "paths": { + "@/*": ["./*"] + } + } +} +``` + ## June 2023 - New CLI, Styles and more I have a lot of updates to share with you today: diff --git a/apps/www/content/docs/index.mdx b/apps/www/content/docs/index.mdx index 341365f825..90f7ed4ef7 100644 --- a/apps/www/content/docs/index.mdx +++ b/apps/www/content/docs/index.mdx @@ -65,11 +65,3 @@ But hey, let me know if you do. I'd love to see what you build. - -## Credits - -- [Radix UI](https://radix-ui.com) - For the primitives. -- [Vercel](https://vercel.com) - Where I host all my projects. -- [Shu Ding](https://shud.in) - The typography style is adapted from his work on Nextra. -- [Cal](https://cal.com) - Where I copied the styles for the first component: the `Button`. -- [cmdk](https://cmdk.paco.me) - For the `` component. diff --git a/apps/www/content/docs/installation/astro.mdx b/apps/www/content/docs/installation/astro.mdx index 62204248ab..1e84289240 100644 --- a/apps/www/content/docs/installation/astro.mdx +++ b/apps/www/content/docs/installation/astro.mdx @@ -88,6 +88,7 @@ npx shadcn-ui@latest init You will be asked a few questions to configure `components.json`: ```txt showLineNumbers +Would you like to use TypeScript (recommended)? no / yes Which style would you like to use? › Default Which color would you like to use as base color? › Slate Where is your global CSS file? › › ./src/styles/globals.css diff --git a/apps/www/content/docs/installation/gatsby.mdx b/apps/www/content/docs/installation/gatsby.mdx index 87ac29fbb1..a680cd2fa3 100644 --- a/apps/www/content/docs/installation/gatsby.mdx +++ b/apps/www/content/docs/installation/gatsby.mdx @@ -84,6 +84,7 @@ npx shadcn-ui@latest init You will be asked a few questions to configure `components.json`: ```txt showLineNumbers +Would you like to use TypeScript (recommended)? no / yes Which style would you like to use? › Default Which color would you like to use as base color? › Slate Where is your global CSS file? › › ./src/styles/globals.css diff --git a/apps/www/content/docs/installation/index.mdx b/apps/www/content/docs/installation/index.mdx index 914abfd7a0..309e830652 100644 --- a/apps/www/content/docs/installation/index.mdx +++ b/apps/www/content/docs/installation/index.mdx @@ -3,7 +3,9 @@ title: Installation description: How to install dependencies and structure your app. --- -
+## Frameworks + +
-## Other frameworks +## TypeScript -I'm looking for help writing guides for other frameworks. Help me write those guides by [opening an PR](https://github.com/shadcn/ui). +This project and the components are written in TypeScript. We recommend using TypeScript for your project as well. + +However we provide a JavaScript version of the components as well. The JavaScript version is available via the [cli](/docs/cli). + +To opt-out of TypeScript, you can use the `tsx` flag in your `components.json` file. + +```json {10} title="components.json" +{ + "style": "default", + "tailwind": { + "config": "tailwind.config.js", + "css": "src/app/globals.css", + "baseColor": "zinc", + "cssVariables": true + }, + "rsc": false, + "tsx": false, + "aliases": { + "utils": "~/lib/utils", + "components": "~/components" + } +} +``` + +To configure import aliases, you can use the following `jsconfig.json`: + +```json {4} title="jsconfig.json" +{ + "compilerOptions": { + "paths": { + "@/*": ["./*"] + } + } +} +``` diff --git a/apps/www/content/docs/installation/next.mdx b/apps/www/content/docs/installation/next.mdx index c7a0cbb6ed..0fe520f5fd 100644 --- a/apps/www/content/docs/installation/next.mdx +++ b/apps/www/content/docs/installation/next.mdx @@ -26,6 +26,7 @@ npx shadcn-ui@latest init You will be asked a few questions to configure `components.json`: ```txt showLineNumbers +Would you like to use TypeScript (recommended)? no / yes Which style would you like to use? › Default Which color would you like to use as base color? › Slate Where is your global CSS file? › › app/globals.css diff --git a/apps/www/content/docs/installation/remix.mdx b/apps/www/content/docs/installation/remix.mdx index b6d925fe88..2b484a1009 100644 --- a/apps/www/content/docs/installation/remix.mdx +++ b/apps/www/content/docs/installation/remix.mdx @@ -26,6 +26,7 @@ npx shadcn-ui@latest init You will be asked a few questions to configure `components.json`: ```txt showLineNumbers +Would you like to use TypeScript (recommended)? no / yes Which style would you like to use? › Default Which color would you like to use as base color? › Slate Where is your global CSS file? › app/tailwind.css diff --git a/apps/www/content/docs/installation/vite.mdx b/apps/www/content/docs/installation/vite.mdx index d369a49e94..bf1195037a 100644 --- a/apps/www/content/docs/installation/vite.mdx +++ b/apps/www/content/docs/installation/vite.mdx @@ -71,6 +71,7 @@ npx shadcn-ui@latest init You will be asked a few questions to configure `components.json`: ```txt showLineNumbers +Would you like to use TypeScript (recommended)? no / yes Which style would you like to use? › Default Which color would you like to use as base color? › Slate Where is your global CSS file? › › src/index.css diff --git a/apps/www/public/schema.json b/apps/www/public/schema.json index 99fbf179d1..14c922a8fb 100644 --- a/apps/www/public/schema.json +++ b/apps/www/public/schema.json @@ -27,6 +27,9 @@ "rsc": { "type": "boolean" }, + "tsx": { + "type": "boolean" + }, "aliases": { "type": "object", "properties": { diff --git a/packages/cli/package.json b/packages/cli/package.json index c79b8e1308..72b409908f 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -45,6 +45,9 @@ }, "dependencies": { "@antfu/ni": "^0.21.4", + "@babel/core": "^7.22.1", + "@babel/parser": "^7.22.6", + "@babel/plugin-transform-typescript": "^7.22.5", "chalk": "5.2.0", "commander": "^10.0.0", "cosmiconfig": "^8.1.3", @@ -52,16 +55,20 @@ "execa": "^7.0.0", "fs-extra": "^11.1.0", "https-proxy-agent": "^6.2.0", + "lodash.template": "^4.5.0", "node-fetch": "^3.3.0", "ora": "^6.1.2", "prompts": "^2.4.2", + "recast": "^0.23.2", "ts-morph": "^18.0.0", "tsconfig-paths": "^4.2.0", "zod": "^3.20.2" }, "devDependencies": { + "@types/babel__core": "^7.20.1", "@types/diff": "^5.0.3", "@types/fs-extra": "^11.0.1", + "@types/lodash.template": "^4.5.1", "@types/prompts": "^2.4.2", "rimraf": "^4.1.3", "tsup": "^6.6.3", diff --git a/packages/cli/src/commands/add.ts b/packages/cli/src/commands/add.ts index 1f20961396..46ef641575 100644 --- a/packages/cli/src/commands/add.ts +++ b/packages/cli/src/commands/add.ts @@ -143,7 +143,7 @@ export const add = new Command() } for (const file of item.files) { - const filePath = path.resolve(targetDir, file.name) + let filePath = path.resolve(targetDir, file.name) // Run transformers. const content = await transform({ @@ -153,6 +153,10 @@ export const add = new Command() baseColor, }) + if (!config.tsx) { + filePath = filePath.replace(/\.tsx$/, ".jsx") + } + await fs.writeFile(filePath, content) } diff --git a/packages/cli/src/commands/diff.ts b/packages/cli/src/commands/diff.ts index 214d84f371..37308eaa89 100644 --- a/packages/cli/src/commands/diff.ts +++ b/packages/cli/src/commands/diff.ts @@ -166,7 +166,7 @@ async function diffComponent( baseColor, }) - const patch = diffLines(registryContent, fileContent) + const patch = diffLines(registryContent as string, fileContent) if (patch.length > 1) { changes.push({ file: file.name, diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index f21931a03c..598ab6d60e 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -2,7 +2,6 @@ import { existsSync, promises as fs } from "fs" import path from "path" import { DEFAULT_COMPONENTS, - DEFAULT_TAILWIND_BASE_COLOR, DEFAULT_TAILWIND_CONFIG, DEFAULT_TAILWIND_CSS, DEFAULT_UTILS, @@ -23,6 +22,7 @@ import * as templates from "@/src/utils/templates" import chalk from "chalk" import { Command } from "commander" import { execa } from "execa" +import template from "lodash.template" import ora from "ora" import prompts from "prompts" import * as z from "zod" @@ -86,6 +86,16 @@ export async function promptForConfig( const baseColors = await getRegistryBaseColors() const options = await prompts([ + { + type: "toggle", + name: "typescript", + message: `Would you like to use ${highlight( + "TypeScript" + )} (recommended)?`, + initial: defaultConfig?.tsx ?? true, + active: "yes", + inactive: "no", + }, { type: "select", name: "style", @@ -115,7 +125,9 @@ export async function promptForConfig( { type: "toggle", name: "tailwindCssVariables", - message: `Do you want to use ${highlight("CSS variables")} for colors?`, + message: `Would you like to use ${highlight( + "CSS variables" + )} for colors?`, initial: defaultConfig?.tailwind.cssVariables ?? true, active: "yes", inactive: "no", @@ -158,6 +170,7 @@ export async function promptForConfig( cssVariables: options.tailwindCssVariables, }, rsc: options.rsc, + tsx: options.typescript, aliases: { utils: options.utils, components: options.components, @@ -213,12 +226,14 @@ export async function runInit(cwd: string, config: Config) { } } + const extension = config.tsx ? "ts" : "js" + // Write tailwind config. await fs.writeFile( config.resolvedPaths.tailwindConfig, config.tailwind.cssVariables - ? templates.TAILWIND_CONFIG_WITH_VARIABLES - : templates.TAILWIND_CONFIG, + ? template(templates.TAILWIND_CONFIG_WITH_VARIABLES)({ extension }) + : template(templates.TAILWIND_CONFIG)({ extension }), "utf8" ) @@ -236,8 +251,8 @@ export async function runInit(cwd: string, config: Config) { // Write cn file. await fs.writeFile( - `${config.resolvedPaths.utils}.ts`, - templates.UTILS, + `${config.resolvedPaths.utils}.${extension}`, + extension === "ts" ? templates.UTILS : templates.UTILS_JS, "utf8" ) diff --git a/packages/cli/src/utils/get-config.ts b/packages/cli/src/utils/get-config.ts index 54b056c4b5..b6376d7029 100644 --- a/packages/cli/src/utils/get-config.ts +++ b/packages/cli/src/utils/get-config.ts @@ -22,6 +22,7 @@ export const rawConfigSchema = z $schema: z.string().optional(), style: z.string(), rsc: z.coerce.boolean().default(false), + tsx: z.coerce.boolean().default(true), tailwind: z.object({ config: z.string(), css: z.string(), @@ -89,6 +90,6 @@ export async function getRawConfig(cwd: string): Promise { return rawConfigSchema.parse(configResult.config) } catch (error) { - throw new Error(`Invald configuration found in ${cwd}/components.json.`) + throw new Error(`Invalid configuration found in ${cwd}/components.json.`) } } diff --git a/packages/cli/src/utils/templates.ts b/packages/cli/src/utils/templates.ts index 523ef7171b..5af47c2f49 100644 --- a/packages/cli/src/utils/templates.ts +++ b/packages/cli/src/utils/templates.ts @@ -6,14 +6,22 @@ export function cn(...inputs: ClassValue[]) { } ` +export const UTILS_JS = `import { clsx } from "clsx" +import { twMerge } from "tailwind-merge" + +export function cn(...inputs) { + return twMerge(clsx(inputs)) +} +` + export const TAILWIND_CONFIG = `/** @type {import('tailwindcss').Config} */ module.exports = { darkMode: ["class"], content: [ - './pages/**/*.{ts,tsx}', - './components/**/*.{ts,tsx}', - './app/**/*.{ts,tsx}', - './src/**/*.{ts,tsx}', + './pages/**/*.{<%- extension %>,<%- extension %>x}', + './components/**/*.{<%- extension %>,<%- extension %>x}', + './app/**/*.{<%- extension %>,<%- extension %>x}', + './src/**/*.{<%- extension %>,<%- extension %>x}', ], theme: { container: { @@ -47,10 +55,10 @@ export const TAILWIND_CONFIG_WITH_VARIABLES = `/** @type {import('tailwindcss'). module.exports = { darkMode: ["class"], content: [ - './pages/**/*.{ts,tsx}', - './components/**/*.{ts,tsx}', - './app/**/*.{ts,tsx}', - './src/**/*.{ts,tsx}', + './pages/**/*.{<%- extension %>,<%- extension %>x}', + './components/**/*.{<%- extension %>,<%- extension %>x}', + './app/**/*.{<%- extension %>,<%- extension %>x}', + './src/**/*.{<%- extension %>,<%- extension %>x}', ], theme: { container: { diff --git a/packages/cli/src/utils/transformers/index.ts b/packages/cli/src/utils/transformers/index.ts index ef38cbae43..b5699d71e6 100644 --- a/packages/cli/src/utils/transformers/index.ts +++ b/packages/cli/src/utils/transformers/index.ts @@ -5,6 +5,7 @@ import { Config } from "@/src/utils/get-config" import { registryBaseColorSchema } from "@/src/utils/registry/schema" import { transformCssVars } from "@/src/utils/transformers/transform-css-vars" import { transformImport } from "@/src/utils/transformers/transform-import" +import { transformJsx } from "@/src/utils/transformers/transform-jsx" import { transformRsc } from "@/src/utils/transformers/transform-rsc" import { Project, ScriptKind, type SourceFile } from "ts-morph" import * as z from "zod" @@ -16,11 +17,11 @@ export type TransformOpts = { baseColor?: z.infer } -export type Transformer = ( +export type Transformer = ( opts: TransformOpts & { sourceFile: SourceFile } -) => Promise +) => Promise const transformers: Transformer[] = [ transformImport, @@ -47,5 +48,8 @@ export async function transform(opts: TransformOpts) { transformer({ sourceFile, ...opts }) } - return sourceFile.getFullText() + return await transformJsx({ + sourceFile, + ...opts, + }) } diff --git a/packages/cli/src/utils/transformers/transform-jsx.ts b/packages/cli/src/utils/transformers/transform-jsx.ts new file mode 100644 index 0000000000..81f6bb597d --- /dev/null +++ b/packages/cli/src/utils/transformers/transform-jsx.ts @@ -0,0 +1,95 @@ +import { type Transformer } from "@/src/utils/transformers" +import { transformFromAstSync } from "@babel/core" +import { ParserOptions, parse } from "@babel/parser" +// @ts-ignore +import transformTypescript from "@babel/plugin-transform-typescript" +import * as recast from "recast" + +// TODO. +// I'm using recast for the AST here. +// Figure out if ts-morph AST is compatible with Babel. + +// This is a copy of the babel options from recast/parser. +// The goal here is to tolerate as much syntax as possible. +// We want to be able to parse any valid tsx code. +// See https://github.com/benjamn/recast/blob/master/parsers/_babel_options.ts. +const PARSE_OPTIONS: ParserOptions = { + sourceType: "module", + allowImportExportEverywhere: true, + allowReturnOutsideFunction: true, + startLine: 1, + tokens: true, + plugins: [ + "asyncGenerators", + "bigInt", + "classPrivateMethods", + "classPrivateProperties", + "classProperties", + "classStaticBlock", + "decimal", + "decorators-legacy", + "doExpressions", + "dynamicImport", + "exportDefaultFrom", + "exportNamespaceFrom", + "functionBind", + "functionSent", + "importAssertions", + "importMeta", + "nullishCoalescingOperator", + "numericSeparator", + "objectRestSpread", + "optionalCatchBinding", + "optionalChaining", + [ + "pipelineOperator", + { + proposal: "minimal", + }, + ], + [ + "recordAndTuple", + { + syntaxType: "hash", + }, + ], + "throwExpressions", + "topLevelAwait", + "v8intrinsic", + "typescript", + "jsx", + ], +} + +export const transformJsx: Transformer = async ({ + sourceFile, + config, +}) => { + const output = sourceFile.getFullText() + + if (config.tsx) { + return output + } + + const ast = recast.parse(output, { + parser: { + parse: (code: string) => { + return parse(code, PARSE_OPTIONS) + }, + }, + }) + + const result = transformFromAstSync(ast, output, { + cloneInputAst: false, + code: false, + ast: true, + plugins: [transformTypescript], + configFile: false, + }) + + if (!result || !result.ast) { + throw new Error("Failed to transform JSX") + } + + return recast.print(result.ast).code +} diff --git a/packages/cli/test/fixtures/config-jsx/components.json b/packages/cli/test/fixtures/config-jsx/components.json new file mode 100644 index 0000000000..92b1f5e029 --- /dev/null +++ b/packages/cli/test/fixtures/config-jsx/components.json @@ -0,0 +1,14 @@ +{ + "style": "default", + "tsx": false, + "tailwind": { + "config": "./tailwind.config.js", + "css": "./src/assets/css/tailwind.css", + "baseColor": "neutral", + "cssVariables": false + }, + "aliases": { + "utils": "@/lib/utils", + "components": "@/components" + } +} diff --git a/packages/cli/test/fixtures/config-jsx/jsconfig.json b/packages/cli/test/fixtures/config-jsx/jsconfig.json new file mode 100644 index 0000000000..2a2e4b3bf8 --- /dev/null +++ b/packages/cli/test/fixtures/config-jsx/jsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "paths": { + "@/*": ["./*"] + } + } +} diff --git a/packages/cli/test/fixtures/config-jsx/package.json b/packages/cli/test/fixtures/config-jsx/package.json new file mode 100644 index 0000000000..b239ba4a65 --- /dev/null +++ b/packages/cli/test/fixtures/config-jsx/package.json @@ -0,0 +1,7 @@ +{ + "name": "test-cli-config-partial", + "version": "1.0.0", + "main": "index.js", + "author": "shadcn", + "license": "MIT" +} diff --git a/packages/cli/test/utils/get-config.test.ts b/packages/cli/test/utils/get-config.test.ts index b56c1fb9be..5ab65a3732 100644 --- a/packages/cli/test/utils/get-config.test.ts +++ b/packages/cli/test/utils/get-config.test.ts @@ -19,6 +19,7 @@ test("get raw config", async () => { cssVariables: false, }, rsc: false, + tsx: true, aliases: { components: "@/components", utils: "@/lib/utils", @@ -50,6 +51,7 @@ test("get config", async () => { cssVariables: false, }, rsc: false, + tsx: true, aliases: { components: "@/components", utils: "@/lib/utils", @@ -83,6 +85,7 @@ test("get config", async () => { ).toEqual({ style: "new-york", rsc: false, + tsx: true, tailwind: { config: "tailwind.config.ts", baseColor: "zinc", @@ -116,4 +119,40 @@ test("get config", async () => { ), }, }) + + expect( + await getConfig(path.resolve(__dirname, "../fixtures/config-jsx")) + ).toEqual({ + style: "default", + tailwind: { + config: "./tailwind.config.js", + css: "./src/assets/css/tailwind.css", + baseColor: "neutral", + cssVariables: false, + }, + rsc: false, + tsx: false, + aliases: { + components: "@/components", + utils: "@/lib/utils", + }, + resolvedPaths: { + tailwindConfig: path.resolve( + __dirname, + "../fixtures/config-jsx", + "tailwind.config.js" + ), + tailwindCss: path.resolve( + __dirname, + "../fixtures/config-jsx", + "./src/assets/css/tailwind.css" + ), + components: path.resolve( + __dirname, + "../fixtures/config-jsx", + "./components" + ), + utils: path.resolve(__dirname, "../fixtures/config-jsx", "./lib/utils"), + }, + }) }) diff --git a/packages/cli/test/utils/transform-css-vars.test.ts b/packages/cli/test/utils/transform-css-vars.test.ts index 1b37a5c9b0..46ad6916a5 100644 --- a/packages/cli/test/utils/transform-css-vars.test.ts +++ b/packages/cli/test/utils/transform-css-vars.test.ts @@ -13,6 +13,7 @@ export function Foo() { }" `, config: { + tsx: true, tailwind: { baseColor: "stone", cssVariables: true, @@ -35,6 +36,7 @@ export function Foo() { }" `, config: { + tsx: true, tailwind: { baseColor: "stone", cssVariables: false, @@ -57,6 +59,7 @@ export function Foo() { }" `, config: { + tsx: true, tailwind: { baseColor: "stone", cssVariables: false, diff --git a/packages/cli/test/utils/transform-import.test.ts b/packages/cli/test/utils/transform-import.test.ts index 98475ade32..4c36cd2505 100644 --- a/packages/cli/test/utils/transform-import.test.ts +++ b/packages/cli/test/utils/transform-import.test.ts @@ -15,6 +15,7 @@ import { Foo } from "bar" import { cn } from "@/lib/utils" `, config: { + tsx: true, tailwind: { baseColor: "neutral", cssVariables: true, @@ -40,6 +41,7 @@ import { Foo } from "bar" import { bar } from "@/lib/utils/bar" `, config: { + tsx: true, aliases: { components: "~/src/components", utils: "~/lib", @@ -61,6 +63,7 @@ import { Foo } from "bar" import { bar } from "@/lib/utils/bar" `, config: { + tsx: true, aliases: { components: "~/src/components", utils: "~/src/utils", diff --git a/packages/cli/test/utils/transform-rsc.test.ts b/packages/cli/test/utils/transform-rsc.test.ts index e370d5ea21..73e0105d75 100644 --- a/packages/cli/test/utils/transform-rsc.test.ts +++ b/packages/cli/test/utils/transform-rsc.test.ts @@ -10,6 +10,7 @@ test("transform rsc", async () => { import { Foo } from "bar" `, config: { + tsx: true, rsc: true, }, }) @@ -24,6 +25,7 @@ import { Foo } from "bar" import { Foo } from "bar" `, config: { + tsx: true, rsc: true, }, }) @@ -38,6 +40,7 @@ import { Foo } from "bar" import { Foo } from "bar" `, config: { + tsx: true, rsc: false, }, }) @@ -54,6 +57,7 @@ import { Foo } from "bar" "use client" `, config: { + tsx: true, rsc: false, }, }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3755a62547..3032dd740b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -342,6 +342,15 @@ importers: '@antfu/ni': specifier: ^0.21.4 version: 0.21.4 + '@babel/core': + specifier: ^7.22.1 + version: 7.22.1 + '@babel/parser': + specifier: ^7.22.6 + version: 7.22.6 + '@babel/plugin-transform-typescript': + specifier: ^7.22.5 + version: 7.22.5(@babel/core@7.22.1) chalk: specifier: 5.2.0 version: 5.2.0 @@ -363,6 +372,9 @@ importers: https-proxy-agent: specifier: ^6.2.0 version: 6.2.0 + lodash.template: + specifier: ^4.5.0 + version: 4.5.0 node-fetch: specifier: ^3.3.0 version: 3.3.0 @@ -372,6 +384,9 @@ importers: prompts: specifier: ^2.4.2 version: 2.4.2 + recast: + specifier: ^0.23.2 + version: 0.23.2 ts-morph: specifier: ^18.0.0 version: 18.0.0 @@ -382,12 +397,18 @@ importers: specifier: ^3.20.2 version: 3.20.2 devDependencies: + '@types/babel__core': + specifier: ^7.20.1 + version: 7.20.1 '@types/diff': specifier: ^5.0.3 version: 5.0.3 '@types/fs-extra': specifier: ^11.0.1 version: 11.0.1 + '@types/lodash.template': + specifier: ^4.5.1 + version: 4.5.1 '@types/prompts': specifier: ^2.4.2 version: 2.4.2 @@ -510,6 +531,13 @@ packages: dependencies: '@babel/highlight': 7.18.6 + /@babel/code-frame@7.22.5: + resolution: {integrity: sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.22.5 + dev: false + /@babel/compat-data@7.22.3: resolution: {integrity: sha512-aNtko9OPOwVESUFp3MZfD8Uzxl7JzSeJpd7npIoxCasU37PFbAQRpKglkaKwlHOyeJdrREpo8TW8ldrkYWwvIQ==} engines: {node: '>=6.9.0'} @@ -524,7 +552,7 @@ packages: '@babel/helper-compilation-targets': 7.22.1(@babel/core@7.22.1) '@babel/helper-module-transforms': 7.22.1 '@babel/helpers': 7.22.3 - '@babel/parser': 7.22.3 + '@babel/parser': 7.22.6 '@babel/template': 7.21.9 '@babel/traverse': 7.22.1 '@babel/types': 7.22.3 @@ -540,11 +568,28 @@ packages: resolution: {integrity: sha512-C17MW4wlk//ES/CJDL51kPNwl+qiBQyN7b9SKyVp11BLGFeSPoVaHrv+MNt8jwQFhQWowW88z1eeBx3pFz9v8A==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.3 + '@babel/types': 7.22.5 '@jridgewell/gen-mapping': 0.3.3 '@jridgewell/trace-mapping': 0.3.18 jsesc: 2.5.2 + /@babel/generator@7.22.5: + resolution: {integrity: sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.5 + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.18 + jsesc: 2.5.2 + dev: false + + /@babel/helper-annotate-as-pure@7.22.5: + resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.5 + dev: false + /@babel/helper-compilation-targets@7.22.1(@babel/core@7.22.1): resolution: {integrity: sha512-Rqx13UM3yVB5q0D/KwQ8+SPfX/+Rnsy1Lw1k/UwOC4KC6qrzIQoY3lYnBu5EHKBlEHHcj0M0W8ltPSkD8rqfsQ==} engines: {node: '>=6.9.0'} @@ -558,28 +603,75 @@ packages: lru-cache: 5.1.1 semver: 6.3.0 + /@babel/helper-create-class-features-plugin@7.22.6(@babel/core@7.22.1): + resolution: {integrity: sha512-iwdzgtSiBxF6ni6mzVnZCF3xt5qE6cEA0J7nFt8QOAWZ0zjCFceEgpn3vtb2V7WFR6QzP2jmIFOHMTRo7eNJjQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.22.1 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.5 + '@babel/helper-function-name': 7.22.5 + '@babel/helper-member-expression-to-functions': 7.22.5 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers': 7.22.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@nicolo-ribaudo/semver-v6': 6.3.3 + transitivePeerDependencies: + - supports-color + dev: false + /@babel/helper-environment-visitor@7.22.1: resolution: {integrity: sha512-Z2tgopurB/kTbidvzeBrc2To3PUP/9i5MUe+fU6QJCQDyPwSH2oRapkLw3KGECDYSjhQZCNxEvNvZlLw8JjGwA==} engines: {node: '>=6.9.0'} + /@babel/helper-environment-visitor@7.22.5: + resolution: {integrity: sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==} + engines: {node: '>=6.9.0'} + dev: false + /@babel/helper-function-name@7.21.0: resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.21.9 - '@babel/types': 7.22.3 + '@babel/types': 7.22.5 + + /@babel/helper-function-name@7.22.5: + resolution: {integrity: sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.22.5 + '@babel/types': 7.22.5 + dev: false /@babel/helper-hoist-variables@7.18.6: resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.3 + '@babel/types': 7.22.5 + + /@babel/helper-hoist-variables@7.22.5: + resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.5 + dev: false + + /@babel/helper-member-expression-to-functions@7.22.5: + resolution: {integrity: sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.5 + dev: false /@babel/helper-module-imports@7.21.4: resolution: {integrity: sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.3 + '@babel/types': 7.22.5 /@babel/helper-module-transforms@7.22.1: resolution: {integrity: sha512-dxAe9E7ySDGbQdCVOY/4+UcD8M9ZFqZcZhSPsPacvCG4M+9lwtDDQfI2EoaSvmf7W/8yCBkGU0m7Pvt1ru3UZw==} @@ -589,31 +681,71 @@ packages: '@babel/helper-module-imports': 7.21.4 '@babel/helper-simple-access': 7.21.5 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/helper-validator-identifier': 7.19.1 + '@babel/helper-validator-identifier': 7.22.5 '@babel/template': 7.21.9 '@babel/traverse': 7.22.1 - '@babel/types': 7.22.3 + '@babel/types': 7.22.5 transitivePeerDependencies: - supports-color + /@babel/helper-optimise-call-expression@7.22.5: + resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.5 + dev: false + + /@babel/helper-plugin-utils@7.22.5: + resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} + engines: {node: '>=6.9.0'} + dev: false + + /@babel/helper-replace-supers@7.22.5: + resolution: {integrity: sha512-aLdNM5I3kdI/V9xGNyKSF3X/gTyMUBohTZ+/3QdQKAA9vxIiy12E+8E2HoOP1/DjeqU+g6as35QHJNMDDYpuCg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-environment-visitor': 7.22.5 + '@babel/helper-member-expression-to-functions': 7.22.5 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/template': 7.22.5 + '@babel/traverse': 7.22.6 + '@babel/types': 7.22.5 + transitivePeerDependencies: + - supports-color + dev: false + /@babel/helper-simple-access@7.21.5: resolution: {integrity: sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.3 + '@babel/types': 7.22.5 + + /@babel/helper-skip-transparent-expression-wrappers@7.22.5: + resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.5 + dev: false /@babel/helper-split-export-declaration@7.18.6: resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.3 + '@babel/types': 7.22.5 - /@babel/helper-string-parser@7.21.5: - resolution: {integrity: sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==} + /@babel/helper-split-export-declaration@7.22.6: + resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.5 + dev: false + + /@babel/helper-string-parser@7.22.5: + resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} engines: {node: '>=6.9.0'} - /@babel/helper-validator-identifier@7.19.1: - resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} + /@babel/helper-validator-identifier@7.22.5: + resolution: {integrity: sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==} engines: {node: '>=6.9.0'} /@babel/helper-validator-option@7.21.0: @@ -626,7 +758,7 @@ packages: dependencies: '@babel/template': 7.21.9 '@babel/traverse': 7.22.1 - '@babel/types': 7.22.3 + '@babel/types': 7.22.5 transitivePeerDependencies: - supports-color @@ -634,16 +766,50 @@ packages: resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-validator-identifier': 7.19.1 + '@babel/helper-validator-identifier': 7.22.5 chalk: 2.4.2 js-tokens: 4.0.0 - /@babel/parser@7.22.3: - resolution: {integrity: sha512-vrukxyW/ep8UD1UDzOYpTKQ6abgjFoeG6L+4ar9+c5TN9QnlqiOi6QK7LSR5ewm/ERyGkT/Ai6VboNrxhbr9Uw==} + /@babel/highlight@7.22.5: + resolution: {integrity: sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.22.5 + chalk: 2.4.2 + js-tokens: 4.0.0 + dev: false + + /@babel/parser@7.22.6: + resolution: {integrity: sha512-EIQu22vNkceq3LbjAq7knDf/UmtI2qbcNI8GRBlijez6TpQLvSodJPYfydQmNA5buwkxxxa/PVI44jjYZ+/cLw==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.22.3 + '@babel/types': 7.22.5 + + /@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.22.1): + resolution: {integrity: sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.1 + '@babel/helper-plugin-utils': 7.22.5 + dev: false + + /@babel/plugin-transform-typescript@7.22.5(@babel/core@7.22.1): + resolution: {integrity: sha512-SMubA9S7Cb5sGSFFUlqxyClTA9zWJ8qGQrppNUm05LtFuN1ELRFNndkix4zUJrC9F+YivWwa1dHMSyo0e0N9dA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.1 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.22.6(@babel/core@7.22.1) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.22.1) + transitivePeerDependencies: + - supports-color + dev: false /@babel/runtime@7.22.3: resolution: {integrity: sha512-XsDuspWKLUsxwCp6r7EhsExHtYfbe5oAGQ19kqngTdCPUoPQzOPdUbD/pB9PJiwb2ptYKQDjSJT3R6dC+EPqfQ==} @@ -656,8 +822,17 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.21.4 - '@babel/parser': 7.22.3 - '@babel/types': 7.22.3 + '@babel/parser': 7.22.6 + '@babel/types': 7.22.5 + + /@babel/template@7.22.5: + resolution: {integrity: sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.22.5 + '@babel/parser': 7.22.6 + '@babel/types': 7.22.5 + dev: false /@babel/traverse@7.22.1: resolution: {integrity: sha512-lAWkdCoUFnmwLBhIRLciFntGYsIIoC6vIbN8zrLPqBnJmPu7Z6nzqnKd7FsxQUNAvZfVZ0x6KdNvNp8zWIOHSQ==} @@ -669,19 +844,45 @@ packages: '@babel/helper-function-name': 7.21.0 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.22.3 - '@babel/types': 7.22.3 + '@babel/parser': 7.22.6 + '@babel/types': 7.22.5 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color + /@babel/traverse@7.22.6: + resolution: {integrity: sha512-53CijMvKlLIDlOTrdWiHileRddlIiwUIyCKqYa7lYnnPldXCG5dUSN38uT0cA6i7rHWNKJLH0VU/Kxdr1GzB3w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.22.5 + '@babel/generator': 7.22.5 + '@babel/helper-environment-visitor': 7.22.5 + '@babel/helper-function-name': 7.22.5 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.22.6 + '@babel/types': 7.22.5 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: false + /@babel/types@7.22.3: resolution: {integrity: sha512-P3na3xIQHTKY4L0YOG7pM8M8uoUIB910WQaSiiMCZUC2Cy8XFEQONGABFnHWBa2gpGKODTAJcNhi5Zk0sLRrzg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.21.5 - '@babel/helper-validator-identifier': 7.19.1 + '@babel/helper-string-parser': 7.22.5 + '@babel/helper-validator-identifier': 7.22.5 + to-fast-properties: 2.0.0 + + /@babel/types@7.22.5: + resolution: {integrity: sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.22.5 + '@babel/helper-validator-identifier': 7.22.5 to-fast-properties: 2.0.0 /@changesets/apply-release-plan@6.1.3: @@ -1550,7 +1751,7 @@ packages: dependencies: '@babel/core': 7.22.1 '@babel/generator': 7.22.3 - '@babel/parser': 7.22.3 + '@babel/parser': 7.22.6 '@babel/traverse': 7.22.1 '@babel/types': 7.22.3 javascript-natural-sort: 0.7.1 @@ -1893,6 +2094,11 @@ packages: dev: false optional: true + /@nicolo-ribaudo/semver-v6@6.3.3: + resolution: {integrity: sha512-3Yc1fUTs69MG/uZbJlLSI3JISMn2UV2rg+1D/vROUqZyh3l6iYHCs7GMp+M40ZD7yOdDbYjJcU1oTJhrc+dGKg==} + hasBin: true + dev: false + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -3647,6 +3853,35 @@ packages: '@types/estree': 1.0.1 dev: false + /@types/babel__core@7.20.1: + resolution: {integrity: sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==} + dependencies: + '@babel/parser': 7.22.6 + '@babel/types': 7.22.5 + '@types/babel__generator': 7.6.4 + '@types/babel__template': 7.4.1 + '@types/babel__traverse': 7.20.1 + dev: true + + /@types/babel__generator@7.6.4: + resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} + dependencies: + '@babel/types': 7.22.5 + dev: true + + /@types/babel__template@7.4.1: + resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} + dependencies: + '@babel/parser': 7.22.6 + '@babel/types': 7.22.5 + dev: true + + /@types/babel__traverse@7.20.1: + resolution: {integrity: sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==} + dependencies: + '@babel/types': 7.22.5 + dev: true + /@types/chai-subset@1.3.3: resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} dependencies: @@ -4163,6 +4398,15 @@ packages: engines: {node: '>=8'} dev: false + /assert@2.0.0: + resolution: {integrity: sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==} + dependencies: + es6-object-assign: 1.1.0 + is-nan: 1.3.2 + object-is: 1.1.5 + util: 0.12.5 + dev: false + /assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: false @@ -4170,6 +4414,13 @@ packages: /ast-types-flow@0.0.7: resolution: {integrity: sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==} + /ast-types@0.16.1: + resolution: {integrity: sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==} + engines: {node: '>=4'} + dependencies: + tslib: 2.5.2 + dev: false + /astring@1.8.5: resolution: {integrity: sha512-TuBbdn7jWVzf8dmFGTaRpW8qgANtWLi1qJLnkfGO5uVf6jf9f/F4B1H35tnOI+qVYZo3p3i8WZlbZOuPAE0wEA==} hasBin: true @@ -5257,6 +5508,10 @@ packages: is-date-object: 1.0.5 is-symbol: 1.0.4 + /es6-object-assign@1.1.0: + resolution: {integrity: sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==} + dev: false + /esbuild@0.17.19: resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} engines: {node: '>=12'} @@ -6629,6 +6884,13 @@ packages: engines: {node: '>=8'} dev: false + /is-generator-function@1.0.10: + resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: false + /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -6655,6 +6917,14 @@ packages: /is-map@2.0.2: resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} + /is-nan@1.3.2: + resolution: {integrity: sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + dev: false + /is-negative-zero@2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} @@ -8902,6 +9172,17 @@ packages: dependencies: picomatch: 2.3.1 + /recast@0.23.2: + resolution: {integrity: sha512-Qv6cPfVZyMOtPszK6PgW70pUgm7gPlFitAPf0Q69rlOA0zLw2XdDcNmPbVGYicFGT9O8I7TZ/0ryJD+6COvIPw==} + engines: {node: '>= 4'} + dependencies: + assert: 2.0.0 + ast-types: 0.16.1 + esprima: 4.0.1 + source-map: 0.6.1 + tslib: 2.5.2 + dev: false + /recharts-scale@0.4.5: resolution: {integrity: sha512-kivNFO+0OcUNu7jQquLXAxz1FIwZj8nrj+YkOKc5694NbjCvcT6aSZiIzNzd2Kul4o4rTto8QVR9lMNtxD4G1w==} dependencies: @@ -10330,6 +10611,16 @@ packages: /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + /util@0.12.5: + resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} + dependencies: + inherits: 2.0.4 + is-arguments: 1.1.1 + is-generator-function: 1.0.10 + is-typed-array: 1.1.10 + which-typed-array: 1.1.9 + dev: false + /uuid@8.3.2: resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} hasBin: true