@marko/compiler 5.39.58 → 5.39.59
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/babel-utils/tags.js +0 -1
- package/dist/babel.js +572 -0
- package/dist/babel.web.js +532 -0
- package/dist/index.js +19 -4
- package/dist/taglib/loader/json-file-reader.js +4 -4
- package/dist/taglib/loader/loadTagFromProps.js +1 -0
- package/dist/taglib/loader/loadTaglibFromProps.js +2 -3
- package/dist/taglib/loader/scanTagsDir.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -19,6 +19,11 @@ var _shouldOptimize = _interopRequireDefault(require("./util/should-optimize"));
|
|
|
19
19
|
var _tryLoadTranslator = _interopRequireDefault(require("./util/try-load-translator"));function _interopRequireWildcard(e, t) {if ("function" == typeof WeakMap) var r = new WeakMap(),n = new WeakMap();return (_interopRequireWildcard = function (e, t) {if (!t && e && e.__esModule) return e;var o,i,f = { __proto__: null, default: e };if (null === e || "object" != typeof e && "function" != typeof e) return f;if (o = t ? n : r) {if (o.has(e)) return o.get(e);o.set(e, f);}for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]);return f;})(e, t);}function _interopRequireDefault(e) {return e && e.__esModule ? e : { default: e };}
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
const hasBabel = !!(
|
|
23
|
+
_modules.default.pkg && (
|
|
24
|
+
_modules.default.pkg.dependencies?.["@babel/core"] ||
|
|
25
|
+
_modules.default.pkg.devDependencies?.["@babel/core"]));
|
|
26
|
+
|
|
22
27
|
let globalConfig = exports.globalConfig = { ..._config.default };
|
|
23
28
|
function configure(newConfig) {
|
|
24
29
|
exports.globalConfig = globalConfig = { ..._config.default, ...newConfig };
|
|
@@ -76,20 +81,29 @@ function loadMarkoConfig(config) {
|
|
|
76
81
|
|
|
77
82
|
async function loadBabelConfig(filename, config) {
|
|
78
83
|
const baseBabelConfig = getBaseBabelConfig(filename, config);
|
|
79
|
-
return
|
|
84
|
+
return shouldResolveBabelConfig(config) ?
|
|
80
85
|
(await (0, _babel.loadPartialConfigAsync)(baseBabelConfig)).options :
|
|
81
86
|
baseBabelConfig;
|
|
82
87
|
}
|
|
83
88
|
|
|
84
89
|
function loadBabelConfigSync(filename, config) {
|
|
85
90
|
const baseBabelConfig = getBaseBabelConfig(filename, config);
|
|
86
|
-
return
|
|
91
|
+
return shouldResolveBabelConfig(config) ?
|
|
87
92
|
(0, _babel.loadPartialConfig)(baseBabelConfig).options :
|
|
88
93
|
baseBabelConfig;
|
|
89
94
|
}
|
|
90
95
|
|
|
96
|
+
function shouldResolveBabelConfig(config) {
|
|
97
|
+
return !!(
|
|
98
|
+
config.babelrc ||
|
|
99
|
+
config.configFile ||
|
|
100
|
+
config.browserslistConfigFile);
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
|
|
91
104
|
function getBaseBabelConfig(filename, { babelConfig, ...markoConfig }) {
|
|
92
105
|
const isTranslated = isTranslatedOutput(markoConfig.output);
|
|
106
|
+
const loadConfig = isTranslated && hasBabel;
|
|
93
107
|
const requiredPlugins = [[_babelPlugin.default, markoConfig]];
|
|
94
108
|
const baseBabelConfig = {
|
|
95
109
|
filenameRelative: filename ?
|
|
@@ -97,8 +111,9 @@ function getBaseBabelConfig(filename, { babelConfig, ...markoConfig }) {
|
|
|
97
111
|
undefined,
|
|
98
112
|
sourceRoot: filename ? _path.default.dirname(filename) : undefined,
|
|
99
113
|
sourceFileName: filename ? _path.default.basename(filename) : undefined,
|
|
100
|
-
|
|
101
|
-
|
|
114
|
+
babelrc: loadConfig,
|
|
115
|
+
configFile: loadConfig,
|
|
116
|
+
browserslistConfigFile: loadConfig,
|
|
102
117
|
...babelConfig,
|
|
103
118
|
filename,
|
|
104
119
|
sourceType: "module",
|
|
@@ -8,9 +8,9 @@ exports.readFileSync = function (path) {
|
|
|
8
8
|
try {
|
|
9
9
|
var taglibProps = JSON.parse(stripJsonComments(json));
|
|
10
10
|
return taglibProps;
|
|
11
|
-
} catch (
|
|
12
|
-
throw new Error(
|
|
13
|
-
|
|
14
|
-
);
|
|
11
|
+
} catch (cause) {
|
|
12
|
+
throw new Error('Unable to parse JSON file at path "' + path + '".', {
|
|
13
|
+
cause
|
|
14
|
+
});
|
|
15
15
|
}
|
|
16
16
|
};
|
|
@@ -91,16 +91,15 @@ class TaglibLoader {
|
|
|
91
91
|
|
|
92
92
|
_handleTag(tagName, value, dependencyChain) {
|
|
93
93
|
var tagProps;
|
|
94
|
-
var tagFilePath = this.filePath;
|
|
95
|
-
|
|
96
94
|
var tag;
|
|
97
95
|
|
|
98
96
|
if (typeof value === "string") {
|
|
99
|
-
tagFilePath = nodePath.resolve(this.dirname, value);
|
|
97
|
+
var tagFilePath = nodePath.resolve(this.dirname, value);
|
|
100
98
|
|
|
101
99
|
try {
|
|
102
100
|
taglibFS.fs.statSync(tagFilePath);
|
|
103
101
|
} catch (_) {
|
|
102
|
+
// eslint-disable-next-line preserve-caught-error
|
|
104
103
|
throw new Error(
|
|
105
104
|
'Tag at path "' +
|
|
106
105
|
tagFilePath +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/compiler",
|
|
3
|
-
"version": "5.39.
|
|
3
|
+
"version": "5.39.59",
|
|
4
4
|
"description": "Marko template to JS compiler.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"babel",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"source-map-support": "^0.5.21"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"marko": "^5.38.
|
|
85
|
+
"marko": "^5.38.28"
|
|
86
86
|
},
|
|
87
87
|
"engines": {
|
|
88
88
|
"node": "18 || 20 || >=22"
|