diff --git a/package.json b/package.json index f8f2d49..b9a4ebb 100644 --- a/package.json +++ b/package.json @@ -33,13 +33,5 @@ "node": "22.11.0", "pnpm": "9.14.2" }, - "pnpm": { - "patchedDependencies": { - "fixturify-project": "patches/fixturify-project.patch" - }, - "overrides": { - "@sveltejs/vite-plugin-svelte": "^4.0.0" - } - }, "packageManager": "pnpm@9.14.2+sha512.6e2baf77d06b9362294152c851c4f278ede37ab1eba3a55fda317a4a17b209f4dbb973fb250a77abc463a341fcb1f17f17cfa24091c4eb319cda0d9b84278387" } diff --git a/packages/core/.gitignore b/packages/core/.gitignore new file mode 100644 index 0000000..53c37a1 --- /dev/null +++ b/packages/core/.gitignore @@ -0,0 +1 @@ +dist \ No newline at end of file diff --git a/packages/svelte/src/lib/handlers/default.ts b/packages/core/handlers/default.ts similarity index 100% rename from packages/svelte/src/lib/handlers/default.ts rename to packages/core/handlers/default.ts diff --git a/packages/svelte/src/lib/handlers/drop.ts b/packages/core/handlers/drop.ts similarity index 100% rename from packages/svelte/src/lib/handlers/drop.ts rename to packages/core/handlers/drop.ts diff --git a/packages/svelte/src/lib/handlers/enqueue.ts b/packages/core/handlers/enqueue.ts similarity index 100% rename from packages/svelte/src/lib/handlers/enqueue.ts rename to packages/core/handlers/enqueue.ts diff --git a/packages/svelte/src/lib/handlers/keep_latest.ts b/packages/core/handlers/keep_latest.ts similarity index 100% rename from packages/svelte/src/lib/handlers/keep_latest.ts rename to packages/core/handlers/keep_latest.ts diff --git a/packages/svelte/src/lib/handlers/restart.ts b/packages/core/handlers/restart.ts similarity index 93% rename from packages/svelte/src/lib/handlers/restart.ts rename to packages/core/handlers/restart.ts index 5172526..06324a0 100644 --- a/packages/svelte/src/lib/handlers/restart.ts +++ b/packages/core/handlers/restart.ts @@ -9,7 +9,7 @@ const handler = (({ max = 1 }: { max?: number } = { max: 1 }) => { if (running_controllers.size >= max) { const first = running_controllers.values().next(); first.value?.abort(); - running_controllers.delete(first.value); + running_controllers.delete(first.value!); } running_controllers.add(utils.abort_controller); try { diff --git a/packages/svelte/src/lib/handlers/types.ts b/packages/core/handlers/types.ts similarity index 100% rename from packages/svelte/src/lib/handlers/types.ts rename to packages/core/handlers/types.ts diff --git a/packages/svelte/src/lib/core.ts b/packages/core/index.ts similarity index 100% rename from packages/svelte/src/lib/core.ts rename to packages/core/index.ts diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 0000000..b73aa79 --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,50 @@ +{ + "name": "@sheepdog/core", + "version": "0.0.1", + "repository": { + "type": "git", + "url": "git+https://github.com/mainmatter/sheepdog.git" + }, + "main": "./dist/index.js", + "type": "module", + "scripts": { + "build": "tsc --outDir dist --declaration --sourceMap false && publint", + "prepack": "pnpm build", + "prepare": "pnpm build" + }, + "files": [ + "dist" + ], + "exports": { + ".": { + "types": "./dist/index.d.ts", + "svelte": "./dist/index.js", + "import": "./dist/index.js" + }, + "./utils": { + "types": "./dist/utils.d.ts", + "svelte": "./dist/utils.js", + "import": "./dist/utils.js" + }, + "./vite": { + "types": "./dist/vite.d.ts", + "svelte": "./dist/vite.js", + "import": "./dist/vite.js" + } + }, + "types": "./dist/index.d.ts", + "svelte": "./dist/index.js", + "dependencies": { + "acorn": "^8.11.3", + "esm-env": "^1.1.4", + "esrap": "^1.2.2", + "zimmerframe": "^1.1.2" + }, + "volta": { + "extends": "../../package.json" + }, + "devDependencies": { + "publint": "^0.2.7", + "vite": "^5.2.11" + } +} diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json new file mode 100644 index 0000000..e0b1312 --- /dev/null +++ b/packages/core/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true + } +} diff --git a/packages/core/utils.ts b/packages/core/utils.ts new file mode 100644 index 0000000..6b9d7a4 --- /dev/null +++ b/packages/core/utils.ts @@ -0,0 +1,33 @@ +import { DEV } from 'esm-env'; +import { CancelationError } from './index'; +import type { TaskFunction } from './index'; + +/** + * Utility method to know if a `perform` thrown because it was canceled + */ +export const didCancel = (e: Error | CancelationError) => { + return e instanceof CancelationError; +}; + +/** + * A Promise that will resolve after {ms} milliseconds + */ +export async function timeout(ms: number) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +/** + * A function to mark your function to be transformable by the + * async transform vite plugin. It will error out in dev mode + * if you didn't add the plugin. + */ +export function transform( + fn: TaskFunction, +): TaskFunction { + if (DEV) { + throw new Error( + 'You are using the transform function without the vite plugin. Please add the `asyncTransform` plugin to your `vite.config.ts`', + ); + } + return fn; +} diff --git a/packages/core/vite.ts b/packages/core/vite.ts new file mode 100644 index 0000000..77101cb --- /dev/null +++ b/packages/core/vite.ts @@ -0,0 +1,144 @@ +import type { + ArrowFunctionExpression, + AwaitExpression, + BlockStatement, + CallExpression, + FunctionExpression, + ImportDeclaration, +} from 'acorn'; +import type { Plugin } from 'vite'; + +type Nodes = + | ImportDeclaration + | FunctionExpression + | ArrowFunctionExpression + | CallExpression + | BlockStatement + | AwaitExpression; + +export async function asyncTransform() { + const { parse } = await import('acorn'); + const { print } = await import('esrap'); + const { walk } = await import('zimmerframe'); + + return { + name: 'sheepdog-async-transform', + async transform(code, id) { + try { + const ast = parse(code, { + ecmaVersion: 'latest', + locations: true, + sourceType: 'module', + }); + let task_fn_name: string; + const transform_fn_names = new Set(); + // let's walk once to find the name (we were using a promise before but that's just messy) + walk( + ast as unknown as ImportDeclaration, + {}, + { + ImportDeclaration(node) { + if ( + node.source.value === '@sheepdog/svelte' || + node.source.value === '@sheepdog/svelte/task' || + node.source.value === '@sheepdog/svelte/utils' + ) { + const task_fn = node.specifiers.find((specifier) => { + return ( + specifier.type === 'ImportSpecifier' && + specifier.imported.type === 'Identifier' && + specifier.imported.name === 'task' + ); + }); + const transform_fn = node.specifiers.find((specifier) => { + return ( + specifier.type === 'ImportSpecifier' && + specifier.imported.type === 'Identifier' && + specifier.imported.name === 'transform' + ); + }); + if (transform_fn && transform_fn.type === 'ImportSpecifier') { + transform_fn_names.add(transform_fn.local.name); + } + if (task_fn && task_fn.type === 'ImportSpecifier') { + task_fn_name = task_fn.local.name; + } + } + }, + }, + ); + let changed = false; + const returned = walk( + ast as unknown as Nodes, + { + transform: false, + }, + { + AwaitExpression(node, { next, state }) { + if (state.transform) { + next(); + node.type = 'YieldExpression' as never; + } + }, + CallExpression(node, { state, next }) { + let local_changed = false; + let task_arg: (typeof node)['arguments'][number] | undefined; + if ( + (node.callee.type === 'Identifier' && + (node.callee.name === task_fn_name || + transform_fn_names.has(node.callee.name))) || + (node.callee.type === 'MemberExpression' && + node.callee.object.type === 'Identifier' && + node.callee.object.name === task_fn_name) + ) { + task_arg = node.arguments[0]; + if (task_arg && task_arg.type === 'ArrowFunctionExpression' && task_arg.async) { + const to_change = task_arg as unknown as FunctionExpression; + to_change.type = 'FunctionExpression'; + to_change.generator = true; + next({ ...state, transform: true }); + changed = true; + local_changed = true; + } else if ( + task_arg && + task_arg.type === 'FunctionExpression' && + !task_arg.generator && + task_arg.async + ) { + const to_change = task_arg as unknown as FunctionExpression; + to_change.generator = true; + next({ ...state, transform: true }); + changed = true; + local_changed = true; + } + } + if (!local_changed) { + next(); + } + if ( + task_arg && + node.callee.type === 'Identifier' && + transform_fn_names.has(node.callee.name) + ) { + return task_arg as never; + } + }, + }, + ) as unknown as typeof ast; + + if (changed) { + return { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ...print(returned as any, { + sourceMapContent: code, + sourceMapSource: id, + }), + }; + } + } catch (e) { + console.error(e); + /** in case parsing fails */ + } + }, + } satisfies Plugin; +} diff --git a/packages/svelte/.npmrc b/packages/svelte/.npmrc index b6f27f1..4fd0219 100644 --- a/packages/svelte/.npmrc +++ b/packages/svelte/.npmrc @@ -1 +1 @@ -engine-strict=true +engine-strict=true \ No newline at end of file diff --git a/packages/svelte/package.json b/packages/svelte/package.json index e139849..f132fb3 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -55,10 +55,7 @@ "test:unit:ui": "vitest --ui" }, "dependencies": { - "acorn": "^8.11.3", - "esm-env": "^1.1.4", - "esrap": "^1.2.2", - "zimmerframe": "^1.1.2" + "@sheepdog/core": "workspace:*" }, "devDependencies": { "@playwright/test": "^1.44.0", @@ -78,7 +75,7 @@ "eslint-plugin-playwright": "^2.0.0", "eslint-plugin-svelte": "2.46.0", "execa": "^9.4.0", - "fixturify-project": "^7.1.2", + "fixturify-project": "^7.1.3", "globals": "^15.2.0", "happy-dom": "^15.0.0", "prettier": "^3.2.5", diff --git a/packages/svelte/src/lib/task.ts b/packages/svelte/src/lib/task.ts index 129b7f2..8dc24b3 100644 --- a/packages/svelte/src/lib/task.ts +++ b/packages/svelte/src/lib/task.ts @@ -1,7 +1,13 @@ import { onDestroy } from 'svelte'; import { writable } from 'svelte/store'; -import type { HandlerType, HandlersMap, SheepdogUtils, TaskOptions, TaskFunction } from './core'; -import { CancelationError, createTask, handlers } from './core'; +import type { + HandlerType, + HandlersMap, + SheepdogUtils, + TaskOptions, + TaskFunction, +} from '@sheepdog/core'; +import { CancelationError, createTask, handlers } from '@sheepdog/core'; import type { ReadableWithGet, WritableWithGet } from './internal/helpers'; import { writable_with_get } from './internal/helpers'; export type { SheepdogUtils, TaskOptions }; diff --git a/packages/svelte/src/lib/utils.ts b/packages/svelte/src/lib/utils.ts index 75c4880..34d6510 100644 --- a/packages/svelte/src/lib/utils.ts +++ b/packages/svelte/src/lib/utils.ts @@ -1,33 +1,3 @@ -import { DEV } from 'esm-env'; -import { CancelationError } from './core'; -import type { TaskFunction } from './core'; +import { didCancel, timeout, transform } from '@sheepdog/core/utils'; -/** - * Utility method to know if a `perform` thrown because it was canceled - */ -export const didCancel = (e: Error | CancelationError) => { - return e instanceof CancelationError; -}; - -/** - * A Promise that will resolve after {ms} milliseconds - */ -export async function timeout(ms: number) { - return new Promise((resolve) => setTimeout(resolve, ms)); -} - -/** - * A function to mark your function to be transformable by the - * async transform vite plugin. It will error out in dev mode - * if you didn't add the plugin. - */ -export function transform( - fn: TaskFunction, -): TaskFunction { - if (DEV) { - throw new Error( - 'You are using the transform function without the vite plugin. Please add the `asyncTransform` plugin to your `vite.config.ts`', - ); - } - return fn; -} +export { didCancel, timeout, transform }; diff --git a/packages/svelte/src/lib/vite.ts b/packages/svelte/src/lib/vite.ts index 77101cb..9ee4734 100644 --- a/packages/svelte/src/lib/vite.ts +++ b/packages/svelte/src/lib/vite.ts @@ -1,144 +1,3 @@ -import type { - ArrowFunctionExpression, - AwaitExpression, - BlockStatement, - CallExpression, - FunctionExpression, - ImportDeclaration, -} from 'acorn'; -import type { Plugin } from 'vite'; +import { asyncTransform } from '@sheepdog/core/vite'; -type Nodes = - | ImportDeclaration - | FunctionExpression - | ArrowFunctionExpression - | CallExpression - | BlockStatement - | AwaitExpression; - -export async function asyncTransform() { - const { parse } = await import('acorn'); - const { print } = await import('esrap'); - const { walk } = await import('zimmerframe'); - - return { - name: 'sheepdog-async-transform', - async transform(code, id) { - try { - const ast = parse(code, { - ecmaVersion: 'latest', - locations: true, - sourceType: 'module', - }); - let task_fn_name: string; - const transform_fn_names = new Set(); - // let's walk once to find the name (we were using a promise before but that's just messy) - walk( - ast as unknown as ImportDeclaration, - {}, - { - ImportDeclaration(node) { - if ( - node.source.value === '@sheepdog/svelte' || - node.source.value === '@sheepdog/svelte/task' || - node.source.value === '@sheepdog/svelte/utils' - ) { - const task_fn = node.specifiers.find((specifier) => { - return ( - specifier.type === 'ImportSpecifier' && - specifier.imported.type === 'Identifier' && - specifier.imported.name === 'task' - ); - }); - const transform_fn = node.specifiers.find((specifier) => { - return ( - specifier.type === 'ImportSpecifier' && - specifier.imported.type === 'Identifier' && - specifier.imported.name === 'transform' - ); - }); - if (transform_fn && transform_fn.type === 'ImportSpecifier') { - transform_fn_names.add(transform_fn.local.name); - } - if (task_fn && task_fn.type === 'ImportSpecifier') { - task_fn_name = task_fn.local.name; - } - } - }, - }, - ); - let changed = false; - const returned = walk( - ast as unknown as Nodes, - { - transform: false, - }, - { - AwaitExpression(node, { next, state }) { - if (state.transform) { - next(); - node.type = 'YieldExpression' as never; - } - }, - CallExpression(node, { state, next }) { - let local_changed = false; - let task_arg: (typeof node)['arguments'][number] | undefined; - if ( - (node.callee.type === 'Identifier' && - (node.callee.name === task_fn_name || - transform_fn_names.has(node.callee.name))) || - (node.callee.type === 'MemberExpression' && - node.callee.object.type === 'Identifier' && - node.callee.object.name === task_fn_name) - ) { - task_arg = node.arguments[0]; - if (task_arg && task_arg.type === 'ArrowFunctionExpression' && task_arg.async) { - const to_change = task_arg as unknown as FunctionExpression; - to_change.type = 'FunctionExpression'; - to_change.generator = true; - next({ ...state, transform: true }); - changed = true; - local_changed = true; - } else if ( - task_arg && - task_arg.type === 'FunctionExpression' && - !task_arg.generator && - task_arg.async - ) { - const to_change = task_arg as unknown as FunctionExpression; - to_change.generator = true; - next({ ...state, transform: true }); - changed = true; - local_changed = true; - } - } - if (!local_changed) { - next(); - } - if ( - task_arg && - node.callee.type === 'Identifier' && - transform_fn_names.has(node.callee.name) - ) { - return task_arg as never; - } - }, - }, - ) as unknown as typeof ast; - - if (changed) { - return { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ...print(returned as any, { - sourceMapContent: code, - sourceMapSource: id, - }), - }; - } - } catch (e) { - console.error(e); - /** in case parsing fails */ - } - }, - } satisfies Plugin; -} +export { asyncTransform }; diff --git a/patches/fixturify-project.patch b/patches/fixturify-project.patch deleted file mode 100644 index 79019c3..0000000 --- a/patches/fixturify-project.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/dist/index.js b/dist/index.js -index 8383eb02ae716166f01a1f40f84866e0d4e47365..160f0ed5f9615212232921e77479ccb51cce5df9 100644 ---- a/dist/index.js -+++ b/dist/index.js -@@ -11,7 +11,9 @@ import deepmerge from "deepmerge"; - import { findWorkspaceDir } from "@pnpm/find-workspace-dir"; - import { findWorkspacePackages } from "@pnpm/workspace.find-packages"; - import { packlist } from "@pnpm/fs.packlist"; --import { PackageCache } from "@embroider/shared-internals"; -+import EmbroiderSharedInternals from "@embroider/shared-internals"; -+ -+const { PackageCache } = EmbroiderSharedInternals; - tmp.setGracefulCleanup(); - var defaultFiles = { - "index.js": ` diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6b7666e..edd4c88 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,14 +4,6 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false -overrides: - '@sveltejs/vite-plugin-svelte': ^4.0.0 - -patchedDependencies: - fixturify-project: - hash: ggdodvgdjn5i44d3bwagq2vs5m - path: patches/fixturify-project.patch - importers: .: @@ -80,7 +72,7 @@ importers: specifier: ^5.4.5 version: 5.6.3 - packages/svelte: + packages/core: dependencies: acorn: specifier: ^8.11.3 @@ -94,6 +86,19 @@ importers: zimmerframe: specifier: ^1.1.2 version: 1.1.2 + devDependencies: + publint: + specifier: ^0.2.7 + version: 0.2.12 + vite: + specifier: ^5.2.11 + version: 5.4.11(@types/node@22.9.1) + + packages/svelte: + dependencies: + '@sheepdog/core': + specifier: workspace:* + version: link:../core devDependencies: '@playwright/test': specifier: ^1.44.0 @@ -147,8 +152,8 @@ importers: specifier: ^9.4.0 version: 9.5.1 fixturify-project: - specifier: ^7.1.2 - version: 7.1.3(patch_hash=ggdodvgdjn5i44d3bwagq2vs5m) + specifier: ^7.1.3 + version: 7.1.3 globals: specifier: ^15.2.0 version: 15.12.0 @@ -1118,41 +1123,21 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.24.0': - resolution: {integrity: sha512-Q6HJd7Y6xdB48x8ZNVDOqsbh2uByBhgK8PiQgPhwkIw/HC/YX5Ghq2mQY5sRMZWHb3VsFkWooUVOZHKr7DmDIA==} - cpu: [arm] - os: [android] - '@rollup/rollup-android-arm-eabi@4.27.3': resolution: {integrity: sha512-EzxVSkIvCFxUd4Mgm4xR9YXrcp976qVaHnqom/Tgm+vU79k4vV4eYTjmRvGfeoW8m9LVcsAy/lGjcgVegKEhLQ==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.24.0': - resolution: {integrity: sha512-ijLnS1qFId8xhKjT81uBHuuJp2lU4x2yxa4ctFPtG+MqEE6+C5f/+X/bStmxapgmwLwiL3ih122xv8kVARNAZA==} - cpu: [arm64] - os: [android] - '@rollup/rollup-android-arm64@4.27.3': resolution: {integrity: sha512-LJc5pDf1wjlt9o/Giaw9Ofl+k/vLUaYsE2zeQGH85giX2F+wn/Cg8b3c5CDP3qmVmeO5NzwVUzQQxwZvC2eQKw==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.24.0': - resolution: {integrity: sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA==} - cpu: [arm64] - os: [darwin] - '@rollup/rollup-darwin-arm64@4.27.3': resolution: {integrity: sha512-OuRysZ1Mt7wpWJ+aYKblVbJWtVn3Cy52h8nLuNSzTqSesYw1EuN6wKp5NW/4eSre3mp12gqFRXOKTcN3AI3LqA==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.24.0': - resolution: {integrity: sha512-X6/nOwoFN7RT2svEQWUsW/5C/fYMBe4fnLK9DQk4SX4mgVBiTA9h64kjUYPvGQ0F/9xwJ5U5UfTbl6BEjaQdBQ==} - cpu: [x64] - os: [darwin] - '@rollup/rollup-darwin-x64@4.27.3': resolution: {integrity: sha512-xW//zjJMlJs2sOrCmXdB4d0uiilZsOdlGQIC/jjmMWT47lkLLoB1nsNhPUcnoqyi5YR6I4h+FjBpILxbEy8JRg==} cpu: [x64] @@ -1168,121 +1153,61 @@ packages: cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.24.0': - resolution: {integrity: sha512-0KXvIJQMOImLCVCz9uvvdPgfyWo93aHHp8ui3FrtOP57svqrF/roSSR5pjqL2hcMp0ljeGlU4q9o/rQaAQ3AYA==} - cpu: [arm] - os: [linux] - '@rollup/rollup-linux-arm-gnueabihf@4.27.3': resolution: {integrity: sha512-h2Ay79YFXyQi+QZKo3ISZDyKaVD7uUvukEHTOft7kh00WF9mxAaxZsNs3o/eukbeKuH35jBvQqrT61fzKfAB/Q==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.24.0': - resolution: {integrity: sha512-it2BW6kKFVh8xk/BnHfakEeoLPv8STIISekpoF+nBgWM4d55CZKc7T4Dx1pEbTnYm/xEKMgy1MNtYuoA8RFIWw==} - cpu: [arm] - os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.27.3': resolution: {integrity: sha512-Sv2GWmrJfRY57urktVLQ0VKZjNZGogVtASAgosDZ1aUB+ykPxSi3X1nWORL5Jk0sTIIwQiPH7iE3BMi9zGWfkg==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.24.0': - resolution: {integrity: sha512-i0xTLXjqap2eRfulFVlSnM5dEbTVque/3Pi4g2y7cxrs7+a9De42z4XxKLYJ7+OhE3IgxvfQM7vQc43bwTgPwA==} - cpu: [arm64] - os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.27.3': resolution: {integrity: sha512-FPoJBLsPW2bDNWjSrwNuTPUt30VnfM8GPGRoLCYKZpPx0xiIEdFip3dH6CqgoT0RnoGXptaNziM0WlKgBc+OWQ==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.24.0': - resolution: {integrity: sha512-9E6MKUJhDuDh604Qco5yP/3qn3y7SLXYuiC0Rpr89aMScS2UAmK1wHP2b7KAa1nSjWJc/f/Lc0Wl1L47qjiyQw==} - cpu: [arm64] - os: [linux] - '@rollup/rollup-linux-arm64-musl@4.27.3': resolution: {integrity: sha512-TKxiOvBorYq4sUpA0JT+Fkh+l+G9DScnG5Dqx7wiiqVMiRSkzTclP35pE6eQQYjP4Gc8yEkJGea6rz4qyWhp3g==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.24.0': - resolution: {integrity: sha512-2XFFPJ2XMEiF5Zi2EBf4h73oR1V/lycirxZxHZNc93SqDN/IWhYYSYj8I9381ikUFXZrz2v7r2tOVk2NBwxrWw==} - cpu: [ppc64] - os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.27.3': resolution: {integrity: sha512-v2M/mPvVUKVOKITa0oCFksnQQ/TqGrT+yD0184/cWHIu0LoIuYHwox0Pm3ccXEz8cEQDLk6FPKd1CCm+PlsISw==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.24.0': - resolution: {integrity: sha512-M3Dg4hlwuntUCdzU7KjYqbbd+BLq3JMAOhCKdBE3TcMGMZbKkDdJ5ivNdehOssMCIokNHFOsv7DO4rlEOfyKpg==} - cpu: [riscv64] - os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.27.3': resolution: {integrity: sha512-LdrI4Yocb1a/tFVkzmOE5WyYRgEBOyEhWYJe4gsDWDiwnjYKjNs7PS6SGlTDB7maOHF4kxevsuNBl2iOcj3b4A==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.24.0': - resolution: {integrity: sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g==} - cpu: [s390x] - os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.27.3': resolution: {integrity: sha512-d4wVu6SXij/jyiwPvI6C4KxdGzuZOvJ6y9VfrcleHTwo68fl8vZC5ZYHsCVPUi4tndCfMlFniWgwonQ5CUpQcA==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.24.0': - resolution: {integrity: sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==} - cpu: [x64] - os: [linux] - '@rollup/rollup-linux-x64-gnu@4.27.3': resolution: {integrity: sha512-/6bn6pp1fsCGEY5n3yajmzZQAh+mW4QPItbiWxs69zskBzJuheb3tNynEjL+mKOsUSFK11X4LYF2BwwXnzWleA==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.24.0': - resolution: {integrity: sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ==} - cpu: [x64] - os: [linux] - '@rollup/rollup-linux-x64-musl@4.27.3': resolution: {integrity: sha512-nBXOfJds8OzUT1qUreT/en3eyOXd2EH5b0wr2bVB5999qHdGKkzGzIyKYaKj02lXk6wpN71ltLIaQpu58YFBoQ==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.24.0': - resolution: {integrity: sha512-VXBrnPWgBpVDCVY6XF3LEW0pOU51KbaHhccHw6AS6vBWIC60eqsH19DAeeObl+g8nKAz04QFdl/Cefta0xQtUQ==} - cpu: [arm64] - os: [win32] - '@rollup/rollup-win32-arm64-msvc@4.27.3': resolution: {integrity: sha512-ogfbEVQgIZOz5WPWXF2HVb6En+kWzScuxJo/WdQTqEgeyGkaa2ui5sQav9Zkr7bnNCLK48uxmmK0TySm22eiuw==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.24.0': - resolution: {integrity: sha512-xrNcGDU0OxVcPTH/8n/ShH4UevZxKIO6HJFK0e15XItZP2UcaiLFd5kiX7hJnqCbSztUF8Qot+JWBC/QXRPYWQ==} - cpu: [ia32] - os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.27.3': resolution: {integrity: sha512-ecE36ZBMLINqiTtSNQ1vzWc5pXLQHlf/oqGp/bSbi7iedcjcNb6QbCBNG73Euyy2C+l/fn8qKWEwxr+0SSfs3w==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.24.0': - resolution: {integrity: sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw==} - cpu: [x64] - os: [win32] - '@rollup/rollup-win32-x64-msvc@4.27.3': resolution: {integrity: sha512-vliZLrDmYKyaUoMzEbMTg2JkerfBjn03KmAw9CykO0Zzkzoyd7o3iZNam/TpyWNjNT+Cz2iO3P9Smv2wgrR+Eg==} cpu: [x64] @@ -1328,7 +1253,7 @@ packages: engines: {node: '>=18.13'} hasBin: true peerDependencies: - '@sveltejs/vite-plugin-svelte': ^4.0.0 + '@sveltejs/vite-plugin-svelte': ^3.0.0 || ^4.0.0-next.1 svelte: ^4.0.0 || ^5.0.0-next.0 vite: ^5.0.3 @@ -1343,7 +1268,7 @@ packages: resolution: {integrity: sha512-2CKypmj1sM4GE7HjllT7UKmo4Q6L5xFRd7VMGEWhYnZ+wc6AUVU01IBd7yUi6WnFndEwWoMNOd6e8UjoN0nbvQ==} engines: {node: ^18.0.0 || ^20.0.0 || >=22} peerDependencies: - '@sveltejs/vite-plugin-svelte': ^4.0.0 + '@sveltejs/vite-plugin-svelte': ^4.0.0-next.0||^4.0.0 svelte: ^5.0.0-next.96 || ^5.0.0 vite: ^5.0.0 @@ -4184,11 +4109,6 @@ packages: deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true - rollup@4.24.0: - resolution: {integrity: sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg==} - engines: {node: '>=18.0.0', npm: '>=8.0.0'} - hasBin: true - rollup@4.27.3: resolution: {integrity: sha512-SLsCOnlmGt9VoZ9Ek8yBK8tAdmPHeppkw+Xa7yDlCEhDTvwYei03JlWo1fdc7YTfLZ4tD8riJCUyAgTbszk1fQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -4730,37 +4650,6 @@ packages: terser: optional: true - vite@5.4.9: - resolution: {integrity: sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@types/node': ^18.0.0 || >=20.0.0 - less: '*' - lightningcss: ^1.21.0 - sass: '*' - sass-embedded: '*' - stylus: '*' - sugarss: '*' - terser: ^5.4.0 - peerDependenciesMeta: - '@types/node': - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - sass-embedded: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - vitefu@1.0.3: resolution: {integrity: sha512-iKKfOMBHob2WxEJbqbJjHAkmYgvFDPhuqrO82om83S8RLk+17FtyMBfcyeH8GqD0ihShtkMW/zzJgiA51hCNCQ==} peerDependencies: @@ -5170,7 +5059,7 @@ snapshots: '@vercel/nft': 0.27.4(encoding@0.1.13) astro: 4.16.14(@types/node@22.9.1)(rollup@4.27.3)(typescript@5.6.3) esbuild: 0.21.5 - vite: 5.4.9(@types/node@22.9.1) + vite: 5.4.11(@types/node@22.9.1) transitivePeerDependencies: - '@types/node' - encoding @@ -6237,27 +6126,15 @@ snapshots: optionalDependencies: rollup: 4.27.3 - '@rollup/rollup-android-arm-eabi@4.24.0': - optional: true - '@rollup/rollup-android-arm-eabi@4.27.3': optional: true - '@rollup/rollup-android-arm64@4.24.0': - optional: true - '@rollup/rollup-android-arm64@4.27.3': optional: true - '@rollup/rollup-darwin-arm64@4.24.0': - optional: true - '@rollup/rollup-darwin-arm64@4.27.3': optional: true - '@rollup/rollup-darwin-x64@4.24.0': - optional: true - '@rollup/rollup-darwin-x64@4.27.3': optional: true @@ -6267,75 +6144,39 @@ snapshots: '@rollup/rollup-freebsd-x64@4.27.3': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.24.0': - optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.27.3': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.24.0': - optional: true - '@rollup/rollup-linux-arm-musleabihf@4.27.3': optional: true - '@rollup/rollup-linux-arm64-gnu@4.24.0': - optional: true - '@rollup/rollup-linux-arm64-gnu@4.27.3': optional: true - '@rollup/rollup-linux-arm64-musl@4.24.0': - optional: true - '@rollup/rollup-linux-arm64-musl@4.27.3': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.24.0': - optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.27.3': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.24.0': - optional: true - '@rollup/rollup-linux-riscv64-gnu@4.27.3': optional: true - '@rollup/rollup-linux-s390x-gnu@4.24.0': - optional: true - '@rollup/rollup-linux-s390x-gnu@4.27.3': optional: true - '@rollup/rollup-linux-x64-gnu@4.24.0': - optional: true - '@rollup/rollup-linux-x64-gnu@4.27.3': optional: true - '@rollup/rollup-linux-x64-musl@4.24.0': - optional: true - '@rollup/rollup-linux-x64-musl@4.27.3': optional: true - '@rollup/rollup-win32-arm64-msvc@4.24.0': - optional: true - '@rollup/rollup-win32-arm64-msvc@4.27.3': optional: true - '@rollup/rollup-win32-ia32-msvc@4.24.0': - optional: true - '@rollup/rollup-win32-ia32-msvc@4.27.3': optional: true - '@rollup/rollup-win32-x64-msvc@4.24.0': - optional: true - '@rollup/rollup-win32-x64-msvc@4.27.3': optional: true @@ -7816,7 +7657,7 @@ snapshots: micromatch: 4.0.8 pkg-dir: 4.2.0 - fixturify-project@7.1.3(patch_hash=ggdodvgdjn5i44d3bwagq2vs5m): + fixturify-project@7.1.3: dependencies: '@embroider/shared-internals': 2.8.1 '@pnpm/find-workspace-dir': 7.0.2 @@ -9903,28 +9744,6 @@ snapshots: dependencies: glob: 7.2.3 - rollup@4.24.0: - dependencies: - '@types/estree': 1.0.6 - optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.24.0 - '@rollup/rollup-android-arm64': 4.24.0 - '@rollup/rollup-darwin-arm64': 4.24.0 - '@rollup/rollup-darwin-x64': 4.24.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.24.0 - '@rollup/rollup-linux-arm-musleabihf': 4.24.0 - '@rollup/rollup-linux-arm64-gnu': 4.24.0 - '@rollup/rollup-linux-arm64-musl': 4.24.0 - '@rollup/rollup-linux-powerpc64le-gnu': 4.24.0 - '@rollup/rollup-linux-riscv64-gnu': 4.24.0 - '@rollup/rollup-linux-s390x-gnu': 4.24.0 - '@rollup/rollup-linux-x64-gnu': 4.24.0 - '@rollup/rollup-linux-x64-musl': 4.24.0 - '@rollup/rollup-win32-arm64-msvc': 4.24.0 - '@rollup/rollup-win32-ia32-msvc': 4.24.0 - '@rollup/rollup-win32-x64-msvc': 4.24.0 - fsevents: 2.3.3 - rollup@4.27.3: dependencies: '@types/estree': 1.0.6 @@ -10503,15 +10322,6 @@ snapshots: '@types/node': 22.9.1 fsevents: 2.3.3 - vite@5.4.9(@types/node@22.9.1): - dependencies: - esbuild: 0.21.5 - postcss: 8.4.47 - rollup: 4.24.0 - optionalDependencies: - '@types/node': 22.9.1 - fsevents: 2.3.3 - vitefu@1.0.3(vite@5.4.11(@types/node@22.9.1)): optionalDependencies: vite: 5.4.11(@types/node@22.9.1) diff --git a/tsconfig.base.json b/tsconfig.base.json index 71650ad..b72ebca 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "outDir": "dist", "strict": true, "strictNullChecks": true, "esModuleInterop": true, @@ -8,6 +9,8 @@ "noUnusedLocals": true, "skipLibCheck": true, "sourceMap": true, + "target": "ESNext", + "module": "ESNext", "moduleResolution": "Bundler" } } diff --git a/tsconfig.json b/tsconfig.json index e0b2b76..57ff435 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,3 @@ { - "extends": "./tsconfig.base.json" + "references": [{ "path": "./packages/core" }] }