supertape 12.12.3 → 13.1.0

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/ChangeLog CHANGED
@@ -1,3 +1,15 @@
1
+ 2026.05.06, v13.1.0
2
+
3
+ feature:
4
+ - c6c0441 supertape: loader-dom: add
5
+ - 4f0c57a supertape: supertape v13.0.0
6
+ - c3506f2 supertape: move out loaders
7
+
8
+ 2026.05.05, v13.0.0
9
+
10
+ feature:
11
+ - 3d3e63c supertape: move out loaders
12
+
1
13
  2026.05.05, v12.12.3
2
14
 
3
15
  fix:
package/README.md CHANGED
@@ -41,7 +41,7 @@
41
41
  - ability to test files that imports css with:
42
42
 
43
43
  ```sh
44
- NODE_OPTIONS="--import supertape/css" tape '{bin,lib}/**/*.spec.*'
44
+ NODE_OPTIONS="--import @supertape/loader-css" tape '{bin,lib}/**/*.spec.*'
45
45
  ```
46
46
 
47
47
  Or in 🏎️[`madrun`](https://github.com/coderaiser/madrun):
package/lib/env/index.js CHANGED
@@ -4,8 +4,7 @@ import justSnakeCase from 'just-snake-case';
4
4
  const isBool = (a) => typeof a === 'boolean';
5
5
  const {entries} = Object;
6
6
 
7
- const addCSSLoader = (a) => `"${a} --import supertape/css"`;
8
- const addJSXLoader = (a) => `"${a} --import supertape/jsx"`;
7
+ const addLoader = (a) => `--import @supertape/loader-${a}`;
9
8
 
10
9
  const parseValue = (a) => {
11
10
  if (isBool(a))
@@ -18,15 +17,23 @@ export const defineEnv = (config, overrides = {}) => {
18
17
  const {env = process.env} = overrides;
19
18
  const {NODE_OPTIONS = ''} = env;
20
19
  const result = {};
20
+ let localEnv = NODE_OPTIONS;
21
21
 
22
22
  for (const [key, value] of entries(config)) {
23
23
  if (key === 'css' && value) {
24
- result.NODE_OPTIONS = addCSSLoader(NODE_OPTIONS);
24
+ localEnv += ` ${addLoader('css')}`;
25
25
  continue;
26
26
  }
27
27
 
28
28
  if (key === 'jsx' && value) {
29
- result.NODE_OPTIONS = addJSXLoader(NODE_OPTIONS);
29
+ localEnv += ` ${addLoader('jsx')}`;
30
+
31
+ continue;
32
+ }
33
+
34
+ if (key === 'dom' && value) {
35
+ localEnv += ` ${addLoader('dom')}`;
36
+
30
37
  continue;
31
38
  }
32
39
 
@@ -35,5 +42,7 @@ export const defineEnv = (config, overrides = {}) => {
35
42
  result[name] = parseValue(value);
36
43
  }
37
44
 
45
+ result.NODE_OPTIONS = `"${localEnv}"`;
46
+
38
47
  return result;
39
48
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supertape",
3
- "version": "12.12.3",
3
+ "version": "13.1.0",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
5
  "description": "📼 Supertape simplest high speed test runner with superpowers",
6
6
  "homepage": "http://github.com/coderaiser/supertape",
@@ -11,8 +11,6 @@
11
11
  "./bin/supertape": "./bin/tracer.js",
12
12
  "./cli": "./lib/cli.js",
13
13
  "./exit-codes": "./lib/exit-codes.js",
14
- "./css": "./lib/loader/register-css.js",
15
- "./jsx": "./lib/loader/register-jsx.js",
16
14
  "./env": "./lib/env/index.js"
17
15
  },
18
16
  "imports": {
@@ -53,6 +51,8 @@
53
51
  "@supertape/formatter-tap": "^4.0.0",
54
52
  "@supertape/formatter-time": "^3.0.0",
55
53
  "@supertape/operator-stub": "^4.0.0",
54
+ "@supertape/loader-jsx": "^1.0.0",
55
+ "@supertape/loader-css": "^1.0.0",
56
56
  "cli-progress": "^3.8.2",
57
57
  "flatted": "^3.3.1",
58
58
  "fullstore": "^4.0.0",
@@ -61,7 +61,6 @@
61
61
  "json-with-bigint": "^3.4.4",
62
62
  "just-snake-case": "^3.2.0",
63
63
  "once": "^1.4.0",
64
- "oxc-transform": "^0.129.0",
65
64
  "resolve": "^1.17.0",
66
65
  "stacktracey": "^2.1.7",
67
66
  "try-to-catch": "^4.0.0",
package/lib/loader/css.js DELETED
@@ -1,20 +0,0 @@
1
- export function resolve(specifier, context, nextResolve) {
2
- if (specifier.endsWith('.css'))
3
- return {
4
- url: new URL(specifier, context.parentURL).href,
5
- shortCircuit: true,
6
- };
7
-
8
- return nextResolve(specifier, context);
9
- }
10
-
11
- export function load(url, context, nextLoad) {
12
- if (url.endsWith('.css'))
13
- return {
14
- format: 'module',
15
- source: 'export default {};',
16
- shortCircuit: true,
17
- };
18
-
19
- return nextLoad(url, context);
20
- }
package/lib/loader/jsx.js DELETED
@@ -1,41 +0,0 @@
1
- import {transformSync} from 'oxc-transform';
2
-
3
- export function resolve(specifier, context, nextResolve) {
4
- if (specifier.endsWith('.jsx'))
5
- return {
6
- url: new URL(specifier, context.parentURL).href,
7
- shortCircuit: true,
8
- };
9
-
10
- return nextResolve(specifier, context);
11
- }
12
-
13
- export function load(url, context, nextLoad) {
14
- if (url.endsWith('.jsx') || url.endsWith('.js')) {
15
- if (url.includes('node_modules'))
16
- return nextLoad(url, context);
17
-
18
- const {source} = nextLoad(url, {
19
- format: 'module',
20
- });
21
-
22
- return {
23
- format: 'module',
24
- source: jsxToJs(String(source)),
25
- shortCircuit: true,
26
- };
27
- }
28
-
29
- return nextLoad(url, context);
30
- }
31
-
32
- export function jsxToJs(source) {
33
- const {errors, code} = transformSync('__supertape.js', source, {
34
- lang: 'jsx',
35
- });
36
-
37
- if (errors.length)
38
- throw Error(errors[0].message);
39
-
40
- return code;
41
- }
@@ -1,6 +0,0 @@
1
- import {registerHooks} from 'node:module';
2
- import * as cssLoaderUrl from './css.js';
3
- import * as jsxLoaderUrl from './jsx.js';
4
-
5
- registerHooks(jsxLoaderUrl);
6
- registerHooks(cssLoaderUrl);
@@ -1,4 +0,0 @@
1
- import {registerHooks} from 'node:module';
2
- import * as jsxLoaderUrl from './jsx.js';
3
-
4
- registerHooks(jsxLoaderUrl);