From 086eac97d2b99bc3d1890a39af200997a1397a83 Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Mon, 22 Apr 2024 18:41:13 +0200 Subject: [PATCH 1/7] feat(compilation): better error message --- source/compilation/index.ts | 6 +-- source/compilation/resolveImports.ts | 49 +++++++++++++++++---- test/compilation/getModelFromSource.test.ts | 16 ++++++- 3 files changed, 59 insertions(+), 12 deletions(-) diff --git a/source/compilation/index.ts b/source/compilation/index.ts index 88102e1..168a981 100644 --- a/source/compilation/index.ts +++ b/source/compilation/index.ts @@ -31,9 +31,9 @@ To import rules from a _packaged_ Publicodes model, you need to specify the foll ```yaml importer!: depuis: - nom: - source: (optional) - url: (optional) + nom: + source: (optional) + url: (optional) dans: (optional) les règles: - diff --git a/source/compilation/resolveImports.ts b/source/compilation/resolveImports.ts index b51aa50..8522c14 100644 --- a/source/compilation/resolveImports.ts +++ b/source/compilation/resolveImports.ts @@ -9,7 +9,7 @@ import { getDoubleDefError, } from '../commons' import { readFileSync } from 'fs' -import { dirname, join } from 'path' +import { dirname, join, basename } from 'path' /** * @param {string} packageName - The package name. @@ -33,6 +33,7 @@ const enginesCache = {} * @param filePath - The path to the file containing the rules in a JSON format. * @param opts - Options. * + * @throws {Error} If the package is not found. * @throws {Error} If the package name is missing in the macro. */ function getEngine( @@ -45,13 +46,28 @@ function getEngine( if (packageName === undefined) { throw new Error( - `Le nom du package est manquant dans la macro 'importer!' dans le fichier: ${filePath}`, + `[Erreur dans la macro 'importer!'] +Le nom du package est manquant dans la macro 'importer!' dans le fichier: ${basename(filePath)}. + +[Solution] +Ajoutez le nom du package dans la macro 'importer!'. + +[Exemple] +importer!: + depuis: + nom: package-name + les règles: + - ruleA + - ruleB + ... +`, ) } if (!enginesCache[packageName]) { + let modelPath = '' try { - const modelPath = + modelPath = depuis.source !== undefined ? join(fileDirPath, depuis.source) : packageModelPath(packageName) @@ -69,7 +85,16 @@ function getEngine( } enginesCache[packageName] = engine } catch (e) { - console.error(`Error when loading '${packageName}': ${e}`) + throw e + // throw new Error(`[Erreur dans la macro 'importer!'] + // ${e} + // Le package '${packageName}' n'a pas pu être trouvé. (Le fichier '${modelPath}' est introuvable). + // + // [Solution] + // - Assurez-vous que le package existe et qu'il est correctement installé dans vos 'node_modules'. + // - Assurez-vous que le fichier '${packageName}.model.json' existe à la racine du package. Sinon, + // précisez le chemin du fichier dans la macro 'importer!' grâce à l'attribut 'source'. + // `) } } @@ -213,7 +238,11 @@ export function resolveImports( rulesToImport?.forEach(({ ruleName, attrs }) => { if (appearsMoreThanOnce(rulesToImport, ruleName)) { throw new Error( - `La règle '${ruleName}' est définie deux fois dans ${importMacro.depuis.nom}`, + `[Erreur dans la macro 'importer!'] +La règle '${ruleName}' est définie deux fois dans ${importMacro.depuis.nom} + +[Solution] +Supprimez une des deux définitions de la règle '${ruleName}' dans la macro 'importer!'`, ) } if (accFind(acc, ruleName)) { @@ -224,9 +253,13 @@ export function resolveImports( try { rule = engine.getRule(ruleName) } catch (e) { - throw new Error( - `La règle '${ruleName}' n'existe pas dans ${importMacro.depuis.nom}`, - ) + throw new Error(`[Erreur dans la macro 'importer!'] +La règle '${ruleName}' n'existe pas dans ${importMacro.depuis.nom} + +[Solution] +- Vérifiez que le nom de la règle est correct. +- Assurez-vous que la règle '${ruleName}' existe dans le package. +`) } const getUpdatedRule = (ruleName: RuleName, rule: Rule) => { diff --git a/test/compilation/getModelFromSource.test.ts b/test/compilation/getModelFromSource.test.ts index c38d549..77e1b22 100644 --- a/test/compilation/getModelFromSource.test.ts +++ b/test/compilation/getModelFromSource.test.ts @@ -167,7 +167,21 @@ Ajout d'une description`, expect(() => { getModelFromSource(path) }).toThrow( - `Le nom du package est manquant dans la macro 'importer!' dans le fichier: ${path}`, + `[Erreur dans la macro 'importer!'] +Le nom du package est manquant dans la macro 'importer!' dans le fichier: no-name-import.publicodes. + +[Solution] +Ajoutez le nom du package dans la macro 'importer!'. + +[Exemple] +importer!: + depuis: + nom: package-name + les règles: + - ruleA + - ruleB + ... +`, ) }) From 52ca973eb2b471e280d0b425cf842299735273da Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Tue, 23 Apr 2024 14:22:49 +0200 Subject: [PATCH 2/7] fix(build): allow interop from cjs project Needed for the publicodes-language-server to work. NOTE: tested with nosgestesclimat, but maybe it's breaking other projects? --- package.json | 17 +- {source => src}/commons.ts | 0 .../compilation/getModelFromSource.ts | 6 +- {source => src}/compilation/index.ts | 0 {source => src}/compilation/resolveImports.ts | 0 {source => src}/index.ts | 0 {source => src}/optims/constantFolding.ts | 0 {source => src}/optims/index.ts | 0 {source => src}/serializeParsedRules.ts | 2 +- test/compilation/getModelFromSource.test.ts | 2 +- test/optims/constantFolding.test.ts | 6 +- test/parseExpression.test.ts | 5 +- test/serializeParsedRules.test.ts | 2 +- test/utils.test.ts | 2 +- tsconfig.json | 33 +- typedoc.json | 7 +- yarn.lock | 524 +++++++++--------- 17 files changed, 312 insertions(+), 294 deletions(-) rename {source => src}/commons.ts (100%) rename {source => src}/compilation/getModelFromSource.ts (93%) rename {source => src}/compilation/index.ts (100%) rename {source => src}/compilation/resolveImports.ts (100%) rename {source => src}/index.ts (100%) rename {source => src}/optims/constantFolding.ts (100%) rename {source => src}/optims/index.ts (100%) rename {source => src}/serializeParsedRules.ts (99%) diff --git a/package.json b/package.json index a4b99d0..50fcba4 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,9 @@ "version": "1.1.2", "description": "A set of utility functions to build tools around Publicodes models", "type": "module", + "main": "dist/index.cjs", + "module": "dist/index.js", + "types": "dist/index.d.ts", "scripts": { "build": "tsup", "watch": "tsup --watch", @@ -64,29 +67,27 @@ "jest": "^29.4.1", "prettier": "^3.0.0", "ts-jest": "^29.0.4", - "ts-node": "^10.9.2", - "tsup": "^6.5.0", + "tsup": "^8.0.2", "typedoc": "^0.24.8", "typedoc-plugin-export-functions": "^1.0.0", "typescript": "^4.9.4", "yaml": "^2.3.1" }, "tsup": { + "verbose": true, "entry": [ - "source/index.ts", - "source/optims/index.ts", - "source/compilation/index.ts", - "source/migration/index.ts" + "src/index.ts", + "src/optims/index.ts", + "src/compilation/index.ts" ], + "cjsInterop": true, "format": [ "cjs", "esm" ], - "allowJs": true, "sourceMap": true, "dts": true, "clean": true, - "target": "es2020", "skipNodeModulesBundle": true }, "publishConfig": { diff --git a/source/commons.ts b/src/commons.ts similarity index 100% rename from source/commons.ts rename to src/commons.ts diff --git a/source/compilation/getModelFromSource.ts b/src/compilation/getModelFromSource.ts similarity index 93% rename from source/compilation/getModelFromSource.ts rename to src/compilation/getModelFromSource.ts index 940ed1e..7f4c52c 100644 --- a/source/compilation/getModelFromSource.ts +++ b/src/compilation/getModelFromSource.ts @@ -1,6 +1,6 @@ import glob from 'glob' import yaml from 'yaml' -import { readFileSync, statSync } from 'fs' +import fs from 'fs' import { getDoubleDefError, RawRules } from '../commons' import { resolveImports } from './resolveImports' @@ -41,7 +41,7 @@ export function getModelFromSource( opts?: GetModelFromSourceOptions, ): RawRules { try { - if (statSync(sourcePath).isDirectory()) { + if (fs.statSync(sourcePath).isDirectory()) { sourcePath = sourcePath + '/**/*.publicodes' } } catch (e) {} @@ -49,7 +49,7 @@ export function getModelFromSource( .sync(sourcePath, { ignore: opts?.ignore }) .reduce( ({ jsonModel, namespaces }, filePath: string) => { - const rules: RawRules = yaml.parse(readFileSync(filePath, 'utf-8')) + const rules: RawRules = yaml.parse(fs.readFileSync(filePath, 'utf-8')) if (rules == null) { console.warn(`⚠️ ${filePath} is empty, skipping...`) return jsonModel diff --git a/source/compilation/index.ts b/src/compilation/index.ts similarity index 100% rename from source/compilation/index.ts rename to src/compilation/index.ts diff --git a/source/compilation/resolveImports.ts b/src/compilation/resolveImports.ts similarity index 100% rename from source/compilation/resolveImports.ts rename to src/compilation/resolveImports.ts diff --git a/source/index.ts b/src/index.ts similarity index 100% rename from source/index.ts rename to src/index.ts diff --git a/source/optims/constantFolding.ts b/src/optims/constantFolding.ts similarity index 100% rename from source/optims/constantFolding.ts rename to src/optims/constantFolding.ts diff --git a/source/optims/index.ts b/src/optims/index.ts similarity index 100% rename from source/optims/index.ts rename to src/optims/index.ts diff --git a/source/serializeParsedRules.ts b/src/serializeParsedRules.ts similarity index 99% rename from source/serializeParsedRules.ts rename to src/serializeParsedRules.ts index 7f47b09..5052947 100644 --- a/source/serializeParsedRules.ts +++ b/src/serializeParsedRules.ts @@ -4,7 +4,7 @@ import { RawRule, RuleName } from './commons' type SerializedRule = RawRule | number | string | null function serializedRuleToRawRule(serializedRule: SerializedRule): RawRule { - if (typeof serializedRule === 'object') { + if (serializedRule !== null && typeof serializedRule === 'object') { return serializedRule } return { diff --git a/test/compilation/getModelFromSource.test.ts b/test/compilation/getModelFromSource.test.ts index 77e1b22..eb70b51 100644 --- a/test/compilation/getModelFromSource.test.ts +++ b/test/compilation/getModelFromSource.test.ts @@ -1,4 +1,4 @@ -import { getModelFromSource } from '../../source/compilation/getModelFromSource' +import { getModelFromSource } from '../../src/compilation/getModelFromSource' import { join, resolve } from 'path' const testDataDir = resolve('./test/compilation/data/') diff --git a/test/optims/constantFolding.test.ts b/test/optims/constantFolding.test.ts index f61da87..02d965c 100644 --- a/test/optims/constantFolding.test.ts +++ b/test/optims/constantFolding.test.ts @@ -1,7 +1,7 @@ import Engine, { RuleNode } from 'publicodes' -import { serializeParsedRules } from '../../source' -import { RuleName, RawRules, disabledLogger } from '../../source/commons' -import { constantFolding } from '../../source/optims/' +import { serializeParsedRules } from '../../src' +import { RuleName, RawRules, disabledLogger } from '../../src/commons' +import { constantFolding } from '../../src/optims/' import { callWithEngine } from '../utils.test' function constantFoldingWith(rawRules: any, targets?: RuleName[]): RawRules { diff --git a/test/parseExpression.test.ts b/test/parseExpression.test.ts index 1273262..5b285dd 100644 --- a/test/parseExpression.test.ts +++ b/test/parseExpression.test.ts @@ -1,7 +1,4 @@ -import { - serializeParsedExprAST, - substituteInParsedExpr, -} from '../source/commons' +import { serializeParsedExprAST, substituteInParsedExpr } from '../src/commons' describe('substituteInParsedExpr', () => { it('should return the same parsed expression if no occurence of the variable is found', () => { diff --git a/test/serializeParsedRules.test.ts b/test/serializeParsedRules.test.ts index b5c7abf..550e361 100644 --- a/test/serializeParsedRules.test.ts +++ b/test/serializeParsedRules.test.ts @@ -1,5 +1,5 @@ import Engine from 'publicodes' -import { serializeParsedRules } from '../source/index' +import { serializeParsedRules } from '../src/index' describe('API > mecanisms list', () => { it('should serialize empty rules', () => { diff --git a/test/utils.test.ts b/test/utils.test.ts index 58fa921..31ea578 100644 --- a/test/utils.test.ts +++ b/test/utils.test.ts @@ -1,4 +1,4 @@ -import { RuleName, disabledLogger } from '../source/commons' +import { RuleName, disabledLogger } from '../src/commons' import Engine from 'publicodes' import type { ParsedRules } from 'publicodes' diff --git a/tsconfig.json b/tsconfig.json index d08fcce..b935f12 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,23 +1,28 @@ { "compilerOptions": { "target": "esnext", - "moduleResolution": "node", - "allowSyntheticDefaultImports": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, + "rootDir": "src", "outDir": "dist", - "rootDir": "source", - "types": ["node", "jest"], "esModuleInterop": true, - "allowJs": true, - "lib": ["es2021"], + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, "sourceMap": true, + "types": [ + "jest", + "node" + ], "declaration": true, + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true }, - "ts-node": { - "transpileOnly": true, - "files": true, - }, - "include": ["source/**/*.ts"], - "exclude": ["./node_modules/", "./dist/", "./jest.config.js", "./test/"], + "include": [ + "src" + ], + "exclude": [ + "./node_modules/", + "./dist/", + "./jest.config.js", + "./test/" + ] } diff --git a/typedoc.json b/typedoc.json index 9905c4c..9ae18cb 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,12 +1,7 @@ { "$schema": "https://typedoc.org/schema.json", "name": "@publicodes/tools API", - "entryPoints": [ - "./source", - "./source/optims/", - "./source/compilation/", - "./source/migration" - ], + "entryPoints": ["./src", "./src/optims/", "./src/compilation/"], "navigationLinks": { "GitHub": "https://github.com/publicodes/tools" }, diff --git a/yarn.lock b/yarn.lock index f6c68d4..52d607d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -297,122 +297,120 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cspotcode/source-map-support@^0.8.0": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== - dependencies: - "@jridgewell/trace-mapping" "0.3.9" - -"@esbuild/android-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz#bafb75234a5d3d1b690e7c2956a599345e84a2fd" - integrity sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA== - -"@esbuild/android-arm@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.19.tgz#5898f7832c2298bc7d0ab53701c57beb74d78b4d" - integrity sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A== - -"@esbuild/android-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.19.tgz#658368ef92067866d95fb268719f98f363d13ae1" - integrity sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww== - -"@esbuild/darwin-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz#584c34c5991b95d4d48d333300b1a4e2ff7be276" - integrity sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg== - -"@esbuild/darwin-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz#7751d236dfe6ce136cce343dce69f52d76b7f6cb" - integrity sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw== - -"@esbuild/freebsd-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz#cacd171665dd1d500f45c167d50c6b7e539d5fd2" - integrity sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ== - -"@esbuild/freebsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz#0769456eee2a08b8d925d7c00b79e861cb3162e4" - integrity sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ== - -"@esbuild/linux-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz#38e162ecb723862c6be1c27d6389f48960b68edb" - integrity sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg== - -"@esbuild/linux-arm@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz#1a2cd399c50040184a805174a6d89097d9d1559a" - integrity sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA== - -"@esbuild/linux-ia32@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz#e28c25266b036ce1cabca3c30155222841dc035a" - integrity sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ== - -"@esbuild/linux-loong64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz#0f887b8bb3f90658d1a0117283e55dbd4c9dcf72" - integrity sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ== - -"@esbuild/linux-mips64el@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz#f5d2a0b8047ea9a5d9f592a178ea054053a70289" - integrity sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A== - -"@esbuild/linux-ppc64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz#876590e3acbd9fa7f57a2c7d86f83717dbbac8c7" - integrity sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg== - -"@esbuild/linux-riscv64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz#7f49373df463cd9f41dc34f9b2262d771688bf09" - integrity sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA== - -"@esbuild/linux-s390x@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz#e2afd1afcaf63afe2c7d9ceacd28ec57c77f8829" - integrity sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q== - -"@esbuild/linux-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz#8a0e9738b1635f0c53389e515ae83826dec22aa4" - integrity sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw== - -"@esbuild/netbsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz#c29fb2453c6b7ddef9a35e2c18b37bda1ae5c462" - integrity sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q== - -"@esbuild/openbsd-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz#95e75a391403cb10297280d524d66ce04c920691" - integrity sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g== - -"@esbuild/sunos-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz#722eaf057b83c2575937d3ffe5aeb16540da7273" - integrity sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg== - -"@esbuild/win32-arm64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz#9aa9dc074399288bdcdd283443e9aeb6b9552b6f" - integrity sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag== - -"@esbuild/win32-ia32@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz#95ad43c62ad62485e210f6299c7b2571e48d2b03" - integrity sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw== - -"@esbuild/win32-x64@0.17.19": - version "0.17.19" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz#8cfaf2ff603e9aabb910e9c0558c26cf32744061" - integrity sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA== +"@esbuild/aix-ppc64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz#d1bc06aedb6936b3b6d313bf809a5a40387d2b7f" + integrity sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA== + +"@esbuild/android-arm64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz#7ad65a36cfdb7e0d429c353e00f680d737c2aed4" + integrity sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA== + +"@esbuild/android-arm@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.12.tgz#b0c26536f37776162ca8bde25e42040c203f2824" + integrity sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w== + +"@esbuild/android-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.12.tgz#cb13e2211282012194d89bf3bfe7721273473b3d" + integrity sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew== + +"@esbuild/darwin-arm64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz#cbee41e988020d4b516e9d9e44dd29200996275e" + integrity sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g== + +"@esbuild/darwin-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz#e37d9633246d52aecf491ee916ece709f9d5f4cd" + integrity sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A== + +"@esbuild/freebsd-arm64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz#1ee4d8b682ed363b08af74d1ea2b2b4dbba76487" + integrity sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA== + +"@esbuild/freebsd-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz#37a693553d42ff77cd7126764b535fb6cc28a11c" + integrity sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg== + +"@esbuild/linux-arm64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz#be9b145985ec6c57470e0e051d887b09dddb2d4b" + integrity sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA== + +"@esbuild/linux-arm@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz#207ecd982a8db95f7b5279207d0ff2331acf5eef" + integrity sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w== + +"@esbuild/linux-ia32@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz#d0d86b5ca1562523dc284a6723293a52d5860601" + integrity sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA== + +"@esbuild/linux-loong64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz#9a37f87fec4b8408e682b528391fa22afd952299" + integrity sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA== + +"@esbuild/linux-mips64el@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz#4ddebd4e6eeba20b509d8e74c8e30d8ace0b89ec" + integrity sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w== + +"@esbuild/linux-ppc64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz#adb67dadb73656849f63cd522f5ecb351dd8dee8" + integrity sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg== + +"@esbuild/linux-riscv64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz#11bc0698bf0a2abf8727f1c7ace2112612c15adf" + integrity sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg== + +"@esbuild/linux-s390x@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz#e86fb8ffba7c5c92ba91fc3b27ed5a70196c3cc8" + integrity sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg== + +"@esbuild/linux-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz#5f37cfdc705aea687dfe5dfbec086a05acfe9c78" + integrity sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg== + +"@esbuild/netbsd-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz#29da566a75324e0d0dd7e47519ba2f7ef168657b" + integrity sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA== + +"@esbuild/openbsd-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz#306c0acbdb5a99c95be98bdd1d47c916e7dc3ff0" + integrity sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw== + +"@esbuild/sunos-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz#0933eaab9af8b9b2c930236f62aae3fc593faf30" + integrity sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA== + +"@esbuild/win32-arm64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz#773bdbaa1971b36db2f6560088639ccd1e6773ae" + integrity sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A== + +"@esbuild/win32-ia32@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz#000516cad06354cc84a73f0943a4aa690ef6fd67" + integrity sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ== + +"@esbuild/win32-x64@0.19.12": + version "0.19.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz#c57c8afbb4054a3ab8317591a0b7320360b444ae" + integrity sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA== "@isaacs/cliui@^8.0.2": version "8.0.2" @@ -643,7 +641,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": +"@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== @@ -658,14 +656,6 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": version "0.3.22" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz#72a621e5de59f5f1ef792d0793a82ee20f645e4c" @@ -707,6 +697,86 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@rollup/rollup-android-arm-eabi@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.16.2.tgz#29b7b3c70ddf532fe6dcf859cbfc3e4714c34842" + integrity sha512-VGodkwtEuZ+ENPz/CpDSl091koMv8ao5jHVMbG1vNK+sbx/48/wVzP84M5xSfDAC69mAKKoEkSo+ym9bXYRK9w== + +"@rollup/rollup-android-arm64@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.16.2.tgz#f50f65d0c3b8b30d070d8616b2dfc0978dd588bd" + integrity sha512-5/W1xyIdc7jw6c/f1KEtg1vYDBWnWCsLiipK41NiaWGLG93eH2edgE6EgQJ3AGiPERhiOLUqlDSfjRK08C9xFg== + +"@rollup/rollup-darwin-arm64@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.16.2.tgz#be3d9fffbf6fc5b9d5f0642f1f0250e0ecab8d3e" + integrity sha512-vOAKMqZSTbPfyPVu1jBiy+YniIQd3MG7LUnqV0dA6Q5tyhdqYtxacTHP1+S/ksKl6qCtMG1qQ0grcIgk/19JEA== + +"@rollup/rollup-darwin-x64@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.16.2.tgz#fe45a772526b2c03d545e20f97a1e5cd60a46e52" + integrity sha512-aIJVRUS3Dnj6MqocBMrcXlatKm64O3ITeQAdAxVSE9swyhNyV1dwnRgw7IGKIkDQofatd8UqMSyUxuFEa42EcA== + +"@rollup/rollup-linux-arm-gnueabihf@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.16.2.tgz#450ecf66f30a51514413aafa79d28561db73151c" + integrity sha512-/bjfUiXwy3P5vYr6/ezv//Yle2Y0ak3a+Av/BKoi76nFryjWCkki8AuVoPR7ZU/ckcvAWFo77OnFK14B9B5JsA== + +"@rollup/rollup-linux-arm-musleabihf@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.16.2.tgz#1e8807d220047084579cd01499c5476a325e0700" + integrity sha512-S24b+tJHwpq2TNRz9T+r71FjMvyBBApY8EkYxz8Cwi/rhH6h+lu/iDUxyc9PuHf9UvyeBFYkWWcrDahai/NCGw== + +"@rollup/rollup-linux-arm64-gnu@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.16.2.tgz#128adb9dbf0057b989127d2e7fd73931a6729410" + integrity sha512-UN7VAXLyeyGbCQWiOtQN7BqmjTDw1ON2Oos4lfk0YR7yNhFEJWZiwGtvj9Ay4lsT/ueT04sh80Sg2MlWVVZ+Ug== + +"@rollup/rollup-linux-arm64-musl@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.16.2.tgz#fddc7730045301a7fb0132532890e5edcb23d2bc" + integrity sha512-ZBKvz3+rIhQjusKMccuJiPsStCrPOtejCHxTe+yWp3tNnuPWtyCh9QLGPKz6bFNFbwbw28E2T6zDgzJZ05F1JQ== + +"@rollup/rollup-linux-powerpc64le-gnu@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.16.2.tgz#7154fe9ffc6405b2a6555ca931c42c0aa5198c2a" + integrity sha512-LjMMFiVBRL3wOe095vHAekL4b7nQqf4KZEpdMWd3/W+nIy5o9q/8tlVKiqMbfieDypNXLsxM9fexOxd9Qcklyg== + +"@rollup/rollup-linux-riscv64-gnu@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.16.2.tgz#7a7d091a94fa7c50ebf72d5578475093e01c739e" + integrity sha512-ohkPt0lKoCU0s4B6twro2aft+QROPdUiWwOjPNTzwTsBK5w+2+iT9kySdtOdq0gzWJAdiqsV4NFtXOwGZmIsHA== + +"@rollup/rollup-linux-s390x-gnu@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.16.2.tgz#39b87bd355dfafbc062ca856d3d6bc5aa1905d89" + integrity sha512-jm2lvLc+/gqXfndlpDw05jKvsl/HKYxUEAt1h5UXcMFVpO4vGpoWmJVUfKDtTqSaHcCNw1his1XjkgR9aort3w== + +"@rollup/rollup-linux-x64-gnu@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.16.2.tgz#30b88169db18dec202ab9662d5148523d59da553" + integrity sha512-oc5/SlITI/Vj/qL4UM+lXN7MERpiy1HEOnrE+SegXwzf7WP9bzmZd6+MDljCEZTdSY84CpvUv9Rq7bCaftn1+g== + +"@rollup/rollup-linux-x64-musl@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.16.2.tgz#d4fd52a28d5ce4aaed436311d89a9a1eaff87c2d" + integrity sha512-/2VWEBG6mKbS2itm7hzPwhIPaxfZh/KLWrYg20pCRLHhNFtF+epLgcBtwy3m07bl/k86Q3PFRAf2cX+VbZbwzQ== + +"@rollup/rollup-win32-arm64-msvc@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.16.2.tgz#edd352302e3fa6a2d612447590b0a0887cdbf762" + integrity sha512-Wg7ANh7+hSilF0lG3e/0Oy8GtfTIfEk1327Bw8juZOMOoKmJLs3R+a4JDa/4cHJp2Gs7QfCDTepXXcyFD0ubBg== + +"@rollup/rollup-win32-ia32-msvc@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.16.2.tgz#f17cc1db108f364bf6ef427f98844b5f742d31f0" + integrity sha512-J/jCDKVMWp0Y2ELnTjpQFYUCUWv1Jr+LdFrJVZtdqGyjDo0PHPa7pCamjHvJel6zBFM3doFFqAr7cmXYWBAbfw== + +"@rollup/rollup-win32-x64-msvc@4.16.2": + version "4.16.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.16.2.tgz#98fb87589960075d39c44784e3a99f67138602f4" + integrity sha512-3nIf+SJMs2ZzrCh+SKNqgLVV9hS/UY0UjT1YU8XQYFGLiUfmHYJ/5trOU1XSvmHjV5gTF/K3DjrWxtyzKKcAHA== + "@sinclair/typebox@^0.27.8": version "0.27.8" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" @@ -726,26 +796,6 @@ dependencies: "@sinonjs/commons" "^3.0.0" -"@tsconfig/node10@^1.0.7": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" - integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== - -"@tsconfig/node12@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" - integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== - -"@tsconfig/node14@^1.0.0": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" - integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== - -"@tsconfig/node16@^1.0.2": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" - integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== - "@types/babel__core@^7.1.14": version "7.20.5" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" @@ -779,6 +829,11 @@ dependencies: "@babel/types" "^7.20.7" +"@types/estree@1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== + "@types/graceful-fs@^4.1.3": version "4.1.9" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.9.tgz#2a06bc0f68a20ab37b3e36aa238be6abdf49e8b4" @@ -844,16 +899,6 @@ dependencies: "@types/yargs-parser" "*" -acorn-walk@^8.1.1: - version "8.3.2" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" - integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== - -acorn@^8.4.1: - version "8.11.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" - integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== - ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -913,11 +958,6 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1201,11 +1241,6 @@ create-jest@^29.7.0: jest-util "^29.7.0" prompts "^2.0.1" -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - cross-spawn@^7.0.0, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -1242,11 +1277,6 @@ diff-sequences@^29.6.3: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -1293,33 +1323,34 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -esbuild@^0.17.6: - version "0.17.19" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.19.tgz#087a727e98299f0462a3d0bcdd9cd7ff100bd955" - integrity sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw== +esbuild@^0.19.2: + version "0.19.12" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.12.tgz#dc82ee5dc79e82f5a5c3b4323a2a641827db3e04" + integrity sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg== optionalDependencies: - "@esbuild/android-arm" "0.17.19" - "@esbuild/android-arm64" "0.17.19" - "@esbuild/android-x64" "0.17.19" - "@esbuild/darwin-arm64" "0.17.19" - "@esbuild/darwin-x64" "0.17.19" - "@esbuild/freebsd-arm64" "0.17.19" - "@esbuild/freebsd-x64" "0.17.19" - "@esbuild/linux-arm" "0.17.19" - "@esbuild/linux-arm64" "0.17.19" - "@esbuild/linux-ia32" "0.17.19" - "@esbuild/linux-loong64" "0.17.19" - "@esbuild/linux-mips64el" "0.17.19" - "@esbuild/linux-ppc64" "0.17.19" - "@esbuild/linux-riscv64" "0.17.19" - "@esbuild/linux-s390x" "0.17.19" - "@esbuild/linux-x64" "0.17.19" - "@esbuild/netbsd-x64" "0.17.19" - "@esbuild/openbsd-x64" "0.17.19" - "@esbuild/sunos-x64" "0.17.19" - "@esbuild/win32-arm64" "0.17.19" - "@esbuild/win32-ia32" "0.17.19" - "@esbuild/win32-x64" "0.17.19" + "@esbuild/aix-ppc64" "0.19.12" + "@esbuild/android-arm" "0.19.12" + "@esbuild/android-arm64" "0.19.12" + "@esbuild/android-x64" "0.19.12" + "@esbuild/darwin-arm64" "0.19.12" + "@esbuild/darwin-x64" "0.19.12" + "@esbuild/freebsd-arm64" "0.19.12" + "@esbuild/freebsd-x64" "0.19.12" + "@esbuild/linux-arm" "0.19.12" + "@esbuild/linux-arm64" "0.19.12" + "@esbuild/linux-ia32" "0.19.12" + "@esbuild/linux-loong64" "0.19.12" + "@esbuild/linux-mips64el" "0.19.12" + "@esbuild/linux-ppc64" "0.19.12" + "@esbuild/linux-riscv64" "0.19.12" + "@esbuild/linux-s390x" "0.19.12" + "@esbuild/linux-x64" "0.19.12" + "@esbuild/netbsd-x64" "0.19.12" + "@esbuild/openbsd-x64" "0.19.12" + "@esbuild/sunos-x64" "0.19.12" + "@esbuild/win32-arm64" "0.19.12" + "@esbuild/win32-ia32" "0.19.12" + "@esbuild/win32-x64" "0.19.12" escalade@^3.1.1: version "3.1.1" @@ -2094,10 +2125,10 @@ leven@^3.1.0: resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== -lilconfig@^2.0.5: - version "2.1.0" - resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" - integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== +lilconfig@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.1.1.tgz#9d8a246fa753106cfc205fd2d77042faca56e5e3" + integrity sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ== lines-and-columns@^1.1.6: version "1.2.4" @@ -2162,7 +2193,7 @@ make-dir@^4.0.0: dependencies: semver "^7.5.3" -make-error@1.x, make-error@^1.1.1: +make-error@1.x: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -2372,13 +2403,13 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -postcss-load-config@^3.0.1: - version "3.1.4" - resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.4.tgz#1ab2571faf84bb078877e1d07905eabe9ebda855" - integrity sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg== +postcss-load-config@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-4.0.2.tgz#7159dcf626118d33e299f485d6afe4aff7c4a3e3" + integrity sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ== dependencies: - lilconfig "^2.0.5" - yaml "^1.10.2" + lilconfig "^3.0.0" + yaml "^2.3.4" prettier@^3.0.0: version "3.2.4" @@ -2470,11 +2501,29 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rollup@^3.2.5: - version "3.29.4" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.29.4.tgz#4d70c0f9834146df8705bfb69a9a19c9e1109981" - integrity sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw== +rollup@^4.0.2: + version "4.16.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.16.2.tgz#43bcbd225d0a6bc68df97a6e41c45003188a3845" + integrity sha512-sxDP0+pya/Yi5ZtptF4p3avI+uWCIf/OdrfdH2Gbv1kWddLKk0U7WE3PmQokhi5JrektxsK3sK8s4hzAmjqahw== + dependencies: + "@types/estree" "1.0.5" optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.16.2" + "@rollup/rollup-android-arm64" "4.16.2" + "@rollup/rollup-darwin-arm64" "4.16.2" + "@rollup/rollup-darwin-x64" "4.16.2" + "@rollup/rollup-linux-arm-gnueabihf" "4.16.2" + "@rollup/rollup-linux-arm-musleabihf" "4.16.2" + "@rollup/rollup-linux-arm64-gnu" "4.16.2" + "@rollup/rollup-linux-arm64-musl" "4.16.2" + "@rollup/rollup-linux-powerpc64le-gnu" "4.16.2" + "@rollup/rollup-linux-riscv64-gnu" "4.16.2" + "@rollup/rollup-linux-s390x-gnu" "4.16.2" + "@rollup/rollup-linux-x64-gnu" "4.16.2" + "@rollup/rollup-linux-x64-musl" "4.16.2" + "@rollup/rollup-win32-arm64-msvc" "4.16.2" + "@rollup/rollup-win32-ia32-msvc" "4.16.2" + "@rollup/rollup-win32-x64-msvc" "4.16.2" fsevents "~2.3.2" run-parallel@^1.1.9: @@ -2751,41 +2800,22 @@ ts-jest@^29.0.4: semver "^7.5.3" yargs-parser "^21.0.1" -ts-node@^10.9.2: - version "10.9.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" - integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== - dependencies: - "@cspotcode/source-map-support" "^0.8.0" - "@tsconfig/node10" "^1.0.7" - "@tsconfig/node12" "^1.0.7" - "@tsconfig/node14" "^1.0.0" - "@tsconfig/node16" "^1.0.2" - acorn "^8.4.1" - acorn-walk "^8.1.1" - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - v8-compile-cache-lib "^3.0.1" - yn "3.1.1" - -tsup@^6.5.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/tsup/-/tsup-6.7.0.tgz#416f350f32a07b6ae86792ad7e52b0cafc566d64" - integrity sha512-L3o8hGkaHnu5TdJns+mCqFsDBo83bJ44rlK7e6VdanIvpea4ArPcU3swWGsLVbXak1PqQx/V+SSmFPujBK+zEQ== +tsup@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/tsup/-/tsup-8.0.2.tgz#c63192a08386515103e2c44ac5a23bdff75c5fa1" + integrity sha512-NY8xtQXdH7hDUAZwcQdY/Vzlw9johQsaqf7iwZ6g1DOUlFYQ5/AtVAjTvihhEyeRlGo4dLRVHtrRaL35M1daqQ== dependencies: bundle-require "^4.0.0" cac "^6.7.12" chokidar "^3.5.1" debug "^4.3.1" - esbuild "^0.17.6" + esbuild "^0.19.2" execa "^5.0.0" globby "^11.0.3" joycon "^3.0.1" - postcss-load-config "^3.0.1" + postcss-load-config "^4.0.1" resolve-from "^5.0.0" - rollup "^3.2.5" + rollup "^4.0.2" source-map "0.8.0-beta.0" sucrase "^3.20.3" tree-kill "^1.2.2" @@ -2833,11 +2863,6 @@ update-browserslist-db@^1.0.13: escalade "^3.1.1" picocolors "^1.0.0" -v8-compile-cache-lib@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== - v8-to-istanbul@^9.0.1: version "9.2.0" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz#2ed7644a245cddd83d4e087b9b33b3e62dfd10ad" @@ -2940,16 +2965,16 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^1.10.2: - version "1.10.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" - integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== - yaml@^2.3.1: version "2.3.4" resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2" integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA== +yaml@^2.3.4: + version "2.4.1" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.4.1.tgz#2e57e0b5e995292c25c75d2658f0664765210eed" + integrity sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg== + yargs-parser@^21.0.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" @@ -2968,11 +2993,6 @@ yargs@^17.3.1: y18n "^5.0.5" yargs-parser "^21.1.1" -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From 81546080e3edc3a533fa0aa39e015ed66ac05516 Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Tue, 23 Apr 2024 17:02:14 +0200 Subject: [PATCH 3/7] pkg: add ts-node needed by jest --- package.json | 1 + yarn.lock | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 96 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 50fcba4..eb9c3fc 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "jest": "^29.4.1", "prettier": "^3.0.0", "ts-jest": "^29.0.4", + "ts-node": "^10.9.2", "tsup": "^8.0.2", "typedoc": "^0.24.8", "typedoc-plugin-export-functions": "^1.0.0", diff --git a/yarn.lock b/yarn.lock index 52d607d..1ee370c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -297,6 +297,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + "@esbuild/aix-ppc64@0.19.12": version "0.19.12" resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz#d1bc06aedb6936b3b6d313bf809a5a40387d2b7f" @@ -641,6 +648,11 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== + "@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" @@ -656,6 +668,14 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": version "0.3.22" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz#72a621e5de59f5f1ef792d0793a82ee20f645e4c" @@ -796,6 +816,26 @@ dependencies: "@sinonjs/commons" "^3.0.0" +"@tsconfig/node10@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" + integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + "@types/babel__core@^7.1.14": version "7.20.5" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" @@ -899,6 +939,16 @@ dependencies: "@types/yargs-parser" "*" +acorn-walk@^8.1.1: + version "8.3.2" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" + integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== + +acorn@^8.4.1: + version "8.11.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" + integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== + ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -958,6 +1008,11 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1241,6 +1296,11 @@ create-jest@^29.7.0: jest-util "^29.7.0" prompts "^2.0.1" +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + cross-spawn@^7.0.0, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -1277,6 +1337,11 @@ diff-sequences@^29.6.3: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -2193,7 +2258,7 @@ make-dir@^4.0.0: dependencies: semver "^7.5.3" -make-error@1.x: +make-error@1.x, make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -2800,6 +2865,25 @@ ts-jest@^29.0.4: semver "^7.5.3" yargs-parser "^21.0.1" +ts-node@^10.9.2: + version "10.9.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" + integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + tsup@^8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/tsup/-/tsup-8.0.2.tgz#c63192a08386515103e2c44ac5a23bdff75c5fa1" @@ -2863,6 +2947,11 @@ update-browserslist-db@^1.0.13: escalade "^3.1.1" picocolors "^1.0.0" +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + v8-to-istanbul@^9.0.1: version "9.2.0" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz#2ed7644a245cddd83d4e087b9b33b3e62dfd10ad" @@ -2993,6 +3082,11 @@ yargs@^17.3.1: y18n "^5.0.5" yargs-parser "^21.1.1" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From 33cb4d9a873b64ec9cc179d8951370535f82bc98 Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Tue, 23 Apr 2024 17:02:26 +0200 Subject: [PATCH 4/7] feat(compilation): improve error message --- src/compilation/resolveImports.ts | 30 ++++++++++++--------- test/compilation/getModelFromSource.test.ts | 8 +++++- tsconfig.json | 18 +++---------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/compilation/resolveImports.ts b/src/compilation/resolveImports.ts index 8522c14..6624adb 100644 --- a/src/compilation/resolveImports.ts +++ b/src/compilation/resolveImports.ts @@ -41,7 +41,7 @@ function getEngine( { depuis }: ImportMacro, verbose: boolean, ): Engine { - const packageName = depuis.nom + const packageName = depuis?.nom const fileDirPath = dirname(filePath) if (packageName === undefined) { @@ -85,16 +85,20 @@ importer!: } enginesCache[packageName] = engine } catch (e) { - throw e - // throw new Error(`[Erreur dans la macro 'importer!'] - // ${e} - // Le package '${packageName}' n'a pas pu être trouvé. (Le fichier '${modelPath}' est introuvable). - // - // [Solution] - // - Assurez-vous que le package existe et qu'il est correctement installé dans vos 'node_modules'. - // - Assurez-vous que le fichier '${packageName}.model.json' existe à la racine du package. Sinon, - // précisez le chemin du fichier dans la macro 'importer!' grâce à l'attribut 'source'. - // `) + throw new Error(`[Erreur dans la macro 'importer!'] +Le package '${packageName}' n'a pas pu être trouvé. (Le fichier '${modelPath}' est introuvable). + +[Solution] +- Assurez-vous que le package existe et qu'il est correctement installé dans vos 'node_modules'. +- Assurez-vous que le fichier '${packageName}.model.json' existe à la racine du package. Sinon, +précisez le chemin du fichier dans la macro 'importer!' grâce à l'attribut 'source'. + +[Exemple] +importer!: + depuis: + nom: package-name + source: ../custom-package/path/package-name.model.json + `) } } @@ -254,11 +258,11 @@ Supprimez une des deux définitions de la règle '${ruleName}' dans la macro 'im rule = engine.getRule(ruleName) } catch (e) { throw new Error(`[Erreur dans la macro 'importer!'] -La règle '${ruleName}' n'existe pas dans ${importMacro.depuis.nom} +La règle '${ruleName}' n'existe pas dans '${importMacro.depuis.nom}'. [Solution] - Vérifiez que le nom de la règle est correct. -- Assurez-vous que la règle '${ruleName}' existe dans le package. +- Assurez-vous que la règle '${ruleName}' existe dans '${importMacro.depuis.nom}'. `) } diff --git a/test/compilation/getModelFromSource.test.ts b/test/compilation/getModelFromSource.test.ts index eb70b51..fb273f0 100644 --- a/test/compilation/getModelFromSource.test.ts +++ b/test/compilation/getModelFromSource.test.ts @@ -158,7 +158,13 @@ Ajout d'une description`, expect(() => { getModelFromSource(join(testDataDir, 'unknown-import.publicodes')) }).toThrow( - "La règle 'root . unknown' n'existe pas dans my-external-package", + `[Erreur dans la macro 'importer!'] +La règle 'root . unknown' n'existe pas dans 'my-external-package'. + +[Solution] +- Vérifiez que le nom de la règle est correct. +- Assurez-vous que la règle 'root . unknown' existe dans 'my-external-package'. +`, ) }) diff --git a/tsconfig.json b/tsconfig.json index b935f12..57d0fd0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,21 +8,11 @@ "moduleResolution": "node", "resolveJsonModule": true, "sourceMap": true, - "types": [ - "jest", - "node" - ], + "types": ["jest", "node"], "declaration": true, "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, }, - "include": [ - "src" - ], - "exclude": [ - "./node_modules/", - "./dist/", - "./jest.config.js", - "./test/" - ] + "include": ["src"], + "exclude": ["./node_modules/", "./dist/", "./jest.config.js", "./test/"], } From f860986db3dc3bf7d28817f35930ba1d1fe21f71 Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Wed, 8 May 2024 15:31:36 +0200 Subject: [PATCH 5/7] fix(compilation): catch engine from source files instead of package names --- src/commons.ts | 2 +- src/compilation/resolveImports.ts | 39 ++++++++++----------- test/compilation/getModelFromSource.test.ts | 16 ++++----- 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/src/commons.ts b/src/commons.ts index 238e00f..7a82072 100644 --- a/src/commons.ts +++ b/src/commons.ts @@ -13,7 +13,7 @@ import yaml from 'yaml' */ /** - * Represents a rule name, i.e. 'rule . A. B' + * Represents a rule name, i.e. 'rule . A . B' */ export type RuleName = string diff --git a/src/compilation/resolveImports.ts b/src/compilation/resolveImports.ts index 6624adb..2af6309 100644 --- a/src/compilation/resolveImports.ts +++ b/src/compilation/resolveImports.ts @@ -46,13 +46,13 @@ function getEngine( if (packageName === undefined) { throw new Error( - `[Erreur dans la macro 'importer!'] + `[ Erreur dans la macro 'importer!' ] Le nom du package est manquant dans la macro 'importer!' dans le fichier: ${basename(filePath)}. -[Solution] +[ Solution ] Ajoutez le nom du package dans la macro 'importer!'. -[Exemple] +[ Exemple ] importer!: depuis: nom: package-name @@ -64,13 +64,13 @@ importer!: ) } - if (!enginesCache[packageName]) { - let modelPath = '' + const modelPath = + depuis.source !== undefined + ? join(fileDirPath, depuis.source) + : packageModelPath(packageName) + + if (!enginesCache[modelPath]) { try { - modelPath = - depuis.source !== undefined - ? join(fileDirPath, depuis.source) - : packageModelPath(packageName) const model = JSON.parse(readFileSync(modelPath, 'utf-8')) const engine = new Engine(model, { logger: { @@ -83,17 +83,17 @@ importer!: if (verbose) { console.debug(`📦 ${packageName} loaded`) } - enginesCache[packageName] = engine + enginesCache[modelPath] = engine } catch (e) { - throw new Error(`[Erreur dans la macro 'importer!'] + throw new Error(`[ Erreur dans la macro 'importer!' ] Le package '${packageName}' n'a pas pu être trouvé. (Le fichier '${modelPath}' est introuvable). -[Solution] +[ Solution ] - Assurez-vous que le package existe et qu'il est correctement installé dans vos 'node_modules'. - Assurez-vous que le fichier '${packageName}.model.json' existe à la racine du package. Sinon, précisez le chemin du fichier dans la macro 'importer!' grâce à l'attribut 'source'. -[Exemple] +[ Exemple ] importer!: depuis: nom: package-name @@ -102,7 +102,7 @@ importer!: } } - return enginesCache[packageName] + return enginesCache[modelPath] } function getDependencies(engine: Engine, rule: RuleNode, acc = []) { @@ -242,10 +242,10 @@ export function resolveImports( rulesToImport?.forEach(({ ruleName, attrs }) => { if (appearsMoreThanOnce(rulesToImport, ruleName)) { throw new Error( - `[Erreur dans la macro 'importer!'] + `[ Erreur dans la macro 'importer!' ] La règle '${ruleName}' est définie deux fois dans ${importMacro.depuis.nom} -[Solution] +[ Solution ] Supprimez une des deux définitions de la règle '${ruleName}' dans la macro 'importer!'`, ) } @@ -257,13 +257,12 @@ Supprimez une des deux définitions de la règle '${ruleName}' dans la macro 'im try { rule = engine.getRule(ruleName) } catch (e) { - throw new Error(`[Erreur dans la macro 'importer!'] + throw new Error(`[ Erreur dans la macro 'importer!' ] La règle '${ruleName}' n'existe pas dans '${importMacro.depuis.nom}'. -[Solution] +[ Solution ] - Vérifiez que le nom de la règle est correct. -- Assurez-vous que la règle '${ruleName}' existe dans '${importMacro.depuis.nom}'. -`) +- Assurez-vous que la règle '${ruleName}' existe dans '${importMacro.depuis.nom}'.`) } const getUpdatedRule = (ruleName: RuleName, rule: Rule) => { diff --git a/test/compilation/getModelFromSource.test.ts b/test/compilation/getModelFromSource.test.ts index fb273f0..879dee1 100644 --- a/test/compilation/getModelFromSource.test.ts +++ b/test/compilation/getModelFromSource.test.ts @@ -158,13 +158,12 @@ Ajout d'une description`, expect(() => { getModelFromSource(join(testDataDir, 'unknown-import.publicodes')) }).toThrow( - `[Erreur dans la macro 'importer!'] + `[ Erreur dans la macro 'importer!' ] La règle 'root . unknown' n'existe pas dans 'my-external-package'. -[Solution] +[ Solution ] - Vérifiez que le nom de la règle est correct. -- Assurez-vous que la règle 'root . unknown' existe dans 'my-external-package'. -`, +- Assurez-vous que la règle 'root . unknown' existe dans 'my-external-package'.`, ) }) @@ -173,21 +172,20 @@ La règle 'root . unknown' n'existe pas dans 'my-external-package'. expect(() => { getModelFromSource(path) }).toThrow( - `[Erreur dans la macro 'importer!'] + `[ Erreur dans la macro 'importer!' ] Le nom du package est manquant dans la macro 'importer!' dans le fichier: no-name-import.publicodes. -[Solution] +[ Solution ] Ajoutez le nom du package dans la macro 'importer!'. -[Exemple] +[ Exemple ] importer!: depuis: nom: package-name les règles: - ruleA - ruleB - ... -`, + ...`, ) }) From f38b79150510f5c7df505555fa86771dd01c5190 Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Wed, 29 May 2024 16:09:13 +0200 Subject: [PATCH 6/7] pkg: rebase with main to support migration --- package.json | 3 ++- tsconfig.json | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index eb9c3fc..d4f005b 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,8 @@ "entry": [ "src/index.ts", "src/optims/index.ts", - "src/compilation/index.ts" + "src/compilation/index.ts", + "src/migration/index.ts" ], "cjsInterop": true, "format": [ diff --git a/tsconfig.json b/tsconfig.json index 57d0fd0..b935f12 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,11 +8,21 @@ "moduleResolution": "node", "resolveJsonModule": true, "sourceMap": true, - "types": ["jest", "node"], + "types": [ + "jest", + "node" + ], "declaration": true, "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": true, + "allowSyntheticDefaultImports": true }, - "include": ["src"], - "exclude": ["./node_modules/", "./dist/", "./jest.config.js", "./test/"], + "include": [ + "src" + ], + "exclude": [ + "./node_modules/", + "./dist/", + "./jest.config.js", + "./test/" + ] } From 6a6b214ca924fb5f51b4fe0a67f9d3abce07bebc Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Wed, 29 May 2024 16:17:05 +0200 Subject: [PATCH 7/7] refactor: mv source/migration into src/migration --- src/compilation/getModelFromSource.ts | 6 +++--- {source => src}/migration/index.ts | 0 {source => src}/migration/migrateSituation.ts | 0 .../deleteKeyFromSituationAndFoldedSteps.ts | 0 .../migrateSituation/getValueWithoutQuotes.ts | 0 .../handleSituationKeysMigration.ts | 0 .../handleSituationValuesMigration.ts | 0 .../migrateSituation/handleSpecialCases.ts | 0 test/migration/migrateSituation.test.ts | 2 +- tsconfig.json | 18 ++++-------------- 10 files changed, 8 insertions(+), 18 deletions(-) rename {source => src}/migration/index.ts (100%) rename {source => src}/migration/migrateSituation.ts (100%) rename {source => src}/migration/migrateSituation/deleteKeyFromSituationAndFoldedSteps.ts (100%) rename {source => src}/migration/migrateSituation/getValueWithoutQuotes.ts (100%) rename {source => src}/migration/migrateSituation/handleSituationKeysMigration.ts (100%) rename {source => src}/migration/migrateSituation/handleSituationValuesMigration.ts (100%) rename {source => src}/migration/migrateSituation/handleSpecialCases.ts (100%) diff --git a/src/compilation/getModelFromSource.ts b/src/compilation/getModelFromSource.ts index 7f4c52c..b053e5b 100644 --- a/src/compilation/getModelFromSource.ts +++ b/src/compilation/getModelFromSource.ts @@ -1,6 +1,6 @@ +import { readFileSync, statSync } from 'fs' import glob from 'glob' import yaml from 'yaml' -import fs from 'fs' import { getDoubleDefError, RawRules } from '../commons' import { resolveImports } from './resolveImports' @@ -41,7 +41,7 @@ export function getModelFromSource( opts?: GetModelFromSourceOptions, ): RawRules { try { - if (fs.statSync(sourcePath).isDirectory()) { + if (statSync(sourcePath).isDirectory()) { sourcePath = sourcePath + '/**/*.publicodes' } } catch (e) {} @@ -49,7 +49,7 @@ export function getModelFromSource( .sync(sourcePath, { ignore: opts?.ignore }) .reduce( ({ jsonModel, namespaces }, filePath: string) => { - const rules: RawRules = yaml.parse(fs.readFileSync(filePath, 'utf-8')) + const rules: RawRules = yaml.parse(readFileSync(filePath, 'utf-8')) if (rules == null) { console.warn(`⚠️ ${filePath} is empty, skipping...`) return jsonModel diff --git a/source/migration/index.ts b/src/migration/index.ts similarity index 100% rename from source/migration/index.ts rename to src/migration/index.ts diff --git a/source/migration/migrateSituation.ts b/src/migration/migrateSituation.ts similarity index 100% rename from source/migration/migrateSituation.ts rename to src/migration/migrateSituation.ts diff --git a/source/migration/migrateSituation/deleteKeyFromSituationAndFoldedSteps.ts b/src/migration/migrateSituation/deleteKeyFromSituationAndFoldedSteps.ts similarity index 100% rename from source/migration/migrateSituation/deleteKeyFromSituationAndFoldedSteps.ts rename to src/migration/migrateSituation/deleteKeyFromSituationAndFoldedSteps.ts diff --git a/source/migration/migrateSituation/getValueWithoutQuotes.ts b/src/migration/migrateSituation/getValueWithoutQuotes.ts similarity index 100% rename from source/migration/migrateSituation/getValueWithoutQuotes.ts rename to src/migration/migrateSituation/getValueWithoutQuotes.ts diff --git a/source/migration/migrateSituation/handleSituationKeysMigration.ts b/src/migration/migrateSituation/handleSituationKeysMigration.ts similarity index 100% rename from source/migration/migrateSituation/handleSituationKeysMigration.ts rename to src/migration/migrateSituation/handleSituationKeysMigration.ts diff --git a/source/migration/migrateSituation/handleSituationValuesMigration.ts b/src/migration/migrateSituation/handleSituationValuesMigration.ts similarity index 100% rename from source/migration/migrateSituation/handleSituationValuesMigration.ts rename to src/migration/migrateSituation/handleSituationValuesMigration.ts diff --git a/source/migration/migrateSituation/handleSpecialCases.ts b/src/migration/migrateSituation/handleSpecialCases.ts similarity index 100% rename from source/migration/migrateSituation/handleSpecialCases.ts rename to src/migration/migrateSituation/handleSpecialCases.ts diff --git a/test/migration/migrateSituation.test.ts b/test/migration/migrateSituation.test.ts index 9eae08e..8a87069 100644 --- a/test/migration/migrateSituation.test.ts +++ b/test/migration/migrateSituation.test.ts @@ -1,4 +1,4 @@ -import { migrateSituation } from '../../source/migration/migrateSituation' +import { migrateSituation } from '../../src/migration/migrateSituation' const migrationInstructions = { keysToMigrate: { age: 'âge', 'année de naissance': '' }, diff --git a/tsconfig.json b/tsconfig.json index b935f12..57d0fd0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,21 +8,11 @@ "moduleResolution": "node", "resolveJsonModule": true, "sourceMap": true, - "types": [ - "jest", - "node" - ], + "types": ["jest", "node"], "declaration": true, "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, }, - "include": [ - "src" - ], - "exclude": [ - "./node_modules/", - "./dist/", - "./jest.config.js", - "./test/" - ] + "include": ["src"], + "exclude": ["./node_modules/", "./dist/", "./jest.config.js", "./test/"], }