@jterrazz/test 15.1.0 → 15.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/oxlint.cjs +27 -13
- package/dist/oxlint.js +27 -13
- package/package.json +1 -1
package/dist/oxlint.cjs
CHANGED
|
@@ -483,7 +483,7 @@ const RULE_DOCS = {
|
|
|
483
483
|
},
|
|
484
484
|
"f3-specs-public-entry": {
|
|
485
485
|
channel: "statique",
|
|
486
|
-
convention: "Depuis `specs/`, seul l’import en profondeur des INTERNES du framework est interdit : un chemin relatif résolvant dans `src/{specification,integrations,vitest,lint}/` du dépôt du framework, ou tout `@jterrazz/test/<subpath>`
|
|
486
|
+
convention: "Depuis `specs/`, seul l’import en profondeur des INTERNES du framework est interdit : un chemin relatif résolvant dans `src/{specification,integrations,vitest,lint}/` du dépôt du framework, ou tout `@jterrazz/test/<subpath>` que la map `exports` du paquet ne publie pas — les subpaths publiés sont exemptés, LUS du manifeste comme en F1, qui en tient la liste. Les imports de la source de SA PROPRE app par un consommateur sont toujours permis (c’est le motif documenté) ; seul `specs/integrations/` peut importer en profondeur `src/integrations/**`.",
|
|
487
487
|
family: "F",
|
|
488
488
|
id: "F3",
|
|
489
489
|
rationale: "Tester par la surface publique garde les specs découplées des chemins internes du framework, sans gêner le consommateur qui importe sa propre app."
|
|
@@ -2941,7 +2941,7 @@ const f1NoSubpathImport = {
|
|
|
2941
2941
|
const TEST_FILE$4 = /\.(?:test|fixtures|specification)\.[cm]?[jt]sx?$/u;
|
|
2942
2942
|
const CONFIG_FILE = /(?:^|[/\\])[\w.-]*\.config\.[cm]?[jt]s$/u;
|
|
2943
2943
|
const TEST_IMPORT$1 = /\.(?:test|fixtures)(?:\.[cm]?[jt]sx?)?$/u;
|
|
2944
|
-
const TOOL_SUBPATH
|
|
2944
|
+
const TOOL_SUBPATH = "@jterrazz/test/oxlint";
|
|
2945
2945
|
/**
|
|
2946
2946
|
* CONVENTIONS F2 — production code never imports a test artefact. In a
|
|
2947
2947
|
* non-test file (not `*.test.ts` / `*.fixtures.ts` / `*.specification.ts`,
|
|
@@ -2960,7 +2960,7 @@ const f2NoTestImportsInProd = {
|
|
|
2960
2960
|
const file = context.filename;
|
|
2961
2961
|
if (TEST_FILE$4.test(file) || CONFIG_FILE.test(file) || isUnderSpecs(file)) return {};
|
|
2962
2962
|
return { ...importSourceVisitor(({ node, source }) => {
|
|
2963
|
-
if (source === TOOL_SUBPATH
|
|
2963
|
+
if (source === TOOL_SUBPATH) return;
|
|
2964
2964
|
if (source === "vitest" || source.startsWith("vitest/")) context.report({
|
|
2965
2965
|
data: { source },
|
|
2966
2966
|
messageId: "testImport",
|
|
@@ -2987,7 +2987,6 @@ const f2NoTestImportsInProd = {
|
|
|
2987
2987
|
//#endregion
|
|
2988
2988
|
//#region src/lint/rules/f3-specs-public-entry.ts
|
|
2989
2989
|
const PACKAGE = "@jterrazz/test";
|
|
2990
|
-
const TOOL_SUBPATH = "@jterrazz/test/oxlint";
|
|
2991
2990
|
/**
|
|
2992
2991
|
* The framework's own top-level `src/` layers. Deep-importing any of these from
|
|
2993
2992
|
* a spec couples the spec to internals the public entry exists to hide. These
|
|
@@ -3005,12 +3004,19 @@ const FRAMEWORK_LAYERS = /* @__PURE__ */ new Set([
|
|
|
3005
3004
|
/**
|
|
3006
3005
|
* CONVENTIONS F3 — from `specs/`, deep-importing the FRAMEWORK's internals is
|
|
3007
3006
|
* forbidden: a relative path resolving inside the framework repo's
|
|
3008
|
-
* `src/{specification,integrations,vitest,lint}/`, or
|
|
3009
|
-
*
|
|
3010
|
-
*
|
|
3007
|
+
* `src/{specification,integrations,vitest,lint}/`, or a `@jterrazz/test/<subpath>`
|
|
3008
|
+
* the package does not publish. A consumer's imports of its OWN app source are
|
|
3009
|
+
* always allowed — that is the pattern.
|
|
3010
|
+
*
|
|
3011
|
+
* The exempt subpaths are not listed here: they are read from the package's own
|
|
3012
|
+
* `exports` map, the same source F1 uses. A published subpath IS the public
|
|
3013
|
+
* surface — reaching `@jterrazz/test/vitest` from a specs-tree `vitest.config.ts`
|
|
3014
|
+
* is the prescribed gesture, not a leak — so what a spec must not reach is what
|
|
3015
|
+
* the manifest never published. The root entry (`.`) is not a subpath and never
|
|
3016
|
+
* concerned this branch: `@jterrazz/test` is the public entry F3 points at.
|
|
3011
3017
|
*
|
|
3012
|
-
* Distinct from F1 (which
|
|
3013
|
-
*
|
|
3018
|
+
* Distinct from F1 (which judges the same specifiers from any file): F3 is the
|
|
3019
|
+
* specs-specific guard that also reaches relative framework-internal paths.
|
|
3014
3020
|
* Documented exception: specs under `specs/integrations/` may deep-import the
|
|
3015
3021
|
* integration module they cover (`src/integrations/**`).
|
|
3016
3022
|
*/
|
|
@@ -3018,12 +3024,17 @@ const f3SpecsPublicEntry = {
|
|
|
3018
3024
|
create(context) {
|
|
3019
3025
|
const anchor = specsAnchor(context.filename);
|
|
3020
3026
|
if (anchor === void 0) return {};
|
|
3027
|
+
const published = new Set(declaredSubpaths());
|
|
3028
|
+
const exempt = published.size === 0 ? "none" : [...published].join(", ");
|
|
3021
3029
|
const underIntegrations = anchor.relative[0] === "integrations";
|
|
3022
3030
|
return { ...importSourceVisitor(({ node, source }) => {
|
|
3023
3031
|
if (source.startsWith(`${PACKAGE}/`)) {
|
|
3024
|
-
if (source
|
|
3032
|
+
if (published.has(source)) return;
|
|
3025
3033
|
context.report({
|
|
3026
|
-
data: {
|
|
3034
|
+
data: {
|
|
3035
|
+
published: exempt,
|
|
3036
|
+
source
|
|
3037
|
+
},
|
|
3027
3038
|
messageId: "deepImport",
|
|
3028
3039
|
node
|
|
3029
3040
|
});
|
|
@@ -3035,7 +3046,10 @@ const f3SpecsPublicEntry = {
|
|
|
3035
3046
|
if (!FRAMEWORK_LAYERS.has(layer)) return;
|
|
3036
3047
|
if (underIntegrations && layer === "integrations") return;
|
|
3037
3048
|
context.report({
|
|
3038
|
-
data: {
|
|
3049
|
+
data: {
|
|
3050
|
+
published: exempt,
|
|
3051
|
+
source
|
|
3052
|
+
},
|
|
3039
3053
|
messageId: "deepImport",
|
|
3040
3054
|
node
|
|
3041
3055
|
});
|
|
@@ -3043,7 +3057,7 @@ const f3SpecsPublicEntry = {
|
|
|
3043
3057
|
},
|
|
3044
3058
|
meta: {
|
|
3045
3059
|
docs: RULE_DOCS["f3-specs-public-entry"],
|
|
3046
|
-
messages: { deepImport: "specs/ must not deep-import framework internals — reach the framework via its public entry (@jterrazz/test, or src/index.js in this repo), not \"{{source}}\" (F3 — see docs/13-linting.md
|
|
3060
|
+
messages: { deepImport: "specs/ must not deep-import framework internals — reach the framework via its public entry (@jterrazz/test, or src/index.js in this repo), not \"{{source}}\" (F3 — see docs/13-linting.md). Exempt: the published subpaths {{published}}, and src/integrations/** from specs/integrations/." },
|
|
3047
3061
|
type: "problem"
|
|
3048
3062
|
}
|
|
3049
3063
|
};
|
package/dist/oxlint.js
CHANGED
|
@@ -479,7 +479,7 @@ const RULE_DOCS = {
|
|
|
479
479
|
},
|
|
480
480
|
"f3-specs-public-entry": {
|
|
481
481
|
channel: "statique",
|
|
482
|
-
convention: "Depuis `specs/`, seul l’import en profondeur des INTERNES du framework est interdit : un chemin relatif résolvant dans `src/{specification,integrations,vitest,lint}/` du dépôt du framework, ou tout `@jterrazz/test/<subpath>`
|
|
482
|
+
convention: "Depuis `specs/`, seul l’import en profondeur des INTERNES du framework est interdit : un chemin relatif résolvant dans `src/{specification,integrations,vitest,lint}/` du dépôt du framework, ou tout `@jterrazz/test/<subpath>` que la map `exports` du paquet ne publie pas — les subpaths publiés sont exemptés, LUS du manifeste comme en F1, qui en tient la liste. Les imports de la source de SA PROPRE app par un consommateur sont toujours permis (c’est le motif documenté) ; seul `specs/integrations/` peut importer en profondeur `src/integrations/**`.",
|
|
483
483
|
family: "F",
|
|
484
484
|
id: "F3",
|
|
485
485
|
rationale: "Tester par la surface publique garde les specs découplées des chemins internes du framework, sans gêner le consommateur qui importe sa propre app."
|
|
@@ -2937,7 +2937,7 @@ const f1NoSubpathImport = {
|
|
|
2937
2937
|
const TEST_FILE$4 = /\.(?:test|fixtures|specification)\.[cm]?[jt]sx?$/u;
|
|
2938
2938
|
const CONFIG_FILE = /(?:^|[/\\])[\w.-]*\.config\.[cm]?[jt]s$/u;
|
|
2939
2939
|
const TEST_IMPORT$1 = /\.(?:test|fixtures)(?:\.[cm]?[jt]sx?)?$/u;
|
|
2940
|
-
const TOOL_SUBPATH
|
|
2940
|
+
const TOOL_SUBPATH = "@jterrazz/test/oxlint";
|
|
2941
2941
|
/**
|
|
2942
2942
|
* CONVENTIONS F2 — production code never imports a test artefact. In a
|
|
2943
2943
|
* non-test file (not `*.test.ts` / `*.fixtures.ts` / `*.specification.ts`,
|
|
@@ -2956,7 +2956,7 @@ const f2NoTestImportsInProd = {
|
|
|
2956
2956
|
const file = context.filename;
|
|
2957
2957
|
if (TEST_FILE$4.test(file) || CONFIG_FILE.test(file) || isUnderSpecs(file)) return {};
|
|
2958
2958
|
return { ...importSourceVisitor(({ node, source }) => {
|
|
2959
|
-
if (source === TOOL_SUBPATH
|
|
2959
|
+
if (source === TOOL_SUBPATH) return;
|
|
2960
2960
|
if (source === "vitest" || source.startsWith("vitest/")) context.report({
|
|
2961
2961
|
data: { source },
|
|
2962
2962
|
messageId: "testImport",
|
|
@@ -2983,7 +2983,6 @@ const f2NoTestImportsInProd = {
|
|
|
2983
2983
|
//#endregion
|
|
2984
2984
|
//#region src/lint/rules/f3-specs-public-entry.ts
|
|
2985
2985
|
const PACKAGE = "@jterrazz/test";
|
|
2986
|
-
const TOOL_SUBPATH = "@jterrazz/test/oxlint";
|
|
2987
2986
|
/**
|
|
2988
2987
|
* The framework's own top-level `src/` layers. Deep-importing any of these from
|
|
2989
2988
|
* a spec couples the spec to internals the public entry exists to hide. These
|
|
@@ -3001,12 +3000,19 @@ const FRAMEWORK_LAYERS = /* @__PURE__ */ new Set([
|
|
|
3001
3000
|
/**
|
|
3002
3001
|
* CONVENTIONS F3 — from `specs/`, deep-importing the FRAMEWORK's internals is
|
|
3003
3002
|
* forbidden: a relative path resolving inside the framework repo's
|
|
3004
|
-
* `src/{specification,integrations,vitest,lint}/`, or
|
|
3005
|
-
*
|
|
3006
|
-
*
|
|
3003
|
+
* `src/{specification,integrations,vitest,lint}/`, or a `@jterrazz/test/<subpath>`
|
|
3004
|
+
* the package does not publish. A consumer's imports of its OWN app source are
|
|
3005
|
+
* always allowed — that is the pattern.
|
|
3006
|
+
*
|
|
3007
|
+
* The exempt subpaths are not listed here: they are read from the package's own
|
|
3008
|
+
* `exports` map, the same source F1 uses. A published subpath IS the public
|
|
3009
|
+
* surface — reaching `@jterrazz/test/vitest` from a specs-tree `vitest.config.ts`
|
|
3010
|
+
* is the prescribed gesture, not a leak — so what a spec must not reach is what
|
|
3011
|
+
* the manifest never published. The root entry (`.`) is not a subpath and never
|
|
3012
|
+
* concerned this branch: `@jterrazz/test` is the public entry F3 points at.
|
|
3007
3013
|
*
|
|
3008
|
-
* Distinct from F1 (which
|
|
3009
|
-
*
|
|
3014
|
+
* Distinct from F1 (which judges the same specifiers from any file): F3 is the
|
|
3015
|
+
* specs-specific guard that also reaches relative framework-internal paths.
|
|
3010
3016
|
* Documented exception: specs under `specs/integrations/` may deep-import the
|
|
3011
3017
|
* integration module they cover (`src/integrations/**`).
|
|
3012
3018
|
*/
|
|
@@ -3014,12 +3020,17 @@ const f3SpecsPublicEntry = {
|
|
|
3014
3020
|
create(context) {
|
|
3015
3021
|
const anchor = specsAnchor(context.filename);
|
|
3016
3022
|
if (anchor === void 0) return {};
|
|
3023
|
+
const published = new Set(declaredSubpaths());
|
|
3024
|
+
const exempt = published.size === 0 ? "none" : [...published].join(", ");
|
|
3017
3025
|
const underIntegrations = anchor.relative[0] === "integrations";
|
|
3018
3026
|
return { ...importSourceVisitor(({ node, source }) => {
|
|
3019
3027
|
if (source.startsWith(`${PACKAGE}/`)) {
|
|
3020
|
-
if (source
|
|
3028
|
+
if (published.has(source)) return;
|
|
3021
3029
|
context.report({
|
|
3022
|
-
data: {
|
|
3030
|
+
data: {
|
|
3031
|
+
published: exempt,
|
|
3032
|
+
source
|
|
3033
|
+
},
|
|
3023
3034
|
messageId: "deepImport",
|
|
3024
3035
|
node
|
|
3025
3036
|
});
|
|
@@ -3031,7 +3042,10 @@ const f3SpecsPublicEntry = {
|
|
|
3031
3042
|
if (!FRAMEWORK_LAYERS.has(layer)) return;
|
|
3032
3043
|
if (underIntegrations && layer === "integrations") return;
|
|
3033
3044
|
context.report({
|
|
3034
|
-
data: {
|
|
3045
|
+
data: {
|
|
3046
|
+
published: exempt,
|
|
3047
|
+
source
|
|
3048
|
+
},
|
|
3035
3049
|
messageId: "deepImport",
|
|
3036
3050
|
node
|
|
3037
3051
|
});
|
|
@@ -3039,7 +3053,7 @@ const f3SpecsPublicEntry = {
|
|
|
3039
3053
|
},
|
|
3040
3054
|
meta: {
|
|
3041
3055
|
docs: RULE_DOCS["f3-specs-public-entry"],
|
|
3042
|
-
messages: { deepImport: "specs/ must not deep-import framework internals — reach the framework via its public entry (@jterrazz/test, or src/index.js in this repo), not \"{{source}}\" (F3 — see docs/13-linting.md
|
|
3056
|
+
messages: { deepImport: "specs/ must not deep-import framework internals — reach the framework via its public entry (@jterrazz/test, or src/index.js in this repo), not \"{{source}}\" (F3 — see docs/13-linting.md). Exempt: the published subpaths {{published}}, and src/integrations/** from specs/integrations/." },
|
|
3043
3057
|
type: "problem"
|
|
3044
3058
|
}
|
|
3045
3059
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jterrazz/test",
|
|
3
|
-
"version": "15.1.
|
|
3
|
+
"version": "15.1.1",
|
|
4
4
|
"description": "Declarative testing framework for HTTP APIs, CLIs, and background jobs — one entry point, real infrastructure, golden-file assertions, plus an oxlint convention plugin.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api-testing",
|