diff --git a/packages/vue/.gitignore b/packages/vue/.gitignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/packages/vue/.gitignore @@ -0,0 +1 @@ +dist diff --git a/packages/vue/README.md b/packages/vue/README.md new file mode 100644 index 00000000..033097a1 --- /dev/null +++ b/packages/vue/README.md @@ -0,0 +1,108 @@ +# `@tryabby/vue` + +Vue 3 integration for [Abby](https://docs.tryabby.com) - A/B testing, feature flags and remote config. + +Mirrors `@tryabby/react`: the same `createAbby` factory, the same type-level +quality, and the same runtime behaviour (including rendering an empty variant +on the first pass so SSR output never mismatches the server). + +## Installation + +```sh +pnpm add @tryabby/vue +``` + +`vue@^3` is a peer dependency. + +## Usage + +```ts +import { createAbby } from "@tryabby/vue"; + +export const { + AbbyProvider, + useAbby, + useFeatureFlag, + useFeatureFlags, + useRemoteConfig, + useRemoteConfigVariables, + getABTestValue, + getFeatureFlagValue, + getRemoteConfig, + getABResetFunction, + getVariants, + updateUserProperties, +} = createAbby({ + projectId: "YOUR_PROJECT_ID", + environments: ["production"], + currentEnvironment: "production", + tests: { + footer: { variants: ["old", "new"] }, + }, + flags: ["newCheckout"], + remoteConfig: { + welcomeMessage: "String", + }, +}); +``` + +Wrap your app once (preferably with `initialData` fetched on the server): + +```vue + + + + + + + +``` + +Use the composables in any descendant component (all reactive `computed` refs): + +```vue + + + + + + + +``` + +Plain (non-reactive) getters - `getABTestValue`, `getFeatureFlagValue`, +`getRemoteConfig`, `getVariants`, `getABResetFunction` - work anywhere, +including outside components. + +## SSR / Nuxt notes + +- `variant` starts as `""` on the very first render (the server never runs + `onMounted`, so no variant is selected yet). Without a lookup object that + empty string is the value; with a lookup object lacking a `""` key the + value is `undefined` until the client resolves. Guard with `v-if="variant"`. +- One `createAbby()` result holds mutable project data on its core instance. + On servers handling concurrent requests (Nuxt SSR), call `createAbby()` + per request (e.g. inside a request-scoped plugin) instead of sharing one + module-level instance, so request A passing `initialData` can never leak + into request B that omits it. SPA / client-only usage can share one + module-level instance (same as `@tryabby/react`). + +## API parity with `@tryabby/react` + +| React | Vue | +| --- | --- | +| `AbbyProvider` (`initialData` prop) | `AbbyProvider` (`initialData` prop) | +| `useAbby(name, lookup?)` ? `{ variant, onAct }` | `useAbby(name, lookup?)` ? `{ variant: ComputedRef, onAct }` | +| `useFeatureFlag(name)` | `useFeatureFlag(name)` ? `ComputedRef` | +| `useFeatureFlags()` | `useFeatureFlags()` ? `ComputedRef>` | +| `useRemoteConfig(name)` | `useRemoteConfig(name)` ? `ComputedRef<...>` | +| `useRemoteConfigVariables()` | `useRemoteConfigVariables()` ? `ComputedRef>` | +| `withDevtools(factory, props)` ? hook | `withDevtools(factory, props)` ? component | diff --git a/packages/vue/demo/browser-demo.png b/packages/vue/demo/browser-demo.png new file mode 100644 index 00000000..cd509e5a Binary files /dev/null and b/packages/vue/demo/browser-demo.png differ diff --git a/packages/vue/demo/index.html b/packages/vue/demo/index.html new file mode 100644 index 00000000..d940c935 --- /dev/null +++ b/packages/vue/demo/index.html @@ -0,0 +1,63 @@ + + + + + @tryabby/vue demo (issue #68) + + + + + @tryabby/vue demo + loading… + + + + diff --git a/packages/vue/demo/ssr-demo.cjs b/packages/vue/demo/ssr-demo.cjs new file mode 100644 index 00000000..6c8ceecb --- /dev/null +++ b/packages/vue/demo/ssr-demo.cjs @@ -0,0 +1,109 @@ +// packages/vue/demo/ssr-demo.cjs — plain Node CJS SSR demo for @tryabby/vue (issue #68). +// No TypeScript, no browser, no ESM import maps. Run from abby repo root: +// node packages/vue/demo/ssr-demo.cjs +// Requires the BUILT packages/vue/dist/index.js (CJS) + vue CJS + @vue/server-renderer. +const path = require("path"); +const fs = require("fs"); + +// 1) Vue CJS: require('vue') resolves to vue/dist/vue.cjs.js via its package.json. +// Fallback to the explicit path inside packages/vue/node_modules. +let vue; +try { + vue = require("vue"); +} catch (e) { + vue = require( + path.join(__dirname, "..", "node_modules", "vue", "dist", "vue.cjs.js") + ); +} +const { createSSRApp, h } = vue; + +// 2) Server renderer (CJS) +let serverRenderer; +try { + serverRenderer = require("@vue/server-renderer"); +} catch (e) { + serverRenderer = require( + path.join( + __dirname, + "..", + "node_modules", + "@vue", + "server-renderer", + "dist", + "server-renderer.cjs.js" + ) + ); +} +const { renderToString } = serverRenderer; + +// 3) Built @tryabby/vue CJS bundle +const { createAbby } = require("../dist/index.js"); + +// 4) Same demo config as the browser demo (demo/index.html) +const { AbbyProvider, useAbby, useFeatureFlag, useRemoteConfig } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "demo", + tests: { footer: { variants: ["OldFooter", "NewFooter"] } }, + flags: ["newHeader"], + remoteConfig: { welcomeText: "String" }, +}); + +// Deterministic: weights [0,1] always select NewFooter on the client. +// NOTE: useAbby renders "" on the server by design (SSR mismatch guard; +// onMounted never runs during SSR). Flags + remoteConfig DO render on SSR. +const initialData = { + tests: [{ name: "footer", weights: [0, 1] }], + flags: [{ name: "newHeader", value: true }], + remoteConfig: [{ name: "welcomeText", value: "Hello from Abby Vue!" }], +}; + +// Child component with h() only (NO templates) +const Demo = { + setup() { + const { variant, onAct } = useAbby("footer"); + const header = useFeatureFlag("newHeader"); + const welcome = useRemoteConfig("welcomeText"); + void onAct; + return () => + h("div", [ + h("div", { class: "card" }, [ + 'useAbby("footer") -> variant: ', + h("b", { id: "variant" }, String(variant.value)), + ]), + h("div", { class: "card" }, [ + 'useFeatureFlag("newHeader") -> ', + h("b", { id: "flag" }, String(header.value)), + ]), + h("div", { class: "card" }, [ + 'useRemoteConfig("welcomeText") -> ', + h("b", { id: "welcome" }, String(welcome.value)), + ]), + ]); + }, +}; + +async function main() { + const app = createSSRApp({ + render: () => + h(AbbyProvider, { initialData }, { default: () => h(Demo) }), + }); + const html = await renderToString(app); + console.log(html); + const doc = + "\n" + + '\n\n\n' + + "@tryabby/vue SSR demo (issue #68)\n" + + "\n" + + "\n\n@tryabby/vue SSR demo\n" + + '' + + html + + "\n\n\n"; + fs.writeFileSync(path.join(__dirname, "ssr-output.html"), doc, "utf8"); + console.log("[ssr-demo] wrote " + path.join(__dirname, "ssr-output.html")); +} + +main().catch((err) => { + console.error("[ssr-demo] FAILED:", err && err.stack ? err.stack : err); + process.exit(1); +}); diff --git a/packages/vue/demo/ssr-output.html b/packages/vue/demo/ssr-output.html new file mode 100644 index 00000000..5a0c9166 --- /dev/null +++ b/packages/vue/demo/ssr-output.html @@ -0,0 +1,12 @@ + + + + +@tryabby/vue SSR demo (issue #68) + + + +@tryabby/vue SSR demo +useAbby("footer") -> variant: useFeatureFlag("newHeader") -> trueuseRemoteConfig("welcomeText") -> Hello from Abby Vue! + + diff --git a/packages/vue/package.json b/packages/vue/package.json new file mode 100644 index 00000000..0a85151d --- /dev/null +++ b/packages/vue/package.json @@ -0,0 +1,49 @@ +{ + "name": "@tryabby/vue", + "version": "7.0.1", + "description": "Vue 3 integration for Abby (A/B testing, feature flags and remote config)", + "main": "dist/index.js", + "files": ["dist"], + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.js" + } + }, + "scripts": { + "build": "tsup src/", + "dev": "pnpm run build --watch", + "test": "vitest" + }, + "homepage": "https://docs.tryabby.com", + "keywords": ["abby", "vue", "ab-testing", "feature-flags", "remote-config"], + "author": "", + "license": "ISC", + "devDependencies": { + "@testing-library/jest-dom": "^5.16.5", + "@tryabby/devtools": "workspace:*", + "@types/js-cookie": "^3.0.3", + "@vue/server-renderer": "^3.4.0", + "@vue/test-utils": "^2.5.0", + "js-cookie": "^3.0.1", + "jsdom": "^20.0.3", + "msw": "^0.49.1", + "node-fetch": "^3.3.0", + "tsconfig": "workspace:*", + "tsup": "^6.5.0", + "typescript": "5.5.4", + "vite": "5.4.0", + "vitest": "2.0.5", + "vue": "^3.4.0" + }, + "peerDependencies": { + "vue": "^3.0.0" + }, + "dependencies": { + "@tryabby/core": "workspace:*", + "js-cookie": "^3.0.1" + } +} diff --git a/packages/vue/src/StorageService.ts b/packages/vue/src/StorageService.ts new file mode 100644 index 00000000..7633105e --- /dev/null +++ b/packages/vue/src/StorageService.ts @@ -0,0 +1,76 @@ +import { + type IStorageService, + type StorageServiceOptions, + getABStorageKey, + getFFStorageKey, + getRCStorageKey, +} from "@tryabby/core"; +import Cookie from "js-cookie"; + +const DEFAULT_COOKIE_AGE = 365; + +class ABStorageService implements IStorageService { + get(projectId: string, testName: string): string | null { + const retrievedValue = Cookie.get(getABStorageKey(projectId, testName)); + if (!retrievedValue) return null; + + return retrievedValue; + } + + set( + projectId: string, + testName: string, + value: string, + options?: StorageServiceOptions + ): void { + Cookie.set(getABStorageKey(projectId, testName), value, { + expires: options?.expiresInDays + ? options.expiresInDays + : DEFAULT_COOKIE_AGE, + }); + } + + remove(projectId: string, testName: string): void { + Cookie.remove(getABStorageKey(projectId, testName)); + } +} + +class FFStorageService implements IStorageService { + get(projectId: string, flagName: string): string | null { + const retrievedValue = Cookie.get(getFFStorageKey(projectId, flagName)); + if (!retrievedValue) return null; + + return retrievedValue; + } + + set(projectId: string, flagName: string, value: string): void { + Cookie.set(getFFStorageKey(projectId, flagName), value, { + expires: DEFAULT_COOKIE_AGE, + }); + } + + remove(projectId: string, flagName: string): void { + Cookie.remove(getFFStorageKey(projectId, flagName)); + } +} + +class RCStorageService implements IStorageService { + get(projectId: string, key: string): string | null { + const retrievedValue = Cookie.get(getRCStorageKey(projectId, key)); + return retrievedValue ?? null; + } + + set(projectId: string, key: string, value: string): void { + Cookie.set(getRCStorageKey(projectId, key), value, { + expires: DEFAULT_COOKIE_AGE, + }); + } + + remove(projectId: string, key: string): void { + Cookie.remove(getRCStorageKey(projectId, key)); + } +} + +export const TestStorageService = new ABStorageService(); +export const FlagStorageService = new FFStorageService(); +export const RemoteConfigStorageService = new RCStorageService(); diff --git a/packages/vue/src/context.ts b/packages/vue/src/context.ts new file mode 100644 index 00000000..51aeed20 --- /dev/null +++ b/packages/vue/src/context.ts @@ -0,0 +1,444 @@ +import { + type ABConfig, + Abby, + type AbbyConfig, + type AbbyDataResponse, + AbbyEventType, + HttpService, + type RemoteConfigValueString, + type RemoteConfigValueStringToType, + type StorageServiceOptions, + type ValidatorType, +} from "@tryabby/core"; +import type { Infer } from "@tryabby/core/validation"; +import type { AbbyDevtoolProps, DevtoolsFactory } from "@tryabby/devtools"; +import { + type Component, + type ComputedRef, + type InjectionKey, + type PropType, + type Ref, + computed, + defineComponent, + inject, + onMounted, + onUnmounted, + provide, + ref, + watch, +} from "vue"; +import { + FlagStorageService, + RemoteConfigStorageService, + TestStorageService, +} from "./StorageService"; + +export type withDevtoolsFunction = ( + factory: DevtoolsFactory, + props: Omit & { + dangerouslyForceShow?: boolean; + } +) => Component; + +export type ABTestReturnValue = Lookup extends undefined + ? TestVariant + : TestVariant extends keyof Lookup + ? Lookup[TestVariant] + : never; + +export function createAbby< + const FlagName extends string, + const TestName extends string, + const Tests extends Record, + const RemoteConfig extends Record, + const RemoteConfigName extends Extract, + const User extends Record = Record< + string, + ValidatorType + >, +>( + abbyConfig: AbbyConfig< + FlagName, + Tests, + string[], + RemoteConfigName, + RemoteConfig, + User + > +) { + const abby = new Abby< + FlagName, + TestName, + Tests, + RemoteConfig, + RemoteConfigName, + string[], + User + >( + abbyConfig, + { + get: (key: string) => { + if (typeof window === "undefined") return null; + return TestStorageService.get(abbyConfig.projectId, key); + }, + set: (key: string, value: any) => { + if (typeof window === "undefined" || config.cookies?.disableByDefault) + return; + TestStorageService.set(abbyConfig.projectId, key, value); + }, + }, + { + get: (key: string) => { + if (typeof window === "undefined") return null; + return FlagStorageService.get(abbyConfig.projectId, key); + }, + set: (key: string, value: any) => { + if (typeof window === "undefined") return; + FlagStorageService.set(abbyConfig.projectId, key, value); + }, + }, + { + get: (key: string) => { + if (typeof window === "undefined") return null; + return RemoteConfigStorageService.get(abbyConfig.projectId, key); + }, + set: (key: string, value: any) => { + if (typeof window === "undefined") return; + RemoteConfigStorageService.set(abbyConfig.projectId, key, value); + }, + } + ); + + type AbbyProjectData = ReturnType; + + const AbbyDataKey: InjectionKey> = Symbol("abby-data"); + + const useAbbyData = () => { + const data = inject(AbbyDataKey); + + if (!data) { + throw new Error( + "useAbbyData must be used within an AbbyProvider. Wrap a parent component in to fix this error." + ); + } + + return data; + }; + + // we need to return the config as a const so that the types are narrowed + const config = abbyConfig; + + const useAbby = < + K extends keyof Tests, + TestVariant extends Tests[K]["variants"][number], + LookupValue, + const Lookup extends + | Record + | undefined = undefined, + >( + name: K, + lookupObject?: Lookup + ): { + variant: ComputedRef>; + onAct: () => void; + } => { + const data = useAbbyData(); + + // always render an empty string on the first render to avoid SSR mismatches + // because the server does not know which variant to render + const selectedVariant = ref(""); + + const readSelectedVariant = () => + data.value.tests[name as unknown as TestName]?.selectedVariant; + + // listen to changes for the current variant + watch(readSelectedVariant, (newVariant) => { + // should never be undefined after mount + if (newVariant !== undefined) { + selectedVariant.value = newVariant; + } + }); + + // lazily resolve the variant on the client after mount + // (onMounted never runs during SSR, so the server keeps rendering "") + onMounted(() => { + selectedVariant.value = + abby.getProjectData().tests[name as unknown as TestName] + ?.selectedVariant ?? ""; + }); + + watch(selectedVariant, (variant) => { + if (!name || !variant) return; + + HttpService.sendData({ + url: config.apiUrl, + type: AbbyEventType.PING, + data: { + projectId: config.projectId, + selectedVariant: variant, + testName: name as string, + }, + }); + }); + + const onAct = () => { + if (!selectedVariant.value) return; + + HttpService.sendData({ + url: config.apiUrl, + type: AbbyEventType.ACT, + data: { + projectId: config.projectId, + selectedVariant: selectedVariant.value, + testName: name as string, + }, + }); + }; + + const variant = computed( + () => + (lookupObject + ? lookupObject[selectedVariant.value as TestVariant] + : // Typescript fails here. If we cast selectedVariant to TestVariant + // it still assumes that it is a string. So we cast it to any instead + (selectedVariant.value as any)) as ABTestReturnValue< + Lookup, + TestVariant + > + ); + + return { + /** + * This function can be called to indicate that something that + * uses the selected variant has been rendered. + * It will automatically send the selected variant to the server. + */ + onAct: onAct, + variant, + }; + }; + + const useFeatureFlag = (name: FlagName): ComputedRef => { + const data = useAbbyData(); + return computed(() => { + // accessing data.value keeps this subscribed to provider updates; + // the core fallback covers dev overrides, defaults and fallback values + // when the response omits the flag instead of crashing on undefined. + const record = data.value.flags[name]; + if (record !== undefined) return record.value; + return abby.getFeatureFlag(name); + }); + }; + + /** + * Returns a computed Array of all flags with their name and value + */ + const useFeatureFlags = (): ComputedRef< + Array<{ name: FlagName; value: boolean }> + > => { + const data = useAbbyData(); + return computed(() => + (Object.keys(data.value.flags) as Array).map((flagName) => ({ + name: flagName, + value: data.value.flags[flagName].value, + })) + ); + }; + + /** + * Returns a computed Array of all remote config variables with their name and value + */ + const useRemoteConfigVariables = (): ComputedRef< + Array<{ + name: RemoteConfigName; + value: RemoteConfigValueStringToType; + }> + > => { + const data = useAbbyData(); + return computed( + () => + (Object.keys(data.value.remoteConfig) as Array).map( + (configName) => ({ + name: configName, + value: data.value.remoteConfig[configName].value, + }) + ) as Array<{ + name: RemoteConfigName; + value: RemoteConfigValueStringToType; + }> + ); + }; + + const AbbyProvider = defineComponent({ + name: "AbbyProvider", + props: { + initialData: { + type: Object as PropType, + required: false, + default: undefined, + }, + }, + setup(props, { slots }) { + const initial: AbbyProjectData = props.initialData + ? abby.init(props.initialData) + : abby.getProjectData(); + // cast: ref() only wraps the root value, so no nested unwrapping + // happens at runtime; the cast keeps the LocalData typing intact + const data = ref(initial) as Ref; + + let isMounted = false; + + // load the project data if it has not been passed in + onMounted(() => { + if (props.initialData || isMounted) return; + isMounted = true; + + // seed the data with the initial data + abby.loadProjectData().then((loaded) => { + if (!loaded) return; + data.value = loaded; + }); + }); + + // subscribe to changes in the project data + const unsubscribe = abby.subscribe((newData) => { + data.value = newData as AbbyProjectData; + }); + onUnmounted(() => { + unsubscribe(); + }); + + provide(AbbyDataKey, data); + + return () => slots.default?.(); + }, + }); + + const getFeatureFlagValue = (name: FlagName) => { + return abby.getFeatureFlag(name); + }; + + const useRemoteConfig = < + T extends RemoteConfigName, + Config extends RemoteConfig[T], + >( + remoteConfigName: T + ): ComputedRef> => { + const data = useAbbyData(); + return computed( + () => + data.value.remoteConfig[remoteConfigName] + .value as RemoteConfigValueStringToType + ); + }; + + const getRemoteConfig = < + T extends RemoteConfigName, + Config extends RemoteConfig[T], + >( + remoteConfigName: T + ): RemoteConfigValueStringToType => { + return abby.getRemoteConfig(remoteConfigName); + }; + + const getABTestValue = < + TestName extends keyof Tests, + TestVariant extends Tests[TestName]["variants"][number], + LookupValue, + const Lookup extends + | Record + | undefined = undefined, + >( + testName: TestName, + lookupObject?: Lookup + ): ABTestReturnValue => { + const variant = abby.getTestVariant(testName); + // Typescript looses its typing here, so we cast as any in favor of having + // better type inference for the user + if (lookupObject === undefined) { + return variant as any; + } + + return lookupObject[variant as TestVariant] as any; + }; + + const withDevtools: withDevtoolsFunction = (factory, props) => { + // hacky way to make sure SSR works: onMounted never runs on the server + return defineComponent({ + name: "AbbyDevtools", + setup() { + let inited = false; + let destroy: (() => void) | undefined; + + onMounted(() => { + if (inited) { + return; + } + + if ( + !props?.dangerouslyForceShow && + process.env.NODE_ENV !== "development" + ) { + return; + } + + inited = true; + + destroy = factory.create({ ...props, abby }); + }); + + onUnmounted(() => { + inited = false; + destroy?.(); + }); + + return () => null; + }, + }); + }; + + /** + * Simple helper function create a function that resets an AB test + * @param name the name of the test + * @returns A function that can be called to reset the test + */ + const getABResetFunction = (name: T) => { + return () => { + TestStorageService.remove(config.projectId, name as string); + }; + }; + + /** + * Simple helper function to get a list of all variants for a given test + * @param name the name of the test + * @returns an array of all variants + */ + const getVariants = (name: T) => { + return abby.getVariants(name); + }; + + const updateUserProperties = ( + user: Partial<{ + -readonly [K in keyof User]: Infer; + }> + ) => { + abby.updateUserProperties(user); + }; + + return { + useAbby, + AbbyProvider, + useFeatureFlag, + getFeatureFlagValue, + useRemoteConfig, + getRemoteConfig, + getABTestValue, + __abby__: abby, + withDevtools, + getABResetFunction, + getVariants, + useFeatureFlags, + useRemoteConfigVariables, + updateUserProperties, + }; +} diff --git a/packages/vue/src/helpers.ts b/packages/vue/src/helpers.ts new file mode 100644 index 00000000..af6ef456 --- /dev/null +++ b/packages/vue/src/helpers.ts @@ -0,0 +1,72 @@ +// taken from https://stackoverflow.com/questions/52489261/typescript-can-i-define-an-n-length-tuple-type +export type Tuple = N extends N + ? number extends N + ? T[] + : _TupleOf + : never; +type _TupleOf = R["length"] extends N + ? R + : _TupleOf; + +// taken from: https://stackoverflow.com/questions/18230217/javascript-generate-a-random-number-within-a-range-using-crypto-getrandomvalues +// crypto.getRandomValues() is better than Math.random() because it's cryptographically secure +// fallback to Math.random() if crypto.getRandomValues() is not available +export function getRandomDecimal() { + if (typeof window !== "undefined" && window.crypto) { + const randomBuffer = new Uint32Array(1); + + window.crypto.getRandomValues(randomBuffer); + + return randomBuffer[0] / (0xffffffff + 1); + } + return Math.random(); +} + +function weightedRand2>(spec: T): keyof T { + let i: keyof T; + let sum = 0; + const r = getRandomDecimal(); + + for (i in spec) { + sum += spec[i]; + if (r <= sum) break; + } + // biome-ignore lint/style/noNonNullAssertion:> + return i!; +} + +export function getWeightedRandomVariant< + Variants extends ReadonlyArray, +>( + variants: Variants, + weights?: Tuple +): Variants[number] { + const validatedWeights = validateWeights(variants, weights); + return weightedRand2( + variants.reduce( + (acc, variant, index) => { + acc[variant as Variants[number]] = validatedWeights[index]; + return acc; + }, + {} as Record + ) + ); +} + +const getDefaultWeights = >( + variants: Variants +) => { + return Array.from({ length: variants.length }).fill( + 1 / variants.length + ); +}; + +export function validateWeights< + Variants extends ReadonlyArray, + Weights extends Tuple, +>(variants: Variants, weights?: Weights): Weights { + const sum = weights?.reduce((acc, weight) => acc + weight, 0); + return weights != null && sum === 1 && variants.length === weights.length + ? weights + : (getDefaultWeights(variants) as Weights); +} diff --git a/packages/vue/src/index.ts b/packages/vue/src/index.ts new file mode 100644 index 00000000..1990f905 --- /dev/null +++ b/packages/vue/src/index.ts @@ -0,0 +1,6 @@ +export { + createAbby, + type withDevtoolsFunction, + type ABTestReturnValue, +} from "./context"; +export { type ABConfig, type AbbyConfig, defineConfig } from "@tryabby/core"; diff --git a/packages/vue/tests/helpers.test.ts b/packages/vue/tests/helpers.test.ts new file mode 100644 index 00000000..5a3becb3 --- /dev/null +++ b/packages/vue/tests/helpers.test.ts @@ -0,0 +1,38 @@ +import { getRandomDecimal, getWeightedRandomVariant } from "../src/helpers"; + +describe("getWeightedRandomVariant", () => { + it("should only return valid values", () => { + const variants = ["A", "B", "C"] as const; + + const variant = getWeightedRandomVariant(variants); + + expect(variant).toBeDefined(); + }); + + it("should work with weights", () => { + const variants = ["A", "B", "C"] as const; + + for (let i = 0; i < 100; i++) { + const variant = getWeightedRandomVariant(variants, [0, 0, 1]); + + expect(variant).toBe("C"); + } + + for (let i = 0; i < 100; i++) { + const variant = getWeightedRandomVariant(variants, [0.5, 0.5, 0]); + + expect(["A", "B"].includes(variant)).toBeTruthy(); + expect(variant).not.toBe("C"); + } + }); +}); + +describe("getRandomDecimal", () => { + it("should return a number between 0 and 1", () => { + for (let i = 0; i < 100; i++) { + const decimal = getRandomDecimal(); + expect(decimal).toBeGreaterThanOrEqual(0); + expect(decimal).toBeLessThanOrEqual(1); + } + }); +}); diff --git a/packages/vue/tests/mocks/handlers.ts b/packages/vue/tests/mocks/handlers.ts new file mode 100644 index 00000000..f2028cb7 --- /dev/null +++ b/packages/vue/tests/mocks/handlers.ts @@ -0,0 +1,42 @@ +import { ABBY_BASE_URL, type AbbyDataResponse } from "@tryabby/core"; +import { rest } from "msw"; + +const returnData: AbbyDataResponse = { + tests: [ + { + name: "test", + weights: [1, 1, 1, 1], + }, + { + name: "test2", + weights: [1, 0], + }, + ], + flags: [ + { + name: "flag1", + value: true, + }, + { + name: "flag2", + value: false, + }, + ], + remoteConfig: [ + { + name: "remoteConfig1", + value: "FooBar", + }, + ], +}; +export const handlers = [ + rest.get( + `${ABBY_BASE_URL}api/dashboard/:projectId/data`, + (_req, res, ctx) => { + return res(ctx.json(returnData)); + } + ), + rest.get(`${ABBY_BASE_URL}api/v2/data/:projectId`, (_req, res, ctx) => { + return res(ctx.json(returnData)); + }), +]; diff --git a/packages/vue/tests/mocks/server.ts b/packages/vue/tests/mocks/server.ts new file mode 100644 index 00000000..9bb8a870 --- /dev/null +++ b/packages/vue/tests/mocks/server.ts @@ -0,0 +1,5 @@ +import { setupServer } from "msw/node"; +import { handlers } from "./handlers"; + +// This configures a request mocking server with the given request handlers. +export const server = setupServer(...handlers); diff --git a/packages/vue/tests/setup.ts b/packages/vue/tests/setup.ts new file mode 100644 index 00000000..ba50b31c --- /dev/null +++ b/packages/vue/tests/setup.ts @@ -0,0 +1,23 @@ +/// @ts-ignore it does not have types +import matchers from "@testing-library/jest-dom/matchers"; +import fetch from "node-fetch"; +import { afterAll, afterEach, beforeAll, expect } from "vitest"; +import { server } from "./mocks/server"; + +/// @ts-ignore +global.fetch = fetch; + +// Establish API mocking before all tests. +beforeAll(() => server.listen()); + +// Clean up after the tests are finished. +afterAll(() => server.close()); + +// extends Vitest expect method with methods from jest-dom +expect.extend(matchers); + +afterEach(() => { + // Reset any request handlers that we may add during the tests, + // so they do not affect other tests. + server.resetHandlers(); +}); diff --git a/packages/vue/tests/ssr.test.ts b/packages/vue/tests/ssr.test.ts new file mode 100644 index 00000000..60c6b695 --- /dev/null +++ b/packages/vue/tests/ssr.test.ts @@ -0,0 +1,183 @@ +import { createSSRApp, defineComponent, h } from "vue"; +import { renderToString } from "@vue/server-renderer"; +import { createAbby } from "../src"; + +const OLD_ENV = process.env; + +beforeEach(() => { + vi.resetModules(); // Most important - it clears the cache + process.env = { ...OLD_ENV }; // Make a copy +}); + +afterAll(() => { + process.env = OLD_ENV; // Restore old environment +}); + +describe("useAbby", () => { + it("does not render a variant on the server", async () => { + const { AbbyProvider, useAbby } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + tests: { + showFooter: { + variants: ["current", "new"], + }, + }, + }); + + const ComponentWithTest = defineComponent({ + setup() { + const { variant } = useAbby("showFooter"); + return () => + h("div", [ + // @ts-expect-error this is just the types for SSR + variant.value === "" ? h("span", "SSR!") : null, + variant.value === "current" + ? h("span", { "data-testid": "current" }, "Secret") + : null, + variant.value === "new" + ? h("span", { "data-testid": "new" }, "Very Secret") + : null, + ]); + }, + }); + + const app = createSSRApp({ + render: () => + h( + AbbyProvider, + { + initialData: { + flags: [], + tests: [ + { + name: "showFooter", + weights: [0.5, 0.5], + }, + ], + remoteConfig: [], + }, + }, + { + default: () => h(ComponentWithTest), + } + ), + }); + + const serverSideHTML = await renderToString(app); + + expect(serverSideHTML).toContain("SSR!"); + expect(serverSideHTML).not.toContain("Secret"); + expect(serverSideHTML).not.toContain("Very Secret"); + }); +}); + +describe("useFeatureFlag", () => { + it("renders the correct feature flag on the server", async () => { + const { AbbyProvider, useFeatureFlag } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + flags: ["test", "test2"], + }); + + const ComponentWithFF = defineComponent({ + setup() { + const test = useFeatureFlag("test"); + const test2 = useFeatureFlag("test2"); + return () => + h("div", [ + test.value + ? h("span", { "data-testid": "test" }, "Secret") + : null, + test2.value + ? h("span", { "data-testid": "test2" }, "SUPER SECRET") + : null, + ]); + }, + }); + + const app = createSSRApp({ + render: () => + h( + AbbyProvider, + { + initialData: { + flags: [ + { + value: true, + name: "test", + }, + { + value: false, + name: "test2", + }, + ], + tests: [], + remoteConfig: [], + }, + }, + { + default: () => h(ComponentWithFF), + } + ), + }); + + const serverSideHTML = await renderToString(app); + + expect(serverSideHTML).toContain("Secret"); + expect(serverSideHTML).not.toContain("SUPER SECRET"); + }); +}); + +describe("useRemoteConfig", () => { + it("renders the correct remoteConfig value on the server", async () => { + const { AbbyProvider, useRemoteConfig } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + remoteConfig: { remoteConfig1: "String" }, + }); + + const ComponentWithRC = defineComponent({ + setup() { + const remoteConfig1 = useRemoteConfig("remoteConfig1"); + return () => + h("div", [ + h("span", { "data-testid": "test" }, String(remoteConfig1.value)), + ]); + }, + }); + + const app = createSSRApp({ + render: () => + h( + AbbyProvider, + { + initialData: { + flags: [ + { + value: true, + name: "test", + }, + { + value: false, + name: "test2", + }, + ], + tests: [], + remoteConfig: [{ name: "remoteConfig1", value: "FooBar" }], + }, + }, + { + default: () => h(ComponentWithRC), + } + ), + }); + + const serverSideHTML = await renderToString(app); + + expect(serverSideHTML).toContain("FooBar"); + }); +}); diff --git a/packages/vue/tests/types.test.ts b/packages/vue/tests/types.test.ts new file mode 100644 index 00000000..1665a9f0 --- /dev/null +++ b/packages/vue/tests/types.test.ts @@ -0,0 +1,157 @@ +import { mount } from "@vue/test-utils"; +import { type Component, defineComponent, h, nextTick } from "vue"; +import { createAbby } from "../src"; + +const OLD_ENV = process.env; + +beforeEach(() => { + vi.resetModules(); // Most important - it clears the cache + process.env = { ...OLD_ENV }; // Make a copy +}); + +afterAll(() => { + process.env = OLD_ENV; // Restore old environment +}); + +function mountComposable(AbbyProvider: Component, useFn: () => T) { + let result!: T; + const Probe = defineComponent({ + setup() { + result = useFn(); + return () => h("div"); + }, + }); + const wrapper = mount( + defineComponent({ + render() { + return h(AbbyProvider as any, null, { + default: () => h(Probe), + }); + }, + }) + ); + return { wrapper, result: () => result }; +} + +describe("useAbby", () => { + it("returns the correct types", async () => { + const test2Variants = [ + "SimonsText", + "MatthiasText", + "TomsText", + "TimsText", + ] as const; + + const { AbbyProvider, useAbby } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + tests: { + test: { variants: ["ONLY_ONE_VARIANT"] }, + test2: { + variants: test2Variants, + }, + }, + }); + + const { result: test1Result } = mountComposable(AbbyProvider, () => + useAbby("test") + ); + await nextTick(); + + // undefined covers the SSR/first render before the client resolves a variant + assertType<"ONLY_ONE_VARIANT" | undefined>(test1Result().variant.value); + + expect(test1Result().variant.value).toBeDefined(); + + const { result: test2Result } = mountComposable(AbbyProvider, () => + useAbby("test2") + ); + await nextTick(); + + assertType<(typeof test2Variants)[number] | undefined>( + test2Result().variant.value + ); + + expect(test2Result().variant.value).toBeDefined(); + }); +}); + +describe("useFeatureFlag", () => { + it("returns the correct types", async () => { + const { AbbyProvider, useFeatureFlag } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + flags: ["test"], + }); + + const { result: testFlagResult } = mountComposable(AbbyProvider, () => + useFeatureFlag("test") + ); + await nextTick(); + + expectTypeOf(testFlagResult().value).toEqualTypeOf(); + expectTypeOf(useFeatureFlag).parameter(0).toEqualTypeOf<"test">(); + }); + + describe("getVariants", () => { + it("has the correct types", () => { + const { getVariants } = createAbby({ + environments: [], + projectId: "123", + currentEnvironment: "test", + tests: { + test: { + variants: ["ONLY_ONE_VARIANT"], + }, + }, + flags: ["test"], + settings: { + flags: { + devOverrides: { + test: true, + }, + }, + }, + }); + expectTypeOf(getVariants("test")).toEqualTypeOf< + readonly ["ONLY_ONE_VARIANT"] + >(); + }); + }); +}); + +describe("useRemoteConfig", () => { + it("uses correct typings", async () => { + const { AbbyProvider, useRemoteConfig } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + remoteConfig: { + stringRc: "String", + numberRc: "Number", + jsonRc: "JSON", + }, + }); + + expectTypeOf(useRemoteConfig) + .parameter(0) + .toEqualTypeOf<"stringRc" | "numberRc" | "jsonRc">(); + + const { result: stringRcResult } = mountComposable(AbbyProvider, () => + useRemoteConfig("stringRc") + ); + const { result: numberRcResult } = mountComposable(AbbyProvider, () => + useRemoteConfig("numberRc") + ); + const { result: jsonRcResult } = mountComposable(AbbyProvider, () => + useRemoteConfig("jsonRc") + ); + await nextTick(); + + expectTypeOf(stringRcResult().value).toEqualTypeOf(); + expectTypeOf(numberRcResult().value).toEqualTypeOf(); + expectTypeOf(jsonRcResult().value).toEqualTypeOf>(); + }); +}); diff --git a/packages/vue/tests/useAbby.test.ts b/packages/vue/tests/useAbby.test.ts new file mode 100644 index 00000000..05d014ca --- /dev/null +++ b/packages/vue/tests/useAbby.test.ts @@ -0,0 +1,534 @@ +import { flushPromises, mount } from "@vue/test-utils"; +import { AbbyEventType, HttpService } from "@tryabby/core"; +import { type Component, defineComponent, h, nextTick } from "vue"; +import { createAbby } from "../src"; +import { TestStorageService } from "../src/StorageService"; + +const OLD_ENV = process.env; + +function clearCookies() { + for (const cookie of document.cookie.split(";")) { + const name = cookie.split("=")[0]?.trim(); + if (name) { + document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`; + } + } +} + +beforeEach(() => { + clearCookies(); + vi.resetModules(); // Most important - it clears the cache + process.env = { ...OLD_ENV }; // Make a copy +}); + +afterAll(() => { + process.env = OLD_ENV; // Restore old environment +}); + +/** + * Mounts a probe component that calls `useFn` inside `setup()` + * as a descendant of the given AbbyProvider. + */ +function mountComposable(AbbyProvider: Component, useFn: () => T) { + let result!: T; + const Probe = defineComponent({ + setup() { + result = useFn(); + return () => h("div"); + }, + }); + const wrapper = mount( + defineComponent({ + render() { + return h(AbbyProvider as any, null, { + default: () => h(Probe), + }); + }, + }) + ); + return { wrapper, result: () => result }; +} + +describe("useAbby", () => { + it("returns the correct amount of options", async () => { + const spy = vi.spyOn(TestStorageService, "set"); + + const { AbbyProvider, useAbby } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + tests: { + test: { variants: ["OldFooter", "NewFooter"] }, + test2: { + variants: ["SimonsText", "MatthiasText", "TomsText", "TimsText"], + }, + }, + }); + + const { result } = mountComposable(AbbyProvider, () => useAbby("test")); + await nextTick(); + + expect(spy).toHaveBeenCalled(); + expect(result().variant.value).toBeDefined(); + expect(result().onAct).toBeDefined(); + }); + + it("should use the persistedValue", async () => { + const persistedValue = "SimonsText"; + const variants = ["SimonsText", "MatthiasText", "TomsText", "TimsText"]; + + const getSpy = vi.spyOn(TestStorageService, "get"); + const setSpy = vi.spyOn(TestStorageService, "set"); + + getSpy.mockReturnValue(persistedValue); + + const { AbbyProvider, useAbby } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + tests: { + test: { variants }, + }, + }); + + const { result } = mountComposable(AbbyProvider, () => useAbby("test")); + await nextTick(); + + // the stored value should not be overwritten + expect(setSpy).not.toHaveBeenCalled(); + + // value set in localstorage + expect(result().variant.value).toEqual(persistedValue); + }); + + it("looks up the selected variant in the lookup object", async () => { + const persistedValue = "SimonsText"; + const variants = [ + "SimonsText", + "MatthiasText", + "TomsText", + "TimsText", + ] as const; + + const getSpy = vi.spyOn(TestStorageService, "get"); + getSpy.mockReturnValue(persistedValue); + + const { AbbyProvider, useAbby } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + tests: { + test: { variants }, + }, + }); + + const { result } = mountComposable(AbbyProvider, () => + useAbby("test", { + SimonsText: "a", + MatthiasText: "b", + TomsText: "c", + TimsText: "d", + }) + ); + await nextTick(); + + // value set in localstorage + expect(result().variant.value).toEqual("a"); + }); + + it("should ping the current info on mount", async () => { + const spy = vi.spyOn(HttpService, "sendData"); + const { AbbyProvider, useAbby } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + tests: { + test: { variants: ["A", "B", "C"] }, + }, + }); + + mountComposable(AbbyProvider, () => useAbby("test")); + await nextTick(); + + expect(spy).toHaveBeenCalledWith( + expect.objectContaining({ type: AbbyEventType.PING }) + ); + }); + + it("should notify the server with onAct", async () => { + const spy = vi.spyOn(HttpService, "sendData"); + const { AbbyProvider, useAbby } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + tests: { + test: { variants: ["A", "B", "C"] }, + }, + }); + + const { result } = mountComposable(AbbyProvider, () => useAbby("test")); + // let the mount PING flush first + await nextTick(); + + result().onAct(); + await nextTick(); + + // call history is restored between tests, so assert the ACT ping as the + // last sendData call of THIS test (mount PING flushes first) + expect(spy).toHaveBeenLastCalledWith( + expect.objectContaining({ type: AbbyEventType.ACT }) + ); + }); + + it("should return the correct feature flags", async () => { + const { AbbyProvider, useFeatureFlag } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + flags: ["flag1", "flag2"], + }); + + const { result: flag1 } = mountComposable(AbbyProvider, () => + useFeatureFlag("flag1") + ); + + // wait for the flag to be fetched + await vi.waitFor(() => expect(flag1().value).toEqual(true)); + + const { result: flag2 } = mountComposable(AbbyProvider, () => + useFeatureFlag("flag2") + ); + await flushPromises(); + + // wait for the flag to be fetched + await vi.waitFor(() => expect(flag2().value).toEqual(false)); + }); + + it("should respect the default values for feature flags", async () => { + const { AbbyProvider, useFeatureFlag } = createAbby({ + environments: [], + projectId: "123", + flags: ["flag1", "flag2"], + currentEnvironment: "a", + }); + + const { result: flag1 } = mountComposable(AbbyProvider, () => + useFeatureFlag("flag1") + ); + // the flag has not been fetched yet on first render, + // so the default value is returned (mirrors the React test, + // which asserts synchronously) + expect(flag1().value).toEqual(false); + }); + + it("uses the devOverrides", async () => { + process.env.NODE_ENV = "development"; + const { AbbyProvider, useFeatureFlag } = createAbby({ + environments: [], + projectId: "123", + flags: ["flag1", "flag2"], + currentEnvironment: "a", + settings: { + flags: { + devOverrides: { + flag1: false, + flag2: true, + }, + }, + }, + }); + + const { result: flag1 } = mountComposable(AbbyProvider, () => + useFeatureFlag("flag1") + ); + await flushPromises(); + + expect(flag1().value).toEqual(false); + + const { result: flag2 } = mountComposable(AbbyProvider, () => + useFeatureFlag("flag2") + ); + await flushPromises(); + + expect(flag2().value).toEqual(true); + }); + + it("gets the stored feature flag value using a function properly", async () => { + const { AbbyProvider, getFeatureFlagValue } = createAbby({ + environments: [], + projectId: "123", + flags: ["flag1", "flag2"], + currentEnvironment: "a", + }); + + // mount the provider so the project data is fetched from the server + mountComposable(AbbyProvider, () => null); + + // await server fetch + await vi.waitFor(() => expect(getFeatureFlagValue("flag1")).toEqual(true)); + expect(getFeatureFlagValue("flag2")).toEqual(false); + }); + + it("returns the correct possible variant values", () => { + const { getVariants } = createAbby({ + environments: [], + projectId: "123", + currentEnvironment: "a", + tests: { + test: { + variants: ["A", "B", "C"], + }, + }, + }); + expect(getVariants("test")).toEqual(["A", "B", "C"]); + }); + + it("uses the lookup object when retrieving a variant", () => { + const { getABTestValue } = createAbby({ + environments: [], + projectId: "123", + currentEnvironment: "a", + tests: { + test: { + variants: ["A", "B", "C"], + }, + }, + }); + + const activeVariant = getABTestValue("test"); + const lookupObject = { + A: 1, + B: 2, + C: 3, + }; + + expect(getABTestValue("test", lookupObject)).toEqual( + lookupObject[activeVariant] + ); + }); + + it("produces proper types with a lookup object", () => { + const { getABTestValue } = createAbby({ + environments: [], + projectId: "123", + currentEnvironment: "a", + tests: { + test: { + variants: ["A", "B", "C"], + }, + }, + }); + + const activeVariant = getABTestValue("test", { + A: "Hello", + B: "Bonjour", + C: "Hola", + }); + + expectTypeOf(activeVariant).toEqualTypeOf<"Hello" | "Bonjour" | "Hola">(); + }); + + it("produces proper types with a lookup object in the composable", async () => { + const { AbbyProvider, useAbby } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + tests: { + test: { + variants: ["A", "B", "C"], + }, + }, + }); + + const { result } = mountComposable(AbbyProvider, () => + useAbby("test", { + A: "Hello", + B: "Bonjour", + C: "Hola", + }) + ); + await nextTick(); + + expectTypeOf(result().variant.value).toEqualTypeOf< + "Hello" | "Bonjour" | "Hola" + >(); + }); + + it("returns correct remoteConfigValue", async () => { + const { AbbyProvider, useRemoteConfig } = createAbby({ + environments: [], + projectId: "123", + remoteConfig: { + remoteConfig1: "String", + }, + currentEnvironment: "a", + }); + + const { result } = mountComposable(AbbyProvider, () => + useRemoteConfig("remoteConfig1") + ); + + // await server fetch + await vi.waitFor(() => expect(result().value).toEqual("FooBar")); + }); + + it("uses defaultValues when remoteConfig is not set", async () => { + const { AbbyProvider, useRemoteConfig } = createAbby({ + environments: [], + projectId: "123", + remoteConfig: { + unsetRemoteConfig: "String", + }, + settings: { + remoteConfig: { + defaultValues: { + String: "defaultValue", + }, + }, + }, + currentEnvironment: "a", + }); + + const { result } = mountComposable(AbbyProvider, () => + useRemoteConfig("unsetRemoteConfig") + ); + + // await server fetch + await vi.waitFor(() => expect(result().value).toEqual("defaultValue")); + }); + + it("uses devOverride for remoteConfig", async () => { + process.env.NODE_ENV = "development"; + const { AbbyProvider, useRemoteConfig } = createAbby({ + environments: [], + projectId: "123", + remoteConfig: { + remoteConfig1: "String", + }, + settings: { + remoteConfig: { + devOverrides: { + remoteConfig1: "overwrittenValue", + }, + }, + }, + currentEnvironment: "a", + }); + + const { result } = mountComposable(AbbyProvider, () => + useRemoteConfig("remoteConfig1") + ); + + // await server fetch + await vi.waitFor(() => expect(result().value).toEqual("overwrittenValue")); + }); +}); + +it("has the correct types", async () => { + const { AbbyProvider, useAbby, useFeatureFlag } = createAbby({ + environments: [""], + currentEnvironment: "", + projectId: "123", + tests: { + test: { variants: ["OldFooter", "NewFooter"] }, + test2: { + variants: ["SimonsText", "MatthiasText", "TomsText", "TimsText"], + }, + }, + flags: ["flag1"], + }); + + expectTypeOf(useAbby).parameter(0).toEqualTypeOf<"test" | "test2">(); + + const { result } = mountComposable(AbbyProvider, () => useAbby("test")); + await nextTick(); + + expectTypeOf(result().variant.value).toEqualTypeOf< + "OldFooter" | "NewFooter" + >(); + + expectTypeOf(useFeatureFlag).parameters.toEqualTypeOf<["flag1"]>(); + + const { result: ffResult } = mountComposable(AbbyProvider, () => + useFeatureFlag("flag1") + ); + await nextTick(); + + expectTypeOf(ffResult().value).toEqualTypeOf(); +}); + +describe("useFeatureFlags()", () => { + it("returns the correct list of feature flags", async () => { + const { AbbyProvider, useFeatureFlags } = createAbby({ + environments: [], + currentEnvironment: "test", + projectId: "123", + tests: { + test: { variants: ["OldFooter", "NewFooter"] }, + test2: { + variants: ["SimonsText", "MatthiasText", "TomsText", "TimsText"], + }, + }, + flags: ["flag1"], + }); + + expectTypeOf(useFeatureFlags).parameter(0).toEqualTypeOf(); + + const { result } = mountComposable(AbbyProvider, () => useFeatureFlags()); + await nextTick(); + + expectTypeOf(result().value).toEqualTypeOf< + Array<{ + name: "flag1"; + value: boolean; + }> + >(); + + expect(result().value).toHaveLength(1); + // wait for the fetch + render to go through + await vi.waitFor(() => + expect(result().value.at(0)).toEqual({ + name: "flag1", + value: true, + }) + ); + }); +}); + +describe("useRemoteConfigVariables()", () => { + it("returns the correct list of remote config variables", async () => { + const { AbbyProvider, useRemoteConfigVariables } = createAbby({ + environments: [], + currentEnvironment: "test", + projectId: "123", + remoteConfig: { + remoteConfig1: "String", + }, + }); + + expectTypeOf(useRemoteConfigVariables) + .parameter(0) + .toEqualTypeOf(); + + const { result } = mountComposable(AbbyProvider, () => + useRemoteConfigVariables() + ); + await nextTick(); + + expectTypeOf(result().value).toEqualTypeOf< + Array<{ + name: "remoteConfig1"; + value: string; + }> + >(); + + expect(result().value).toHaveLength(1); + // wait for the fetch + render to go through + await vi.waitFor(() => + expect(result().value.at(0)).toEqual({ + name: "remoteConfig1", + value: expect.any(String), + }) + ); + }); +}); diff --git a/packages/vue/tsconfig.json b/packages/vue/tsconfig.json new file mode 100644 index 00000000..38b90efb --- /dev/null +++ b/packages/vue/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "tsconfig/base.json", + "compilerOptions": { + "lib": ["ESNext", "DOM"], + "module": "ESNext", + "moduleResolution": "bundler", + "target": "es2017", + "types": ["vitest/globals"] + } +} diff --git a/packages/vue/tsup.config.ts b/packages/vue/tsup.config.ts new file mode 100644 index 00000000..e6fa8e2b --- /dev/null +++ b/packages/vue/tsup.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + dts: true, + // we want to bundle the shared package because it is not published to npm + // it is hacky :) + noExternal: ["shared/src/types"], + clean: true, + format: ["cjs", "esm"], + sourcemap: true, + treeshake: true, +}); diff --git a/packages/vue/vite.config.ts b/packages/vue/vite.config.ts new file mode 100644 index 00000000..a030f9a6 --- /dev/null +++ b/packages/vue/vite.config.ts @@ -0,0 +1,17 @@ +/// + +import { defineConfig } from "vite"; + +export default defineConfig({ + resolve: { + // use the full build so @vue/test-utils can compile `template` strings + alias: { + vue: "vue/dist/vue.esm-bundler.js", + }, + }, + test: { + globals: true, + environment: "jsdom", + setupFiles: "./tests/setup.ts", + }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 69fa896e..e5899115 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -620,7 +620,7 @@ importers: version: 2.4.2 tsup: specifier: ^6.5.0 - version: 6.7.0(postcss@8.4.41)(ts-node@10.9.1(@types/node@20.3.1)(typescript@5.5.4))(typescript@5.5.4) + version: 6.7.0(postcss@8.5.28)(ts-node@10.9.1(@types/node@20.3.1)(typescript@5.5.4))(typescript@5.5.4) unconfig: specifier: ^0.3.10 version: 0.3.10 @@ -681,7 +681,7 @@ importers: version: link:../tsconfig tsup: specifier: ^6.5.0 - version: 6.7.0(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4))(typescript@5.5.4) + version: 6.7.0(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4))(typescript@5.5.4) typescript: specifier: 5.5.4 version: 5.5.4 @@ -757,7 +757,7 @@ importers: version: 3.59.1 svelte-check: specifier: ^2.10.3 - version: 2.10.3(@babel/core@7.23.6)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.4.41)(sass@1.77.8)(svelte@3.59.1) + version: 2.10.3(@babel/core@7.23.6)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.5.28)(sass@1.77.8)(svelte@3.59.1) tslib: specifier: ^2.5.0 version: 2.5.3 @@ -827,7 +827,7 @@ importers: version: link:../tsconfig tsup: specifier: ^6.5.0 - version: 6.7.0(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4))(typescript@5.5.4) + version: 6.7.0(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4))(typescript@5.5.4) typescript: specifier: 5.5.4 version: 5.5.4 @@ -876,7 +876,7 @@ importers: version: link:../tsconfig tsup: specifier: ^6.5.0 - version: 6.7.0(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4))(typescript@5.5.4) + version: 6.7.0(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4))(typescript@5.5.4) typescript: specifier: 5.5.4 version: 5.5.4 @@ -940,7 +940,7 @@ importers: version: link:../tsconfig tsup: specifier: ^6.5.0 - version: 6.7.0(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4))(typescript@5.5.4) + version: 6.7.0(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4))(typescript@5.5.4) typescript: specifier: 5.5.4 version: 5.5.4 @@ -1004,7 +1004,7 @@ importers: version: link:../tsconfig tsup: specifier: ^6.5.0 - version: 6.7.0(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4))(typescript@5.5.4) + version: 6.7.0(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4))(typescript@5.5.4) typescript: specifier: 5.5.4 version: 5.5.4 @@ -1089,7 +1089,7 @@ importers: version: 3.59.1 svelte-check: specifier: ^2.10.3 - version: 2.10.3(@babel/core@7.24.9)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.4.41)(sass@1.77.8)(svelte@3.59.1) + version: 2.10.3(@babel/core@7.24.9)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.5.28)(sass@1.77.8)(svelte@3.59.1) tslib: specifier: ^2.5.0 version: 2.5.3 @@ -1108,6 +1108,58 @@ importers: packages/tsconfig: {} + packages/vue: + dependencies: + '@tryabby/core': + specifier: workspace:* + version: link:../core + js-cookie: + specifier: ^3.0.1 + version: 3.0.5 + devDependencies: + '@testing-library/jest-dom': + specifier: ^5.16.5 + version: 5.16.5 + '@tryabby/devtools': + specifier: workspace:* + version: link:../devtools + '@types/js-cookie': + specifier: ^3.0.3 + version: 3.0.3 + '@vue/server-renderer': + specifier: ^3.4.0 + version: 3.5.43 + '@vue/test-utils': + specifier: ^2.5.0 + version: 2.5.1(@vue/compiler-dom@3.5.43)(@vue/server-renderer@3.5.43)(vue@3.5.43(typescript@5.5.4)) + jsdom: + specifier: ^20.0.3 + version: 20.0.3 + msw: + specifier: ^0.49.1 + version: 0.49.3(encoding@0.1.13)(typescript@5.5.4) + node-fetch: + specifier: ^3.3.0 + version: 3.3.2 + tsconfig: + specifier: workspace:* + version: link:../tsconfig + tsup: + specifier: ^6.5.0 + version: 6.7.0(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4))(typescript@5.5.4) + typescript: + specifier: 5.5.4 + version: 5.5.4 + vite: + specifier: 5.4.0 + version: 5.4.0(@types/node@22.1.0)(less@4.2.0)(sass@1.77.8)(terser@5.31.1) + vitest: + specifier: 2.0.5 + version: 2.0.5(@types/node@22.1.0)(jsdom@20.0.3)(less@4.2.0)(sass@1.77.8)(terser@5.31.1) + vue: + specifier: ^3.4.0 + version: 3.5.43(typescript@5.5.4) + packages: '@adobe/css-tools@4.2.0': @@ -1582,6 +1634,10 @@ packages: resolution: {integrity: sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==} engines: {node: '>=6.9.0'} + '@babel/helper-string-parser@7.29.7': + resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} + engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.22.20': resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} @@ -1590,6 +1646,10 @@ packages: resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.29.7': + resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} + engines: {node: '>=6.9.0'} + '@babel/helper-validator-option@7.22.5': resolution: {integrity: sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==} engines: {node: '>=6.9.0'} @@ -1671,6 +1731,11 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + '@babel/parser@7.29.9': + resolution: {integrity: sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==} + engines: {node: '>=6.0.0'} + hasBin: true + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.3': resolution: {integrity: sha512-wUrcsxZg6rqBXG05HG1FPYgsP6EvwF4WpBbxIpWIIYnH8wG0gzx3yZY3dtEHas4sTAOGkbTsc9EGPxwff8lRoA==} engines: {node: '>=6.9.0'} @@ -2673,6 +2738,10 @@ packages: resolution: {integrity: sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==} engines: {node: '>=6.9.0'} + '@babel/types@7.29.8': + resolution: {integrity: sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==} + engines: {node: '>=6.9.0'} + '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} @@ -2892,7 +2961,7 @@ packages: '@emotion/use-insertion-effect-with-fallbacks@1.0.1': resolution: {integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==} peerDependencies: - react: ^18.2.0 + react: '>=16.8.0' '@esbuild-plugins/node-globals-polyfill@0.2.3': resolution: {integrity: sha512-r3MIryXDeXDOZh7ih1l/yE9ZLORCd5e8vWg02azWRGj5SPTuoh69A2AIyn0Z31V/kHBfZ4HgWJ+OK3GTTwLmnw==} @@ -3750,6 +3819,9 @@ packages: '@jridgewell/sourcemap-codec@1.4.15': resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + '@jridgewell/trace-mapping@0.3.18': resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} @@ -3845,7 +3917,7 @@ packages: '@mdx-js/react@2.3.0': resolution: {integrity: sha512-zQH//gdOmuu7nt2oJR29vFhDv88oGPmVw6BggmrHeMI+xgEkp1B2dX9/bMBSYtK0dyLX/aOmesKS09g222K1/g==} peerDependencies: - react: ^18.2.0 + react: '>=16' '@mdx-js/react@3.0.0': resolution: {integrity: sha512-nDctevR9KyYFyV+m+/+S4cpzCWHqj+iHDHq3QrsWezcC+B17uZdIWgCguESUkwFhM3n/56KxWVE3V6EokrmONQ==} @@ -4295,6 +4367,9 @@ packages: resolution: {integrity: sha512-TUkJLtI163Bz5+JK0O+zDkQpn4gKwN+BovclUvCj6pI/6RXrFqQvUMRS2M+Rt8Rv0qR3wjoMoOPmpJKeOh0nBg==} engines: {node: '>= 18'} + '@one-ini/wasm@0.2.1': + resolution: {integrity: sha512-TUqERXGNTifZ9y2g3wPxQrw3HpHv/02DsW3D90T9x0hhonrL1ZqpSmNrU2XkoIq0fP1N6gZfVQzy2Fw1ZvGBNg==} + '@open-draft/until@1.0.3': resolution: {integrity: sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q==} @@ -4671,8 +4746,8 @@ packages: '@radix-ui/react-direction@1.1.0': resolution: {integrity: sha512-BUuBvgThEiAXh2DWu93XsT+a3aWrGqolGlqqw5VU1kG7p/ZH2cuDlM1sRLNnY3QcBS69UIz2mcKhMxDsdewhjg==} peerDependencies: - '@types/react': 18.0.26 - react: ^18.2.0 + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -5161,8 +5236,8 @@ packages: '@radix-ui/react-use-layout-effect@1.1.0': resolution: {integrity: sha512-+FPE0rOdziWSrH9athwI1R0HDVbWlEhd+FR+aSDk4uWGmSJ9Z54sdZVDQPZAinJhJXwfT+qnj969mCsT2gfm5w==} peerDependencies: - '@types/react': 18.0.26 - react: ^18.2.0 + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc peerDependenciesMeta: '@types/react': optional: true @@ -6690,9 +6765,21 @@ packages: '@vue/compiler-core@3.4.24': resolution: {integrity: sha512-vbW/tgbwJYj62N/Ww99x0zhFTkZDTcGh3uwJEuadZ/nF9/xuFMC4693P9r+3sxGXISABpDKvffY5ApH9pmdd1A==} + '@vue/compiler-core@3.5.43': + resolution: {integrity: sha512-zdiLhnbe1QQqgDT8xZMpNmyqZ3qlI+/Q/FHQco57Kwl/b05HhCzN6eVGN9QU9rbga4CrS0H5SYY8VGHZCt/1Hg==} + '@vue/compiler-dom@3.4.24': resolution: {integrity: sha512-4XgABML/4cNndVsQndG6BbGN7+EoisDwi3oXNovqL/4jdNhwvP8/rfRMTb6FxkxIxUUtg6AI1/qZvwfSjxJiWA==} + '@vue/compiler-dom@3.5.43': + resolution: {integrity: sha512-PEZoAk3NQmsn/ejMzSOCyTYqwGqczrWm70PuhBKjjv1+TCoQAaO/zOqNwjV+honlNstT5ILxtc+8r8UUfj+iEQ==} + + '@vue/compiler-sfc@3.5.43': + resolution: {integrity: sha512-FCbrG3XNCRl+js3huuKx4IVHBLTvMkJhVepjbxSPu1gn4yWLaYtGNQdjJGZaMytXB6qb76qQDDmDSLy/vkmleQ==} + + '@vue/compiler-ssr@3.5.43': + resolution: {integrity: sha512-GF62orf7KiJX9RqrHNGrYBudsQGD0OhJ5nDs90O8UiDuS40+YMYomiXu6w6EuvtXuRDc3MSNis3EaaSKAVSWpg==} + '@vue/language-core@1.8.27': resolution: {integrity: sha512-L8Kc27VdQserNaCUNiSFdDl9LWT24ly8Hpwf1ECy3aFb9m6bDhBGQYOujDm21N7EW3moKIOKEanQwe1q5BK+mA==} peerDependencies: @@ -6701,9 +6788,34 @@ packages: typescript: optional: true + '@vue/reactivity@3.5.43': + resolution: {integrity: sha512-G/c9GyOZNI2jVaaS6OX1EF1SSFSv7H0ERqNTl4+DTFMlZmB5eVAB53aLQNam/7NL2NPtaDD7RdVrzf8uJzMuOA==} + + '@vue/runtime-core@3.5.43': + resolution: {integrity: sha512-hU6U6VnVhBGQDpvlnnDlIB8ZGJBiOcgk2lh/0InltHiz3D8oSkluvuvY+do1G2H3+udeKFsmaBlgVYP7gXQzEw==} + + '@vue/runtime-dom@3.5.43': + resolution: {integrity: sha512-Bb2Jc0YjjJdMt1SJmb9b2L/IWd3I8lIT9x9eS/xvvP9CiVgna0ffua74xKRmt4/uSJ+0r4iN8ex1jrqkhQGWQw==} + + '@vue/server-renderer@3.5.43': + resolution: {integrity: sha512-l2Ygjv9NehV94PSBxNWsAHC0j/eIIKbn92mBuWXAPGLnn6HfJ6MH5ubsd+Nk0YoZ5FRuxWI1P2VSoh+dbPQhCQ==} + '@vue/shared@3.4.24': resolution: {integrity: sha512-BW4tajrJBM9AGAknnyEw5tO2xTmnqgup0VTnDAMcxYmqOX0RG0b9aSUGAbEKolD91tdwpA6oCwbltoJoNzpItw==} + '@vue/shared@3.5.43': + resolution: {integrity: sha512-uksS7YGMR5NZyr4JNq0Rp+QyLns0ueaz20KwzIPW9R0LH1Vnt4E+XUM29PNseEbf1www2gOuhuDi5AKOIXag9Q==} + + '@vue/test-utils@2.5.1': + resolution: {integrity: sha512-V/4a99odJ7hapr0bRt35XxljGk8hefq31gSOnlKTcEq2fUeoj2qb+FcpJYfQu4qfYhW9Ug+O2+CZ3QmZ7gXDzA==} + peerDependencies: + '@vue/compiler-dom': 3.x + '@vue/server-renderer': 3.x + vue: 3.x + peerDependenciesMeta: + '@vue/server-renderer': + optional: true + '@web3-storage/multipart-parser@1.0.0': resolution: {integrity: sha512-BEO6al7BYqcnfX15W2cnGR+Q566ACXAT9UQykORCWW80lmkpWsnEob6zJS1ZVBKsSJC8+7vJkHwlp+lXG1UCdw==} @@ -6786,6 +6898,10 @@ packages: resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + abbrev@5.0.0: + resolution: {integrity: sha512-/XrFJgzQQQHpti1raDJC6m4ws6aNktmjBlhk8Fdlk7LwCEuDoieEJJY9OFHjfiFJFFRM2tK+Ky/IsfbbmlMu1w==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -7141,6 +7257,10 @@ packages: balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} + base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -7206,6 +7326,10 @@ packages: brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + brace-expansion@5.0.12: + resolution: {integrity: sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==} + engines: {node: 20 || >=22} + braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} @@ -7576,6 +7700,10 @@ packages: resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} engines: {node: '>=18'} + commander@14.0.3: + resolution: {integrity: sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==} + engines: {node: '>=20'} + commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -7796,6 +7924,9 @@ packages: csstype@3.1.2: resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + csv-generate@3.4.3: resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} @@ -8276,6 +8407,11 @@ packages: resolution: {integrity: sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==} hasBin: true + editorconfig@3.0.2: + resolution: {integrity: sha512-T0ix8GhtxyKVfUFEcvdNDt3YGqlwkFHbD4/5bgFUDgFmxhI/cSRAeJ87/Sz//Cq8Eam6JX/e23RkoFO71P7aAA==} + engines: {node: '>=20'} + hasBin: true + ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} @@ -8345,6 +8481,10 @@ packages: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} + entities@7.0.1: + resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==} + engines: {node: '>=0.12'} + env-paths@2.2.1: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} @@ -8994,6 +9134,10 @@ packages: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true + glob@13.0.6: + resolution: {integrity: sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==} + engines: {node: 18 || 20 || >=22} + glob@7.1.6: resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} deprecated: Glob versions prior to v9 are no longer supported @@ -9882,10 +10026,18 @@ packages: engines: {node: '>=12'} hasBin: true + js-beautify@2.0.3: + resolution: {integrity: sha512-cyFbh3tkPhknnTD/0bLf0T0yy2ZIbqL05mttzbt4y1Zfr7NxqXQZ62dkBLKs3oHH/lpjmDRAnciJiSUyOy8XwQ==} + engines: {node: '>=14'} + hasBin: true + js-cookie@3.0.5: resolution: {integrity: sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==} engines: {node: '>=14'} + js-cookie@3.0.8: + resolution: {integrity: sha512-yeJd4aNAdYZQjaon2bpD/Gb0B/omw7HQOsynXXcOiWVCacbBcPlgn8S/d1X6blFSaHao7ozqtW7NZW19xpCtIw==} + js-levenshtein@1.1.6: resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==} engines: {node: '>=0.10.0'} @@ -10220,6 +10372,10 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + lru-cache@11.5.3: + resolution: {integrity: sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==} + engines: {node: 20 || >=22} + lru-cache@4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} @@ -10261,6 +10417,9 @@ packages: magic-string@0.30.10: resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==} + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + magic-string@0.30.8: resolution: {integrity: sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==} engines: {node: '>=12'} @@ -10713,6 +10872,10 @@ packages: minimalistic-assert@1.0.1: resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + minimatch@10.2.6: + resolution: {integrity: sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==} + engines: {node: 18 || 20 || >=22} + minimatch@3.0.8: resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==} @@ -10774,6 +10937,10 @@ packages: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + minizlib@2.1.2: resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} engines: {node: '>= 8'} @@ -10884,6 +11051,11 @@ packages: mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + nanoid@3.3.19: + resolution: {integrity: sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + nanoid@3.3.6: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -11131,6 +11303,11 @@ packages: resolution: {integrity: sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==} hasBin: true + nopt@10.0.1: + resolution: {integrity: sha512-df3sBr/6ax9hSGuC3CspvLlbnX8cP5L5nZwXF8cGN8l0zSWR6BvzmQ6jPUKjvo6+/xdpkNvEcucBNUdBeeV13g==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + hasBin: true + nopt@6.0.0: resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -11516,6 +11693,10 @@ packages: resolution: {integrity: sha512-qSDLy2aGFPm8i4rsbHd4MNyTcrzHFsLQykrtbuGRknZZCBBVXSv2tSCDN2Cg6Rt/GFRw8GoW9y9Ecw5rIPG1sg==} engines: {node: '>=16 || 14 >=14.17'} + path-scurry@2.0.2: + resolution: {integrity: sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==} + engines: {node: 18 || 20 || >=22} + path-to-regexp@0.1.7: resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} @@ -11569,6 +11750,9 @@ packages: picocolors@1.0.1: resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} @@ -11735,6 +11919,10 @@ packages: resolution: {integrity: sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==} engines: {node: ^10 || ^12 || >=14} + postcss@8.5.28: + resolution: {integrity: sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==} + engines: {node: ^10 || ^12 || >=14} + postgres-array@2.0.0: resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} engines: {node: '>=4'} @@ -12587,6 +12775,11 @@ packages: engines: {node: '>=10'} hasBin: true + semver@7.8.5: + resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} + engines: {node: '>=10'} + hasBin: true + send@0.18.0: resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} engines: {node: '>= 0.8.0'} @@ -12771,6 +12964,10 @@ packages: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + source-map-loader@5.0.0: resolution: {integrity: sha512-k2Dur7CbSLcAH73sBcIkV5xjPV4SzqO1NJ7+XaQl8if3VODDUj3FNchNGpqgJSKbvUfJuhVdv8K2Eu8/TNl2eA==} engines: {node: '>= 18.12.0'} @@ -13964,6 +14161,9 @@ packages: vscode-textmate@8.0.0: resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} + vue-component-type-helpers@3.3.11: + resolution: {integrity: sha512-LwcxzeliO9fkQcpJG0PoX8X5kmAhKmH9wkpDLxNabwzkQ9Zeib2YVHwFV4pcWmMLfXVfjr/dSV+DaJ3cIPgSNA==} + vue-template-compiler@2.7.16: resolution: {integrity: sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==} @@ -13973,6 +14173,14 @@ packages: peerDependencies: typescript: '*' + vue@3.5.43: + resolution: {integrity: sha512-o5qZoksdnjIKvW1srZ3ab7pcDNYAerBjRe54D0LBLfRdCYFrSgBHVXokMas35czQc0//lmx4/tuY4ZNQ+Rf2Ng==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + w3c-keyname@2.2.8: resolution: {integrity: sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==} @@ -14046,7 +14254,7 @@ packages: engines: {node: '>= 18.12.0'} hasBin: true peerDependencies: - webpack: 5.93.0 + webpack: ^5.0.0 webpack-cli: '*' peerDependenciesMeta: webpack: @@ -14411,7 +14619,7 @@ snapshots: dependencies: '@ampproject/remapping': 2.3.0 '@angular-devkit/architect': 0.1801.3(chokidar@3.6.0) - '@angular-devkit/build-webpack': 0.1801.3(chokidar@3.6.0)(webpack-dev-server@5.0.4(webpack@5.92.1))(webpack@5.92.1(esbuild@0.21.5)) + '@angular-devkit/build-webpack': 0.1801.3(chokidar@3.6.0)(webpack-dev-server@5.0.4(webpack@5.92.1))(webpack@5.92.1) '@angular-devkit/core': 18.1.3(chokidar@3.6.0) '@angular/build': 18.1.3(@angular/compiler-cli@18.1.3(@angular/compiler@18.1.3(@angular/core@18.1.3(rxjs@7.8.1)(zone.js@0.12.0)))(typescript@5.5.4))(@types/node@20.3.1)(chokidar@3.6.0)(less@4.2.0)(postcss@8.4.38)(tailwindcss@3.3.2(ts-node@10.9.1(@types/node@20.3.1)(typescript@5.5.4)))(terser@5.29.2)(typescript@5.5.4) '@angular/compiler-cli': 18.1.3(@angular/compiler@18.1.3(@angular/core@18.1.3(rxjs@7.8.1)(zone.js@0.12.0)))(typescript@5.5.4) @@ -14425,15 +14633,15 @@ snapshots: '@babel/preset-env': 7.24.7(@babel/core@7.24.7) '@babel/runtime': 7.24.7 '@discoveryjs/json-ext': 0.5.7 - '@ngtools/webpack': 18.1.3(@angular/compiler-cli@18.1.3(@angular/compiler@18.1.3(@angular/core@18.1.3(rxjs@7.8.1)(zone.js@0.12.0)))(typescript@5.5.4))(typescript@5.5.4)(webpack@5.92.1(esbuild@0.21.5)) + '@ngtools/webpack': 18.1.3(@angular/compiler-cli@18.1.3(@angular/compiler@18.1.3(@angular/core@18.1.3(rxjs@7.8.1)(zone.js@0.12.0)))(typescript@5.5.4))(typescript@5.5.4)(webpack@5.92.1) '@vitejs/plugin-basic-ssl': 1.1.0(vite@5.3.2(@types/node@20.3.1)(less@4.2.0)(sass@1.77.6)(terser@5.29.2)) ansi-colors: 4.1.3 autoprefixer: 10.4.19(postcss@8.4.38) - babel-loader: 9.1.3(@babel/core@7.24.7)(webpack@5.92.1(esbuild@0.21.5)) + babel-loader: 9.1.3(@babel/core@7.24.7)(webpack@5.92.1) browserslist: 4.23.1 - copy-webpack-plugin: 12.0.2(webpack@5.92.1(esbuild@0.21.5)) + copy-webpack-plugin: 12.0.2(webpack@5.92.1) critters: 0.0.24 - css-loader: 7.1.2(webpack@5.92.1(esbuild@0.21.5)) + css-loader: 7.1.2(webpack@5.92.1) esbuild-wasm: 0.21.5 fast-glob: 3.3.2 http-proxy-middleware: 3.0.0 @@ -14442,11 +14650,11 @@ snapshots: jsonc-parser: 3.3.1 karma-source-map-support: 1.4.0 less: 4.2.0 - less-loader: 12.2.0(less@4.2.0)(webpack@5.92.1(esbuild@0.21.5)) - license-webpack-plugin: 4.0.2(webpack@5.92.1(esbuild@0.21.5)) + less-loader: 12.2.0(less@4.2.0)(webpack@5.92.1) + license-webpack-plugin: 4.0.2(webpack@5.92.1) loader-utils: 3.3.1 magic-string: 0.30.10 - mini-css-extract-plugin: 2.9.0(webpack@5.92.1(esbuild@0.21.5)) + mini-css-extract-plugin: 2.9.0(webpack@5.92.1) mrmime: 2.0.0 open: 10.1.0 ora: 5.4.1 @@ -14454,13 +14662,13 @@ snapshots: picomatch: 4.0.2 piscina: 4.6.1 postcss: 8.4.38 - postcss-loader: 8.1.1(postcss@8.4.38)(typescript@5.5.4)(webpack@5.92.1(esbuild@0.21.5)) + postcss-loader: 8.1.1(postcss@8.4.38)(typescript@5.5.4)(webpack@5.92.1) resolve-url-loader: 5.0.0 rxjs: 7.8.1 sass: 1.77.6 - sass-loader: 14.2.1(sass@1.77.6)(webpack@5.92.1(esbuild@0.21.5)) + sass-loader: 14.2.1(sass@1.77.6)(webpack@5.92.1) semver: 7.6.2 - source-map-loader: 5.0.0(webpack@5.92.1(esbuild@0.21.5)) + source-map-loader: 5.0.0(webpack@5.92.1) source-map-support: 0.5.21 terser: 5.29.2 tree-kill: 1.2.2 @@ -14473,7 +14681,7 @@ snapshots: webpack-dev-middleware: 7.2.1(webpack@5.92.1) webpack-dev-server: 5.0.4(webpack@5.92.1) webpack-merge: 5.10.0 - webpack-subresource-integrity: 5.1.0(webpack@5.92.1(esbuild@0.21.5)) + webpack-subresource-integrity: 5.1.0(webpack@5.92.1) optionalDependencies: esbuild: 0.21.5 karma: 6.4.0 @@ -14497,7 +14705,7 @@ snapshots: - utf-8-validate - webpack-cli - '@angular-devkit/build-webpack@0.1801.3(chokidar@3.6.0)(webpack-dev-server@5.0.4(webpack@5.92.1))(webpack@5.92.1(esbuild@0.21.5))': + '@angular-devkit/build-webpack@0.1801.3(chokidar@3.6.0)(webpack-dev-server@5.0.4(webpack@5.92.1))(webpack@5.92.1)': dependencies: '@angular-devkit/architect': 0.1801.3(chokidar@3.6.0) rxjs: 7.8.1 @@ -15239,10 +15447,14 @@ snapshots: '@babel/helper-string-parser@7.24.8': {} + '@babel/helper-string-parser@7.29.7': {} + '@babel/helper-validator-identifier@7.22.20': {} '@babel/helper-validator-identifier@7.24.7': {} + '@babel/helper-validator-identifier@7.29.7': {} + '@babel/helper-validator-option@7.22.5': {} '@babel/helper-validator-option@7.23.5': {} @@ -15340,6 +15552,10 @@ snapshots: dependencies: '@babel/types': 7.25.2 + '@babel/parser@7.29.9': + dependencies: + '@babel/types': 7.29.8 + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.3(@babel/core@7.24.7)': dependencies: '@babel/core': 7.24.7 @@ -17180,6 +17396,11 @@ snapshots: '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 + '@babel/types@7.29.8': + dependencies: + '@babel/helper-string-parser': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + '@bcoe/v8-coverage@0.2.3': {} '@biomejs/biome@1.9.4': @@ -18088,6 +18309,8 @@ snapshots: '@jridgewell/sourcemap-codec@1.4.15': {} + '@jridgewell/sourcemap-codec@1.6.0': {} + '@jridgewell/trace-mapping@0.3.18': dependencies: '@jridgewell/resolve-uri': 3.1.0 @@ -18462,7 +18685,7 @@ snapshots: '@next/swc-win32-x64-msvc@14.1.1': optional: true - '@ngtools/webpack@18.1.3(@angular/compiler-cli@18.1.3(@angular/compiler@18.1.3(@angular/core@18.1.3(rxjs@7.8.1)(zone.js@0.12.0)))(typescript@5.5.4))(typescript@5.5.4)(webpack@5.92.1(esbuild@0.21.5))': + '@ngtools/webpack@18.1.3(@angular/compiler-cli@18.1.3(@angular/compiler@18.1.3(@angular/core@18.1.3(rxjs@7.8.1)(zone.js@0.12.0)))(typescript@5.5.4))(typescript@5.5.4)(webpack@5.92.1)': dependencies: '@angular/compiler-cli': 18.1.3(@angular/compiler@18.1.3(@angular/core@18.1.3(rxjs@7.8.1)(zone.js@0.12.0)))(typescript@5.5.4) typescript: 5.5.4 @@ -18691,6 +18914,8 @@ snapshots: '@octokit/request-error': 6.1.4 '@octokit/webhooks-methods': 5.1.0 + '@one-ini/wasm@0.2.1': {} + '@open-draft/until@1.0.3': {} '@openpanel/nextjs@1.0.3(next@14.1.1(@babel/core@7.24.7)(@opentelemetry/api@1.9.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(sass@1.77.8))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': @@ -21847,11 +22072,41 @@ snapshots: estree-walker: 2.0.2 source-map-js: 1.2.0 + '@vue/compiler-core@3.5.43': + dependencies: + '@babel/parser': 7.29.9 + '@vue/shared': 3.5.43 + entities: 7.0.1 + estree-walker: 2.0.2 + source-map-js: 1.2.1 + '@vue/compiler-dom@3.4.24': dependencies: '@vue/compiler-core': 3.4.24 '@vue/shared': 3.4.24 + '@vue/compiler-dom@3.5.43': + dependencies: + '@vue/compiler-core': 3.5.43 + '@vue/shared': 3.5.43 + + '@vue/compiler-sfc@3.5.43': + dependencies: + '@babel/parser': 7.29.9 + '@vue/compiler-core': 3.5.43 + '@vue/compiler-dom': 3.5.43 + '@vue/compiler-ssr': 3.5.43 + '@vue/shared': 3.5.43 + estree-walker: 2.0.2 + magic-string: 0.30.21 + postcss: 8.5.28 + source-map-js: 1.2.1 + + '@vue/compiler-ssr@3.5.43': + dependencies: + '@vue/compiler-dom': 3.5.43 + '@vue/shared': 3.5.43 + '@vue/language-core@1.8.27(typescript@5.5.4)': dependencies: '@volar/language-core': 1.11.1 @@ -21866,8 +22121,41 @@ snapshots: optionalDependencies: typescript: 5.5.4 + '@vue/reactivity@3.5.43': + dependencies: + '@vue/shared': 3.5.43 + + '@vue/runtime-core@3.5.43': + dependencies: + '@vue/reactivity': 3.5.43 + '@vue/shared': 3.5.43 + + '@vue/runtime-dom@3.5.43': + dependencies: + '@vue/reactivity': 3.5.43 + '@vue/runtime-core': 3.5.43 + '@vue/shared': 3.5.43 + csstype: 3.2.3 + + '@vue/server-renderer@3.5.43': + dependencies: + '@vue/compiler-ssr': 3.5.43 + '@vue/runtime-dom': 3.5.43 + '@vue/shared': 3.5.43 + '@vue/shared@3.4.24': {} + '@vue/shared@3.5.43': {} + + '@vue/test-utils@2.5.1(@vue/compiler-dom@3.5.43)(@vue/server-renderer@3.5.43)(vue@3.5.43(typescript@5.5.4))': + dependencies: + '@vue/compiler-dom': 3.5.43 + js-beautify: 2.0.3 + vue: 3.5.43(typescript@5.5.4) + vue-component-type-helpers: 3.3.11 + optionalDependencies: + '@vue/server-renderer': 3.5.43 + '@web3-storage/multipart-parser@1.0.0': {} '@webassemblyjs/ast@1.12.1': @@ -21968,6 +22256,8 @@ snapshots: abbrev@2.0.0: {} + abbrev@5.0.0: {} + abort-controller@3.0.0: dependencies: event-target-shim: 5.0.1 @@ -22234,7 +22524,7 @@ snapshots: dependencies: '@babel/core': 7.24.4 - babel-loader@9.1.3(@babel/core@7.24.7)(webpack@5.92.1(esbuild@0.21.5)): + babel-loader@9.1.3(@babel/core@7.24.7)(webpack@5.92.1): dependencies: '@babel/core': 7.24.7 find-cache-dir: 4.0.0 @@ -22327,6 +22617,8 @@ snapshots: balanced-match@1.0.2: {} + balanced-match@4.0.4: {} + base64-js@1.5.1: {} base64id@2.0.0: {} @@ -22407,6 +22699,10 @@ snapshots: dependencies: balanced-match: 1.0.2 + brace-expansion@5.0.12: + dependencies: + balanced-match: 4.0.4 + braces@3.0.2: dependencies: fill-range: 7.0.1 @@ -22798,6 +23094,8 @@ snapshots: commander@12.1.0: {} + commander@14.0.3: {} + commander@2.20.3: {} commander@4.1.1: {} @@ -22907,7 +23205,7 @@ snapshots: dependencies: is-what: 4.1.15 - copy-webpack-plugin@12.0.2(webpack@5.92.1(esbuild@0.21.5)): + copy-webpack-plugin@12.0.2(webpack@5.92.1): dependencies: fast-glob: 3.3.2 glob-parent: 6.0.2 @@ -22981,7 +23279,7 @@ snapshots: crypto-random-string@2.0.0: {} - css-loader@7.1.2(webpack@5.92.1(esbuild@0.21.5)): + css-loader@7.1.2(webpack@5.92.1): dependencies: icss-utils: 5.1.0(postcss@8.4.38) postcss: 8.4.38 @@ -23018,6 +23316,8 @@ snapshots: csstype@3.1.2: {} + csstype@3.2.3: {} + csv-generate@3.4.3: {} csv-parse@4.16.3: {} @@ -23508,6 +23808,13 @@ snapshots: semver: 5.7.1 sigmund: 1.0.1 + editorconfig@3.0.2: + dependencies: + '@one-ini/wasm': 0.2.1 + commander: 14.0.3 + minimatch: 10.2.6 + semver: 7.8.5 + ee-first@1.1.1: {} ejs@3.1.9: @@ -23575,6 +23882,8 @@ snapshots: entities@4.5.0: {} + entities@7.0.1: {} + env-paths@2.2.1: {} envinfo@7.8.1: {} @@ -24460,6 +24769,12 @@ snapshots: package-json-from-dist: 1.0.0 path-scurry: 1.11.1 + glob@13.0.6: + dependencies: + minimatch: 10.2.6 + minipass: 7.1.3 + path-scurry: 2.0.2 + glob@7.1.6: dependencies: fs.realpath: 1.0.0 @@ -25507,8 +25822,18 @@ snapshots: glob: 8.1.0 nopt: 6.0.0 + js-beautify@2.0.3: + dependencies: + config-chain: 1.1.13 + editorconfig: 3.0.2 + glob: 13.0.6 + js-cookie: 3.0.8 + nopt: 10.0.1 + js-cookie@3.0.5: {} + js-cookie@3.0.8: {} + js-levenshtein@1.1.6: {} js-tokens@4.0.0: {} @@ -25781,7 +26106,7 @@ snapshots: leac@0.6.0: {} - less-loader@12.2.0(less@4.2.0)(webpack@5.92.1(esbuild@0.21.5)): + less-loader@12.2.0(less@4.2.0)(webpack@5.92.1): dependencies: less: 4.2.0 optionalDependencies: @@ -25813,7 +26138,7 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - license-webpack-plugin@4.0.2(webpack@5.92.1(esbuild@0.21.5)): + license-webpack-plugin@4.0.2(webpack@5.92.1): dependencies: webpack-sources: 3.2.3 optionalDependencies: @@ -25961,6 +26286,8 @@ snapshots: lru-cache@10.4.3: {} + lru-cache@11.5.3: {} + lru-cache@4.1.5: dependencies: pseudomap: 1.0.2 @@ -26000,6 +26327,10 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + magic-string@0.30.8: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 @@ -26919,7 +27250,7 @@ snapshots: min-indent@1.0.1: {} - mini-css-extract-plugin@2.9.0(webpack@5.92.1(esbuild@0.21.5)): + mini-css-extract-plugin@2.9.0(webpack@5.92.1): dependencies: schema-utils: 4.1.0 tapable: 2.2.1 @@ -26948,6 +27279,10 @@ snapshots: minimalistic-assert@1.0.1: {} + minimatch@10.2.6: + dependencies: + brace-expansion: 5.0.12 + minimatch@3.0.8: dependencies: brace-expansion: 1.1.11 @@ -27010,6 +27345,8 @@ snapshots: minipass@7.1.2: {} + minipass@7.1.3: {} + minizlib@2.1.2: dependencies: minipass: 3.3.6 @@ -27150,6 +27487,8 @@ snapshots: object-assign: 4.1.1 thenify-all: 1.6.0 + nanoid@3.3.19: {} + nanoid@3.3.6: {} nanoid@3.3.7: {} @@ -27475,6 +27814,10 @@ snapshots: dependencies: abbrev: 1.1.1 + nopt@10.0.1: + dependencies: + abbrev: 5.0.0 + nopt@6.0.0: dependencies: abbrev: 1.1.1 @@ -27922,6 +28265,11 @@ snapshots: lru-cache: 9.1.2 minipass: 5.0.0 + path-scurry@2.0.2: + dependencies: + lru-cache: 11.5.3 + minipass: 7.1.3 + path-to-regexp@0.1.7: {} path-to-regexp@6.2.1: {} @@ -27968,6 +28316,8 @@ snapshots: picocolors@1.0.1: {} + picocolors@1.1.1: {} + picomatch@2.3.1: {} picomatch@4.0.2: {} @@ -28033,20 +28383,20 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.4.24 - postcss-load-config@3.1.4(postcss@8.4.41)(ts-node@10.9.1(@types/node@20.3.1)(typescript@5.5.4)): + postcss-load-config@3.1.4(postcss@8.5.28)(ts-node@10.9.1(@types/node@20.3.1)(typescript@5.5.4)): dependencies: lilconfig: 2.1.0 yaml: 1.10.2 optionalDependencies: - postcss: 8.4.41 + postcss: 8.5.28 ts-node: 10.9.1(@types/node@20.3.1)(typescript@5.5.4) - postcss-load-config@3.1.4(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)): + postcss-load-config@3.1.4(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)): dependencies: lilconfig: 2.1.0 yaml: 1.10.2 optionalDependencies: - postcss: 8.4.41 + postcss: 8.5.28 ts-node: 10.9.1(@types/node@22.1.0)(typescript@5.5.4) postcss-load-config@4.0.1(postcss@8.4.24)(ts-node@10.9.1(@types/node@18.16.17)(typescript@5.5.4)): @@ -28066,16 +28416,16 @@ snapshots: ts-node: 10.9.1(@types/node@20.3.1)(typescript@5.5.4) optional: true - postcss-load-config@4.0.1(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)): + postcss-load-config@4.0.1(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)): dependencies: lilconfig: 2.1.0 yaml: 2.3.1 optionalDependencies: - postcss: 8.4.41 + postcss: 8.5.28 ts-node: 10.9.1(@types/node@22.1.0)(typescript@5.5.4) optional: true - postcss-loader@8.1.1(postcss@8.4.38)(typescript@5.5.4)(webpack@5.92.1(esbuild@0.21.5)): + postcss-loader@8.1.1(postcss@8.4.38)(typescript@5.5.4)(webpack@5.92.1): dependencies: cosmiconfig: 9.0.0(typescript@5.5.4) jiti: 1.21.6 @@ -28156,6 +28506,12 @@ snapshots: picocolors: 1.0.1 source-map-js: 1.2.0 + postcss@8.5.28: + dependencies: + nanoid: 3.3.19 + picocolors: 1.1.1 + source-map-js: 1.2.1 + postgres-array@2.0.0: {} postgres-bytea@1.0.0: {} @@ -29018,7 +29374,7 @@ snapshots: mkdirp: 0.5.6 rimraf: 2.7.1 - sass-loader@14.2.1(sass@1.77.6)(webpack@5.92.1(esbuild@0.21.5)): + sass-loader@14.2.1(sass@1.77.6)(webpack@5.92.1): dependencies: neo-async: 2.6.2 optionalDependencies: @@ -29118,6 +29474,8 @@ snapshots: semver@7.6.2: {} + semver@7.8.5: {} + send@0.18.0: dependencies: debug: 2.6.9 @@ -29393,7 +29751,9 @@ snapshots: source-map-js@1.2.0: {} - source-map-loader@5.0.0(webpack@5.92.1(esbuild@0.21.5)): + source-map-js@1.2.1: {} + + source-map-loader@5.0.0(webpack@5.92.1): dependencies: iconv-lite: 0.6.3 source-map-js: 1.2.0 @@ -29689,7 +30049,7 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte-check@2.10.3(@babel/core@7.23.6)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.4.41)(sass@1.77.8)(svelte@3.59.1): + svelte-check@2.10.3(@babel/core@7.23.6)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.5.28)(sass@1.77.8)(svelte@3.59.1): dependencies: '@jridgewell/trace-mapping': 0.3.18 chokidar: 3.5.3 @@ -29698,7 +30058,7 @@ snapshots: picocolors: 1.0.0 sade: 1.8.1 svelte: 3.59.1 - svelte-preprocess: 4.10.7(@babel/core@7.23.6)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.4.41)(sass@1.77.8)(svelte@3.59.1)(typescript@5.5.4) + svelte-preprocess: 4.10.7(@babel/core@7.23.6)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.5.28)(sass@1.77.8)(svelte@3.59.1)(typescript@5.5.4) typescript: 5.5.4 transitivePeerDependencies: - '@babel/core' @@ -29712,7 +30072,7 @@ snapshots: - stylus - sugarss - svelte-check@2.10.3(@babel/core@7.24.9)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.4.41)(sass@1.77.8)(svelte@3.59.1): + svelte-check@2.10.3(@babel/core@7.24.9)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.5.28)(sass@1.77.8)(svelte@3.59.1): dependencies: '@jridgewell/trace-mapping': 0.3.18 chokidar: 3.5.3 @@ -29721,7 +30081,7 @@ snapshots: picocolors: 1.0.0 sade: 1.8.1 svelte: 3.59.1 - svelte-preprocess: 4.10.7(@babel/core@7.24.9)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.4.41)(sass@1.77.8)(svelte@3.59.1)(typescript@5.5.4) + svelte-preprocess: 4.10.7(@babel/core@7.24.9)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.5.28)(sass@1.77.8)(svelte@3.59.1)(typescript@5.5.4) typescript: 5.5.4 transitivePeerDependencies: - '@babel/core' @@ -29739,7 +30099,7 @@ snapshots: dependencies: svelte: 3.59.1 - svelte-preprocess@4.10.7(@babel/core@7.23.6)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.4.41)(sass@1.77.8)(svelte@3.59.1)(typescript@5.5.4): + svelte-preprocess@4.10.7(@babel/core@7.23.6)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.5.28)(sass@1.77.8)(svelte@3.59.1)(typescript@5.5.4): dependencies: '@types/pug': 2.0.6 '@types/sass': 1.45.0 @@ -29751,12 +30111,12 @@ snapshots: optionalDependencies: '@babel/core': 7.23.6 less: 4.2.0 - postcss: 8.4.41 - postcss-load-config: 4.0.1(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)) + postcss: 8.5.28 + postcss-load-config: 4.0.1(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)) sass: 1.77.8 typescript: 5.5.4 - svelte-preprocess@4.10.7(@babel/core@7.24.9)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.4.41)(sass@1.77.8)(svelte@3.59.1)(typescript@5.5.4): + svelte-preprocess@4.10.7(@babel/core@7.24.9)(less@4.2.0)(postcss-load-config@4.0.1(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)))(postcss@8.5.28)(sass@1.77.8)(svelte@3.59.1)(typescript@5.5.4): dependencies: '@types/pug': 2.0.6 '@types/sass': 1.45.0 @@ -29768,8 +30128,8 @@ snapshots: optionalDependencies: '@babel/core': 7.24.9 less: 4.2.0 - postcss: 8.4.41 - postcss-load-config: 4.0.1(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)) + postcss: 8.5.28 + postcss-load-config: 4.0.1(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)) sass: 1.77.8 typescript: 5.5.4 @@ -30151,7 +30511,7 @@ snapshots: tsscmp@1.0.6: {} - tsup@6.7.0(postcss@8.4.41)(ts-node@10.9.1(@types/node@20.3.1)(typescript@5.5.4))(typescript@5.5.4): + tsup@6.7.0(postcss@8.5.28)(ts-node@10.9.1(@types/node@20.3.1)(typescript@5.5.4))(typescript@5.5.4): dependencies: bundle-require: 4.0.1(esbuild@0.17.19) cac: 6.7.14 @@ -30161,20 +30521,20 @@ snapshots: execa: 5.1.1 globby: 11.1.0 joycon: 3.1.1 - postcss-load-config: 3.1.4(postcss@8.4.41)(ts-node@10.9.1(@types/node@20.3.1)(typescript@5.5.4)) + postcss-load-config: 3.1.4(postcss@8.5.28)(ts-node@10.9.1(@types/node@20.3.1)(typescript@5.5.4)) resolve-from: 5.0.0 rollup: 3.25.0 source-map: 0.8.0-beta.0 sucrase: 3.32.0 tree-kill: 1.2.2 optionalDependencies: - postcss: 8.4.41 + postcss: 8.5.28 typescript: 5.5.4 transitivePeerDependencies: - supports-color - ts-node - tsup@6.7.0(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4))(typescript@5.5.4): + tsup@6.7.0(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4))(typescript@5.5.4): dependencies: bundle-require: 4.0.1(esbuild@0.17.19) cac: 6.7.14 @@ -30184,14 +30544,14 @@ snapshots: execa: 5.1.1 globby: 11.1.0 joycon: 3.1.1 - postcss-load-config: 3.1.4(postcss@8.4.41)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)) + postcss-load-config: 3.1.4(postcss@8.5.28)(ts-node@10.9.1(@types/node@22.1.0)(typescript@5.5.4)) resolve-from: 5.0.0 rollup: 3.25.0 source-map: 0.8.0-beta.0 sucrase: 3.32.0 tree-kill: 1.2.2 optionalDependencies: - postcss: 8.4.41 + postcss: 8.5.28 typescript: 5.5.4 transitivePeerDependencies: - supports-color @@ -30905,6 +31265,8 @@ snapshots: vscode-textmate@8.0.0: {} + vue-component-type-helpers@3.3.11: {} + vue-template-compiler@2.7.16: dependencies: de-indent: 1.0.2 @@ -30917,6 +31279,16 @@ snapshots: semver: 7.6.0 typescript: 5.5.4 + vue@3.5.43(typescript@5.5.4): + dependencies: + '@vue/compiler-dom': 3.5.43 + '@vue/compiler-sfc': 3.5.43 + '@vue/runtime-dom': 3.5.43 + '@vue/server-renderer': 3.5.43 + '@vue/shared': 3.5.43 + optionalDependencies: + typescript: 5.5.4 + w3c-keyname@2.2.8: {} w3c-xmlserializer@4.0.0: @@ -31041,7 +31413,7 @@ snapshots: webpack-sources@3.2.3: {} - webpack-subresource-integrity@5.1.0(webpack@5.92.1(esbuild@0.21.5)): + webpack-subresource-integrity@5.1.0(webpack@5.92.1): dependencies: typed-assert: 1.0.9 webpack: 5.92.1(esbuild@0.21.5)