karma-requirejs-esm-preprocessor 2.3.0 → 3.0.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/README.md +10 -9
- package/index.js +18 -4
- package/package.json +38 -37
package/README.md
CHANGED
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
## Synopsis
|
|
6
6
|
|
|
7
7
|
```js
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
8
|
+
export default config =>
|
|
9
|
+
config.set({
|
|
10
|
+
preprocessors: {
|
|
11
|
+
'src/**/*.js': ['requirejs-esm']
|
|
12
|
+
},
|
|
13
|
+
requirejsEsmPreprocessor: {
|
|
14
|
+
isScript: path => !path.includes('/test/'),
|
|
15
|
+
sourceMap: true
|
|
16
|
+
}
|
|
17
|
+
})
|
|
17
18
|
```
|
|
18
19
|
|
|
19
20
|
## Installation
|
package/index.js
CHANGED
|
@@ -4,8 +4,13 @@ function createPreprocessor(args, config, helper) {
|
|
|
4
4
|
const { basePath, logLevel, LOG_DEBUG, LOG_DISABLE, requirejsEsmPreprocessor } = config
|
|
5
5
|
const defaults = { useStrict: true, sourceMap: true }
|
|
6
6
|
const {
|
|
7
|
-
isScript,
|
|
8
|
-
|
|
7
|
+
isScript,
|
|
8
|
+
useStrict,
|
|
9
|
+
sourceMap,
|
|
10
|
+
onBeforeTransform,
|
|
11
|
+
onAfterTransform,
|
|
12
|
+
onBeforeUpdate,
|
|
13
|
+
onAfterUpdate
|
|
9
14
|
} = helper.merge(defaults, args, requirejsEsmPreprocessor || {})
|
|
10
15
|
const verbose = logLevel === LOG_DEBUG
|
|
11
16
|
const silent = logLevel === LOG_DISABLE
|
|
@@ -16,8 +21,17 @@ function createPreprocessor(args, config, helper) {
|
|
|
16
21
|
if (path.startsWith(basePath)) path = path.substring(basePathLen)
|
|
17
22
|
if (!isScript || isScript(path)) {
|
|
18
23
|
contents = preprocess({
|
|
19
|
-
path,
|
|
20
|
-
|
|
24
|
+
path,
|
|
25
|
+
contents,
|
|
26
|
+
isScript,
|
|
27
|
+
useStrict,
|
|
28
|
+
sourceMap,
|
|
29
|
+
verbose,
|
|
30
|
+
silent,
|
|
31
|
+
onBeforeTransform,
|
|
32
|
+
onAfterTransform,
|
|
33
|
+
onBeforeUpdate,
|
|
34
|
+
onAfterUpdate
|
|
21
35
|
})
|
|
22
36
|
}
|
|
23
37
|
done(null, contents)
|
package/package.json
CHANGED
|
@@ -1,63 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "karma-requirejs-esm-preprocessor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Karma preprocessor for converting ES modules to AMD in RequireJS projects.",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
"keywords": [
|
|
6
|
+
"amd",
|
|
7
|
+
"es6",
|
|
8
|
+
"esm",
|
|
9
|
+
"karma",
|
|
10
|
+
"karma-plugin",
|
|
11
|
+
"karma-preprocessor",
|
|
12
|
+
"plugin",
|
|
13
|
+
"preprocessor",
|
|
14
|
+
"requirejs"
|
|
12
15
|
],
|
|
13
16
|
"homepage": "https://github.com/prantlf/karma-requirejs-esm-preprocessor#readme",
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "https://github.com/prantlf/karma-requirejs-esm-preprocessor.git"
|
|
17
|
-
},
|
|
18
17
|
"bugs": {
|
|
19
18
|
"url": "https://github.com/prantlf/karma-requirejs-esm-preprocessor/issues"
|
|
20
19
|
},
|
|
21
|
-
"
|
|
22
|
-
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"author": "Ferdinand Prantl <prantlf@gmail.com>",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/prantlf/karma-requirejs-esm-preprocessor.git"
|
|
23
25
|
},
|
|
24
26
|
"files": [
|
|
25
27
|
"index.js"
|
|
26
28
|
],
|
|
27
29
|
"scripts": {
|
|
28
|
-
"lint": "
|
|
29
|
-
"fix": "
|
|
30
|
+
"lint": "oxlint",
|
|
31
|
+
"fix": "oxlint --fix",
|
|
30
32
|
"check1": "karma start test/karma.conf1.js",
|
|
31
33
|
"check2": "karma start test/karma.conf2.js",
|
|
32
34
|
"check": "npm run check1 && npm run check2",
|
|
33
35
|
"cover": "c8 npm run check1 && c8 --no-clean npm run check2 && c8 report -r text -r lcov && c8 check-coverage --100",
|
|
34
36
|
"test": "npm run lint && npm run cover"
|
|
35
37
|
},
|
|
36
|
-
"c8": {
|
|
37
|
-
"reporter": []
|
|
38
|
-
},
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"requirejs-esm-preprocessor": "^3.4.0"
|
|
41
|
-
},
|
|
42
38
|
"devDependencies": {
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"jasmine-core": "^6.2.0",
|
|
39
|
+
"c8": "^12.0.0",
|
|
40
|
+
"jasmine-core": "^6.3.0",
|
|
46
41
|
"karma": "^6.4.4",
|
|
47
|
-
"karma-brief-reporter": "^0.
|
|
42
|
+
"karma-brief-reporter": "^0.4.0",
|
|
48
43
|
"karma-chrome-launcher": "^3.2.0",
|
|
49
44
|
"karma-jasmine": "^5.1.0",
|
|
50
|
-
"
|
|
45
|
+
"oxfmt": "^0.74.0",
|
|
46
|
+
"oxlint": "^1.89.0",
|
|
47
|
+
"requirejs-esm-preprocessor": "^4.0.0"
|
|
51
48
|
},
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"requirejs-esm-preprocessor": "^4.0.0"
|
|
51
|
+
},
|
|
52
|
+
"c8": {
|
|
53
|
+
"reporter": []
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=22"
|
|
57
|
+
},
|
|
58
|
+
"licenses": [
|
|
59
|
+
{
|
|
60
|
+
"type": "MIT",
|
|
61
|
+
"url": "https://github.com/prantlf/karma-requirejs-esm-preprocessor/blob/master/LICENSE"
|
|
62
|
+
}
|
|
62
63
|
]
|
|
63
64
|
}
|