mirror of
https://github.com/penpot/penpot-plugins.git
synced 2025-01-06 14:50:21 -05:00
test: create api
This commit is contained in:
parent
2138085d39
commit
0e0be26057
21 changed files with 270 additions and 491 deletions
|
@ -1,21 +0,0 @@
|
|||
import { AppElement } from './app.element';
|
||||
|
||||
describe('AppElement', () => {
|
||||
let app: AppElement;
|
||||
|
||||
beforeEach(() => {
|
||||
app = new AppElement();
|
||||
});
|
||||
|
||||
it('should create successfully', () => {
|
||||
expect(app).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should have a greeting', () => {
|
||||
app.connectedCallback();
|
||||
|
||||
expect(app.querySelector('h1').innerHTML).toContain(
|
||||
'Welcome example-plugin'
|
||||
);
|
||||
});
|
||||
});
|
|
@ -15,6 +15,10 @@ penpot.ui.onMessage<{ content: string }>((message) => {
|
|||
const pageState = penpot.getPageState();
|
||||
const fileState = penpot.getFileState();
|
||||
|
||||
if (!pageState || !fileState) {
|
||||
return;
|
||||
}
|
||||
|
||||
penpot.ui.sendMessage({
|
||||
type: 'init',
|
||||
content: {
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
import { AppElement } from './app.element';
|
||||
|
||||
describe('AppElement', () => {
|
||||
let app: AppElement;
|
||||
|
||||
beforeEach(() => {
|
||||
app = new AppElement();
|
||||
});
|
||||
|
||||
it('should create successfully', () => {
|
||||
expect(app).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should have a greeting', () => {
|
||||
app.connectedCallback();
|
||||
|
||||
expect(app.querySelector('h1').innerHTML).toContain(
|
||||
'Welcome example-styles'
|
||||
);
|
||||
});
|
||||
});
|
|
@ -1,11 +0,0 @@
|
|||
/* eslint-disable */
|
||||
export default {
|
||||
displayName: 'rpc-api',
|
||||
preset: '../../jest.preset.js',
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'js', 'html'],
|
||||
coverageDirectory: '../../coverage/apps/rpc-api',
|
||||
};
|
|
@ -50,13 +50,6 @@
|
|||
"buildTarget": "rpc-api:build:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||
"options": {
|
||||
"jestConfig": "apps/rpc-api/jest.config.ts"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": []
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
import Fastify, { FastifyInstance } from 'fastify';
|
||||
import { app } from './app';
|
||||
|
||||
describe('GET /', () => {
|
||||
let server: FastifyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
server = Fastify();
|
||||
server.register(app);
|
||||
});
|
||||
|
||||
it('should respond with a message', async () => {
|
||||
const response = await server.inject({
|
||||
method: 'GET',
|
||||
url: '/',
|
||||
});
|
||||
|
||||
expect(response.json()).toEqual({ message: 'Hello API' });
|
||||
});
|
||||
});
|
|
@ -5,6 +5,6 @@
|
|||
"module": "commonjs",
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"],
|
||||
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"],
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": [
|
||||
"jest.config.ts",
|
||||
"src/**/*.test.ts",
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.d.ts"
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
import { getJestProjects } from '@nx/jest';
|
||||
|
||||
export default {
|
||||
projects: getJestProjects(),
|
||||
};
|
|
@ -1,3 +0,0 @@
|
|||
const nxPreset = require('@nx/jest/preset').default;
|
||||
|
||||
module.exports = { ...nxPreset };
|
|
@ -1,7 +1,11 @@
|
|||
{
|
||||
"name": "plugins-runtime",
|
||||
"version": "0.0.1",
|
||||
"devDependencies": {
|
||||
"happy-dom": "^13.6.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"vitest": "1.2.2",
|
||||
"ses": "^1.1.0",
|
||||
"zod": "^3.22.4"
|
||||
},
|
||||
|
|
|
@ -7,15 +7,12 @@ type Callback<T> = (message: T) => void;
|
|||
|
||||
const validEvents = ['pagechange', 'filechange', 'selectionchange'] as const;
|
||||
|
||||
let uiMessagesCallbacks: Callback<unknown>[] = [];
|
||||
export let uiMessagesCallbacks: Callback<unknown>[] = [];
|
||||
|
||||
let modal: HTMLElement | null = null;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let pageState = {} as any;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let fileState = {} as any;
|
||||
|
||||
let pageState: Page | null = null;
|
||||
let fileState: File | null = null;
|
||||
let selection: null | string = null;
|
||||
|
||||
const eventListeners: Map<string, Callback<unknown>[]> = new Map();
|
||||
|
@ -58,6 +55,8 @@ export function setSelection(selectionId: string) {
|
|||
|
||||
export function createApi(manifest: Manifest) {
|
||||
const closePlugin = () => {
|
||||
modal?.removeEventListener('close', closePlugin);
|
||||
|
||||
if (modal) {
|
||||
modal.remove();
|
||||
}
|
||||
|
@ -112,10 +111,10 @@ export function createApi(manifest: Manifest) {
|
|||
|
||||
if (type === 'pagechange') {
|
||||
checkPermission('page:read');
|
||||
}
|
||||
|
||||
if (type === 'filechange') {
|
||||
} else if (type === 'filechange') {
|
||||
checkPermission('file:read');
|
||||
} else if (type === 'selectionchange') {
|
||||
checkPermission('selection:read');
|
||||
}
|
||||
|
||||
const listeners = eventListeners.get(type) || [];
|
||||
|
|
230
libs/plugins-runtime/src/lib/api/plugin-api.spec.ts
Normal file
230
libs/plugins-runtime/src/lib/api/plugin-api.spec.ts
Normal file
|
@ -0,0 +1,230 @@
|
|||
import { expect, describe, vi } from 'vitest';
|
||||
import {
|
||||
createApi,
|
||||
setFileState,
|
||||
setPageState,
|
||||
setSelection,
|
||||
triggerEvent,
|
||||
uiMessagesCallbacks,
|
||||
} from './index.js';
|
||||
import openUIApi from './openUI.api.js';
|
||||
|
||||
vi.mock('./openUI.api', () => {
|
||||
return {
|
||||
default: vi.fn().mockImplementation(() => ({
|
||||
addEventListener: vi.fn(),
|
||||
dispatchEvent: vi.fn(),
|
||||
removeEventListener: vi.fn(),
|
||||
remove: vi.fn(),
|
||||
})),
|
||||
};
|
||||
});
|
||||
|
||||
vi.hoisted(() => {
|
||||
const addEventListenerMock = vi.fn();
|
||||
window.addEventListener = addEventListenerMock;
|
||||
});
|
||||
|
||||
describe('Plugin api', () => {
|
||||
const api = createApi({
|
||||
name: 'test',
|
||||
code: '',
|
||||
permissions: ['page:read', 'file:read', 'selection:read'],
|
||||
});
|
||||
|
||||
const addEventListenerMock = vi.mocked(window.addEventListener);
|
||||
const messageEvent = addEventListenerMock.mock.calls[0][1] as EventListener;
|
||||
|
||||
afterEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
describe('ui', () => {
|
||||
it('open', () => {
|
||||
const name = 'test';
|
||||
const url = 'http://fake.com';
|
||||
const options = { width: 100, height: 100 };
|
||||
const openUIApiMock = vi.mocked(openUIApi);
|
||||
|
||||
api.ui.open(name, url, options);
|
||||
|
||||
const modalMock = openUIApiMock.mock.results[0].value;
|
||||
|
||||
expect(openUIApiMock).toHaveBeenCalledWith(name, url, options);
|
||||
expect(modalMock.addEventListener).toHaveBeenCalledWith(
|
||||
'close',
|
||||
expect.any(Function),
|
||||
{ once: true }
|
||||
);
|
||||
});
|
||||
|
||||
it('sendMessage', () => {
|
||||
const name = 'test';
|
||||
const url = 'http://fake.com';
|
||||
const options = { width: 100, height: 100 };
|
||||
const message = { test: 'test' };
|
||||
const openUIApiMock = vi.mocked(openUIApi);
|
||||
|
||||
api.ui.open(name, url, options);
|
||||
api.ui.sendMessage(message);
|
||||
|
||||
const modalMock = openUIApiMock.mock.results[0].value;
|
||||
const eventPassedToDispatchEvent =
|
||||
modalMock.dispatchEvent.mock.calls[0][0];
|
||||
|
||||
expect(modalMock.dispatchEvent).toHaveBeenCalled();
|
||||
expect(eventPassedToDispatchEvent.type).toBe('message');
|
||||
expect(eventPassedToDispatchEvent.detail).toBe(message);
|
||||
});
|
||||
|
||||
it('onMessage', () => {
|
||||
const message = new MessageEvent('message', {
|
||||
data: {
|
||||
test: 'test',
|
||||
},
|
||||
});
|
||||
|
||||
const callback = vi.fn();
|
||||
|
||||
api.ui.onMessage(callback);
|
||||
messageEvent(message);
|
||||
|
||||
expect(uiMessagesCallbacks.length).toEqual(1);
|
||||
expect(callback).toHaveBeenCalledWith(message.data);
|
||||
});
|
||||
});
|
||||
|
||||
describe('events', () => {
|
||||
it('invalid event', () => {
|
||||
expect(() => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
api.on('invalid' as any, vi.fn());
|
||||
}).toThrow();
|
||||
});
|
||||
|
||||
it('pagechange', () => {
|
||||
const callback = vi.fn();
|
||||
|
||||
api.on('pagechange', callback);
|
||||
|
||||
triggerEvent('pagechange', 'test');
|
||||
|
||||
api.off('pagechange', callback);
|
||||
|
||||
triggerEvent('pagechange', 'test');
|
||||
|
||||
expect(callback).toHaveBeenCalledWith('test');
|
||||
expect(callback).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('filechange', () => {
|
||||
const callback = vi.fn();
|
||||
|
||||
api.on('filechange', callback);
|
||||
|
||||
triggerEvent('filechange', 'test');
|
||||
|
||||
api.off('filechange', callback);
|
||||
|
||||
triggerEvent('filechange', 'test');
|
||||
|
||||
expect(callback).toHaveBeenCalledWith('test');
|
||||
expect(callback).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe.concurrent('permissions', () => {
|
||||
const api = createApi({
|
||||
name: 'test',
|
||||
code: '',
|
||||
permissions: [],
|
||||
});
|
||||
|
||||
it('on', () => {
|
||||
const callback = vi.fn();
|
||||
|
||||
expect(() => {
|
||||
api.on('filechange', callback);
|
||||
}).toThrow();
|
||||
|
||||
expect(() => {
|
||||
api.on('pagechange', callback);
|
||||
}).toThrow();
|
||||
|
||||
expect(() => {
|
||||
api.on('selectionchange', callback);
|
||||
}).toThrow();
|
||||
});
|
||||
|
||||
it('get states', () => {
|
||||
expect(() => {
|
||||
api.getFileState();
|
||||
}).toThrow();
|
||||
|
||||
expect(() => {
|
||||
api.getPageState();
|
||||
}).toThrow();
|
||||
|
||||
expect(() => {
|
||||
api.getSelection();
|
||||
}).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
it('get file state', () => {
|
||||
const examplePage = {
|
||||
name: 'test',
|
||||
id: '123',
|
||||
};
|
||||
|
||||
setPageState(examplePage);
|
||||
|
||||
const pageState = api.getPageState();
|
||||
|
||||
expect(pageState).toEqual(examplePage);
|
||||
});
|
||||
|
||||
it('get page state', () => {
|
||||
const exampleFile = {
|
||||
name: 'test',
|
||||
id: '123',
|
||||
revn: 0,
|
||||
} as File;
|
||||
|
||||
setFileState(exampleFile);
|
||||
|
||||
const fileState = api.getFileState();
|
||||
|
||||
expect(fileState).toEqual(exampleFile);
|
||||
});
|
||||
|
||||
it('get selection', () => {
|
||||
const selection = '123';
|
||||
|
||||
setSelection(selection);
|
||||
|
||||
const currentSelection = api.getSelection();
|
||||
|
||||
expect(currentSelection).toEqual(selection);
|
||||
});
|
||||
|
||||
it('close puglin', () => {
|
||||
const name = 'test';
|
||||
const url = 'http://fake.com';
|
||||
const options = { width: 100, height: 100 };
|
||||
const openUIApiMock = vi.mocked(openUIApi);
|
||||
const callback = vi.fn();
|
||||
|
||||
api.ui.open(name, url, options);
|
||||
api.ui.onMessage(callback);
|
||||
|
||||
api.closePlugin();
|
||||
|
||||
const modalMock = openUIApiMock.mock.results[0].value;
|
||||
|
||||
expect(modalMock.remove).toHaveBeenCalled();
|
||||
expect(modalMock.removeEventListener).toHaveBeenCalled();
|
||||
expect(callback).not.toHaveBeenCalled();
|
||||
expect(uiMessagesCallbacks).toEqual([]);
|
||||
});
|
||||
});
|
4
libs/plugins-runtime/src/lib/index.d.ts
vendored
4
libs/plugins-runtime/src/lib/index.d.ts
vendored
|
@ -38,8 +38,8 @@ interface Penpot {
|
|||
type: T,
|
||||
callback: (event: EventsMap[T]) => void
|
||||
) => void;
|
||||
getFileState: () => File;
|
||||
getPageState: () => Page;
|
||||
getFileState: () => File | null;
|
||||
getPageState: () => Page | null;
|
||||
getSelection: () => string | null;
|
||||
fetch: typeof fetch;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ export default defineConfig({
|
|||
cache: {
|
||||
dir: '../node_modules/.vitest',
|
||||
},
|
||||
environment: 'node',
|
||||
environment: 'happy-dom',
|
||||
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
||||
|
||||
reporters: ['default'],
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
/* eslint-disable */
|
||||
export default {
|
||||
displayName: 'plugins-styles',
|
||||
preset: '../jest.preset.js',
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'js', 'html'],
|
||||
coverageDirectory: '../coverage/plugins-styles',
|
||||
};
|
|
@ -14,13 +14,6 @@
|
|||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": ["{options.outputFile}"]
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||
"options": {
|
||||
"jestConfig": "plugins-styles/jest.config.ts"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": []
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
"types": ["node", "vite/client"]
|
||||
},
|
||||
"include": ["src/**/*.ts"],
|
||||
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
|
||||
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"]
|
||||
}
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
"compilerOptions": {
|
||||
"outDir": "../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": [
|
||||
"jest.config.ts",
|
||||
"src/**/*.test.ts",
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.d.ts"
|
||||
|
|
377
package-lock.json
generated
377
package-lock.json
generated
|
@ -29,7 +29,6 @@
|
|||
"@nx/esbuild": "18.0.2",
|
||||
"@nx/eslint": "18.0.2",
|
||||
"@nx/eslint-plugin": "18.0.2",
|
||||
"@nx/jest": "18.0.2",
|
||||
"@nx/js": "18.0.2",
|
||||
"@nx/node": "^18.0.2",
|
||||
"@nx/vite": "18.0.2",
|
||||
|
@ -37,7 +36,6 @@
|
|||
"@swc-node/register": "~1.6.7",
|
||||
"@swc/core": "~1.3.85",
|
||||
"@swc/helpers": "~0.5.2",
|
||||
"@types/jest": "^29.4.0",
|
||||
"@types/node": "20.11.16",
|
||||
"@typescript-eslint/eslint-plugin": "6.21.0",
|
||||
"@typescript-eslint/parser": "6.21.0",
|
||||
|
@ -46,14 +44,12 @@
|
|||
"esbuild": "^0.19.2",
|
||||
"eslint": "~8.48.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"happy-dom": "^13.6.2",
|
||||
"husky": "^9.0.10",
|
||||
"jest": "^29.4.1",
|
||||
"jest-environment-node": "^29.4.1",
|
||||
"jsdom": "~22.1.0",
|
||||
"nx": "18.0.2",
|
||||
"prettier": "^2.6.2",
|
||||
"swc-loader": "0.1.15",
|
||||
"ts-jest": "^29.1.0",
|
||||
"ts-node": "10.9.1",
|
||||
"typescript": "~5.2.2",
|
||||
"vite": "^5.0.0",
|
||||
|
@ -2788,53 +2784,6 @@
|
|||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@jest/core": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz",
|
||||
"integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jest/console": "^29.7.0",
|
||||
"@jest/reporters": "^29.7.0",
|
||||
"@jest/test-result": "^29.7.0",
|
||||
"@jest/transform": "^29.7.0",
|
||||
"@jest/types": "^29.6.3",
|
||||
"@types/node": "*",
|
||||
"ansi-escapes": "^4.2.1",
|
||||
"chalk": "^4.0.0",
|
||||
"ci-info": "^3.2.0",
|
||||
"exit": "^0.1.2",
|
||||
"graceful-fs": "^4.2.9",
|
||||
"jest-changed-files": "^29.7.0",
|
||||
"jest-config": "^29.7.0",
|
||||
"jest-haste-map": "^29.7.0",
|
||||
"jest-message-util": "^29.7.0",
|
||||
"jest-regex-util": "^29.6.3",
|
||||
"jest-resolve": "^29.7.0",
|
||||
"jest-resolve-dependencies": "^29.7.0",
|
||||
"jest-runner": "^29.7.0",
|
||||
"jest-runtime": "^29.7.0",
|
||||
"jest-snapshot": "^29.7.0",
|
||||
"jest-util": "^29.7.0",
|
||||
"jest-validate": "^29.7.0",
|
||||
"jest-watcher": "^29.7.0",
|
||||
"micromatch": "^4.0.4",
|
||||
"pretty-format": "^29.7.0",
|
||||
"slash": "^3.0.0",
|
||||
"strip-ansi": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"node-notifier": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@jest/environment": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz",
|
||||
|
@ -4296,16 +4245,6 @@
|
|||
"@types/istanbul-lib-report": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/jest": {
|
||||
"version": "29.5.12",
|
||||
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz",
|
||||
"integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"expect": "^29.0.0",
|
||||
"pretty-format": "^29.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/json-schema": {
|
||||
"version": "7.0.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
|
||||
|
@ -5607,18 +5546,6 @@
|
|||
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
|
||||
}
|
||||
},
|
||||
"node_modules/bs-logger": {
|
||||
"version": "0.2.6",
|
||||
"resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz",
|
||||
"integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fast-json-stable-stringify": "2.x"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/bser": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz",
|
||||
|
@ -6085,27 +6012,6 @@
|
|||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/create-jest": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz",
|
||||
"integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jest/types": "^29.6.3",
|
||||
"chalk": "^4.0.0",
|
||||
"exit": "^0.1.2",
|
||||
"graceful-fs": "^4.2.9",
|
||||
"jest-config": "^29.7.0",
|
||||
"jest-util": "^29.7.0",
|
||||
"prompts": "^2.0.1"
|
||||
},
|
||||
"bin": {
|
||||
"create-jest": "bin/create-jest.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/create-require": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||
|
@ -7504,6 +7410,20 @@
|
|||
"integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/happy-dom": {
|
||||
"version": "13.6.2",
|
||||
"resolved": "https://registry.npmjs.org/happy-dom/-/happy-dom-13.6.2.tgz",
|
||||
"integrity": "sha512-Ku+wDqcF/KwFA0dI+xIMZd9Jn020RXjuSil/Vz7gu2yhDC3FsDYZ55qqV9k+SGC4opwb4acisXqVSRxUJMlPbQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"entities": "^4.5.0",
|
||||
"webidl-conversions": "^7.0.0",
|
||||
"whatwg-mimetype": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hard-rejection": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz",
|
||||
|
@ -7808,25 +7728,6 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/import-local": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz",
|
||||
"integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"pkg-dir": "^4.2.0",
|
||||
"resolve-cwd": "^3.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"import-local-fixture": "fixtures/cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/imurmurhash": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
|
||||
|
@ -8147,46 +8048,6 @@
|
|||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/jest": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz",
|
||||
"integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jest/core": "^29.7.0",
|
||||
"@jest/types": "^29.6.3",
|
||||
"import-local": "^3.0.2",
|
||||
"jest-cli": "^29.7.0"
|
||||
},
|
||||
"bin": {
|
||||
"jest": "bin/jest.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"node-notifier": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/jest-changed-files": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz",
|
||||
"integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"execa": "^5.0.0",
|
||||
"jest-util": "^29.7.0",
|
||||
"p-limit": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jest-circus": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz",
|
||||
|
@ -8218,39 +8079,6 @@
|
|||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jest-cli": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz",
|
||||
"integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jest/core": "^29.7.0",
|
||||
"@jest/test-result": "^29.7.0",
|
||||
"@jest/types": "^29.6.3",
|
||||
"chalk": "^4.0.0",
|
||||
"create-jest": "^29.7.0",
|
||||
"exit": "^0.1.2",
|
||||
"import-local": "^3.0.2",
|
||||
"jest-config": "^29.7.0",
|
||||
"jest-util": "^29.7.0",
|
||||
"jest-validate": "^29.7.0",
|
||||
"yargs": "^17.3.1"
|
||||
},
|
||||
"bin": {
|
||||
"jest": "bin/jest.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"node-notifier": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/jest-config": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz",
|
||||
|
@ -8528,19 +8356,6 @@
|
|||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jest-resolve-dependencies": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz",
|
||||
"integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"jest-regex-util": "^29.6.3",
|
||||
"jest-snapshot": "^29.7.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jest-resolve/node_modules/resolve.exports": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz",
|
||||
|
@ -9001,15 +8816,6 @@
|
|||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/kleur": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz",
|
||||
"integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/kolorist": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.8.0.tgz",
|
||||
|
@ -9160,12 +8966,6 @@
|
|||
"integrity": "sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/lodash.memoize": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
|
||||
"integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/lodash.merge": {
|
||||
"version": "4.6.2",
|
||||
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
|
||||
|
@ -10078,70 +9878,6 @@
|
|||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/pkg-dir": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
|
||||
"integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"find-up": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/pkg-dir/node_modules/find-up": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
|
||||
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"locate-path": "^5.0.0",
|
||||
"path-exists": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/pkg-dir/node_modules/locate-path": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
|
||||
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"p-locate": "^4.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/pkg-dir/node_modules/p-limit": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
|
||||
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"p-try": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/pkg-dir/node_modules/p-locate": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
|
||||
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"p-limit": "^2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/pkg-types": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz",
|
||||
|
@ -10285,19 +10021,6 @@
|
|||
"resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.3.2.tgz",
|
||||
"integrity": "sha512-n9wh8tvBe5sFmsqlg+XQhaQLumwpqoAUruLwjCopgTmUBjJ/fjtBsJzKleCaIGBOMXYEhp1YfKl4d7rJ5ZKJGA=="
|
||||
},
|
||||
"node_modules/prompts": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz",
|
||||
"integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"kleur": "^3.0.3",
|
||||
"sisteransi": "^1.0.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
|
@ -10691,27 +10414,6 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/resolve-cwd": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz",
|
||||
"integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"resolve-from": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/resolve-cwd/node_modules/resolve-from": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
|
||||
"integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/resolve-from": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
|
||||
|
@ -11071,12 +10773,6 @@
|
|||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/sisteransi": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
|
||||
"integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/slash": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
|
||||
|
@ -11677,49 +11373,6 @@
|
|||
"typescript": ">=4.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ts-jest": {
|
||||
"version": "29.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz",
|
||||
"integrity": "sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"bs-logger": "0.x",
|
||||
"fast-json-stable-stringify": "2.x",
|
||||
"jest-util": "^29.0.0",
|
||||
"json5": "^2.2.3",
|
||||
"lodash.memoize": "4.x",
|
||||
"make-error": "1.x",
|
||||
"semver": "^7.5.3",
|
||||
"yargs-parser": "^21.0.1"
|
||||
},
|
||||
"bin": {
|
||||
"ts-jest": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.10.0 || ^18.0.0 || >=20.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": ">=7.0.0-beta.0 <8",
|
||||
"@jest/types": "^29.0.0",
|
||||
"babel-jest": "^29.0.0",
|
||||
"jest": "^29.0.0",
|
||||
"typescript": ">=4.3 <6"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@babel/core": {
|
||||
"optional": true
|
||||
},
|
||||
"@jest/types": {
|
||||
"optional": true
|
||||
},
|
||||
"babel-jest": {
|
||||
"optional": true
|
||||
},
|
||||
"esbuild": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/ts-morph": {
|
||||
"version": "18.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-18.0.0.tgz",
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"build": "npx nx build plugins-runtime --emptyOutDir=true",
|
||||
"lint": "nx run-many --all --target=lint --parallel",
|
||||
"lint:affected": "npx nx affected --target=lint",
|
||||
"test": "npx nx test plugins-runtime",
|
||||
"prepare": "husky"
|
||||
},
|
||||
"private": true,
|
||||
|
@ -20,7 +21,6 @@
|
|||
"@nx/esbuild": "18.0.2",
|
||||
"@nx/eslint": "18.0.2",
|
||||
"@nx/eslint-plugin": "18.0.2",
|
||||
"@nx/jest": "18.0.2",
|
||||
"@nx/js": "18.0.2",
|
||||
"@nx/node": "^18.0.2",
|
||||
"@nx/vite": "18.0.2",
|
||||
|
@ -28,7 +28,6 @@
|
|||
"@swc-node/register": "~1.6.7",
|
||||
"@swc/core": "~1.3.85",
|
||||
"@swc/helpers": "~0.5.2",
|
||||
"@types/jest": "^29.4.0",
|
||||
"@types/node": "20.11.16",
|
||||
"@typescript-eslint/eslint-plugin": "6.21.0",
|
||||
"@typescript-eslint/parser": "6.21.0",
|
||||
|
@ -37,14 +36,12 @@
|
|||
"esbuild": "^0.19.2",
|
||||
"eslint": "~8.48.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"happy-dom": "^13.6.2",
|
||||
"husky": "^9.0.10",
|
||||
"jest": "^29.4.1",
|
||||
"jest-environment-node": "^29.4.1",
|
||||
"jsdom": "~22.1.0",
|
||||
"nx": "18.0.2",
|
||||
"prettier": "^2.6.2",
|
||||
"swc-loader": "0.1.15",
|
||||
"ts-jest": "^29.1.0",
|
||||
"ts-node": "10.9.1",
|
||||
"typescript": "~5.2.2",
|
||||
"vite": "^5.0.0",
|
||||
|
|
Loading…
Reference in a new issue