@tapjs/typescript
Advanced tools
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAE,MAAM,aAAa,CAAA;AAO5C,eAAO,MAAM,MAAM,0BAA0B,CAAA;AAC7C,eAAO,MAAM,YAAY,6BAA6B,CAAA;AAItD,eAAO,MAAM,OAAO,OAAO,CAAA;AAa3B,eAAO,MAAM,MAAM,EAAE,SAAS,CAAC,EAAE,CA0ChC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,UAAqC,CAAA;AAEpE;;;;GAIG;AACH,eAAO,MAAM,MAAM;IACjB;;;;;;;;;;;;;;;;;;;;;OAqBG;;;;;IAyBH;;;;;;;;;;;;;;;;;OAiBG;;;;;IAqBH;;;;;;;;;;;;;;;;;;;;;;OAsBG;;;;;CAuBJ,CAAA"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAE,MAAM,aAAa,CAAA;AAO5C,eAAO,MAAM,MAAM,0BAA0B,CAAA;AAC7C,eAAO,MAAM,YAAY,6BAA6B,CAAA;AAItD,eAAO,MAAM,OAAO,OAAO,CAAA;AAa3B,eAAO,MAAM,MAAM,EAAE,SAAS,CAAC,EAAE,CAmDhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,UAAqC,CAAA;AAEpE;;;;GAIG;AACH,eAAO,MAAM,MAAM;IACjB;;;;;;;;;;;;;;;;;;;;;OAqBG;;;;;IAyBH;;;;;;;;;;;;;;;;;OAiBG;;;;;IAqBH;;;;;;;;;;;;;;;;;;;;;;OAsBG;;;;;CAuBJ,CAAA"} |
@@ -35,6 +35,14 @@ "use strict"; | ||
| // this stopped being a warning in node v24 | ||
| const nw = nv <= 23 ? '--no-warnings ' : ''; | ||
| const nw = nv <= 23 || nv >= 26 ? '--no-warnings ' : ''; | ||
| core_1.env.NODE_OPTIONS = `${core_1.env.NODE_OPTIONS ?? ''} ${nw}${nv === 22 ? '--experimental-strip-types' : ''}`.trim(); | ||
| return {}; | ||
| } | ||
| // node version 26 started spamming the stderr with warnings | ||
| // about ts-node's module.register() usage. For now, just turn | ||
| // that off. | ||
| /* v8 ignore start */ | ||
| if (nv >= 26) { | ||
| core_1.env.NODE_OPTIONS = `${core_1.env.NODE_OPTIONS ?? ''} --no-warnings`.trim(); | ||
| } | ||
| /* v8 ignore stop */ | ||
| if (core_1.env.TAP_TYPECHECK === '1') { | ||
@@ -41,0 +49,0 @@ core_1.env.TS_NODE_TRANSPILE_ONLY = '0'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,sCAA4C;AAC5C,qCAAkC;AAClC,yCAAmC;AAEnC,wCAAwC;AACxC,+BAA+B;AAC/B,kDAAkD;AACrC,QAAA,MAAM,GAAG,uBAAuB,CAAA;AAChC,QAAA,YAAY,GAAG,0BAA0B,CAAA;AAEtD,mEAAmE;AACnE,+CAA+C;AAClC,QAAA,OAAO,GAAG,IAAI,CAAA;AAE3B,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;IAClC,IAAI,CAAC;QACH,OAAO,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAA;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA;AAED,IAAI,MAAM,GAAG,KAAK,CAAA;AAClB,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;AAEvC,MAAM,MAAM,GAAkB,GAAG,EAAE;IACxC,IAAI,MAAM;QAAE,OAAO,EAAE,CAAA;IAErB,MAAM,GAAG,IAAI,CAAA;IAEb,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC;QACZ,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,MAAM,UA0ClB;AAED;;GAEG;AACU,QAAA,kBAAkB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AAEpE;;;;GAIG;AACU,QAAA,MAAM,GAAG;IACpB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;;;;;;;;;;;;;;;;;;;KAmBZ;KACF;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE;;;;;;;;;;;;;;;kCAeiB;KAC/B;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAAiB,EAAE;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;;;;;;;;;;;;;;;;;;KAkBZ;KACF;CACF,CAAA","sourcesContent":["import { env, TapPlugin } from '@tapjs/core'\nimport { statSync } from 'node:fs'\nimport { resolve } from 'node:path'\n\n// This just adds the ts-node/esm loader\n// appease the import-deps test\n// import('@isaacs/ts-node-temp-fork-for-pr-2009')\nexport const loader = '@tapjs/typescript/esm'\nexport const importLoader = '@tapjs/typescript/import'\n\n// ts-node/esm should come AHEAD of other loaders in the args list,\n// otherwise any other resolve()'s won't be run\nexport const preload = true\n\nconst fileExists = (path: string) => {\n try {\n return statSync(path).isFile()\n } catch {\n return false\n }\n}\n\nlet didSet = false\nconst nv = parseInt(process.versions.node, 10)\n\nexport const plugin: TapPlugin<{}> = () => {\n if (didSet) return {}\n\n didSet = true\n\n if (nv < 22) {\n // not supported on node versions < 22\n env.TAP_TYPE_STRIP_ONLY = '0'\n }\n\n if (env.TAP_TYPE_STRIP_ONLY === '1') {\n // this stopped being a warning in node v24\n const nw = nv <= 23 ? '--no-warnings ' : ''\n env.NODE_OPTIONS = `${env.NODE_OPTIONS ?? ''} ${nw}${\n nv === 22 ? '--experimental-strip-types' : ''\n }`.trim()\n return {}\n }\n\n if (env.TAP_TYPECHECK === '1') {\n env.TS_NODE_TRANSPILE_ONLY = '0'\n } else {\n env.TS_NODE_TRANSPILE_ONLY = '1'\n }\n\n if (env.TAP_CWD && !env.TAP_TSCONFIG) {\n for (const tsconfig of [\n 'tsconfig.tap.json',\n 'tsconfig.test.json',\n 'tsconfig.spec.json',\n 'tsconfig.json',\n ]) {\n if (fileExists(resolve(env.TAP_CWD, tsconfig))) {\n env.TAP_TSCONFIG = tsconfig\n break\n }\n }\n }\n if (env.TAP_TSCONFIG && env.TAP_CWD) {\n env.TS_NODE_PROJECT = resolve(env.TAP_CWD, env.TAP_TSCONFIG)\n }\n return {}\n}\n\n/**\n * File types that this plugin adds support for\n */\nexport const testFileExtensions = ['ts', 'cts', 'mts', 'tsx', 'jsx']\n\n/**\n * Options added by this plugin\n *\n * @group Configuration\n */\nexport const config = {\n /**\n * flag\n *\n * Type-check test files, in addition to transpiling and running them.\n *\n * This defaults to false, even though type checking your tests is generally\n * a good idea. Unfortunately, it is also often considerably slower, adding\n * as much as 500-750ms to each test suite file, which can be painful if you\n * have a lot of tests. In large project folders, the effect can be even more\n * pronounced.\n *\n * It is a good idea to enable this in CI environments, where test speed is\n * less of an ergonomic drawback.\n *\n * The `\"skipLibCheck\": true` option in tsconfig will also speed things up a\n * bit, at the expense of some type safety.\n *\n * Note that even if you pre-compile your tests, they will still be subject\n * to type checking if `\"allowJs\": true` is set in your tsconfig.\n *\n * @group Configuration\n */\n typecheck: {\n type: 'boolean',\n description: `Type-check test files, in addition to transpiling and running\n them.\n\n This defaults to false, even though type checking your tests\n is generally a good idea. Unfortunately, it is also often\n considerably slower, adding as much as 500-750ms to each test\n suite file, which can be painful if you have a lot of tests.\n In large project folders, the effect can be even more\n pronounced.\n\n It is a good idea to enable this in CI environments, where\n test speed is less of an ergonomic drawback.\n\n The \\`\"skipLibCheck\": true\"\\` option in tsconfig will also\n speed things up a bit, at the expense of some type safety.\n\n Note that even if you pre-compile your tests, they will still\n be subject to type checking if \\`\"allowJs\": true\\` is set in\n your tsconfig.\n `,\n },\n\n /**\n * Path to the `tsconfig.json` file containing project settings provided to\n * ts-node when running tests.\n *\n * Similar to the `--project` option to ts-node. Sets the `TS_NODE_PROJECT`\n * environment variable.\n *\n * If this is a relative directory, then it is resolved against the project\n * root directory.\n *\n * Defaults to the first of these files that are found in the project root\n * directory:\n *\n * - tsconfig.tap.json\n * - tsconfig.test.json\n * - tsconfig.spec.json\n * - tsconfig.json\n */\n tsconfig: {\n type: 'string',\n description: `Path to the \\`tsconfig.json\\` file containing project\n settings provided to ts-node when running tests.\n\n Similar to the \\`--project\\` option to ts-node. Sets the\n \\`TS_NODE_PROJECT\\` environment variable.\n\n If this is a relative directory, then it is resolved\n against the project root directory.\n\n Defaults to the first of these files that are found in\n the project root directory:\n\n - tsconfig.tap.json\n - tsconfig.test.json\n - tsconfig.spec.json\n - tsconfig.json`,\n },\n\n /**\n * flag\n *\n * Do not compile OR typecheck test files, and instead, opt into Node's\n * built-in type stripping behavior.\n *\n * Note that this limits the TypeScript features that can be used, but it is\n * the fastest and most responsive approach, because it does not require a\n * build step of any kind.\n *\n * This flag supercedes `typecheck` and `tsconfig`, because no compilation is\n * performed.\n *\n * Only supported on Node 22 and higher.\n *\n * On Node 22, adds the `--experimental-strip-types` flag. On Node 23 and\n * higher, this is supported by default.\n *\n * Adds a `--no-warnings` flag on all Node versions, to avoid the prevalance\n * of warnings about type stripping being an experimental feature.\n *\n * @group Configuration\n */\n 'type-strip-only': {\n type: 'boolean',\n description: `Do not compile OR typecheck test files, and instead, opt into\n Node's built-in type stripping behavior.\n\n Note that this limits the TypeScript features that can be\n used, but it is the fastest and most responsive approach,\n because it does not require a build step of any kind.\n\n This flag supercedes \\`typecheck\\` and \\`tsconfig\\`, because\n no compilation is performed.\n\n Only supported on Node 22 and higher.\n\n On Node 22, adds the \\`--experimental-strip-types\\` flag. On\n Node 23 and higher, this is supported by default.\n\n Adds a \\`--no-warnings\\` flag on Node versions 22 and 23, to\n avoid warnings about type stripping being an experimental\n feature.\n `,\n },\n}\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,sCAA4C;AAC5C,qCAAkC;AAClC,yCAAmC;AAEnC,wCAAwC;AACxC,+BAA+B;AAC/B,kDAAkD;AACrC,QAAA,MAAM,GAAG,uBAAuB,CAAA;AAChC,QAAA,YAAY,GAAG,0BAA0B,CAAA;AAEtD,mEAAmE;AACnE,+CAA+C;AAClC,QAAA,OAAO,GAAG,IAAI,CAAA;AAE3B,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;IAClC,IAAI,CAAC;QACH,OAAO,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAA;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA;AAED,IAAI,MAAM,GAAG,KAAK,CAAA;AAClB,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;AAEvC,MAAM,MAAM,GAAkB,GAAG,EAAE;IACxC,IAAI,MAAM;QAAE,OAAO,EAAE,CAAA;IAErB,MAAM,GAAG,IAAI,CAAA;IAEb,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC;QACZ,sCAAsC;QACtC,UAAG,CAAC,mBAAmB,GAAG,GAAG,CAAA;IAC/B,CAAC;IAED,IAAI,UAAG,CAAC,mBAAmB,KAAK,GAAG,EAAE,CAAC;QACpC,2CAA2C;QAC3C,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAA;QACvD,UAAG,CAAC,YAAY,GAAG,GAAG,UAAG,CAAC,YAAY,IAAI,EAAE,IAAI,EAAE,GAChD,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,4B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GAIG;AACU,QAAA,MAAM,GAAG;IACpB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;;;;;;;;;;;;;;;;;;;KAmBZ;KACF;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE;;;;;;;;;;;;;;;kCAeiB;KAC/B;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAAiB,EAAE;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;;;;;;;;;;;;;;;;;;KAkBZ;KACF;CACF,CAAA","sourcesContent":["import { env, TapPlugin } from '@tapjs/core'\nimport { statSync } from 'node:fs'\nimport { resolve } from 'node:path'\n\n// This just adds the ts-node/esm loader\n// appease the import-deps test\n// import('@isaacs/ts-node-temp-fork-for-pr-2009')\nexport const loader = '@tapjs/typescript/esm'\nexport const importLoader = '@tapjs/typescript/import'\n\n// ts-node/esm should come AHEAD of other loaders in the args list,\n// otherwise any other resolve()'s won't be run\nexport const preload = true\n\nconst fileExists = (path: string) => {\n try {\n return statSync(path).isFile()\n } catch {\n return false\n }\n}\n\nlet didSet = false\nconst nv = parseInt(process.versions.node, 10)\n\nexport const plugin: TapPlugin<{}> = () => {\n if (didSet) return {}\n\n didSet = true\n\n if (nv < 22) {\n // not supported on node versions < 22\n env.TAP_TYPE_STRIP_ONLY = '0'\n }\n\n if (env.TAP_TYPE_STRIP_ONLY === '1') {\n // this stopped being a warning in node v24\n const nw = nv <= 23 || nv >= 26 ? '--no-warnings ' : ''\n env.NODE_OPTIONS = `${env.NODE_OPTIONS ?? ''} ${nw}${\n nv === 22 ? '--experimental-strip-types' : ''\n }`.trim()\n return {}\n }\n\n // node version 26 started spamming the stderr with warnings\n // about ts-node's module.register() usage. For now, just turn\n // that off.\n /* v8 ignore start */\n if (nv >= 26) {\n env.NODE_OPTIONS = `${env.NODE_OPTIONS ?? ''} --no-warnings`.trim()\n }\n /* v8 ignore stop */\n\n if (env.TAP_TYPECHECK === '1') {\n env.TS_NODE_TRANSPILE_ONLY = '0'\n } else {\n env.TS_NODE_TRANSPILE_ONLY = '1'\n }\n\n if (env.TAP_CWD && !env.TAP_TSCONFIG) {\n for (const tsconfig of [\n 'tsconfig.tap.json',\n 'tsconfig.test.json',\n 'tsconfig.spec.json',\n 'tsconfig.json',\n ]) {\n if (fileExists(resolve(env.TAP_CWD, tsconfig))) {\n env.TAP_TSCONFIG = tsconfig\n break\n }\n }\n }\n if (env.TAP_TSCONFIG && env.TAP_CWD) {\n env.TS_NODE_PROJECT = resolve(env.TAP_CWD, env.TAP_TSCONFIG)\n }\n return {}\n}\n\n/**\n * File types that this plugin adds support for\n */\nexport const testFileExtensions = ['ts', 'cts', 'mts', 'tsx', 'jsx']\n\n/**\n * Options added by this plugin\n *\n * @group Configuration\n */\nexport const config = {\n /**\n * flag\n *\n * Type-check test files, in addition to transpiling and running them.\n *\n * This defaults to false, even though type checking your tests is generally\n * a good idea. Unfortunately, it is also often considerably slower, adding\n * as much as 500-750ms to each test suite file, which can be painful if you\n * have a lot of tests. In large project folders, the effect can be even more\n * pronounced.\n *\n * It is a good idea to enable this in CI environments, where test speed is\n * less of an ergonomic drawback.\n *\n * The `\"skipLibCheck\": true` option in tsconfig will also speed things up a\n * bit, at the expense of some type safety.\n *\n * Note that even if you pre-compile your tests, they will still be subject\n * to type checking if `\"allowJs\": true` is set in your tsconfig.\n *\n * @group Configuration\n */\n typecheck: {\n type: 'boolean',\n description: `Type-check test files, in addition to transpiling and running\n them.\n\n This defaults to false, even though type checking your tests\n is generally a good idea. Unfortunately, it is also often\n considerably slower, adding as much as 500-750ms to each test\n suite file, which can be painful if you have a lot of tests.\n In large project folders, the effect can be even more\n pronounced.\n\n It is a good idea to enable this in CI environments, where\n test speed is less of an ergonomic drawback.\n\n The \\`\"skipLibCheck\": true\"\\` option in tsconfig will also\n speed things up a bit, at the expense of some type safety.\n\n Note that even if you pre-compile your tests, they will still\n be subject to type checking if \\`\"allowJs\": true\\` is set in\n your tsconfig.\n `,\n },\n\n /**\n * Path to the `tsconfig.json` file containing project settings provided to\n * ts-node when running tests.\n *\n * Similar to the `--project` option to ts-node. Sets the `TS_NODE_PROJECT`\n * environment variable.\n *\n * If this is a relative directory, then it is resolved against the project\n * root directory.\n *\n * Defaults to the first of these files that are found in the project root\n * directory:\n *\n * - tsconfig.tap.json\n * - tsconfig.test.json\n * - tsconfig.spec.json\n * - tsconfig.json\n */\n tsconfig: {\n type: 'string',\n description: `Path to the \\`tsconfig.json\\` file containing project\n settings provided to ts-node when running tests.\n\n Similar to the \\`--project\\` option to ts-node. Sets the\n \\`TS_NODE_PROJECT\\` environment variable.\n\n If this is a relative directory, then it is resolved\n against the project root directory.\n\n Defaults to the first of these files that are found in\n the project root directory:\n\n - tsconfig.tap.json\n - tsconfig.test.json\n - tsconfig.spec.json\n - tsconfig.json`,\n },\n\n /**\n * flag\n *\n * Do not compile OR typecheck test files, and instead, opt into Node's\n * built-in type stripping behavior.\n *\n * Note that this limits the TypeScript features that can be used, but it is\n * the fastest and most responsive approach, because it does not require a\n * build step of any kind.\n *\n * This flag supercedes `typecheck` and `tsconfig`, because no compilation is\n * performed.\n *\n * Only supported on Node 22 and higher.\n *\n * On Node 22, adds the `--experimental-strip-types` flag. On Node 23 and\n * higher, this is supported by default.\n *\n * Adds a `--no-warnings` flag on all Node versions, to avoid the prevalance\n * of warnings about type stripping being an experimental feature.\n *\n * @group Configuration\n */\n 'type-strip-only': {\n type: 'boolean',\n description: `Do not compile OR typecheck test files, and instead, opt into\n Node's built-in type stripping behavior.\n\n Note that this limits the TypeScript features that can be\n used, but it is the fastest and most responsive approach,\n because it does not require a build step of any kind.\n\n This flag supercedes \\`typecheck\\` and \\`tsconfig\\`, because\n no compilation is performed.\n\n Only supported on Node 22 and higher.\n\n On Node 22, adds the \\`--experimental-strip-types\\` flag. On\n Node 23 and higher, this is supported by default.\n\n Adds a \\`--no-warnings\\` flag on Node versions 22 and 23, to\n avoid warnings about type stripping being an experimental\n feature.\n `,\n },\n}\n"]} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAE,MAAM,aAAa,CAAA;AAO5C,eAAO,MAAM,MAAM,0BAA0B,CAAA;AAC7C,eAAO,MAAM,YAAY,6BAA6B,CAAA;AAItD,eAAO,MAAM,OAAO,OAAO,CAAA;AAa3B,eAAO,MAAM,MAAM,EAAE,SAAS,CAAC,EAAE,CA0ChC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,UAAqC,CAAA;AAEpE;;;;GAIG;AACH,eAAO,MAAM,MAAM;IACjB;;;;;;;;;;;;;;;;;;;;;OAqBG;;;;;IAyBH;;;;;;;;;;;;;;;;;OAiBG;;;;;IAqBH;;;;;;;;;;;;;;;;;;;;;;OAsBG;;;;;CAuBJ,CAAA"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAE,MAAM,aAAa,CAAA;AAO5C,eAAO,MAAM,MAAM,0BAA0B,CAAA;AAC7C,eAAO,MAAM,YAAY,6BAA6B,CAAA;AAItD,eAAO,MAAM,OAAO,OAAO,CAAA;AAa3B,eAAO,MAAM,MAAM,EAAE,SAAS,CAAC,EAAE,CAmDhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,UAAqC,CAAA;AAEpE;;;;GAIG;AACH,eAAO,MAAM,MAAM;IACjB;;;;;;;;;;;;;;;;;;;;;OAqBG;;;;;IAyBH;;;;;;;;;;;;;;;;;OAiBG;;;;;IAqBH;;;;;;;;;;;;;;;;;;;;;;OAsBG;;;;;CAuBJ,CAAA"} |
@@ -32,6 +32,14 @@ import { env } from '@tapjs/core'; | ||
| // this stopped being a warning in node v24 | ||
| const nw = nv <= 23 ? '--no-warnings ' : ''; | ||
| const nw = nv <= 23 || nv >= 26 ? '--no-warnings ' : ''; | ||
| env.NODE_OPTIONS = `${env.NODE_OPTIONS ?? ''} ${nw}${nv === 22 ? '--experimental-strip-types' : ''}`.trim(); | ||
| return {}; | ||
| } | ||
| // node version 26 started spamming the stderr with warnings | ||
| // about ts-node's module.register() usage. For now, just turn | ||
| // that off. | ||
| /* v8 ignore start */ | ||
| if (nv >= 26) { | ||
| env.NODE_OPTIONS = `${env.NODE_OPTIONS ?? ''} --no-warnings`.trim(); | ||
| } | ||
| /* v8 ignore stop */ | ||
| if (env.TAP_TYPECHECK === '1') { | ||
@@ -38,0 +46,0 @@ env.TS_NODE_TRANSPILE_ONLY = '0'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAa,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,wCAAwC;AACxC,+BAA+B;AAC/B,kDAAkD;AAClD,MAAM,CAAC,MAAM,MAAM,GAAG,uBAAuB,CAAA;AAC7C,MAAM,CAAC,MAAM,YAAY,GAAG,0BAA0B,CAAA;AAEtD,mEAAmE;AACnE,+CAA+C;AAC/C,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAA;AAE3B,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;IAClC,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAA;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA;AAED,IAAI,MAAM,GAAG,KAAK,CAAA;AAClB,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EA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AAO,EAAE,CAAC;QACpC,GAAG,CAAC,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,YAAY,CAAC,CAAA;IAC9D,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AAEpE;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;;;;;;;;;;;;;;;;;;;KAmBZ;KACF;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE;;;;;;;;;;;;;;;kCAeiB;KAC/B;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAAiB,EAAE;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;;;;;;;;;;;;;;;;;;KAkBZ;KACF;CACF,CAAA","sourcesContent":["import { env, TapPlugin } from '@tapjs/core'\nimport { statSync } from 'node:fs'\nimport { resolve } from 'node:path'\n\n// This just adds the ts-node/esm loader\n// appease the import-deps test\n// import('@isaacs/ts-node-temp-fork-for-pr-2009')\nexport const loader = '@tapjs/typescript/esm'\nexport const importLoader = '@tapjs/typescript/import'\n\n// ts-node/esm should come AHEAD of other loaders in the args list,\n// otherwise any other resolve()'s won't be run\nexport const preload = true\n\nconst fileExists = (path: string) => {\n try {\n return statSync(path).isFile()\n } catch {\n return false\n }\n}\n\nlet didSet = false\nconst nv = parseInt(process.versions.node, 10)\n\nexport const plugin: TapPlugin<{}> = () => {\n if (didSet) return {}\n\n didSet = true\n\n if (nv < 22) {\n // not supported on node versions < 22\n env.TAP_TYPE_STRIP_ONLY = '0'\n }\n\n if (env.TAP_TYPE_STRIP_ONLY === '1') {\n // this stopped being a warning in node v24\n const nw = nv <= 23 ? '--no-warnings ' : ''\n env.NODE_OPTIONS = `${env.NODE_OPTIONS ?? ''} ${nw}${\n nv === 22 ? '--experimental-strip-types' : ''\n }`.trim()\n return {}\n }\n\n if (env.TAP_TYPECHECK === '1') {\n env.TS_NODE_TRANSPILE_ONLY = '0'\n } else {\n env.TS_NODE_TRANSPILE_ONLY = '1'\n }\n\n if (env.TAP_CWD && !env.TAP_TSCONFIG) {\n for (const tsconfig of [\n 'tsconfig.tap.json',\n 'tsconfig.test.json',\n 'tsconfig.spec.json',\n 'tsconfig.json',\n ]) {\n if (fileExists(resolve(env.TAP_CWD, tsconfig))) {\n env.TAP_TSCONFIG = tsconfig\n break\n }\n }\n }\n if (env.TAP_TSCONFIG && env.TAP_CWD) {\n env.TS_NODE_PROJECT = resolve(env.TAP_CWD, env.TAP_TSCONFIG)\n }\n return {}\n}\n\n/**\n * File types that this plugin adds support for\n */\nexport const testFileExtensions = ['ts', 'cts', 'mts', 'tsx', 'jsx']\n\n/**\n * Options added by this plugin\n *\n * @group Configuration\n */\nexport const config = {\n /**\n * flag\n *\n * Type-check test files, in addition to transpiling and running them.\n *\n * This defaults to false, even though type checking your tests is generally\n * a good idea. Unfortunately, it is also often considerably slower, adding\n * as much as 500-750ms to each test suite file, which can be painful if you\n * have a lot of tests. In large project folders, the effect can be even more\n * pronounced.\n *\n * It is a good idea to enable this in CI environments, where test speed is\n * less of an ergonomic drawback.\n *\n * The `\"skipLibCheck\": true` option in tsconfig will also speed things up a\n * bit, at the expense of some type safety.\n *\n * Note that even if you pre-compile your tests, they will still be subject\n * to type checking if `\"allowJs\": true` is set in your tsconfig.\n *\n * @group Configuration\n */\n typecheck: {\n type: 'boolean',\n description: `Type-check test files, in addition to transpiling and running\n them.\n\n This defaults to false, even though type checking your tests\n is generally a good idea. Unfortunately, it is also often\n considerably slower, adding as much as 500-750ms to each test\n suite file, which can be painful if you have a lot of tests.\n In large project folders, the effect can be even more\n pronounced.\n\n It is a good idea to enable this in CI environments, where\n test speed is less of an ergonomic drawback.\n\n The \\`\"skipLibCheck\": true\"\\` option in tsconfig will also\n speed things up a bit, at the expense of some type safety.\n\n Note that even if you pre-compile your tests, they will still\n be subject to type checking if \\`\"allowJs\": true\\` is set in\n your tsconfig.\n `,\n },\n\n /**\n * Path to the `tsconfig.json` file containing project settings provided to\n * ts-node when running tests.\n *\n * Similar to the `--project` option to ts-node. Sets the `TS_NODE_PROJECT`\n * environment variable.\n *\n * If this is a relative directory, then it is resolved against the project\n * root directory.\n *\n * Defaults to the first of these files that are found in the project root\n * directory:\n *\n * - tsconfig.tap.json\n * - tsconfig.test.json\n * - tsconfig.spec.json\n * - tsconfig.json\n */\n tsconfig: {\n type: 'string',\n description: `Path to the \\`tsconfig.json\\` file containing project\n settings provided to ts-node when running tests.\n\n Similar to the \\`--project\\` option to ts-node. Sets the\n \\`TS_NODE_PROJECT\\` environment variable.\n\n If this is a relative directory, then it is resolved\n against the project root directory.\n\n Defaults to the first of these files that are found in\n the project root directory:\n\n - tsconfig.tap.json\n - tsconfig.test.json\n - tsconfig.spec.json\n - tsconfig.json`,\n },\n\n /**\n * flag\n *\n * Do not compile OR typecheck test files, and instead, opt into Node's\n * built-in type stripping behavior.\n *\n * Note that this limits the TypeScript features that can be used, but it is\n * the fastest and most responsive approach, because it does not require a\n * build step of any kind.\n *\n * This flag supercedes `typecheck` and `tsconfig`, because no compilation is\n * performed.\n *\n * Only supported on Node 22 and higher.\n *\n * On Node 22, adds the `--experimental-strip-types` flag. On Node 23 and\n * higher, this is supported by default.\n *\n * Adds a `--no-warnings` flag on all Node versions, to avoid the prevalance\n * of warnings about type stripping being an experimental feature.\n *\n * @group Configuration\n */\n 'type-strip-only': {\n type: 'boolean',\n description: `Do not compile OR typecheck test files, and instead, opt into\n Node's built-in type stripping behavior.\n\n Note that this limits the TypeScript features that can be\n used, but it is the fastest and most responsive approach,\n because it does not require a build step of any kind.\n\n This flag supercedes \\`typecheck\\` and \\`tsconfig\\`, because\n no compilation is performed.\n\n Only supported on Node 22 and higher.\n\n On Node 22, adds the \\`--experimental-strip-types\\` flag. On\n Node 23 and higher, this is supported by default.\n\n Adds a \\`--no-warnings\\` flag on Node versions 22 and 23, to\n avoid warnings about type stripping being an experimental\n feature.\n `,\n },\n}\n"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAa,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,wCAAwC;AACxC,+BAA+B;AAC/B,kDAAkD;AAClD,MAAM,CAAC,MAAM,MAAM,GAAG,uBAAuB,CAAA;AAC7C,MAAM,CAAC,MAAM,YAAY,GAAG,0BAA0B,CAAA;AAEtD,mEAAmE;AACnE,+CAA+C;AAC/C,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAA;AAE3B,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE;IAClC,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAA;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA;AAED,IAAI,MAAM,GAAG,KAAK,CAAA;AAClB,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;AAE9C,MAAM,CAAC,MAAM,MAAM,GAAkB,GAAG,EAAE;IACxC,IAAI,MAAM;QAAE,OAAO,EAAE,CAAA;IAErB,MAAM,GAAG,IAAI,CAAA;IAEb,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC;QACZ,sCAAsC;QACtC,GAAG,CAAC,mBAAmB,GAAG,GAAG,CAAA;IAC/B,CAAC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CAAC;QACpC,GAAG,CAAC,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,YAAY,CAAC,CAAA;IAC9D,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AAEpE;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;;;;;;;;;;;;;;;;;;;KAmBZ;KACF;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE;;;;;;;;;;;;;;;kCAeiB;KAC/B;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAAiB,EAAE;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;;;;;;;;;;;;;;;;;;KAkBZ;KACF;CACF,CAAA","sourcesContent":["import { env, TapPlugin } from '@tapjs/core'\nimport { statSync } from 'node:fs'\nimport { resolve } from 'node:path'\n\n// This just adds the ts-node/esm loader\n// appease the import-deps test\n// import('@isaacs/ts-node-temp-fork-for-pr-2009')\nexport const loader = '@tapjs/typescript/esm'\nexport const importLoader = '@tapjs/typescript/import'\n\n// ts-node/esm should come AHEAD of other loaders in the args list,\n// otherwise any other resolve()'s won't be run\nexport const preload = true\n\nconst fileExists = (path: string) => {\n try {\n return statSync(path).isFile()\n } catch {\n return false\n }\n}\n\nlet didSet = false\nconst nv = parseInt(process.versions.node, 10)\n\nexport const plugin: TapPlugin<{}> = () => {\n if (didSet) return {}\n\n didSet = true\n\n if (nv < 22) {\n // not supported on node versions < 22\n env.TAP_TYPE_STRIP_ONLY = '0'\n }\n\n if (env.TAP_TYPE_STRIP_ONLY === '1') {\n // this stopped being a warning in node v24\n const nw = nv <= 23 || nv >= 26 ? '--no-warnings ' : ''\n env.NODE_OPTIONS = `${env.NODE_OPTIONS ?? ''} ${nw}${\n nv === 22 ? '--experimental-strip-types' : ''\n }`.trim()\n return {}\n }\n\n // node version 26 started spamming the stderr with warnings\n // about ts-node's module.register() usage. For now, just turn\n // that off.\n /* v8 ignore start */\n if (nv >= 26) {\n env.NODE_OPTIONS = `${env.NODE_OPTIONS ?? ''} --no-warnings`.trim()\n }\n /* v8 ignore stop */\n\n if (env.TAP_TYPECHECK === '1') {\n env.TS_NODE_TRANSPILE_ONLY = '0'\n } else {\n env.TS_NODE_TRANSPILE_ONLY = '1'\n }\n\n if (env.TAP_CWD && !env.TAP_TSCONFIG) {\n for (const tsconfig of [\n 'tsconfig.tap.json',\n 'tsconfig.test.json',\n 'tsconfig.spec.json',\n 'tsconfig.json',\n ]) {\n if (fileExists(resolve(env.TAP_CWD, tsconfig))) {\n env.TAP_TSCONFIG = tsconfig\n break\n }\n }\n }\n if (env.TAP_TSCONFIG && env.TAP_CWD) {\n env.TS_NODE_PROJECT = resolve(env.TAP_CWD, env.TAP_TSCONFIG)\n }\n return {}\n}\n\n/**\n * File types that this plugin adds support for\n */\nexport const testFileExtensions = ['ts', 'cts', 'mts', 'tsx', 'jsx']\n\n/**\n * Options added by this plugin\n *\n * @group Configuration\n */\nexport const config = {\n /**\n * flag\n *\n * Type-check test files, in addition to transpiling and running them.\n *\n * This defaults to false, even though type checking your tests is generally\n * a good idea. Unfortunately, it is also often considerably slower, adding\n * as much as 500-750ms to each test suite file, which can be painful if you\n * have a lot of tests. In large project folders, the effect can be even more\n * pronounced.\n *\n * It is a good idea to enable this in CI environments, where test speed is\n * less of an ergonomic drawback.\n *\n * The `\"skipLibCheck\": true` option in tsconfig will also speed things up a\n * bit, at the expense of some type safety.\n *\n * Note that even if you pre-compile your tests, they will still be subject\n * to type checking if `\"allowJs\": true` is set in your tsconfig.\n *\n * @group Configuration\n */\n typecheck: {\n type: 'boolean',\n description: `Type-check test files, in addition to transpiling and running\n them.\n\n This defaults to false, even though type checking your tests\n is generally a good idea. Unfortunately, it is also often\n considerably slower, adding as much as 500-750ms to each test\n suite file, which can be painful if you have a lot of tests.\n In large project folders, the effect can be even more\n pronounced.\n\n It is a good idea to enable this in CI environments, where\n test speed is less of an ergonomic drawback.\n\n The \\`\"skipLibCheck\": true\"\\` option in tsconfig will also\n speed things up a bit, at the expense of some type safety.\n\n Note that even if you pre-compile your tests, they will still\n be subject to type checking if \\`\"allowJs\": true\\` is set in\n your tsconfig.\n `,\n },\n\n /**\n * Path to the `tsconfig.json` file containing project settings provided to\n * ts-node when running tests.\n *\n * Similar to the `--project` option to ts-node. Sets the `TS_NODE_PROJECT`\n * environment variable.\n *\n * If this is a relative directory, then it is resolved against the project\n * root directory.\n *\n * Defaults to the first of these files that are found in the project root\n * directory:\n *\n * - tsconfig.tap.json\n * - tsconfig.test.json\n * - tsconfig.spec.json\n * - tsconfig.json\n */\n tsconfig: {\n type: 'string',\n description: `Path to the \\`tsconfig.json\\` file containing project\n settings provided to ts-node when running tests.\n\n Similar to the \\`--project\\` option to ts-node. Sets the\n \\`TS_NODE_PROJECT\\` environment variable.\n\n If this is a relative directory, then it is resolved\n against the project root directory.\n\n Defaults to the first of these files that are found in\n the project root directory:\n\n - tsconfig.tap.json\n - tsconfig.test.json\n - tsconfig.spec.json\n - tsconfig.json`,\n },\n\n /**\n * flag\n *\n * Do not compile OR typecheck test files, and instead, opt into Node's\n * built-in type stripping behavior.\n *\n * Note that this limits the TypeScript features that can be used, but it is\n * the fastest and most responsive approach, because it does not require a\n * build step of any kind.\n *\n * This flag supercedes `typecheck` and `tsconfig`, because no compilation is\n * performed.\n *\n * Only supported on Node 22 and higher.\n *\n * On Node 22, adds the `--experimental-strip-types` flag. On Node 23 and\n * higher, this is supported by default.\n *\n * Adds a `--no-warnings` flag on all Node versions, to avoid the prevalance\n * of warnings about type stripping being an experimental feature.\n *\n * @group Configuration\n */\n 'type-strip-only': {\n type: 'boolean',\n description: `Do not compile OR typecheck test files, and instead, opt into\n Node's built-in type stripping behavior.\n\n Note that this limits the TypeScript features that can be\n used, but it is the fastest and most responsive approach,\n because it does not require a build step of any kind.\n\n This flag supercedes \\`typecheck\\` and \\`tsconfig\\`, because\n no compilation is performed.\n\n Only supported on Node 22 and higher.\n\n On Node 22, adds the \\`--experimental-strip-types\\` flag. On\n Node 23 and higher, this is supported by default.\n\n Adds a \\`--no-warnings\\` flag on Node versions 22 and 23, to\n avoid warnings about type stripping being an experimental\n feature.\n `,\n },\n}\n"]} |
+2
-2
| { | ||
| "name": "@tapjs/typescript", | ||
| "version": "3.5.8", | ||
| "version": "3.5.9", | ||
| "description": "a built-in tap extension that adds typescript support", | ||
@@ -62,3 +62,3 @@ "tshy": { | ||
| "peerDependencies": { | ||
| "@tapjs/core": "4.5.6" | ||
| "@tapjs/core": "4.5.7" | ||
| }, | ||
@@ -65,0 +65,0 @@ "tap": { |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
50707
3.42%584
2.82%6
200%