@pi-r/babel 0.6.5 → 0.7.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 (3) hide show
  1. package/README.md +3 -6
  2. package/index.js +5 -7
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,10 +1,7 @@
1
- # @pi-r/babel
1
+ ### @pi-r/babel
2
2
 
3
- ## Documentation
3
+ https://e-mc.readthedocs.io/en/latest/document/plugins/built-in.html
4
4
 
5
- - [E-mc](https://e-mc.readthedocs.io/en/latest/document/plugins/built-in.html)
6
- - [squared](https://squared.readthedocs.io)
7
-
8
- ## LICENSE
5
+ ### LICENSE
9
6
 
10
7
  MIT
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const path = require("path");
3
- function transform(context, value, options) {
3
+ module.exports = function transform(context, value, options) {
4
4
  context = options.upgrade(context, __dirname);
5
5
  const { sourceMap, supplementChunks } = options;
6
6
  const baseConfig = options.toBaseConfig();
@@ -17,8 +17,8 @@ function transform(context, value, options) {
17
17
  url = path.basename(baseConfig.sourceFileName);
18
18
  }
19
19
  }
20
- baseConfig.filename || (baseConfig.filename = options.filename);
21
- baseConfig.sourceType || (baseConfig.sourceType = options.imported ? 'module' : 'script');
20
+ baseConfig.filename ||= options.filename;
21
+ baseConfig.sourceType ||= options.imported ? 'module' : 'script';
22
22
  if (!baseConfig.cwd) {
23
23
  const esmData = options.getMainFile(value);
24
24
  if (esmData?.code) {
@@ -39,7 +39,7 @@ function transform(context, value, options) {
39
39
  if (code) {
40
40
  chunk.code = code;
41
41
  if (map) {
42
- (chunk.sourceMap || (chunk.sourceMap = options.createSourceMap(code))).nextMap('babel', code, map);
42
+ (chunk.sourceMap ||= options.createSourceMap(code)).nextMap('babel', code, map);
43
43
  }
44
44
  else {
45
45
  chunk.sourceMap?.reset();
@@ -56,6 +56,4 @@ function transform(context, value, options) {
56
56
  }
57
57
  return code;
58
58
  }
59
- }
60
-
61
- module.exports = transform;
59
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/babel",
3
- "version": "0.6.5",
3
+ "version": "0.7.0",
4
4
  "description": "@babel/core transform function for E-mc.",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -20,6 +20,6 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/pi-r#readme",
22
22
  "dependencies": {
23
- "@babel/core": "^7.24.0"
23
+ "@babel/core": "^7.24.4"
24
24
  }
25
25
  }