@jsenv/core 27.0.0-alpha.1 → 27.0.0-alpha.12
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/package.json +5 -6
- package/src/build/build.js +208 -78
- package/src/build/build_urls_generator.js +16 -7
- package/src/build/inject_service_worker_urls.js +25 -0
- package/src/build/inject_version_mappings.js +4 -3
- package/src/build/plugins/bundle_js_module/jsenv_plugin_bundle_js_module.js +16 -14
- package/src/dev/start_dev_server.js +6 -3
- package/src/execute/execute.js +7 -1
- package/src/omega/core_plugins/babel/{babel_helper → helpers}/babel_plugin_babel_helpers_as_jsenv_imports.js +1 -2
- package/src/omega/core_plugins/babel/helpers/babel_plugin_structure.js +69 -80
- package/src/omega/core_plugins/babel/jsenv_plugin_babel.js +19 -5
- package/src/omega/core_plugins/html_supervisor/client/uneval_exception.js +1 -1
- package/src/omega/core_plugins/import_meta_scenarios/jsenv_plugin_import_meta_scenarios.js +16 -6
- package/src/omega/core_plugins/inject_globals/jsenv_plugin_inject_globals.js +27 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_new_inline_content.js +1 -4
- package/src/omega/core_plugins.js +3 -0
- package/src/omega/file_url_converter.js +8 -50
- package/src/omega/kitchen.js +14 -15
- package/src/omega/runtime_support/features_compatibility.js +40 -1
- package/src/omega/runtime_support/runtime_support.js +48 -16
- package/src/omega/url_graph/url_graph_load.js +1 -0
- package/src/omega/url_graph.js +1 -0
- package/src/test/execute_plan.js +5 -3
- package/src/test/execute_test_plan.js +11 -1
- package/src/omega/core_plugins/babel/babel_helper/babel_helper_directory.js +0 -29
- package/src/omega/core_plugins/babel/babel_helper/client/.eslintrc.cjs +0 -24
- package/src/omega/core_plugins/babel/babel_helper/client/AsyncGenerator/AsyncGenerator.js +0 -81
- package/src/omega/core_plugins/babel/babel_helper/client/AwaitValue/AwaitValue.js +0 -3
- package/src/omega/core_plugins/babel/babel_helper/client/applyDecoratorDescriptor/applyDecoratorDescriptor.js +0 -33
- package/src/omega/core_plugins/babel/babel_helper/client/arrayLikeToArray/arrayLikeToArray.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/arrayWithHoles/arrayWithHoles.js +0 -4
- package/src/omega/core_plugins/babel/babel_helper/client/arrayWithoutHoles/arrayWithoutHoles.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/assertThisInitialized/assertThisInitialized.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/asyncGeneratorDelegate/asyncGeneratorDelegate.js +0 -40
- package/src/omega/core_plugins/babel/babel_helper/client/asyncIterator/asyncIterator.js +0 -65
- package/src/omega/core_plugins/babel/babel_helper/client/asyncToGenerator/asyncToGenerator.js +0 -34
- package/src/omega/core_plugins/babel/babel_helper/client/awaitAsyncGenerator/awaitAsyncGenerator.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +0 -20
- package/src/omega/core_plugins/babel/babel_helper/client/classApplyDescriptorGet/classApplyDescriptorGet.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/classApplyDescriptorSet/classApplyDescriptorSet.js +0 -13
- package/src/omega/core_plugins/babel/babel_helper/client/classCallCheck/classCallCheck.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/classExtractFieldDescriptor/classExtractFieldDescriptor.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/classNameTDZError/classNameTDZError.js +0 -4
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateFieldGet/classPrivateFieldGet.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateFieldSet/classPrivateFieldSet.js +0 -8
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateMethodGet/classPrivateMethodGet.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateMethodSet/classPrivateMethodSet.js +0 -3
- package/src/omega/core_plugins/babel/babel_helper/client/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +0 -9
- package/src/omega/core_plugins/babel/babel_helper/client/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +0 -15
- package/src/omega/core_plugins/babel/babel_helper/client/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +0 -3
- package/src/omega/core_plugins/babel/babel_helper/client/construct/construct.js +0 -16
- package/src/omega/core_plugins/babel/babel_helper/client/createClass/createClass.js +0 -15
- package/src/omega/core_plugins/babel/babel_helper/client/createForOfIteratorHelper/createForOfIteratorHelper.js +0 -60
- package/src/omega/core_plugins/babel/babel_helper/client/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +0 -23
- package/src/omega/core_plugins/babel/babel_helper/client/createRawReactElement/createRawReactElement.js +0 -50
- package/src/omega/core_plugins/babel/babel_helper/client/createSuper/createSuper.js +0 -22
- package/src/omega/core_plugins/babel/babel_helper/client/decorate/decorate.js +0 -403
- package/src/omega/core_plugins/babel/babel_helper/client/defaults/defaults.js +0 -11
- package/src/omega/core_plugins/babel/babel_helper/client/defineEnumerableProperties/defineEnumerableProperties.js +0 -23
- package/src/omega/core_plugins/babel/babel_helper/client/defineProperty/defineProperty.js +0 -18
- package/src/omega/core_plugins/babel/babel_helper/client/extends/extends.js +0 -14
- package/src/omega/core_plugins/babel/babel_helper/client/get/get.js +0 -19
- package/src/omega/core_plugins/babel/babel_helper/client/getPrototypeOf/getPrototypeOf.js +0 -4
- package/src/omega/core_plugins/babel/babel_helper/client/inherits/inherits.js +0 -19
- package/src/omega/core_plugins/babel/babel_helper/client/inheritsLoose/inheritsLoose.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/initializerDefineProperty/initializerDefineProperty.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/initializerWarningHelper/initializerWarningHelper.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/instanceof/instanceof.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/interopRequireDefault/interopRequireDefault.js +0 -3
- package/src/omega/core_plugins/babel/babel_helper/client/interopRequireWildcard/interopRequireWildcard.js +0 -37
- package/src/omega/core_plugins/babel/babel_helper/client/isNativeFunction/isNativeFunction.js +0 -4
- package/src/omega/core_plugins/babel/babel_helper/client/isNativeReflectConstruct/isNativeReflectConstruct.js +0 -21
- package/src/omega/core_plugins/babel/babel_helper/client/iterableToArray/iterableToArray.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/iterableToArrayLimit/iterableToArrayLimit.js +0 -36
- package/src/omega/core_plugins/babel/babel_helper/client/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/jsx/jsx.js +0 -50
- package/src/omega/core_plugins/babel/babel_helper/client/maybeArrayLike/maybeArrayLike.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/newArrowCheck/newArrowCheck.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/nonIterableRest/nonIterableRest.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/nonIterableSpread/nonIterableSpread.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/objectDestructuringEmpty/objectDestructuringEmpty.js +0 -3
- package/src/omega/core_plugins/babel/babel_helper/client/objectSpread/objectSpread.js +0 -23
- package/src/omega/core_plugins/babel/babel_helper/client/objectSpread2/objectSpread2.js +0 -41
- package/src/omega/core_plugins/babel/babel_helper/client/objectWithoutProperties/objectWithoutProperties.js +0 -19
- package/src/omega/core_plugins/babel/babel_helper/client/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +0 -13
- package/src/omega/core_plugins/babel/babel_helper/client/possibleConstructorReturn/possibleConstructorReturn.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/readOnlyError/readOnlyError.js +0 -4
- package/src/omega/core_plugins/babel/babel_helper/client/readme.md +0 -8
- package/src/omega/core_plugins/babel/babel_helper/client/set/set.js +0 -44
- package/src/omega/core_plugins/babel/babel_helper/client/setPrototypeOf/setPrototypeOf.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/skipFirstGeneratorNext/skipFirstGeneratorNext.js +0 -8
- package/src/omega/core_plugins/babel/babel_helper/client/slicedToArray/slicedToArray.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/slicedToArrayLoose/slicedToArrayLoose.js +0 -13
- package/src/omega/core_plugins/babel/babel_helper/client/superPropBase/superPropBase.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/taggedTemplateLiteral/taggedTemplateLiteral.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/tdz/tdz.js +0 -4
- package/src/omega/core_plugins/babel/babel_helper/client/temporalRef/temporalRef.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/temporalUndefined/temporalUndefined.js +0 -3
- package/src/omega/core_plugins/babel/babel_helper/client/toArray/toArray.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/toConsumableArray/toConsumableArray.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/toPrimitive/toPrimitive.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/toPropertyKey/toPropertyKey.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/typeof/typeof.js +0 -14
- package/src/omega/core_plugins/babel/babel_helper/client/unsupportedIterableToArray/unsupportedIterableToArray.js +0 -12
- package/src/omega/core_plugins/babel/babel_helper/client/wrapAsyncGenerator/wrapAsyncGenerator.js +0 -8
- package/src/omega/core_plugins/babel/babel_helper/client/wrapNativeSuper/wrapNativeSuper.js +0 -30
- package/src/omega/core_plugins/babel/babel_helper/client/wrapRegExp/wrapRegExp.js +0 -63
- package/src/omega/core_plugins/babel/babel_helper/client/writeOnlyError/writeOnlyError.js +0 -4
package/src/omega/kitchen.js
CHANGED
|
@@ -8,11 +8,10 @@ import {
|
|
|
8
8
|
} from "@jsenv/filesystem"
|
|
9
9
|
|
|
10
10
|
import { stringifyUrlSite } from "@jsenv/utils/urls/url_trace.js"
|
|
11
|
+
import { setUrlExtension } from "@jsenv/utils/urls/url_utils.js"
|
|
11
12
|
|
|
12
13
|
import { createUrlInfoTransformer } from "./url_graph/url_info_transformations.js"
|
|
13
|
-
import {
|
|
14
|
-
import { isFeatureSupportedOnRuntimes } from "./runtime_support/runtime_support.js"
|
|
15
|
-
import { fileUrlConverter } from "./file_url_converter.js"
|
|
14
|
+
import { RUNTIME_SUPPORT } from "./runtime_support/runtime_support.js"
|
|
16
15
|
import { parseUrlMentions } from "./url_mentions/parse_url_mentions.js"
|
|
17
16
|
import {
|
|
18
17
|
createResolveError,
|
|
@@ -185,14 +184,6 @@ export const createKitchen = ({
|
|
|
185
184
|
},
|
|
186
185
|
})
|
|
187
186
|
|
|
188
|
-
const isSupported = ({
|
|
189
|
-
runtimeSupport,
|
|
190
|
-
featureName,
|
|
191
|
-
featureCompat = featuresCompatMap[featureName],
|
|
192
|
-
}) => {
|
|
193
|
-
return isFeatureSupportedOnRuntimes(runtimeSupport, featureCompat)
|
|
194
|
-
}
|
|
195
|
-
|
|
196
187
|
const load = async ({ reference, urlInfo, context }) => {
|
|
197
188
|
try {
|
|
198
189
|
const loadReturnValue = urlInfo.isInline
|
|
@@ -274,8 +265,8 @@ export const createKitchen = ({
|
|
|
274
265
|
reference,
|
|
275
266
|
outDirectoryUrl,
|
|
276
267
|
runtimeSupport,
|
|
277
|
-
isSupportedOnRuntime: (
|
|
278
|
-
return isSupported(
|
|
268
|
+
isSupportedOnRuntime: (feature) => {
|
|
269
|
+
return RUNTIME_SUPPORT.isSupported(runtimeSupport, feature)
|
|
279
270
|
},
|
|
280
271
|
cook: (params) => {
|
|
281
272
|
return cookDuringCook({
|
|
@@ -453,6 +444,7 @@ export const createKitchen = ({
|
|
|
453
444
|
type: urlMention.type,
|
|
454
445
|
subtype: urlMention.subtype,
|
|
455
446
|
specifier: urlMention.specifier,
|
|
447
|
+
data: urlMention.data,
|
|
456
448
|
})
|
|
457
449
|
urlMention.reference = reference
|
|
458
450
|
}
|
|
@@ -585,7 +577,6 @@ export const createKitchen = ({
|
|
|
585
577
|
urlInfoTransformer,
|
|
586
578
|
rootDirectoryUrl,
|
|
587
579
|
jsenvDirectoryUrl,
|
|
588
|
-
isSupported,
|
|
589
580
|
createReference,
|
|
590
581
|
resolveReference,
|
|
591
582
|
cook,
|
|
@@ -659,8 +650,16 @@ const determineFileUrlForOutDirectory = ({
|
|
|
659
650
|
if (!urlIsInsideOf(url, rootDirectoryUrl)) {
|
|
660
651
|
url = `${rootDirectoryUrl}@fs/${url.slice(fileSystemRootUrl.length)}`
|
|
661
652
|
}
|
|
653
|
+
const { searchParams } = new URL(url)
|
|
654
|
+
if (
|
|
655
|
+
searchParams.has("json_module") ||
|
|
656
|
+
searchParams.has("css_module") ||
|
|
657
|
+
searchParams.has("text_module")
|
|
658
|
+
) {
|
|
659
|
+
url = setUrlExtension(url, ".js")
|
|
660
|
+
}
|
|
662
661
|
return moveUrl({
|
|
663
|
-
url
|
|
662
|
+
url,
|
|
664
663
|
from: rootDirectoryUrl,
|
|
665
664
|
to: outDirectoryUrl,
|
|
666
665
|
preferAbsolute: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const featureCompats = {
|
|
2
2
|
script_type_module: {
|
|
3
3
|
edge: "16",
|
|
4
4
|
firefox: "60",
|
|
@@ -52,6 +52,7 @@ export const featuresCompatMap = {
|
|
|
52
52
|
chrome: "93",
|
|
53
53
|
edge: "93",
|
|
54
54
|
},
|
|
55
|
+
import_type_text: {},
|
|
55
56
|
// https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet#browser_compatibility
|
|
56
57
|
new_stylesheet: {
|
|
57
58
|
chrome: "73",
|
|
@@ -59,6 +60,33 @@ export const featuresCompatMap = {
|
|
|
59
60
|
opera: "53",
|
|
60
61
|
android: "73",
|
|
61
62
|
},
|
|
63
|
+
// https://caniuse.com/?search=worker
|
|
64
|
+
worker: {
|
|
65
|
+
ie: "10",
|
|
66
|
+
edge: "12",
|
|
67
|
+
firefox: "3.5",
|
|
68
|
+
chrome: "4",
|
|
69
|
+
opera: "11.5",
|
|
70
|
+
safari: "4",
|
|
71
|
+
ios: "5",
|
|
72
|
+
android: "4.4",
|
|
73
|
+
},
|
|
74
|
+
service_worker: {
|
|
75
|
+
edge: "17",
|
|
76
|
+
firefox: "44",
|
|
77
|
+
chrome: "40",
|
|
78
|
+
safari: "11.1",
|
|
79
|
+
opera: "27",
|
|
80
|
+
ios: "11.3",
|
|
81
|
+
android: "12.12",
|
|
82
|
+
},
|
|
83
|
+
service_worker_type_module: {
|
|
84
|
+
chrome: "80",
|
|
85
|
+
edge: "80",
|
|
86
|
+
opera: "67",
|
|
87
|
+
android: "80",
|
|
88
|
+
},
|
|
89
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker#browser_compatibility
|
|
62
90
|
worker_type_module: {
|
|
63
91
|
chrome: "80",
|
|
64
92
|
edge: "80",
|
|
@@ -88,4 +116,15 @@ export const featuresCompatMap = {
|
|
|
88
116
|
samsung: "8",
|
|
89
117
|
electron: "3",
|
|
90
118
|
},
|
|
119
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#browser_compatibility
|
|
120
|
+
template_literals: {
|
|
121
|
+
chrome: "41",
|
|
122
|
+
edge: "12",
|
|
123
|
+
firefox: "34",
|
|
124
|
+
opera: "28",
|
|
125
|
+
safari: "9",
|
|
126
|
+
ios: "9",
|
|
127
|
+
android: "4",
|
|
128
|
+
node: "4",
|
|
129
|
+
},
|
|
91
130
|
}
|
|
@@ -1,20 +1,52 @@
|
|
|
1
1
|
import { findHighestVersion } from "@jsenv/utils/semantic_versioning/highest_version.js"
|
|
2
|
+
import { featureCompats } from "./features_compatibility.js"
|
|
2
3
|
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
export const RUNTIME_SUPPORT = {
|
|
5
|
+
featureCompats,
|
|
6
|
+
|
|
7
|
+
add: (originalRuntimeSupport, feature) => {
|
|
8
|
+
const featureCompat = getFeatureCompat(feature)
|
|
9
|
+
const runtimeSupport = {
|
|
10
|
+
...originalRuntimeSupport,
|
|
11
|
+
}
|
|
12
|
+
Object.keys(featureCompat).forEach((runtimeName) => {
|
|
13
|
+
const firstVersion = originalRuntimeSupport[runtimeName]
|
|
14
|
+
const secondVersion = featureCompat[runtimeName]
|
|
15
|
+
runtimeSupport[runtimeName] = firstVersion
|
|
16
|
+
? findHighestVersion(firstVersion, secondVersion)
|
|
17
|
+
: secondVersion
|
|
18
|
+
})
|
|
19
|
+
return runtimeSupport
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
isSupported: (runtimeSupport, feature) => {
|
|
23
|
+
const featureCompat = getFeatureCompat(feature)
|
|
24
|
+
const runtimeNames = Object.keys(runtimeSupport)
|
|
25
|
+
return runtimeNames.every((runtimeName) => {
|
|
26
|
+
const runtimeVersion = runtimeSupport[runtimeName]
|
|
27
|
+
const runtimeVersionCompatible = featureCompat[runtimeName] || "Infinity"
|
|
28
|
+
const highestVersion = findHighestVersion(
|
|
29
|
+
runtimeVersion,
|
|
30
|
+
runtimeVersionCompatible,
|
|
31
|
+
)
|
|
32
|
+
if (highestVersion !== runtimeVersion) {
|
|
33
|
+
return false
|
|
34
|
+
}
|
|
35
|
+
return true
|
|
36
|
+
})
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const getFeatureCompat = (feature) => {
|
|
41
|
+
if (typeof feature === "string") {
|
|
42
|
+
const compat = featureCompats[feature]
|
|
43
|
+
if (!compat) {
|
|
44
|
+
throw new Error(`"${feature}" feature is unknown`)
|
|
17
45
|
}
|
|
18
|
-
return
|
|
19
|
-
}
|
|
46
|
+
return compat
|
|
47
|
+
}
|
|
48
|
+
if (typeof feature !== "object") {
|
|
49
|
+
throw new TypeError(`feature must be a string or an object, got ${feature}`)
|
|
50
|
+
}
|
|
51
|
+
return feature
|
|
20
52
|
}
|
package/src/omega/url_graph.js
CHANGED
package/src/test/execute_plan.js
CHANGED
|
@@ -62,9 +62,10 @@ export const executePlan = async (
|
|
|
62
62
|
coverageV8ConflictWarning,
|
|
63
63
|
coverageTempDirectoryRelativeUrl,
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
injectedGlobals,
|
|
66
|
+
plugins,
|
|
67
|
+
scenario,
|
|
68
|
+
sourcemaps,
|
|
68
69
|
|
|
69
70
|
protocol,
|
|
70
71
|
privateKey,
|
|
@@ -151,6 +152,7 @@ export const executePlan = async (
|
|
|
151
152
|
return {}
|
|
152
153
|
},
|
|
153
154
|
},
|
|
155
|
+
injectedGlobals,
|
|
154
156
|
}),
|
|
155
157
|
],
|
|
156
158
|
scenario,
|
|
@@ -80,6 +80,11 @@ export const executeTestPlan = async ({
|
|
|
80
80
|
// skip full means file with 100% coverage won't appear in coverage reports (log and html)
|
|
81
81
|
coverageSkipFull = false,
|
|
82
82
|
|
|
83
|
+
injectedGlobals,
|
|
84
|
+
plugins = [],
|
|
85
|
+
scenario = "test",
|
|
86
|
+
sourcemaps = "inline",
|
|
87
|
+
|
|
83
88
|
protocol,
|
|
84
89
|
privateKey,
|
|
85
90
|
certificate,
|
|
@@ -143,8 +148,8 @@ export const executeTestPlan = async ({
|
|
|
143
148
|
logFileRelativeUrl,
|
|
144
149
|
completedExecutionLogMerging,
|
|
145
150
|
completedExecutionLogAbbreviation,
|
|
146
|
-
|
|
147
151
|
rootDirectoryUrl,
|
|
152
|
+
|
|
148
153
|
maxExecutionsInParallel,
|
|
149
154
|
defaultMsAllocatedPerExecution,
|
|
150
155
|
failFast,
|
|
@@ -159,6 +164,11 @@ export const executeTestPlan = async ({
|
|
|
159
164
|
coverageV8ConflictWarning,
|
|
160
165
|
coverageTempDirectoryRelativeUrl,
|
|
161
166
|
|
|
167
|
+
injectedGlobals,
|
|
168
|
+
plugins,
|
|
169
|
+
scenario,
|
|
170
|
+
sourcemaps,
|
|
171
|
+
|
|
162
172
|
protocol,
|
|
163
173
|
privateKey,
|
|
164
174
|
certificate,
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// https://github.com/babel/babel/blob/99f4f6c3b03c7f3f67cf1b9f1a21b80cfd5b0224/packages/babel-core/src/tools/build-external-helpers.js
|
|
2
|
-
// the list of possible helpers:
|
|
3
|
-
// https://github.com/babel/babel/blob/99f4f6c3b03c7f3f67cf1b9f1a21b80cfd5b0224/packages/babel-helpers/src/helpers.js#L13
|
|
4
|
-
|
|
5
|
-
const babelHelperClientDirectoryUrl = new URL("./client/", import.meta.url).href
|
|
6
|
-
|
|
7
|
-
// we cannot use "@jsenv/core/src/*" because babel helper might be injected
|
|
8
|
-
// into node_modules not depending on "@jsenv/core"
|
|
9
|
-
export const getBabelHelperFileUrl = (babelHelperName) => {
|
|
10
|
-
const babelHelperFileUrl = new URL(
|
|
11
|
-
`./${babelHelperName}/${babelHelperName}.js`,
|
|
12
|
-
babelHelperClientDirectoryUrl,
|
|
13
|
-
).href
|
|
14
|
-
return babelHelperFileUrl
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const babelHelperNameFromUrl = (url) => {
|
|
18
|
-
if (!url.startsWith(babelHelperClientDirectoryUrl)) {
|
|
19
|
-
return null
|
|
20
|
-
}
|
|
21
|
-
const afterBabelHelperDirectory = url.slice(
|
|
22
|
-
babelHelperClientDirectoryUrl.length,
|
|
23
|
-
)
|
|
24
|
-
const babelHelperName = afterBabelHelperDirectory.slice(
|
|
25
|
-
0,
|
|
26
|
-
afterBabelHelperDirectory.indexOf("/"),
|
|
27
|
-
)
|
|
28
|
-
return babelHelperName
|
|
29
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const eslintConfig = require("../../.eslintrc.cjs")
|
|
2
|
-
|
|
3
|
-
// babel helpers are copy pasted from the babel repository
|
|
4
|
-
Object.assign(eslintConfig.rules, {
|
|
5
|
-
"eqeqeq": ["off"],
|
|
6
|
-
"no-eq-null": ["off"],
|
|
7
|
-
"no-undef-init": ["off"],
|
|
8
|
-
"dot-notation": ["off"],
|
|
9
|
-
"consistent-return": ["off"],
|
|
10
|
-
"one-var": ["off"],
|
|
11
|
-
"object-shorthand": ["off"],
|
|
12
|
-
"no-return-assign": ["off"],
|
|
13
|
-
"prefer-template": ["off"],
|
|
14
|
-
"prefer-rest-params": ["off"],
|
|
15
|
-
"no-void": ["off"],
|
|
16
|
-
"no-implicit-coercion": ["off"],
|
|
17
|
-
"prefer-spread": ["off"],
|
|
18
|
-
"no-loop-func": ["off"],
|
|
19
|
-
"no-negated-condition": ["off"],
|
|
20
|
-
"no-func-assign": ["off"],
|
|
21
|
-
"no-else-return": ["off"],
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
module.exports = eslintConfig
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import AwaitValue from "../AwaitValue/AwaitValue.js"
|
|
2
|
-
|
|
3
|
-
export default function AsyncGenerator(gen) {
|
|
4
|
-
var front, back
|
|
5
|
-
function send(key, arg) {
|
|
6
|
-
return new Promise(function (resolve, reject) {
|
|
7
|
-
var request = {
|
|
8
|
-
key: key,
|
|
9
|
-
arg: arg,
|
|
10
|
-
resolve: resolve,
|
|
11
|
-
reject: reject,
|
|
12
|
-
next: null,
|
|
13
|
-
}
|
|
14
|
-
if (back) {
|
|
15
|
-
back = back.next = request
|
|
16
|
-
} else {
|
|
17
|
-
front = back = request
|
|
18
|
-
resume(key, arg)
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
function resume(key, arg) {
|
|
23
|
-
try {
|
|
24
|
-
var result = gen[key](arg)
|
|
25
|
-
var value = result.value
|
|
26
|
-
var wrappedAwait = value instanceof AwaitValue
|
|
27
|
-
Promise.resolve(wrappedAwait ? value.wrapped : value).then(
|
|
28
|
-
function (arg) {
|
|
29
|
-
if (wrappedAwait) {
|
|
30
|
-
resume(key === "return" ? "return" : "next", arg)
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
settle(result.done ? "return" : "normal", arg)
|
|
34
|
-
},
|
|
35
|
-
function (err) {
|
|
36
|
-
resume("throw", err)
|
|
37
|
-
},
|
|
38
|
-
)
|
|
39
|
-
} catch (err) {
|
|
40
|
-
settle("throw", err)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function settle(type, value) {
|
|
44
|
-
switch (type) {
|
|
45
|
-
case "return":
|
|
46
|
-
front.resolve({ value: value, done: true })
|
|
47
|
-
break
|
|
48
|
-
case "throw":
|
|
49
|
-
front.reject(value)
|
|
50
|
-
break
|
|
51
|
-
default:
|
|
52
|
-
front.resolve({ value: value, done: false })
|
|
53
|
-
break
|
|
54
|
-
}
|
|
55
|
-
front = front.next
|
|
56
|
-
if (front) {
|
|
57
|
-
resume(front.key, front.arg)
|
|
58
|
-
} else {
|
|
59
|
-
back = null
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
this._invoke = send
|
|
63
|
-
// Hide "return" method if generator return is not supported
|
|
64
|
-
if (typeof gen.return !== "function") {
|
|
65
|
-
this.return = undefined
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
AsyncGenerator.prototype[
|
|
69
|
-
(typeof Symbol === "function" && Symbol.asyncIterator) || "@@asyncIterator"
|
|
70
|
-
] = function () {
|
|
71
|
-
return this
|
|
72
|
-
}
|
|
73
|
-
AsyncGenerator.prototype.next = function (arg) {
|
|
74
|
-
return this._invoke("next", arg)
|
|
75
|
-
}
|
|
76
|
-
AsyncGenerator.prototype.throw = function (arg) {
|
|
77
|
-
return this._invoke("throw", arg)
|
|
78
|
-
}
|
|
79
|
-
AsyncGenerator.prototype.return = function (arg) {
|
|
80
|
-
return this._invoke("return", arg)
|
|
81
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-void */
|
|
2
|
-
export default function _applyDecoratedDescriptor(
|
|
3
|
-
target,
|
|
4
|
-
property,
|
|
5
|
-
decorators,
|
|
6
|
-
descriptor,
|
|
7
|
-
context,
|
|
8
|
-
) {
|
|
9
|
-
var desc = {}
|
|
10
|
-
Object.keys(descriptor).forEach(function (key) {
|
|
11
|
-
desc[key] = descriptor[key]
|
|
12
|
-
})
|
|
13
|
-
desc.enumerable = Boolean(desc.enumerable)
|
|
14
|
-
desc.configurable = Boolean(desc.configurable)
|
|
15
|
-
if ("value" in desc || desc.initializer) {
|
|
16
|
-
desc.writable = true
|
|
17
|
-
}
|
|
18
|
-
desc = decorators
|
|
19
|
-
.slice()
|
|
20
|
-
.reverse()
|
|
21
|
-
.reduce(function (desc, decorator) {
|
|
22
|
-
return decorator(target, property, desc) || desc
|
|
23
|
-
}, desc)
|
|
24
|
-
if (context && desc.initializer !== void 0) {
|
|
25
|
-
desc.value = desc.initializer ? desc.initializer.call(context) : void 0
|
|
26
|
-
desc.initializer = undefined
|
|
27
|
-
}
|
|
28
|
-
if (desc.initializer === void 0) {
|
|
29
|
-
Object.defineProperty(target, property, desc)
|
|
30
|
-
desc = null
|
|
31
|
-
}
|
|
32
|
-
return desc
|
|
33
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export default function _asyncGeneratorDelegate(inner, awaitWrap) {
|
|
2
|
-
var iter = {},
|
|
3
|
-
waiting = false
|
|
4
|
-
function pump(key, value) {
|
|
5
|
-
waiting = true
|
|
6
|
-
value = new Promise(function (resolve) {
|
|
7
|
-
resolve(inner[key](value))
|
|
8
|
-
})
|
|
9
|
-
return { done: false, value: awaitWrap(value) }
|
|
10
|
-
}
|
|
11
|
-
iter[(typeof Symbol !== "undefined" && Symbol.iterator) || "@@iterator"] = function () {
|
|
12
|
-
return this
|
|
13
|
-
}
|
|
14
|
-
iter.next = function (value) {
|
|
15
|
-
if (waiting) {
|
|
16
|
-
waiting = false
|
|
17
|
-
return value
|
|
18
|
-
}
|
|
19
|
-
return pump("next", value)
|
|
20
|
-
}
|
|
21
|
-
if (typeof inner.throw === "function") {
|
|
22
|
-
iter.throw = function (value) {
|
|
23
|
-
if (waiting) {
|
|
24
|
-
waiting = false
|
|
25
|
-
throw value
|
|
26
|
-
}
|
|
27
|
-
return pump("throw", value)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (typeof inner.return === "function") {
|
|
31
|
-
iter.return = function (value) {
|
|
32
|
-
if (waiting) {
|
|
33
|
-
waiting = false
|
|
34
|
-
return value
|
|
35
|
-
}
|
|
36
|
-
return pump("return", value)
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return iter
|
|
40
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export default function _asyncIterator(iterable) {
|
|
2
|
-
var method,
|
|
3
|
-
async,
|
|
4
|
-
sync,
|
|
5
|
-
retry = 2;
|
|
6
|
-
|
|
7
|
-
if (typeof Symbol !== "undefined") {
|
|
8
|
-
async = Symbol.asyncIterator;
|
|
9
|
-
sync = Symbol.iterator;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
while (retry--) {
|
|
13
|
-
if (async && (method = iterable[async]) != null) {
|
|
14
|
-
return method.call(iterable);
|
|
15
|
-
}
|
|
16
|
-
if (sync && (method = iterable[sync]) != null) {
|
|
17
|
-
return new AsyncFromSyncIterator(method.call(iterable));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async = "@@asyncIterator";
|
|
21
|
-
sync = "@@iterator";
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
throw new TypeError("Object is not async iterable");
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function AsyncFromSyncIterator(s) {
|
|
28
|
-
AsyncFromSyncIterator = function (s) {
|
|
29
|
-
this.s = s;
|
|
30
|
-
this.n = s.next;
|
|
31
|
-
};
|
|
32
|
-
AsyncFromSyncIterator.prototype = {
|
|
33
|
-
/* SyncIterator */ s: null,
|
|
34
|
-
/* SyncIterator.[[Next]] */ n: null,
|
|
35
|
-
next: function () {
|
|
36
|
-
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
|
|
37
|
-
},
|
|
38
|
-
return: function (value) {
|
|
39
|
-
var ret = this.s.return;
|
|
40
|
-
if (ret === undefined) {
|
|
41
|
-
return Promise.resolve({ value: value, done: true });
|
|
42
|
-
}
|
|
43
|
-
return AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));
|
|
44
|
-
},
|
|
45
|
-
throw: function (value) {
|
|
46
|
-
var thr = this.s.return;
|
|
47
|
-
if (thr === undefined) return Promise.reject(value);
|
|
48
|
-
return AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
function AsyncFromSyncIteratorContinuation(r) {
|
|
53
|
-
// This step is _before_ calling AsyncFromSyncIteratorContinuation in the spec.
|
|
54
|
-
if (Object(r) !== r) {
|
|
55
|
-
return Promise.reject(new TypeError(r + " is not an object."));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
var done = r.done;
|
|
59
|
-
return Promise.resolve(r.value).then(function (value) {
|
|
60
|
-
return { value: value, done: done };
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return new AsyncFromSyncIterator(s);
|
|
65
|
-
}
|
package/src/omega/core_plugins/babel/babel_helper/client/asyncToGenerator/asyncToGenerator.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export default function (fn) {
|
|
2
|
-
return function () {
|
|
3
|
-
var self = this
|
|
4
|
-
// eslint-disable-next-line prefer-rest-params
|
|
5
|
-
var args = arguments
|
|
6
|
-
return new Promise(function (resolve, reject) {
|
|
7
|
-
var gen = fn.apply(self, args)
|
|
8
|
-
function _next(value) {
|
|
9
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value)
|
|
10
|
-
}
|
|
11
|
-
function _throw(err) {
|
|
12
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err)
|
|
13
|
-
}
|
|
14
|
-
_next(undefined)
|
|
15
|
-
})
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const asyncGeneratorStep = (gen, resolve, reject, _next, _throw, key, arg) => {
|
|
20
|
-
var info
|
|
21
|
-
var value
|
|
22
|
-
try {
|
|
23
|
-
info = gen[key](arg)
|
|
24
|
-
value = info.value
|
|
25
|
-
} catch (error) {
|
|
26
|
-
reject(error)
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
if (info.done) {
|
|
30
|
-
resolve(value)
|
|
31
|
-
} else {
|
|
32
|
-
Promise.resolve(value).then(_next, _throw)
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export default function _classApplyDescriptorDestructureSet(receiver, descriptor) {
|
|
2
|
-
if (descriptor.set) {
|
|
3
|
-
if (!("__destrObj" in descriptor)) {
|
|
4
|
-
descriptor.__destrObj = {
|
|
5
|
-
// eslint-disable-next-line accessor-pairs
|
|
6
|
-
set value(v) {
|
|
7
|
-
descriptor.set.call(receiver, v)
|
|
8
|
-
},
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
return descriptor.__destrObj
|
|
12
|
-
}
|
|
13
|
-
if (!descriptor.writable) {
|
|
14
|
-
// This should only throw in strict mode, but class bodies are
|
|
15
|
-
// always strict and private fields can only be used inside
|
|
16
|
-
// class bodies.
|
|
17
|
-
throw new TypeError("attempted to set read only private field")
|
|
18
|
-
}
|
|
19
|
-
return descriptor
|
|
20
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export default function _classApplyDescriptorSet(receiver, descriptor, value) {
|
|
2
|
-
if (descriptor.set) {
|
|
3
|
-
descriptor.set.call(receiver, value)
|
|
4
|
-
} else {
|
|
5
|
-
if (!descriptor.writable) {
|
|
6
|
-
// This should only throw in strict mode, but class bodies are
|
|
7
|
-
// always strict and private fields can only be used inside
|
|
8
|
-
// class bodies.
|
|
9
|
-
throw new TypeError("attempted to set read only private field")
|
|
10
|
-
}
|
|
11
|
-
descriptor.value = value
|
|
12
|
-
}
|
|
13
|
-
}
|