karma-requirejs-esm-preprocessor 2.2.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.
Files changed (4) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +11 -10
  3. package/index.js +18 -4
  4. package/package.json +38 -37
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022-2025 Ferdinand Prantl
3
+ Copyright (c) 2022-2026 Ferdinand Prantl
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -5,15 +5,16 @@
5
5
  ## Synopsis
6
6
 
7
7
  ```js
8
- module.exports = config => config.set({
9
- preprocessors: {
10
- 'src/**/*.js': ['requirejs-esm']
11
- },
12
- requirejsEsmPreprocessor: {
13
- isScript: path => !path.includes('/test/'),
14
- sourceMap: true
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
@@ -58,7 +59,7 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.
58
59
 
59
60
  ## License
60
61
 
61
- Copyright (c) 2022-2025 Ferdinand Prantl
62
+ Copyright (c) 2022-2026 Ferdinand Prantl
62
63
 
63
64
  Licensed under the MIT license.
64
65
 
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, useStrict, sourceMap,
8
- onBeforeTransform, onAfterTransform, onBeforeUpdate, onAfterUpdate
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, contents, isScript, useStrict, sourceMap, verbose, silent,
20
- onBeforeTransform, onAfterTransform, onBeforeUpdate, onAfterUpdate
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": "2.2.0",
3
+ "version": "3.0.0",
4
4
  "description": "Karma preprocessor for converting ES modules to AMD in RequireJS projects.",
5
- "author": "Ferdinand Prantl <prantlf@gmail.com>",
6
- "license": "MIT",
7
- "licenses": [
8
- {
9
- "type": "MIT",
10
- "url": "https://github.com/prantlf/karma-requirejs-esm-preprocessor/blob/master/LICENSE"
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
- "engines": {
22
- "node": ">=14"
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": "biome lint *.js",
29
- "fix": "biome lint --fix *.js",
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.3.0"
41
- },
42
38
  "devDependencies": {
43
- "@biomejs/biome": "^2.4.14",
44
- "c8": "^11.0.0",
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.3.0",
42
+ "karma-brief-reporter": "^0.4.0",
48
43
  "karma-chrome-launcher": "^3.2.0",
49
44
  "karma-jasmine": "^5.1.0",
50
- "requirejs-esm-preprocessor": "^3.3.0"
45
+ "oxfmt": "^0.74.0",
46
+ "oxlint": "^1.89.0",
47
+ "requirejs-esm-preprocessor": "^4.0.0"
51
48
  },
52
- "keywords": [
53
- "karma-preprocessor",
54
- "karma-plugin",
55
- "karma",
56
- "preprocessor",
57
- "plugin",
58
- "requirejs",
59
- "amd",
60
- "esm",
61
- "es6"
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
  }