From c4ed71e16e6e96220e89ec89238f556e6c5c6c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Fri, 18 Feb 2022 18:46:44 +0100 Subject: [PATCH] Fixed a type compatibility with Svelte's readables --- .changeset/curvy-pears-cheat.md | 5 + .github/actions/ci-checks/action.yml | 15 ++ .github/actions/ci-setup/action.yml | 12 ++ .github/workflows/nodejs.yml | 20 +-- .github/workflows/release.yml | 13 +- package.json | 2 - packages/core/rollup.config.js | 32 +--- packages/core/src/Actor.ts | 20 ++- packages/core/src/index.ts | 3 +- packages/core/src/interpreter.ts | 47 ++--- packages/core/src/types.ts | 10 +- packages/core/src/utils.ts | 11 +- packages/core/test/types.test.ts | 21 +++ packages/xstate-inspect/src/browser.ts | 24 +-- packages/xstate-inspect/src/server.ts | 19 +- packages/xstate-react/test/useActor.test.tsx | 4 +- .../xstate-react/test/useSelector.test.tsx | 3 +- packages/xstate-svelte/package.json | 4 +- .../test/interpreterAsReadable.svelte | 19 ++ yarn.lock | 168 +++++++++++++++++- 20 files changed, 321 insertions(+), 131 deletions(-) create mode 100644 .changeset/curvy-pears-cheat.md create mode 100644 .github/actions/ci-checks/action.yml create mode 100644 .github/actions/ci-setup/action.yml create mode 100644 packages/xstate-svelte/test/interpreterAsReadable.svelte diff --git a/.changeset/curvy-pears-cheat.md b/.changeset/curvy-pears-cheat.md new file mode 100644 index 0000000000..8633e6a01a --- /dev/null +++ b/.changeset/curvy-pears-cheat.md @@ -0,0 +1,5 @@ +--- +'xstate': patch +--- + +Fixed a type compatibility with Svelte's readables. It should be possible again to use XState interpreters directly as readables at the type-level. diff --git a/.github/actions/ci-checks/action.yml b/.github/actions/ci-checks/action.yml new file mode 100644 index 0000000000..47386e8e15 --- /dev/null +++ b/.github/actions/ci-checks/action.yml @@ -0,0 +1,15 @@ +name: 'CI checks' +runs: + using: 'composite' + steps: + - name: Build + run: yarn build + shell: bash + + - name: Test + run: yarn test --silent + shell: bash + + - name: Svelte Check + run: yarn --cwd packages/xstate-svelte svelte-check + shell: bash diff --git a/.github/actions/ci-setup/action.yml b/.github/actions/ci-setup/action.yml new file mode 100644 index 0000000000..b5544914d9 --- /dev/null +++ b/.github/actions/ci-setup/action.yml @@ -0,0 +1,12 @@ +name: 'CI setup' +runs: + using: 'composite' + steps: + - name: Use Node.js 14.x + uses: actions/setup-node@v2 + with: + node-version: 14.x + + - name: Install Dependencies + run: yarn + shell: bash diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index c11ff34ef3..83a7f4a057 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -8,23 +8,7 @@ jobs: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [14.x] - steps: - uses: actions/checkout@v2 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - - - name: Install dependencies - run: yarn install - - - name: Build - run: yarn build - - - name: Test - run: yarn test --silent + - uses: ./.github/actions/ci-setup + - uses: ./.github/actions/ci-checks diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3625be78e9..b2602cbaa4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,17 +15,8 @@ jobs: steps: - uses: actions/checkout@v2 - with: - # This makes action fetch all Git history so that Changesets can generate changelogs with the correct commits - fetch-depth: 0 - - - name: Use Node.js 14.x - uses: actions/setup-node@v2 - with: - node-version: 14.x - - - name: Install Dependencies - run: yarn + - uses: ./.github/actions/ci-setup + - uses: ./.github/actions/ci-checks - name: Create Release Pull Request or Publish to npm uses: changesets/action@v1 diff --git a/package.json b/package.json index de2d9567f9..0a5cbf7a10 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,7 @@ "test": "jest", "test:core": "npm test --prefix packages/core", "dev": "node ./scripts/dev.js", - "ci": "npm run build && npm run test", "changeset": "changeset", - "prerelease": "npm run build && npm run test", "release": "changeset publish", "version": "changeset version && node ./scripts/bump-peer-dep-ranges.js" }, diff --git a/packages/core/rollup.config.js b/packages/core/rollup.config.js index 0004fee07f..dfc1062b5b 100644 --- a/packages/core/rollup.config.js +++ b/packages/core/rollup.config.js @@ -4,33 +4,6 @@ import { terser } from 'rollup-plugin-terser'; import rollupReplace from 'rollup-plugin-replace'; import fileSize from 'rollup-plugin-filesize'; -const stripSymbolObservableMethodPlugin = ({ types: t }) => { - const isSymbolObservable = t.buildMatchMemberExpression('Symbol.observable'); - return { - visitor: { - MemberExpression(path) { - if (!isSymbolObservable(path.node)) { - return; - } - // class Interpreter { [Symbol.observable]() {} } - if (path.parentPath.isClassMethod()) { - path.parentPath.remove(); - return; - } - // Interpreter.prototype[Symbol.observable] = function() {} - if ( - path.parentPath.isMemberExpression() && - path.parentPath.get('property') === path && - path.parentPath.parentPath.isAssignmentExpression() - ) { - path.parentPath.parentPath.remove(); - return; - } - } - } - }; -}; - const createTsPlugin = ({ declaration = true, target } = {}) => typescript({ clean: true, @@ -49,10 +22,7 @@ const createBabelPlugin = () => skipPreflightCheck: true, babelHelpers: 'inline', extensions: ['.ts', '.tsx', '.js'], - plugins: [ - 'babel-plugin-annotate-pure-calls', - stripSymbolObservableMethodPlugin - ] + plugins: ['babel-plugin-annotate-pure-calls'] }); const createNpmConfig = ({ input, output }) => ({ diff --git a/packages/core/src/Actor.ts b/packages/core/src/Actor.ts index 7e490c1a2e..35e1c22374 100644 --- a/packages/core/src/Actor.ts +++ b/packages/core/src/Actor.ts @@ -9,7 +9,12 @@ import { ActorRef, BaseActorRef } from './types'; -import { interopSymbols, isMachine, mapContext, toInvokeSource } from './utils'; +import { + symbolObservableRef, + isMachine, + mapContext, + toInvokeSource +} from './utils'; import * as serviceScope from './serviceScope'; export interface Actor< @@ -38,7 +43,9 @@ export function createNullActor(id: string): ActorRef { toJSON: () => ({ id }), - ...interopSymbols + [symbolObservableRef.symbol]: function () { + return this; + } }; } @@ -107,16 +114,21 @@ export function isSpawnedActor(item: any): item is ActorRef { return isActor(item) && 'id' in item; } +// TODO: refactor the return type, this could be written in a better way but it's best to avoid unneccessary breaking changes now export function toActorRef< TEvent extends EventObject, TEmitted = any, TActorRefLike extends BaseActorRef = BaseActorRef ->(actorRefLike: TActorRefLike): ActorRef { +>( + actorRefLike: TActorRefLike +): ActorRef & Omit> { return { subscribe: () => ({ unsubscribe: () => void 0 }), id: 'anonymous', getSnapshot: () => undefined, - ...interopSymbols, + [symbolObservableRef.symbol]: function () { + return this; + }, ...actorRefLike }; } diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index a53d909ed0..4c2dd665a5 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -3,7 +3,7 @@ import { mapState } from './mapState'; import { StateNode } from './StateNode'; import { State } from './State'; import { Machine, createMachine } from './Machine'; -import { Actor } from './Actor'; +import { Actor, toActorRef } from './Actor'; import * as actions from './actions'; import { interpret, @@ -18,6 +18,7 @@ const { assign, send, sendParent, sendUpdate, forwardTo, doneInvoke } = actions; export { Actor, + toActorRef, Machine, StateNode, State, diff --git a/packages/core/src/interpreter.ts b/packages/core/src/interpreter.ts index 60ecaa44e4..68b8e1adc4 100644 --- a/packages/core/src/interpreter.ts +++ b/packages/core/src/interpreter.ts @@ -33,7 +33,8 @@ import { StopActionObject, Subscription, AnyState, - StateConfig + StateConfig, + InteropSubscribable } from './types'; import { State, bindActionToState, isStateConfig } from './State'; import * as actionTypes from './actionTypes'; @@ -53,12 +54,11 @@ import { toEventObject, toSCXMLEvent, reportUnhandledExceptionOnInvocation, - symbolObservable, toInvokeSource, toObserver, isActor, isBehavior, - interopSymbols + symbolObservableRef } from './utils'; import { Scheduler } from './scheduler'; import { Actor, isSpawnedActor, createDeferredActor } from './Actor'; @@ -388,6 +388,11 @@ export class Interpreter< return this; } + public subscribe( + observer: Observer< + State + > + ): Subscription; public subscribe( nextListener?: ( state: State @@ -395,11 +400,6 @@ export class Interpreter< errorListener?: (error: any) => void, completeListener?: () => void ): Subscription; - public subscribe( - observer: Observer< - State - > - ): Subscription; public subscribe( nextListenerOrObserver?: | (( @@ -1166,7 +1166,9 @@ export class Interpreter< return { id }; }, getSnapshot: () => resolvedData, - ...interopSymbols + [symbolObservableRef.symbol]: function () { + return this; + } }; this.children.set(id, actor); @@ -1208,11 +1210,12 @@ export class Interpreter< id, send: (event) => receivers.forEach((receiver) => receiver(event)), subscribe: (next) => { - listeners.add(next); + const observer = toObserver(next); + listeners.add(observer.next); return { unsubscribe: () => { - listeners.delete(next); + listeners.delete(observer.next); } }; }, @@ -1226,7 +1229,9 @@ export class Interpreter< return { id }; }, getSnapshot: () => emitted, - ...interopSymbols + [symbolObservableRef.symbol]: function () { + return this; + } }; this.children.set(id, actor); @@ -1265,7 +1270,9 @@ export class Interpreter< toJSON() { return { id }; }, - ...interopSymbols + [symbolObservableRef.symbol]: function () { + return this; + } }; this.children.set(id, actor); @@ -1310,7 +1317,9 @@ export class Interpreter< toJSON() { return { id }; }, - ...interopSymbols + [symbolObservableRef.symbol]: function () { + return this; + } }); } @@ -1357,15 +1366,7 @@ export class Interpreter< }; } - public [symbolObservable](): Subscribable< - State - > { - return this; - } - - // this gets stripped by Babel to avoid having "undefined" property in environments without this non-standard Symbol - // it has to be here to be included in the generated .d.ts - public [Symbol.observable](): Subscribable< + public [symbolObservableRef.symbol](): InteropSubscribable< State > { return this; diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index ef131d79f4..dda1d56cfb 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -1603,16 +1603,20 @@ export interface Subscription { } export interface InteropObservable { - [Symbol.observable]: () => Subscribable; + [Symbol.observable]: () => InteropSubscribable; } -export interface Subscribable { +export interface InteropSubscribable { + subscribe(observer: Observer): Subscription; +} + +export interface Subscribable extends InteropSubscribable { + subscribe(observer: Observer): Subscription; subscribe( next: (value: T) => void, error?: (error: any) => void, complete?: () => void ): Subscription; - subscribe(observer: Observer): Subscription; } export type Spawnable = diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index e6eb1eead5..5f4d7277a8 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -529,15 +529,18 @@ export function isObservable(value: any): value is Subscribable { } } -export const symbolObservable = (() => +const symbolObservable = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')(); +export const symbolObservableRef = { + symbol: symbolObservable as Exclude +} as const; + +// TODO: to be removed in v5, left it out just to minimize the scope of the change and maintain compatibility with older versions of integration paackages export const interopSymbols = { - [symbolObservable]: function () { + [symbolObservableRef.symbol]: function () { return this; }, - // this gets stripped by Babel to avoid having "undefined" property in environments without this non-standard Symbol - // it has to be here to be included in the generated .d.ts [Symbol.observable]: function () { return this; } diff --git a/packages/core/test/types.test.ts b/packages/core/test/types.test.ts index 2e23fcd545..8cb2d6e468 100644 --- a/packages/core/test/types.test.ts +++ b/packages/core/test/types.test.ts @@ -1,3 +1,4 @@ +import { from } from 'rxjs'; import { Machine, assign, createMachine, interpret } from '../src/index'; import { raise } from '../src/actions'; @@ -386,3 +387,23 @@ describe('Typestates', () => { expect(failed).toEqual({ result: none, error: 'oops' }); }); }); + +describe('interpreter', () => { + it('should be convertable to Rx observable', () => { + const state$ = from( + interpret( + createMachine({ + schema: { + context: {} as { count: number } + } + }) + ) + ); + + state$.subscribe((state) => { + ((_val: number) => {})(state.context.count); + // @ts-expect-error + ((_val: string) => {})(state.context.count); + }); + }); +}); diff --git a/packages/xstate-inspect/src/browser.ts b/packages/xstate-inspect/src/browser.ts index 584c2e635f..802faa0279 100644 --- a/packages/xstate-inspect/src/browser.ts +++ b/packages/xstate-inspect/src/browser.ts @@ -4,15 +4,11 @@ import { interpret, EventObject, EventData, - Observer + Observer, + toActorRef } from 'xstate'; import { XStateDevInterface } from 'xstate/lib/devTools'; -import { - toSCXMLEvent, - toEventObject, - toObserver, - interopSymbols -} from 'xstate/lib/utils'; +import { toSCXMLEvent, toEventObject, toObserver } from 'xstate/lib/utils'; import { createInspectMachine, InspectMachineEvent } from './inspectMachine'; import { stringifyMachine, stringifyState } from './serialize'; import type { @@ -259,7 +255,7 @@ export function createWindowReceiver( ownWindow.addEventListener('message', handler); - const actorRef: InspectReceiver = { + const actorRef: InspectReceiver = toActorRef({ id: 'xstate.windowReceiver', send(event) { @@ -286,9 +282,8 @@ export function createWindowReceiver( }, getSnapshot() { return latestEvent; - }, - ...interopSymbols - }; + } + }); actorRef.send({ type: 'xstate.inspecting' @@ -305,7 +300,7 @@ export function createWebSocketReceiver( const observers = new Set>(); let latestEvent: ParsedReceiverEvent; - const actorRef: InspectReceiver = { + const actorRef: InspectReceiver = toActorRef({ id: 'xstate.webSocketReceiver', send(event) { ws.send(stringify(event, options.serialize)); @@ -323,9 +318,8 @@ export function createWebSocketReceiver( }, getSnapshot() { return latestEvent; - }, - ...interopSymbols - }; + } + }); ws.onopen = () => { actorRef.send({ diff --git a/packages/xstate-inspect/src/server.ts b/packages/xstate-inspect/src/server.ts index 412c6e42b5..fb4d00edeb 100644 --- a/packages/xstate-inspect/src/server.ts +++ b/packages/xstate-inspect/src/server.ts @@ -4,11 +4,12 @@ import { EventData, EventObject, interpret, - Interpreter + Interpreter, + toActorRef } from 'xstate'; -import { toEventObject, toSCXMLEvent, interopSymbols } from 'xstate/lib/utils'; +import { toEventObject, toSCXMLEvent } from 'xstate/lib/utils'; -import { createInspectMachine } from './inspectMachine'; +import { createInspectMachine, InspectMachineEvent } from './inspectMachine'; import { Inspector, Replacer } from './types'; import { stringify } from './utils'; @@ -53,8 +54,7 @@ export function inspect(options: ServerInspectorOptions): Inspector { const inspectService = interpret( createInspectMachine(globalThis.__xstate__, options) ).start(); - let client: ActorRef = { - ...interopSymbols, + let client: ActorRef = toActorRef({ id: '@@xstate/ws-client', send: (event: any) => { server.clients.forEach((wsClient) => { @@ -67,7 +67,7 @@ export function inspect(options: ServerInspectorOptions): Inspector { return { unsubscribe: () => void 0 }; }, getSnapshot: () => undefined - }; + }); server.on('connection', function connection(wsClient) { wsClient.on('message', function incoming(data, isBinary) { @@ -134,10 +134,9 @@ export function inspect(options: ServerInspectorOptions): Inspector { }); }); - const inspector: Inspector = { - ...interopSymbols, + const inspector: Inspector = toActorRef({ id: '@@xstate/inspector', - send: (event) => { + send: (event: InspectMachineEvent) => { inspectService.send(event); }, subscribe: () => { @@ -150,7 +149,7 @@ export function inspect(options: ServerInspectorOptions): Inspector { inspectService.stop(); }, getSnapshot: () => undefined - }; + }); server.on('close', () => { inspectService.stop(); diff --git a/packages/xstate-react/test/useActor.test.tsx b/packages/xstate-react/test/useActor.test.tsx index 9efcb749be..a40bfccb23 100644 --- a/packages/xstate-react/test/useActor.test.tsx +++ b/packages/xstate-react/test/useActor.test.tsx @@ -7,9 +7,9 @@ import { spawn, ActorRef, ActorRefFrom, - interpret + interpret, + toActorRef } from 'xstate'; -import { toActorRef } from 'xstate/lib/Actor'; import { render, cleanup, fireEvent, act } from '@testing-library/react'; import { useActor } from '../src/useActor'; import { useState } from 'react'; diff --git a/packages/xstate-react/test/useSelector.test.tsx b/packages/xstate-react/test/useSelector.test.tsx index cc031507ae..e10a29f1f5 100644 --- a/packages/xstate-react/test/useSelector.test.tsx +++ b/packages/xstate-react/test/useSelector.test.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; -import { assign, createMachine, interpret, spawn } from 'xstate'; -import { toActorRef } from 'xstate/lib/Actor'; +import { assign, createMachine, interpret, spawn, toActorRef } from 'xstate'; import { act, render, cleanup, fireEvent } from '@testing-library/react'; import { useInterpret, useMachine, useSelector } from '../src'; diff --git a/packages/xstate-svelte/package.json b/packages/xstate-svelte/package.json index b1fbfb66a3..d349879cf3 100644 --- a/packages/xstate-svelte/package.json +++ b/packages/xstate-svelte/package.json @@ -34,7 +34,8 @@ "clean": "rm -rf dist lib tsconfig.tsbuildinfo", "build": "tsc", "test": "jest", - "prepare": "npm run build" + "prepare": "npm run build", + "svelte-check": "svelte-check" }, "bugs": { "url": "https://github.com/statelyai/xstate/issues" @@ -60,6 +61,7 @@ "jest": "^26.6.3", "lerna-alias": "3.0.3-0", "svelte": "^3.24.1", + "svelte-check": "^2.4.5", "svelte-jester": "^1.1.2", "svelte-preprocess": "^4.0.10", "ts-jest": "^26.5.6", diff --git a/packages/xstate-svelte/test/interpreterAsReadable.svelte b/packages/xstate-svelte/test/interpreterAsReadable.svelte new file mode 100644 index 0000000000..bfadbd214e --- /dev/null +++ b/packages/xstate-svelte/test/interpreterAsReadable.svelte @@ -0,0 +1,19 @@ + + +
$count
diff --git a/yarn.lock b/yarn.lock index 819c64613e..516f195321 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1566,6 +1566,14 @@ anymatch@^3.0.3, anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -2061,6 +2069,11 @@ bser@2.1.1: dependencies: node-int64 "^0.4.0" +buffer-crc32@^0.2.5: + version "0.2.13" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= + buffer-from@1.x, buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" @@ -2243,6 +2256,21 @@ chokidar@^3.4.0: optionalDependencies: fsevents "~2.1.2" +chokidar@^3.4.1: + 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" + ci-info@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" @@ -2933,6 +2961,11 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es6-promise@^3.1.2: + version "3.3.1" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" + integrity sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM= + escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.4, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -3172,6 +3205,17 @@ fast-glob@^3.1.1: micromatch "^4.0.2" picomatch "^2.2.1" +fast-glob@^3.2.7: + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -3465,6 +3509,11 @@ fsevents@~2.1.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -3614,6 +3663,13 @@ glob-parent@^5.1.0, glob-parent@~5.1.0: dependencies: is-glob "^4.0.1" +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== + dependencies: + is-glob "^4.0.1" + glob-to-regexp@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" @@ -3731,6 +3787,11 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.5, graceful-fs@^4.1.6, resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== +graceful-fs@^4.1.3: + version "4.2.9" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" + integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== + grapheme-splitter@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" @@ -4069,7 +4130,7 @@ import-fresh@^2.0.0: caller-path "^2.0.0" resolve-from "^3.0.0" -import-fresh@^3.1.0: +import-fresh@^3.1.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -5560,6 +5621,14 @@ micromatch@^4.0.2: braces "^3.0.1" picomatch "^2.0.5" +micromatch@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" + integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== + dependencies: + braces "^3.0.1" + picomatch "^2.2.3" + mime-db@1.44.0: version "1.44.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" @@ -5658,6 +5727,11 @@ mkdirp@1.x, mkdirp@~1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== +mri@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" + integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -6223,11 +6297,21 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= +picocolors@^1.0.0: + version "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.0.5, picomatch@^2.2.1, picomatch@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== +picomatch@^2.2.3: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -6640,6 +6724,13 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" +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" @@ -6854,7 +6945,7 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@^2.2.8, rimraf@^2.6.3: +rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -6964,6 +7055,13 @@ rxjs@^7.1.0: dependencies: tslib "~2.1.0" +sade@^1.7.4: + version "1.8.1" + resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701" + integrity sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A== + dependencies: + mri "^1.1.0" + safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -6986,6 +7084,16 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +sander@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/sander/-/sander-0.5.1.tgz#741e245e231f07cafb6fdf0f133adfa216a502ad" + integrity sha1-dB4kXiMfB8r7b98PEzrfohalAq0= + dependencies: + es6-promise "^3.1.2" + graceful-fs "^4.1.3" + mkdirp "^0.5.1" + rimraf "^2.5.2" + sane@^4.0.3: version "4.1.0" resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" @@ -7206,6 +7314,16 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" +sorcery@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/sorcery/-/sorcery-0.10.0.tgz#8ae90ad7d7cb05fc59f1ab0c637845d5c15a52b7" + integrity sha1-iukK19fLBfxZ8asMY3hF1cFaUrc= + dependencies: + buffer-crc32 "^0.2.5" + minimist "^1.2.0" + sander "^0.5.0" + sourcemap-codec "^1.3.0" + sort-keys@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" @@ -7267,7 +7385,7 @@ source-map@^0.7.3: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== -sourcemap-codec@^1.4.4: +sourcemap-codec@^1.3.0, sourcemap-codec@^1.4.4: version "1.4.8" resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== @@ -7582,6 +7700,21 @@ supports-hyperlinks@^2.0.0: has-flag "^4.0.0" supports-color "^7.0.0" +svelte-check@^2.4.5: + version "2.4.5" + resolved "https://registry.yarnpkg.com/svelte-check/-/svelte-check-2.4.5.tgz#a2001993034d495118980bd95577fb3e7980661a" + integrity sha512-nRft8BbG2wcxyCdHDZ7X43xLcvDzua3xLwq6wzHGcAF3ka3Jyhv2rvgq0+SF9NwHLMefp9C2XkM6etzsxK/cMQ== + dependencies: + chokidar "^3.4.1" + fast-glob "^3.2.7" + import-fresh "^3.2.1" + minimist "^1.2.5" + picocolors "^1.0.0" + sade "^1.7.4" + source-map "^0.7.3" + svelte-preprocess "^4.0.0" + typescript "*" + svelte-jester@^1.1.2: version "1.3.0" resolved "https://registry.yarnpkg.com/svelte-jester/-/svelte-jester-1.3.0.tgz#f7de754d581ba73418506a915f6a041e6b008fc3" @@ -7589,6 +7722,18 @@ svelte-jester@^1.1.2: dependencies: cosmiconfig "^6.0.0" +svelte-preprocess@^4.0.0: + version "4.10.3" + resolved "https://registry.yarnpkg.com/svelte-preprocess/-/svelte-preprocess-4.10.3.tgz#9aac89a8abc3889fa5740fb34f7dd74f3c578e13" + integrity sha512-ttw17lJfb/dx2ZJT9sesaXT5l7mPQ9Apx1H496Kli3Hkk7orIRGpOw6rCPkRNzr6ueVPqb4vzodS5x7sBFhKHw== + dependencies: + "@types/pug" "^2.0.4" + "@types/sass" "^1.16.0" + detect-indent "^6.0.0" + magic-string "^0.25.7" + sorcery "^0.10.0" + strip-indent "^3.0.0" + svelte-preprocess@^4.0.10: version "4.6.1" resolved "https://registry.yarnpkg.com/svelte-preprocess/-/svelte-preprocess-4.6.1.tgz#a7de4d91b32d5608b6637da960ee81e6089ae276" @@ -7839,7 +7984,17 @@ ts-jest@^26.5.6: semver "7.x" yargs-parser "20.x" -tslib@2.1.0, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^2.3.1, tslib@~2.1.0: +tslib@2.1.0, tslib@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" + integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== + +tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tslib@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== @@ -7938,6 +8093,11 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= +typescript@*: + version "4.5.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" + integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== + typescript@^4.5.2: version "4.5.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998"