diff --git a/package.json b/package.json index b93283d0..24373260 100644 --- a/package.json +++ b/package.json @@ -63,9 +63,7 @@ "build:vanilla_utils": "rollup -c --config-vanilla_utils", "build:react": "rollup -c --config-react", "build:react_utils": "rollup -c --config-react_utils", - "build:macro": "rollup -c --config-macro", - "build:macro_vite": "rollup -c --config-macro_vite", - "postbuild": "yarn patch-d-ts && yarn copy && yarn patch-macro-vite && yarn patch-old-ts && yarn patch-esm-ts", + "postbuild": "yarn patch-d-ts && yarn copy && yarn patch-old-ts && yarn patch-esm-ts", "prettier": "prettier '*.{js,json,md}' '{src,tests,docs}/**/*.{ts,tsx,md,mdx}' --write", "prettier:ci": "prettier '*.{js,json,md}' '{src,tests,docs}/**/*.{ts,tsx,md,mdx}' --list-different", "eslint": "eslint --no-eslintrc --c .eslintrc.json --fix '*.{js,json,ts}' '{src,tests}/**/*.{ts,tsx}'", @@ -75,7 +73,6 @@ "test:ci": "vitest", "patch-d-ts": "node -e \"var {entries}=require('./rollup.config.js');require('shelljs').find('dist/**/*.d.ts').forEach(f=>{entries.forEach(({find,replacement})=>require('shelljs').sed('-i',new RegExp(' from \\''+find.source.slice(0,-1)+'\\';$'),' from \\''+replacement+'\\';',f));require('shelljs').sed('-i',/ from '(\\.[^']+)\\.ts';$/,' from \\'\\$1\\';',f)})\"", "copy": "shx cp -r dist/src/* dist/esm && shx cp -r dist/src/* dist && shx rm -rf dist/{src,tests} && shx cp package.json readme.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.prettier=undefined;\"", - "patch-macro-vite": "shx cp dist/esm/macro/vite.d.ts dist/macro/", "patch-old-ts": "shx touch dist/ts_version_4.5_and_above_is_required.d.ts", "patch-esm-ts": "node -e \"require('shelljs').find('dist/esm/**/*.d.ts').forEach(f=>{var f2=f.replace(/\\.ts$/,'.mts');require('fs').renameSync(f,f2);require('shelljs').sed('-i',/ from '(\\.[^']+)';$/,' from \\'\\$1.mjs\\';',f2);require('shelljs').sed('-i',/^declare module '(\\.[^']+)'/,'declare module \\'\\$1.mjs\\'',f2)})\"" }, @@ -112,11 +109,9 @@ }, "devDependencies": { "@babel/core": "^7.23.2", - "@babel/helper-module-imports": "^7.22.15", "@babel/plugin-transform-react-jsx": "^7.22.15", "@babel/plugin-transform-typescript": "^7.22.15", "@babel/preset-env": "^7.23.2", - "@babel/types": "^7.23.0", "@redux-devtools/extension": "^3.2.5", "@rollup/plugin-alias": "^5.0.1", "@rollup/plugin-babel": "^6.0.4", @@ -125,7 +120,6 @@ "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-typescript": "^11.1.5", "@testing-library/react": "^14.0.0", - "@types/babel-plugin-macros": "^3.1.2", "@types/jsdom": "^21.1.4", "@types/react": "^18.2.34", "@types/react-dom": "^18.2.14", @@ -133,9 +127,6 @@ "@typescript-eslint/parser": "^6.9.1", "@vitest/coverage-v8": "0.33.0", "@vitest/ui": "0.33.0", - "aslemammad-vite-plugin-macro": "^1.0.0", - "babel-plugin-macros": "^3.1.0", - "babel-plugin-tester": "10.1.0", "concurrently": "^8.2.2", "esbuild": "^0.19.5", "eslint": "^8.52.0", diff --git a/src/macro.ts b/src/macro.ts deleted file mode 100644 index f6801e60..00000000 --- a/src/macro.ts +++ /dev/null @@ -1,50 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore -import { addNamed } from '@babel/helper-module-imports' -import type { NodePath } from '@babel/traverse' -import * as t from '@babel/types' -import { MacroError, createMacro } from 'babel-plugin-macros' - -const macro = ({ references }: any) => { - if (import.meta.env?.MODE !== 'production') { - console.warn('[DEPRECATED] Use useProxy hook instead.') - } - references.useProxy?.forEach((path: NodePath) => { - const hook = addNamed(path, 'useSnapshot', 'valtio') - const proxy = (path.parentPath?.get('arguments.0') as any)?.node - if (!t.isIdentifier(proxy)) throw new MacroError('no proxy object') - const snap = t.identifier(`valtio_macro_snap_${proxy.name}`) - path.parentPath?.parentPath?.replaceWith( - t.variableDeclaration('const', [ - t.variableDeclarator(snap, t.callExpression(hook, [proxy])), - ]), - ) - let inFunction = 0 - path.parentPath?.getFunctionParent()?.traverse({ - Identifier(p) { - if ( - inFunction === 0 && // in render - p.node !== proxy && - p.node.name === proxy.name - ) { - p.node.name = snap.name - } - }, - Function: { - enter() { - ++inFunction - }, - exit() { - --inFunction - }, - }, - }) - }) -} - -/** - * @deprecated Use useProxy hook instead. - */ -export declare function useProxy(proxyObject: T): void - -export default createMacro(macro, { configName: 'valtio' }) diff --git a/src/macro/vite.ts b/src/macro/vite.ts deleted file mode 100644 index d24bc5d4..00000000 --- a/src/macro/vite.ts +++ /dev/null @@ -1,73 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore -import * as babelModuleImports from '@babel/helper-module-imports' -import * as t from '@babel/types' -import * as plugin from 'aslemammad-vite-plugin-macro' -import * as babelMacro from 'babel-plugin-macros' - -const { defineMacro, defineMacroProvider, createMacroPlugin } = - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - ('default' in plugin ? plugin.default : plugin) as typeof plugin - -// const {} = plugin.default as typeof import('aslemammad-vite-plugin-macro') -export const valtioMacro = defineMacro(`useProxy`) - .withSignature(`(proxyObject: T): void`) - .withHandler((ctx) => { - const { path, args } = ctx - const hook = babelModuleImports.addNamed(path, 'useSnapshot', 'valtio') - const proxy = args[0]?.node - - if (!t.isIdentifier(proxy)) { - throw new babelMacro.MacroError('no proxy object') - } - - const snap = t.identifier(`valtio_macro_snap_${proxy.name}`) - path.parentPath?.replaceWith( - t.variableDeclaration('const', [ - t.variableDeclarator(snap, t.callExpression(hook, [proxy])), - ]), - ) - - let inFunction = 0 - path.parentPath?.getFunctionParent()?.traverse({ - Identifier(p) { - if ( - inFunction === 0 && // in render - p.node !== proxy && - p.node.name === proxy.name - ) { - p.node.name = snap.name - } - }, - Function: { - enter() { - ++inFunction - }, - exit() { - --inFunction - }, - }, - }) - }) - -export function provideValtioMacro() { - if (import.meta.env?.MODE !== 'production') { - console.warn('[DEPRECATED] Use useProxy hook instead.') - } - return defineMacroProvider({ - id: 'valtio/macro', - exports: { - 'valtio/macro': { - macros: [valtioMacro], - }, - }, - }) -} - -/** - * @deprecated Use useProxy hook instead. - */ -const macroPlugin = createMacroPlugin({}).use(provideValtioMacro()) - -export default macroPlugin diff --git a/src/vanilla/utils.ts b/src/vanilla/utils.ts index 5063b8ba..7c2c59b2 100644 --- a/src/vanilla/utils.ts +++ b/src/vanilla/utils.ts @@ -2,8 +2,6 @@ export { subscribeKey } from './utils/subscribeKey.ts' export { watch } from './utils/watch.ts' export { devtools } from './utils/devtools.ts' export { derive, underive, unstable_deriveSubscriptions } from 'derive-valtio' -export { addComputed_DEPRECATED as addComputed } from './utils/addComputed.ts' -export { proxyWithComputed_DEPRECATED as proxyWithComputed } from './utils/proxyWithComputed.ts' export { deepClone } from './utils/deepClone.ts' export { proxyWithHistory } from './utils/proxyWithHistory.ts' export { proxySet } from './utils/proxySet.ts' diff --git a/src/vanilla/utils/addComputed.ts b/src/vanilla/utils/addComputed.ts deleted file mode 100644 index 5cb5cad5..00000000 --- a/src/vanilla/utils/addComputed.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { derive } from 'derive-valtio' - -/** - * addComputed (DEPRECATED) - * - * @deprecated Please consider using `derive` or `proxyWithComputed` instead. - */ -export function addComputed_DEPRECATED( - proxyObject: T, - computedFns_FAKE: { - [K in keyof U]: (snap_FAKE: T) => U[K] - }, - targetObject: any = proxyObject, -) { - if (import.meta.env?.MODE !== 'production') { - console.warn( - 'addComputed is deprecated. Please consider using `derive`. Falling back to emulation with derive. https://github.com/pmndrs/valtio/pull/201', - ) - } - const derivedFns: { - [K in keyof U]: (get: any) => U[K] - } = {} as any - ;(Object.keys(computedFns_FAKE) as (keyof U)[]).forEach((key) => { - derivedFns[key] = (get) => computedFns_FAKE[key](get(proxyObject)) - }) - return derive(derivedFns, { proxy: targetObject }) -} diff --git a/src/vanilla/utils/devtools.ts b/src/vanilla/utils/devtools.ts index 026c8bdb..6eaf6f3c 100644 --- a/src/vanilla/utils/devtools.ts +++ b/src/vanilla/utils/devtools.ts @@ -21,19 +21,6 @@ type Options = { name?: string } & Config -export function devtools( - proxyObject: T, - options?: Options, -): (() => void) | undefined - -/** - * @deprecated Please use { name } option - */ -export function devtools( - proxyObject: T, - name?: string, -): (() => void) | undefined - /** * devtools * @@ -47,14 +34,8 @@ export function devtools( */ export function devtools( proxyObject: T, - options?: Options | string, -) { - if (typeof options === 'string') { - console.warn( - 'string name option is deprecated, use { name }. https://github.com/pmndrs/valtio/pull/400', - ) - options = { name: options } - } + options?: Options, +): (() => void) | undefined { const { enabled, name = '', ...rest } = options || {} let extension: (typeof window)['__REDUX_DEVTOOLS_EXTENSION__'] | false diff --git a/src/vanilla/utils/proxyWithComputed.ts b/src/vanilla/utils/proxyWithComputed.ts deleted file mode 100644 index a1f41dd4..00000000 --- a/src/vanilla/utils/proxyWithComputed.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { proxy, snapshot } from '../../vanilla.ts' -import type { INTERNAL_Snapshot as Snapshot } from '../../vanilla.ts' - -/** - * proxyWithComputed (DEPRECATED) - * - * @deprecated Please follow "Computed Properties" guide in docs. - */ -export function proxyWithComputed_DEPRECATED< - T extends object, - U extends object, ->( - initialObject: T, - computedFns: { - [K in keyof U]: - | ((snap: Snapshot) => U[K]) - | { - get: (snap: Snapshot) => U[K] - set?: (state: T, newValue: U[K]) => void - } - }, -) { - if (import.meta.env?.MODE !== 'production') { - console.warn( - 'proxyWithComputed is deprecated. Please follow "Computed Properties" guide in docs.', - ) - } - ;(Object.keys(computedFns) as (keyof U)[]).forEach((key) => { - if (Object.getOwnPropertyDescriptor(initialObject, key)) { - throw new Error('object property already defined') - } - const computedFn = computedFns[key] - const { get, set } = ( - typeof computedFn === 'function' ? { get: computedFn } : computedFn - ) as { - get: (snap: Snapshot) => U[typeof key] - set?: (state: T, newValue: U[typeof key]) => void - } - const desc: PropertyDescriptor = {} - desc.get = () => get(snapshot(proxyObject)) - if (set) { - desc.set = (newValue) => set(proxyObject, newValue) - } - Object.defineProperty(initialObject, key, desc) - }) - const proxyObject = proxy(initialObject) as T & U - return proxyObject -} diff --git a/tests/__snapshots__/macro-vite.test.ts.snap b/tests/__snapshots__/macro-vite.test.ts.snap deleted file mode 100644 index ab9d8265..00000000 --- a/tests/__snapshots__/macro-vite.test.ts.snap +++ /dev/null @@ -1,34 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`basic 1`] = ` -"import { useSnapshot as _useSnapshot } from \\"valtio\\"; - - -const Component = () => {const valtio_macro_snap_state = _useSnapshot( - state); - return ( -
- {valtio_macro_snap_state.count} - -
); - -};" -`; - -exports[`complex 1`] = ` -"import { useSnapshot as _useSnapshot } from \\"valtio\\"; - - -const Component = () => {const valtio_macro_snap_state = _useSnapshot( - state); - return ( -
- - {valtio_macro_snap_state.count} -
); - -};" -`; diff --git a/tests/__snapshots__/macro.test.ts.snap b/tests/__snapshots__/macro.test.ts.snap deleted file mode 100644 index 3ea4fd2a..00000000 --- a/tests/__snapshots__/macro.test.ts.snap +++ /dev/null @@ -1,71 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`valtio/macro > 1. valtio/macro > 1. valtio/macro 1`] = ` -" -import { useProxy } from '../dist/macro' - -const Component = () => { - useProxy(state) - return ( -
- {state.count} - -
- ) -} - - ↓ ↓ ↓ ↓ ↓ ↓ - -import { useSnapshot as _useSnapshot } from 'valtio' -const Component = () => { - const valtio_macro_snap_state = _useSnapshot(state) - return ( -
- {valtio_macro_snap_state.count} - -
- ) -} - -" -`; - -exports[`valtio/macro > 2. valtio/macro > 2. valtio/macro 1`] = ` -" -import { useProxy } from '../dist/macro' - -const Component = () => { - useProxy(state) - return ( -
- - {state.count} -
- ) -} - - ↓ ↓ ↓ ↓ ↓ ↓ - -import { useSnapshot as _useSnapshot } from 'valtio' -const Component = () => { - const valtio_macro_snap_state = _useSnapshot(state) - return ( -
- - {valtio_macro_snap_state.count} -
- ) -} - -" -`; diff --git a/tests/computed.test.tsx b/tests/computed.test.tsx deleted file mode 100644 index e223b7e9..00000000 --- a/tests/computed.test.tsx +++ /dev/null @@ -1,327 +0,0 @@ -/// - -import ReactExports, { StrictMode, Suspense } from 'react' -import { fireEvent, render } from '@testing-library/react' -import { memoize } from 'proxy-memoize' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { proxy, snapshot, subscribe, useSnapshot } from 'valtio' -import { addComputed, proxyWithComputed, subscribeKey } from 'valtio/utils' - -const { use } = ReactExports -const use2 = (x: T): Awaited => (x instanceof Promise ? use(x) : x) - -const consoleWarn = console.warn -beforeEach(() => { - console.warn = vi.fn((message: string) => { - if (message.startsWith('addComputed is deprecated.')) { - return - } - consoleWarn(message) - }) -}) -afterEach(() => { - console.warn = consoleWarn -}) - -const sleep = (ms: number) => - new Promise((resolve) => { - setTimeout(resolve, ms) - }) - -describe('proxyWithComputed', () => { - it('simple computed getters', async () => { - const computeDouble = vi.fn((x: number) => x * 2) - const state = proxyWithComputed( - { - text: '', - count: 0, - }, - { - doubled: { get: memoize((snap) => computeDouble(snap.count)) }, - }, - ) - - const callback = vi.fn() - subscribe(state, callback) - - expect(snapshot(state)).toMatchObject({ text: '', count: 0, doubled: 0 }) - expect(computeDouble).toBeCalledTimes(1) - expect(callback).toBeCalledTimes(0) - - state.count += 1 - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: '', count: 1, doubled: 2 }) - expect(computeDouble).toBeCalledTimes(2) - expect(callback).toBeCalledTimes(1) - - state.text = 'a' - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: 'a', count: 1, doubled: 2 }) - expect(computeDouble).toBeCalledTimes(2) - expect(callback).toBeCalledTimes(2) - }) - - it('computed getters and setters', async () => { - const computeDouble = vi.fn((x: number) => x * 2) - const state = proxyWithComputed( - { - text: '', - count: 0, - }, - { - doubled: { - get: memoize((snap) => computeDouble(snap.count)), - set: (state, newValue: number) => { - state.count = newValue / 2 - }, - }, - }, - ) - - expect(snapshot(state)).toMatchObject({ text: '', count: 0, doubled: 0 }) - expect(computeDouble).toBeCalledTimes(1) - - state.count += 1 - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: '', count: 1, doubled: 2 }) - expect(computeDouble).toBeCalledTimes(2) - - state.doubled = 1 - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: '', count: 0.5, doubled: 1 }) - expect(computeDouble).toBeCalledTimes(3) - - state.text = 'a' - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: 'a', count: 0.5, doubled: 1 }) - expect(computeDouble).toBeCalledTimes(3) - }) - - it('computed setters with object and array', async () => { - const state = proxyWithComputed( - { - obj: { a: 1 }, - arr: [2], - }, - { - object: { - get: memoize((snap) => snap.obj), - set: (state, newValue: any) => { - state.obj = newValue - }, - }, - array: { - get: (snap) => snap.arr, - set: (state, newValue: any) => { - state.arr = newValue - }, - }, - }, - ) - - expect(snapshot(state)).toMatchObject({ - obj: { a: 1 }, - arr: [2], - object: { a: 1 }, - array: [2], - }) - - state.object = { a: 2 } - state.array = [3] - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ - obj: { a: 2 }, - arr: [3], - object: { a: 2 }, - array: [3], - }) - }) - - it('render computed getter with condition (#435)', async () => { - const state = proxyWithComputed( - { - texts: [] as string[], - filter: '', - }, - { - filtered: memoize((snap) => { - if (!snap.filter) return snap.texts - return snap.texts.filter((text) => !text.includes(snap.filter)) - }), - }, - ) - - const Component = () => { - const snap = useSnapshot(state) - return ( - <> -
filtered: [{snap.filtered.join(',')}]
- - - ) - } - - const { getByText, findByText } = render( - - - , - ) - - await findByText('filtered: []') - - fireEvent.click(getByText('button')) - await findByText('filtered: [foo]') - }) -}) - -describe('DEPRECATED addComputed', () => { - it('simple addComputed', async () => { - const computeDouble = vi.fn((x: number) => x * 2) - const state = proxy({ - text: '', - count: 0, - }) - addComputed(state, { - doubled: (snap) => computeDouble(snap.count), - }) - - const callback = vi.fn() - subscribe(state, callback) - - expect(snapshot(state)).toMatchObject({ text: '', count: 0, doubled: 0 }) - expect(computeDouble).toBeCalledTimes(1) - expect(callback).toBeCalledTimes(0) - - state.count += 1 - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: '', count: 1, doubled: 2 }) - expect(computeDouble).toBeCalledTimes(2) - await Promise.resolve() - expect(callback).toBeCalledTimes(1) - - state.text = 'a' - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ text: 'a', count: 1, doubled: 2 }) - // This can't pass with derive emulation: expect(computeDouble).toBeCalledTimes(2) - expect(callback).toBeCalledTimes(2) - }) - - it.skipIf(typeof use === 'undefined')('async addComputed', async () => { - const state = proxy({ count: 0 }) - addComputed(state, { - delayedCount: async (snap) => { - await sleep(300) - return snap.count + 1 - }, - }) - - const Counter = () => { - const snap = useSnapshot( - state as { count: number; delayedCount: Promise }, - ) - return ( - <> -
- count: {snap.count}, delayedCount: {use2(snap.delayedCount)} -
- - - ) - } - - const { getByText, findByText } = render( - - - - - , - ) - - await findByText('loading') - await findByText('count: 0, delayedCount: 1') - - fireEvent.click(getByText('button')) - await findByText('loading') - await findByText('count: 1, delayedCount: 2') - }) - - it('nested emulation with addComputed', async () => { - const computeDouble = vi.fn((x: number) => x * 2) - const state = proxy({ text: '', math: { count: 0 } }) - addComputed( - state, - { - doubled: (snap) => computeDouble(snap.math.count), - }, - state.math, - ) - - const callback = vi.fn() - subscribe(state, callback) - - expect(snapshot(state)).toMatchObject({ - text: '', - math: { count: 0, doubled: 0 }, - }) - expect(computeDouble).toBeCalledTimes(1) - expect(callback).toBeCalledTimes(0) - - state.math.count += 1 - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ - text: '', - math: { count: 1, doubled: 2 }, - }) - expect(computeDouble).toBeCalledTimes(2) - await Promise.resolve() - expect(callback).toBeCalledTimes(1) - - state.text = 'a' - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ - text: 'a', - math: { count: 1, doubled: 2 }, - }) - // This can't pass with derive emulation: expect(computeDouble).toBeCalledTimes(2) - expect(callback).toBeCalledTimes(2) - }) - - it('addComputed with array.pop (#124)', async () => { - const state = proxy({ - arr: [{ n: 1 }, { n: 2 }, { n: 3 }], - }) - addComputed(state, { - nums: (snap) => snap.arr.map((item) => item.n), - }) - - expect(snapshot(state)).toMatchObject({ - arr: [{ n: 1 }, { n: 2 }, { n: 3 }], - nums: [1, 2, 3], - }) - - state.arr.pop() - await Promise.resolve() - expect(snapshot(state)).toMatchObject({ - arr: [{ n: 1 }, { n: 2 }], - nums: [1, 2], - }) - }) -}) - -describe('proxyWithComputed and subscribeKey', () => { - it('should call subscribeKey subscription when computed value changes?', async () => { - const state = proxyWithComputed( - { - count: 1, - }, - { - doubled: (snap) => snap.count * 2, - }, - ) - const handler = vi.fn() - subscribeKey(state, 'doubled', handler) - state.count = 2 - await Promise.resolve() - expect(handler).toBeCalledTimes(1) - }) -}) diff --git a/tests/macro-vite.test.ts b/tests/macro-vite.test.ts deleted file mode 100644 index a89c97c3..00000000 --- a/tests/macro-vite.test.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { EnvContext } from '@typed-macro/core' -import { createTransformer } from '@typed-macro/runtime' -import { expect, it } from 'vitest' -import { valtioMacro } from 'valtio/macro/vite' - -const env: EnvContext = { - host: 'test', - packageManager: 'test', - projectPath: [''], - dev: true, - ssr: false, -} - -it('basic', async () => { - const transform = createTransformer({}) - transform.appendMacros('valtio/macro', [valtioMacro]) - - expect( - transform.transform( - ` -import { useProxy } from 'valtio/macro' - -const Component = () => { - useProxy(state) - return ( -
- {state.count} - -
- ) -} -`, - 'test.ts', - env, - ), - ).toMatchSnapshot() -}) - -it('complex', async () => { - const transform = createTransformer({}) - transform.appendMacros('valtio/macro', [valtioMacro]) - - expect( - transform.transform( - ` -import { useProxy } from 'valtio/macro' - -const Component = () => { - useProxy(state) - return ( -
- - {state.count} -
- ) -} -`, - 'test.ts', - env, - ), - ).toMatchSnapshot() -}) diff --git a/tests/macro.test.ts b/tests/macro.test.ts deleted file mode 100644 index 34ddbf4c..00000000 --- a/tests/macro.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import plugin from 'babel-plugin-macros' -import BabelPluginTester from 'babel-plugin-tester' -import { describe, expect, it } from 'vitest' - -// @ts-ignore -globalThis.describe = describe -// @ts-ignore -globalThis.it = it -// @ts-ignore -globalThis.expect = expect - -const pluginTester = (BabelPluginTester as any).default || BabelPluginTester - -pluginTester({ - pluginName: 'valtio/macro', - plugin, - snapshot: true, - babelOptions: { - filename: './valtio/tests', - parserOpts: { plugins: ['jsx'] }, - }, - tests: [ - ` -import { useProxy } from '../dist/macro' - -const Component = () => { - useProxy(state) - return ( -
- {state.count} - -
- ) -} -`, - ` -import { useProxy } from '../dist/macro' - -const Component = () => { - useProxy(state) - return ( -
- - {state.count} -
- ) -} -`, - ], -}) diff --git a/yarn.lock b/yarn.lock index 8c99ae3c..425392e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,7 +15,7 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.22.13": +"@babel/code-frame@^7.10.4", "@babel/code-frame@^7.22.13": version "7.22.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== @@ -29,32 +29,32 @@ integrity sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ== "@babel/core@^7.23.2": - version "7.23.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.2.tgz#ed10df0d580fff67c5f3ee70fd22e2e4c90a9f94" - integrity sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.3.tgz#5ec09c8803b91f51cc887dedc2654a35852849c9" + integrity sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew== dependencies: "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.22.13" - "@babel/generator" "^7.23.0" + "@babel/generator" "^7.23.3" "@babel/helper-compilation-targets" "^7.22.15" - "@babel/helper-module-transforms" "^7.23.0" + "@babel/helper-module-transforms" "^7.23.3" "@babel/helpers" "^7.23.2" - "@babel/parser" "^7.23.0" + "@babel/parser" "^7.23.3" "@babel/template" "^7.22.15" - "@babel/traverse" "^7.23.2" - "@babel/types" "^7.23.0" + "@babel/traverse" "^7.23.3" + "@babel/types" "^7.23.3" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.15.8", "@babel/generator@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420" - integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g== +"@babel/generator@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.3.tgz#86e6e83d95903fbe7613f448613b8b319f330a8e" + integrity sha512-keeZWAV4LU3tW0qRi19HRpabC/ilM0HRBBzf9/k8FFiG4KVpiv0FIy4hHfLfFQZNhziCTPTmd59zoyv6DNISzg== dependencies: - "@babel/types" "^7.23.0" + "@babel/types" "^7.23.3" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" @@ -164,6 +164,17 @@ "@babel/helper-split-export-declaration" "^7.22.6" "@babel/helper-validator-identifier" "^7.22.20" +"@babel/helper-module-transforms@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" + integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-module-imports" "^7.22.15" + "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/helper-validator-identifier" "^7.22.20" + "@babel/helper-optimise-call-expression@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" @@ -257,11 +268,16 @@ chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.15.8", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.0": +"@babel/parser@^7.22.15": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719" integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== +"@babel/parser@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.3.tgz#0ce0be31a4ca4f1884b5786057cadcb6c3be58f9" + integrity sha512-uVsWNvlVsIninV2prNz/3lHCb+5CJ+e+IUBfbjToAHODtfGYLfCFuY4AU7TskI+dAKk+njsPiBjq1gKTvZOBaw== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.15": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.15.tgz#02dc8a03f613ed5fdc29fb2f728397c78146c962" @@ -347,9 +363,9 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918" - integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz#8f2e4f8a9b5f9aa16067e142c1ac9cd9f810f473" + integrity sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -409,10 +425,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz#aac8d383b062c5072c647a31ef990c1d0af90272" - integrity sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ== +"@babel/plugin-syntax-typescript@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz#24f460c85dbbc983cd2b9c4994178bcc01df958f" + integrity sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ== dependencies: "@babel/helper-plugin-utils" "^7.22.5" @@ -793,14 +809,14 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-transform-typescript@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.22.15.tgz#15adef906451d86349eb4b8764865c960eb54127" - integrity sha512-1uirS0TnijxvQLnlv5wQBwOX3E1wCFX7ITv+9pBV2wKEk4K+M5tqDaoNXnTH8tjEIYHLO98MwiTWO04Ggz4XuA== + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.23.3.tgz#ce806e6cb485d468c48c4f717696719678ab0138" + integrity sha512-ogV0yWnq38CFwH20l2Afz0dfKuZBx9o/Y2Rmh5vuSS0YD1hswgEgTfyTzuSrT2q9btmHRSqYoSfwFUVaC1M1Jw== dependencies: "@babel/helper-annotate-as-pure" "^7.22.5" "@babel/helper-create-class-features-plugin" "^7.22.15" "@babel/helper-plugin-utils" "^7.22.5" - "@babel/plugin-syntax-typescript" "^7.22.5" + "@babel/plugin-syntax-typescript" "^7.23.3" "@babel/plugin-transform-unicode-escapes@^7.22.10": version "7.22.10" @@ -940,7 +956,7 @@ dependencies: regenerator-runtime "^0.14.0" -"@babel/template@^7.15.4", "@babel/template@^7.22.15", "@babel/template@^7.22.5": +"@babel/template@^7.22.15", "@babel/template@^7.22.5": version "7.22.15" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== @@ -949,23 +965,23 @@ "@babel/parser" "^7.22.15" "@babel/types" "^7.22.15" -"@babel/traverse@^7.15.4", "@babel/traverse@^7.23.2": - version "7.23.2" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.2.tgz#329c7a06735e144a506bdb2cad0268b7f46f4ad8" - integrity sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw== +"@babel/traverse@^7.23.2", "@babel/traverse@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.3.tgz#26ee5f252e725aa7aca3474aa5b324eaf7908b5b" + integrity sha512-+K0yF1/9yR0oHdE0StHuEj3uTPzwwbrLGfNOndVJVV2TqA5+j3oljJUb4nmB954FLGjNem976+B+eDuLIjesiQ== dependencies: "@babel/code-frame" "^7.22.13" - "@babel/generator" "^7.23.0" + "@babel/generator" "^7.23.3" "@babel/helper-environment-visitor" "^7.22.20" "@babel/helper-function-name" "^7.23.0" "@babel/helper-hoist-variables" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.23.0" - "@babel/types" "^7.23.0" + "@babel/parser" "^7.23.3" + "@babel/types" "^7.23.3" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.15.6", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.4.4": +"@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.4.4": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb" integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg== @@ -974,6 +990,15 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.3.tgz#d5ea892c07f2ec371ac704420f4dcdb07b5f9598" + integrity sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw== + dependencies: + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -1502,96 +1527,11 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== -"@typed-macro/core@1.0.0-alpha.1": - version "1.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/@typed-macro/core/-/core-1.0.0-alpha.1.tgz#a1e53bda569e48e0d4d640606b0cd3563fbd9178" - integrity sha512-Io7F9hZVuj5UXBrJBYlEdOThxV0/S3jweJqKs936a4nnXxmePa91EFkSFdtAPMXo76Eyl0748WUPIF131dfciQ== - dependencies: - "@babel/generator" "^7.15.8" - "@babel/parser" "^7.15.8" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" - "@typed-macro/shared" "1.0.0-alpha.1" - "@types/babel__generator" "^7.6.3" - "@types/babel__template" "^7.4.1" - "@types/babel__traverse" "^7.14.2" - -"@typed-macro/runtime@1.0.0-alpha.1": - version "1.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/@typed-macro/runtime/-/runtime-1.0.0-alpha.1.tgz#d5ba549be737c43e7c1a626798f938cdd5500ff6" - integrity sha512-u+4Wb909rzcTqGHWyisfmbkgDqGQr810hDt5WsIBHcLrEnJMw7CXlb70FQ41Ij2NJkGUzF4Ay25NLou6jYPlcg== - dependencies: - "@babel/generator" "^7.15.8" - "@babel/parser" "^7.15.8" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" - "@typed-macro/core" "1.0.0-alpha.1" - "@typed-macro/shared" "1.0.0-alpha.1" - "@types/babel__generator" "^7.6.3" - "@types/babel__template" "^7.4.1" - "@types/babel__traverse" "^7.14.2" - picomatch "^2.3.0" - -"@typed-macro/shared@1.0.0-alpha.1": - version "1.0.0-alpha.1" - resolved "https://registry.yarnpkg.com/@typed-macro/shared/-/shared-1.0.0-alpha.1.tgz#c00cdfd3c7dfd6365c6bccbad9b0c05c3aa47047" - integrity sha512-4qw1Dtfkzj/dkVut8oCkfRa5y0YZzmklK0GYMA3E6+JofqJSpZfX1SvM6+Iv40kiSZz74XgqUXet645vZh3X1A== - "@types/aria-query@^5.0.1": version "5.0.3" resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-5.0.3.tgz#07570ebd25f9b516c910a91f7244052c9b58eabc" integrity sha512-0Z6Tr7wjKJIk4OUEjVUQMtyunLDy339vcMaj38Kpj6jM2OE1p3S4kXExKZ7a3uXQAPCoy3sbrP1wibDKaf39oA== -"@types/babel-plugin-macros@^3.1.2": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@types/babel-plugin-macros/-/babel-plugin-macros-3.1.2.tgz#f0ff713d44a00b7c1c69b3aaffb53e39f80eff6c" - integrity sha512-reO/Op5+rVgMPajMQslgFtoBtUMkkVVUkcXmsz8hLEHq1A2gr3JyHmrs+s2rJjhPKJIi2S2p/fj0q6BYP111Uw== - dependencies: - "@types/babel__core" "*" - -"@types/babel-plugin-tester@^9.0.0": - version "9.0.8" - resolved "https://registry.yarnpkg.com/@types/babel-plugin-tester/-/babel-plugin-tester-9.0.8.tgz#7e392d7aebd171234c3f86c0bb346787f5976260" - integrity sha512-X7tIuDs4wKBaCtV62vofhCr7MexAFNTqqPGEirI3iU++WKcIlh6rdNfM/VWJK/4gk/nm9dwju5ymBy2ZWDFYDA== - dependencies: - "@types/babel__core" "*" - "@types/prettier" "^2.0.0" - -"@types/babel__core@*": - version "7.20.3" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.3.tgz#d5625a50b6f18244425a1359a858c73d70340778" - integrity sha512-54fjTSeSHwfan8AyHWrKbfBWiEUrNTZsUwPTDSNaaP1QDQIZbeNUg3a59E9D+375MzUw/x1vx2/0F5LBz+AeYA== - dependencies: - "@babel/parser" "^7.20.7" - "@babel/types" "^7.20.7" - "@types/babel__generator" "*" - "@types/babel__template" "*" - "@types/babel__traverse" "*" - -"@types/babel__generator@*", "@types/babel__generator@^7.6.3": - version "7.6.6" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.6.tgz#676f89f67dc8ddaae923f70ebc5f1fa800c031a8" - integrity sha512-66BXMKb/sUWbMdBNdMvajU7i/44RkrA3z/Yt1c7R5xejt8qh84iU54yUWCtm0QwGJlDcf/gg4zd/x4mpLAlb/w== - dependencies: - "@babel/types" "^7.0.0" - -"@types/babel__template@*", "@types/babel__template@^7.4.1": - version "7.4.3" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.3.tgz#db9ac539a2fe05cfe9e168b24f360701bde41f5f" - integrity sha512-ciwyCLeuRfxboZ4isgdNZi/tkt06m8Tw6uGbBSBgWrnnZGNXiEyM27xc/PjXGQLqlZ6ylbgHMnm7ccF9tCkOeQ== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - -"@types/babel__traverse@*", "@types/babel__traverse@^7.14.2": - version "7.20.3" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.3.tgz#a971aa47441b28ef17884ff945d0551265a2d058" - integrity sha512-Lsh766rGEFbaxMIDH7Qa+Yha8cMVI3qAK6CHt3OR0YfxOIn5Z54iHiyDRycHrBqeIiqGa20Kpsv1cavfBKkRSw== - dependencies: - "@babel/types" "^7.20.7" - "@types/chai-subset@^1.3.3": version "1.3.4" resolved "https://registry.yarnpkg.com/@types/chai-subset/-/chai-subset-1.3.4.tgz#7938fa929dd12db451457e4d6faa27bcd599a729" @@ -1640,16 +1580,6 @@ dependencies: undici-types "~5.26.4" -"@types/parse-json@^4.0.0": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.1.tgz#27f7559836ad796cea31acb63163b203756a5b4e" - integrity sha512-3YmXzzPAdOTVljVMkTMBdBEvlOLg2cDQaDhnnhT3nT9uDbnJzjWhKlzb+desT12Y7tGqaN6d+AbozcKzyL36Ng== - -"@types/prettier@^2.0.0": - version "2.7.3" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.3.tgz#3e51a17e291d01d17d3fc61422015a933af7a08f" - integrity sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA== - "@types/prop-types@*": version "15.7.9" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.9.tgz#b6f785caa7ea1fe4414d9df42ee0ab67f23d8a6d" @@ -1915,14 +1845,6 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== -anymatch@~3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - argparse@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" @@ -2014,16 +1936,6 @@ arraybuffer.prototype.slice@^1.0.2: is-array-buffer "^3.0.2" is-shared-array-buffer "^1.0.2" -aslemammad-vite-plugin-macro@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/aslemammad-vite-plugin-macro/-/aslemammad-vite-plugin-macro-1.0.0.tgz#e19f018af4d3ca045a9c34e7245157670a244e78" - integrity sha512-PFxmuU34aHoA6yNSsV5apBUB06xL2d3raSeEhdjzsN514kWRSzpTTwGV3hYw2PsqUxy9SyXAFD9TIqg3Rj5zNg== - dependencies: - "@typed-macro/core" "1.0.0-alpha.1" - "@typed-macro/runtime" "1.0.0-alpha.1" - "@typed-macro/shared" "1.0.0-alpha.1" - chokidar "^3.5.2" - assertion-error@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" @@ -2046,15 +1958,6 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -babel-plugin-macros@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" - integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg== - dependencies: - "@babel/runtime" "^7.12.5" - cosmiconfig "^7.0.0" - resolve "^1.19.0" - babel-plugin-polyfill-corejs2@^0.4.6: version "0.4.6" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.6.tgz#b2df0251d8e99f229a8e60fc4efa9a68b41c8313" @@ -2079,16 +1982,6 @@ babel-plugin-polyfill-regenerator@^0.5.3: dependencies: "@babel/helper-define-polyfill-provider" "^0.4.3" -babel-plugin-tester@10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-tester/-/babel-plugin-tester-10.1.0.tgz#e099ee1d8dec538439c427a7d12aad132885757b" - integrity sha512-4P2tNaM/Mtg6ytA9YAqmgONnMYqWvdbGDuwRTpIIC9yFZGQrEHoyvDPCx+X1QALAufVb5DKieOPGj5dffiEiNg== - dependencies: - "@types/babel-plugin-tester" "^9.0.0" - lodash.mergewith "^4.6.2" - prettier "^2.0.1" - strip-indent "^3.0.0" - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -2099,11 +1992,6 @@ big-integer@^1.6.44: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - bplist-parser@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/bplist-parser/-/bplist-parser-0.2.0.tgz#43a9d183e5bf9d545200ceac3e712f79ebbe8d0e" @@ -2119,7 +2007,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^3.0.2, braces@~3.0.2: +braces@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== @@ -2214,21 +2102,6 @@ check-error@^1.0.3: dependencies: get-func-name "^2.0.2" -chokidar@^3.5.2: - version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - cliui@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" @@ -2306,17 +2179,6 @@ core-js-compat@^3.31.0, core-js-compat@^3.33.1: dependencies: browserslist "^4.22.1" -cosmiconfig@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" - integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== - dependencies: - "@types/parse-json" "^4.0.0" - import-fresh "^3.2.1" - parse-json "^5.0.0" - path-type "^4.0.0" - yaml "^1.10.0" - cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -2518,13 +2380,6 @@ entities@^4.4.0: resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - es-abstract@^1.22.1: version "1.22.3" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.3.tgz#48e79f5573198de6dee3589195727f4f74bc4f32" @@ -3092,7 +2947,7 @@ get-tsconfig@^4.7.2: dependencies: resolve-pkg-maps "^1.0.0" -glob-parent@^5.1.2, glob-parent@~5.1.2: +glob-parent@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -3320,11 +3175,6 @@ is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: get-intrinsic "^1.2.0" is-typed-array "^1.1.10" -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== - is-async-function@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-async-function/-/is-async-function-2.0.0.tgz#8e4418efd3e5d3a6ebb0164c05ef5afb69aa9646" @@ -3339,13 +3189,6 @@ is-bigint@^1.0.1: dependencies: has-bigints "^1.0.1" -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - is-boolean-object@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" @@ -3414,7 +3257,7 @@ is-generator-function@^1.0.10: dependencies: has-tostringtag "^1.0.0" -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -3651,11 +3494,6 @@ json-buffer@3.0.1: resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -3713,11 +3551,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - local-pkg@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.3.tgz#0ff361ab3ae7f1c19113d9bb97b98b905dbc4963" @@ -3740,11 +3573,6 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.mergewith@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55" - integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ== - lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -3837,11 +3665,6 @@ mimic-fn@^4.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== -min-indent@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" - integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== - minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -3894,11 +3717,6 @@ node-releases@^2.0.13: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" @@ -4067,16 +3885,6 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - parse5@^7.0.0, parse5@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" @@ -4129,7 +3937,7 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.0, picomatch@^2.3.1: +picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -4169,11 +3977,6 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.0.1: - version "2.8.8" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" - integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== - prettier@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" @@ -4275,13 +4078,6 @@ react@18.3.0-canary-c47c306a7-20231109: dependencies: loose-envify "^1.1.0" -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -4380,7 +4176,7 @@ resolve-pkg-maps@^1.0.0: resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== -resolve@^1.1.6, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.22.1, resolve@^1.22.4: +resolve@^1.1.6, resolve@^1.14.2, resolve@^1.22.1, resolve@^1.22.4: version "1.22.8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -4743,13 +4539,6 @@ strip-final-newline@^3.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz#52894c313fbff318835280aed60ff71ebf12b8fd" integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== -strip-indent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" - integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== - dependencies: - min-indent "^1.0.0" - strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -5249,11 +5038,6 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^1.10.0: - version "1.10.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" - integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== - yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"