feat(providence): fix postinstall; update/cleanup deps; tests compatible with node 20;
This commit is contained in:
parent
dbb964077f
commit
a30dbf32f0
5 changed files with 25 additions and 48 deletions
5
.changeset/old-walls-cover.md
Normal file
5
.changeset/old-walls-cover.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'providence-analytics': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
update dependencies
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
"@lion/ui": patch
|
'@lion/ui': patch
|
||||||
---
|
---
|
||||||
|
|
||||||
fix(ui/calendar): use correct firstUpdated type signature
|
fix(ui/calendar): use correct firstUpdated type signature
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dashboard": "node ./src/dashboard/server.js --run-server --serve-from-package-root",
|
"dashboard": "node ./src/dashboard/server.js --run-server --serve-from-package-root",
|
||||||
"postinstall": "npx patch-package",
|
|
||||||
"match-lion-imports": "npm run providence -- analyze match-imports --search-target-collection @lion-targets --reference-collection @lion-references --measure-perf --skip-check-match-compatibility",
|
"match-lion-imports": "npm run providence -- analyze match-imports --search-target-collection @lion-targets --reference-collection @lion-references --measure-perf --skip-check-match-compatibility",
|
||||||
"providence": "node --max-old-space-size=8192 ./src/cli/index.js",
|
"providence": "node --max-old-space-size=8192 ./src/cli/index.js",
|
||||||
"prepublishOnly": "npm run publish-docs",
|
"prepublishOnly": "npm run publish-docs",
|
||||||
|
|
@ -39,27 +38,25 @@
|
||||||
"test:node:unit": "mocha './{test-node,src}/**/*.test.js'"
|
"test:node:unit": "mocha './{test-node,src}/**/*.test.js'"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/parser": "^7.24.5",
|
"@babel/parser": "^7.25.8",
|
||||||
"@babel/plugin-syntax-import-assertions": "^7.24.1",
|
"@babel/plugin-syntax-import-assertions": "^7.25.7",
|
||||||
"@babel/traverse": "^7.24.5",
|
"@babel/traverse": "^7.25.7",
|
||||||
"@babel/types": "^7.24.5",
|
"@babel/types": "^7.25.8",
|
||||||
"@putout/babel": "^2.4.0",
|
"@putout/babel": "^2.8.0",
|
||||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
||||||
"@swc/core": "^1.5.6",
|
"@swc/core": "^1.7.36",
|
||||||
"commander": "^2.20.3",
|
"commander": "^2.20.3",
|
||||||
"parse5": "^7.1.2",
|
"parse5": "^7.2.0",
|
||||||
"semver": "^7.6.2"
|
"semver": "^7.6.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chai": "^4.3.16",
|
|
||||||
"@types/inquirer": "^9.0.7",
|
"@types/inquirer": "^9.0.7",
|
||||||
"@types/mocha": "^10.0.6",
|
"@types/mocha": "^10.0.9",
|
||||||
"@web/dev-server": "^0.4.5",
|
"@web/dev-server": "^0.4.6",
|
||||||
"@web/dev-server-core": "^0.7.2",
|
"@web/dev-server-core": "^0.7.3",
|
||||||
"globby": "^14.0.1",
|
"globby": "^14.0.2",
|
||||||
"lit-element": "^4.0.5",
|
"lit-element": "^4.1.1",
|
||||||
"mock-fs": "^5.2.0",
|
"mock-fs": "^5.4.0"
|
||||||
"mock-require": "^3.0.3"
|
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"analysis",
|
"analysis",
|
||||||
|
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
/* eslint-disable import/no-extraneous-dependencies */
|
|
||||||
// @ts-expect-error
|
|
||||||
import mockFs from 'mock-fs';
|
|
||||||
// @ts-expect-error
|
|
||||||
import mockRequire from 'mock-require';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {object} obj
|
|
||||||
*/
|
|
||||||
export function mockFsAndRequire(obj) {
|
|
||||||
mockFs(obj);
|
|
||||||
|
|
||||||
// Object.entries(obj).forEach(([key, value]) => {
|
|
||||||
// if (key.endsWith('.json')) {
|
|
||||||
// mockRequire(key, JSON.parse(value));
|
|
||||||
// } else {
|
|
||||||
// mockRequire(key, value);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
|
|
||||||
mockFsAndRequire.restore = () => {
|
|
||||||
mockFs.restore();
|
|
||||||
mockRequire.stopAll();
|
|
||||||
};
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||||
import { mockFsAndRequire } from './mock-fs-and-require.js';
|
import mockFs from 'mock-fs';
|
||||||
|
|
||||||
export const mock = mockFsAndRequire;
|
export const mock = mockFs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes sure that, whenever the main program (providence) calls
|
* Makes sure that, whenever the main program (providence) calls
|
||||||
|
|
@ -72,12 +72,12 @@ function getMockObjectForProject(files, cfg = {}, existingMock = {}) {
|
||||||
*/
|
*/
|
||||||
export function mockProject(files, cfg = {}, existingMock = {}) {
|
export function mockProject(files, cfg = {}, existingMock = {}) {
|
||||||
const obj = getMockObjectForProject(files, cfg, existingMock);
|
const obj = getMockObjectForProject(files, cfg, existingMock);
|
||||||
mockFsAndRequire(obj);
|
mockFs(obj);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function restoreMockedProjects() {
|
export function restoreMockedProjects() {
|
||||||
mockFsAndRequire.restore();
|
mockFs.restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getEntry(queryResult, index = 0) {
|
export function getEntry(queryResult, index = 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue