@modern-js/babel-compiler 2.58.2 → 2.58.3

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/cjs/build.js CHANGED
@@ -22,8 +22,8 @@ __export(build_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(build_exports);
24
24
  var import_utils = require("@modern-js/utils");
25
- var import_constants = require("./constants");
26
25
  var import_compiler = require("./compiler");
26
+ var import_constants = require("./constants");
27
27
  const build = async (option, babelConfig = {}) => {
28
28
  const { rootDir, enableVirtualDist, filenames, clean, distDir, distFileExtMap = import_constants.defaultDistFileExtMap, verbose = false, quiet = false } = option;
29
29
  const virtualDists = [];
@@ -34,8 +34,8 @@ __export(buildWatch_exports, {
34
34
  runBuildWatch: () => runBuildWatch
35
35
  });
36
36
  module.exports = __toCommonJS(buildWatch_exports);
37
- var path = __toESM(require("path"));
38
37
  var Event = __toESM(require("events"));
38
+ var path = __toESM(require("path"));
39
39
  var import_utils = require("@modern-js/utils");
40
40
  var import_build = require("./build");
41
41
  var import_compilerErrorResult = require("./compilerErrorResult");
@@ -37,8 +37,8 @@ module.exports = __toCommonJS(compiler_exports);
37
37
  var path = __toESM(require("path"));
38
38
  var babel = __toESM(require("@babel/core"));
39
39
  var import_utils = require("@modern-js/utils");
40
- var utils = __toESM(require("./utils"));
41
40
  var import_constants = require("./constants");
41
+ var utils = __toESM(require("./utils"));
42
42
  const defaultDistDir = "dist";
43
43
  const isRes = (r) => Boolean(r);
44
44
  const getDistFilePath = (option) => {
@@ -24,8 +24,8 @@ __export(getFinalOption_exports, {
24
24
  getGlobPattern: () => getGlobPattern
25
25
  });
26
26
  module.exports = __toCommonJS(getFinalOption_exports);
27
- var import_utils = require("@modern-js/utils");
28
27
  var import_core = require("@babel/core");
28
+ var import_utils = require("@modern-js/utils");
29
29
  var import_defaults = require("./defaults");
30
30
  const getGlobPattern = (dir, extensions) => {
31
31
  if (extensions.length > 1) {
package/dist/cjs/index.js CHANGED
@@ -22,9 +22,9 @@ __export(src_exports, {
22
22
  compiler: () => compiler
23
23
  });
24
24
  module.exports = __toCommonJS(src_exports);
25
- var import_getFinalOption = require("./getFinalOption");
26
25
  var import_build = require("./build");
27
26
  var import_buildWatch = require("./buildWatch");
27
+ var import_getFinalOption = require("./getFinalOption");
28
28
  var import_validate = require("./validate");
29
29
  __reExport(src_exports, require("./buildWatch"), module.exports);
30
30
  __reExport(src_exports, require("./type"), module.exports);
package/dist/esm/build.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
3
3
  import { fs, logger } from "@modern-js/utils";
4
- import { defaultDistFileExtMap } from "./constants";
5
4
  import { compiler } from "./compiler";
5
+ import { defaultDistFileExtMap } from "./constants";
6
6
  var build = function() {
7
7
  var _ref = _async_to_generator(function(option) {
8
8
  var babelConfig, rootDir, enableVirtualDist, filenames, clean, distDir, _option_distFileExtMap, distFileExtMap, _option_verbose, verbose, _option_quiet, quiet, virtualDists, messageDetails, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, filename, dist, happenError;
@@ -5,9 +5,9 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
5
5
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
6
6
  import { _ as _create_super } from "@swc/helpers/_/_create_super";
7
7
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
8
- import * as path from "path";
9
8
  import * as Event from "events";
10
- import { logger, watch, WatchChangeType } from "@modern-js/utils";
9
+ import * as path from "path";
10
+ import { WatchChangeType, logger, watch } from "@modern-js/utils";
11
11
  import { build } from "./build";
12
12
  import { CompilerErrorResult } from "./compilerErrorResult";
13
13
  var BuildWatchEvent = {
@@ -2,9 +2,9 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
3
  import * as path from "path";
4
4
  import * as babel from "@babel/core";
5
- import { logger, fs } from "@modern-js/utils";
6
- import * as utils from "./utils";
5
+ import { fs, logger } from "@modern-js/utils";
7
6
  import { defaultDistFileExtMap } from "./constants";
7
+ import * as utils from "./utils";
8
8
  var defaultDistDir = "dist";
9
9
  var isRes = function(r) {
10
10
  return Boolean(r);
@@ -1,8 +1,8 @@
1
1
  import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
3
  import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
4
- import { glob } from "@modern-js/utils";
5
4
  import { DEFAULT_EXTENSIONS } from "@babel/core";
5
+ import { glob } from "@modern-js/utils";
6
6
  import { mergeDefaultOption } from "./defaults";
7
7
  var getGlobPattern = function(dir, extensions) {
8
8
  if (extensions.length > 1) {
package/dist/esm/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
2
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
3
- import { getFinalCompilerOption } from "./getFinalOption";
4
3
  import { build } from "./build";
5
4
  import { buildWatch } from "./buildWatch";
5
+ import { getFinalCompilerOption } from "./getFinalOption";
6
6
  import { validate } from "./validate";
7
7
  function compiler(compilerOptions) {
8
8
  return _compiler.apply(this, arguments);
@@ -1,6 +1,6 @@
1
1
  import { fs, logger } from "@modern-js/utils";
2
- import { defaultDistFileExtMap } from "./constants";
3
2
  import { compiler } from "./compiler";
3
+ import { defaultDistFileExtMap } from "./constants";
4
4
  const build = async (option, babelConfig = {}) => {
5
5
  const { rootDir, enableVirtualDist, filenames, clean, distDir, distFileExtMap = defaultDistFileExtMap, verbose = false, quiet = false } = option;
6
6
  const virtualDists = [];
@@ -1,6 +1,6 @@
1
- import * as path from "path";
2
1
  import * as Event from "events";
3
- import { logger, watch, WatchChangeType } from "@modern-js/utils";
2
+ import * as path from "path";
3
+ import { WatchChangeType, logger, watch } from "@modern-js/utils";
4
4
  import { build } from "./build";
5
5
  import { CompilerErrorResult } from "./compilerErrorResult";
6
6
  const BuildWatchEvent = {
@@ -1,8 +1,8 @@
1
1
  import * as path from "path";
2
2
  import * as babel from "@babel/core";
3
- import { logger, fs } from "@modern-js/utils";
4
- import * as utils from "./utils";
3
+ import { fs, logger } from "@modern-js/utils";
5
4
  import { defaultDistFileExtMap } from "./constants";
5
+ import * as utils from "./utils";
6
6
  const defaultDistDir = "dist";
7
7
  const isRes = (r) => Boolean(r);
8
8
  const getDistFilePath = (option) => {
@@ -1,5 +1,5 @@
1
- import { glob } from "@modern-js/utils";
2
1
  import { DEFAULT_EXTENSIONS } from "@babel/core";
2
+ import { glob } from "@modern-js/utils";
3
3
  import { mergeDefaultOption } from "./defaults";
4
4
  const getGlobPattern = (dir, extensions) => {
5
5
  if (extensions.length > 1) {
@@ -1,6 +1,6 @@
1
- import { getFinalCompilerOption } from "./getFinalOption";
2
1
  import { build } from "./build";
3
2
  import { buildWatch } from "./buildWatch";
3
+ import { getFinalCompilerOption } from "./getFinalOption";
4
4
  import { validate } from "./validate";
5
5
  async function compiler(compilerOptions, babelOptions = {}) {
6
6
  const validRet = validate(compilerOptions);
@@ -1,2 +1,2 @@
1
- import type { IFinaleCompilerOptions, BabelOptions, ICompilerResult } from './type';
1
+ import type { BabelOptions, ICompilerResult, IFinaleCompilerOptions } from './type';
2
2
  export declare const build: (option: IFinaleCompilerOptions, babelConfig?: BabelOptions) => Promise<ICompilerResult>;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import * as Event from 'events';
3
3
  import { type FSWatcher } from '@modern-js/utils';
4
- import type { IFinaleCompilerOptions, BabelOptions } from './type';
4
+ import type { BabelOptions, IFinaleCompilerOptions } from './type';
5
5
  export declare const BuildWatchEvent: {
6
6
  firstCompiler: string;
7
7
  compiling: string;
@@ -1,4 +1,4 @@
1
- import type { ICompilerResult, ICompilerMessageDetail } from './type';
1
+ import type { ICompilerMessageDetail, ICompilerResult } from './type';
2
2
  export declare class CompilerErrorResult {
3
3
  _messageDetails: ICompilerMessageDetail[];
4
4
  constructor(initErrorResult?: ICompilerResult);
@@ -1,5 +1,5 @@
1
- import type { ICompilerOptions, ICompilerResult, BabelOptions } from './type';
2
1
  import { type BuildWatchEmitter } from './buildWatch';
2
+ import type { BabelOptions, ICompilerOptions, ICompilerResult } from './type';
3
3
  export declare function compiler(compilerOptions: ICompilerOptions & {
4
4
  enableWatch: true;
5
5
  }, babelOptions?: BabelOptions): Promise<BuildWatchEmitter>;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.58.2",
18
+ "version": "2.58.3",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@babel/core": "^7.24.7",
35
35
  "@swc/helpers": "0.5.3",
36
- "@modern-js/utils": "2.58.2"
36
+ "@modern-js/utils": "2.58.3"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@babel/plugin-transform-classes": "^7.22.15",
@@ -44,8 +44,8 @@
44
44
  "@types/node": "^14",
45
45
  "jest": "^29",
46
46
  "typescript": "^5",
47
- "@scripts/build": "2.58.2",
48
- "@scripts/jest-config": "2.58.2"
47
+ "@scripts/build": "2.58.3",
48
+ "@scripts/jest-config": "2.58.3"
49
49
  },
50
50
  "sideEffects": false,
51
51
  "publishConfig": {