@jsenv/core 20.3.2 → 21.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 (29) hide show
  1. package/dist/.DS_Store +0 -0
  2. package/dist/jsenv_compile_proxy.js +4 -6
  3. package/dist/jsenv_compile_proxy.js.map +3 -4
  4. package/dist/jsenv_exploring_redirector.js +4 -6
  5. package/dist/jsenv_exploring_redirector.js.map +3 -4
  6. package/dist/jsenv_toolbar.js +7 -16
  7. package/dist/jsenv_toolbar.js.map +4 -6
  8. package/{LICENSE → license} +0 -0
  9. package/main.js +2 -1
  10. package/package.json +3 -7
  11. package/readme.md +8 -8
  12. package/src/{convertCommonJsWithRollup.js → commonJsToJavaScriptModule.js} +23 -5
  13. package/src/execute.js +2 -2
  14. package/src/executeTestPlan.js +2 -2
  15. package/src/internal/compiling/compile-directory/getOrGenerateCompiledFile.js +17 -14
  16. package/src/internal/compiling/createCompiledFileService.js +125 -64
  17. package/src/internal/compiling/js-compilation-service/jsenvTransform.js +1 -1
  18. package/src/internal/compiling/js-compilation-service/transformJs.js +1 -71
  19. package/src/internal/compiling/jsenvCompilerForHtml.js +146 -187
  20. package/src/internal/compiling/jsenvCompilerForImportmap.js +79 -13
  21. package/src/internal/compiling/jsenvCompilerForJavaScript.js +33 -70
  22. package/src/internal/compiling/startCompileServer.js +1 -7
  23. package/src/internal/compiling/transformResultToCompilationResult.js +7 -2
  24. package/src/internal/executing/executePlan.js +2 -2
  25. package/src/internal/runtime/createBrowserRuntime/scanBrowserRuntimeFeatures.js +4 -7
  26. package/src/internal/toolbar/compilation/toolbar.compilation.js +3 -11
  27. package/src/startExploring.js +0 -2
  28. package/src/textToJavaScriptModule.js +10 -0
  29. package/src/internal/compiling/transformImportmap.js +0 -94
@@ -1,4 +1,3 @@
1
- import { urlToContentType } from "@jsenv/server"
2
1
  import { resolveUrl, urlToRelativeUrl } from "@jsenv/filesystem"
3
2
 
4
3
  import {
@@ -9,7 +8,6 @@ import {
9
8
  import { getDefaultImportMap } from "@jsenv/core/src/internal/import-resolution/importmap-default.js"
10
9
  import { setJavaScriptSourceMappingUrl } from "../sourceMappingURLUtils.js"
11
10
  import { transformJs } from "./js-compilation-service/transformJs.js"
12
- import { compileIdToBabelPluginMap } from "./jsenvCompilerForJavaScript.js"
13
11
  import {
14
12
  parseHtmlString,
15
13
  parseHtmlAstRessources,
@@ -25,30 +23,24 @@ import {
25
23
  } from "./compileHtml.js"
26
24
  import { generateCompiledFileAssetUrl } from "./compile-directory/compile-asset.js"
27
25
 
28
- const compileHtmlFile = ({
26
+ export const compileHtml = async ({
29
27
  // cancellationToken,
30
28
  // logger,
31
29
  // request,
32
-
30
+ code,
31
+ url,
32
+ compiledUrl,
33
33
  projectDirectoryUrl,
34
34
  outDirectoryRelativeUrl,
35
- originalFileUrl,
36
- compiledFileUrl,
37
35
  compileId,
38
- groupMap,
39
- babelPluginMap,
40
- convertMap,
36
+
41
37
  transformTopLevelAwait,
42
38
  moduleOutFormat,
43
39
  importMetaFormat,
40
+ babelPluginMap,
44
41
 
45
42
  jsenvToolbarInjection,
46
43
  }) => {
47
- const contentType = urlToContentType(originalFileUrl)
48
- if (contentType !== "text/html") {
49
- return null
50
- }
51
-
52
44
  const jsenvBrowserBuildUrlRelativeToProject = urlToRelativeUrl(
53
45
  jsenvBrowserSystemFileInfo.jsenvBuildUrl,
54
46
  projectDirectoryUrl,
@@ -58,189 +50,160 @@ const compileHtmlFile = ({
58
50
  projectDirectoryUrl,
59
51
  )
60
52
 
61
- return {
62
- compile: async (htmlBeforeCompilation) => {
63
- // ideally we should try/catch html syntax error
64
- const htmlAst = parseHtmlString(htmlBeforeCompilation)
53
+ // ideally we should try/catch html syntax error
54
+ const htmlAst = parseHtmlString(code)
65
55
 
66
- if (moduleOutFormat !== "esmodule") {
67
- await mutateRessourceHints(htmlAst)
68
- }
56
+ if (moduleOutFormat !== "esmodule") {
57
+ await mutateRessourceHints(htmlAst)
58
+ }
69
59
 
70
- manipulateHtmlAst(htmlAst, {
71
- scriptInjections: [
72
- {
73
- src: `/${jsenvBrowserBuildUrlRelativeToProject}`,
74
- },
75
- ...(jsenvToolbarInjection &&
76
- originalFileUrl !== jsenvToolbarHtmlFileInfo.url
77
- ? [
78
- {
79
- src: `/${jsenvToolbarInjectorBuildRelativeUrlForProject}`,
80
- },
81
- ]
82
- : []),
83
- ],
84
- })
60
+ manipulateHtmlAst(htmlAst, {
61
+ scriptInjections: [
62
+ {
63
+ src: `/${jsenvBrowserBuildUrlRelativeToProject}`,
64
+ },
65
+ ...(jsenvToolbarInjection && url !== jsenvToolbarHtmlFileInfo.url
66
+ ? [
67
+ {
68
+ src: `/${jsenvToolbarInjectorBuildRelativeUrlForProject}`,
69
+ },
70
+ ]
71
+ : []),
72
+ ],
73
+ })
85
74
 
86
- const { scripts } = parseHtmlAstRessources(htmlAst)
75
+ const { scripts } = parseHtmlAstRessources(htmlAst)
87
76
 
88
- let hasImportmap = false
89
- const inlineScriptsContentMap = {}
90
- scripts.forEach((script) => {
91
- const typeAttribute = getHtmlNodeAttributeByName(script, "type")
92
- const srcAttribute = getHtmlNodeAttributeByName(script, "src")
77
+ let hasImportmap = false
78
+ const inlineScriptsContentMap = {}
79
+ scripts.forEach((script) => {
80
+ const typeAttribute = getHtmlNodeAttributeByName(script, "type")
81
+ const srcAttribute = getHtmlNodeAttributeByName(script, "src")
93
82
 
94
- // remote
95
- if (
96
- typeAttribute &&
97
- typeAttribute.value === "importmap" &&
98
- srcAttribute
99
- ) {
100
- hasImportmap = true
101
- typeAttribute.value = "jsenv-importmap"
102
- return
103
- }
104
- if (typeAttribute && typeAttribute.value === "module" && srcAttribute) {
105
- removeHtmlNodeAttribute(script, typeAttribute)
106
- removeHtmlNodeAttribute(script, srcAttribute)
107
- setHtmlNodeText(
108
- script,
109
- `window.__jsenv__.executeFileUsingSystemJs(${JSON.stringify(
110
- srcAttribute.value,
111
- )})`,
112
- )
113
- return
114
- }
115
- // inline
116
- const textNode = getHtmlNodeTextNode(script)
117
- if (typeAttribute && typeAttribute.value === "module" && textNode) {
118
- const scriptAssetUrl = generateCompiledFileAssetUrl(
119
- compiledFileUrl,
120
- getUniqueNameForInlineHtmlNode(script, scripts, `[id].js`),
121
- )
122
- const specifier = `./${urlToRelativeUrl(
123
- scriptAssetUrl,
124
- compiledFileUrl,
125
- )}`
126
- inlineScriptsContentMap[specifier] = textNode.value
83
+ // remote
84
+ if (typeAttribute && typeAttribute.value === "importmap" && srcAttribute) {
85
+ hasImportmap = true
86
+ typeAttribute.value = "jsenv-importmap"
87
+ return
88
+ }
89
+ if (typeAttribute && typeAttribute.value === "module" && srcAttribute) {
90
+ removeHtmlNodeAttribute(script, typeAttribute)
91
+ removeHtmlNodeAttribute(script, srcAttribute)
92
+ setHtmlNodeText(
93
+ script,
94
+ `window.__jsenv__.executeFileUsingSystemJs(${JSON.stringify(
95
+ srcAttribute.value,
96
+ )})`,
97
+ )
98
+ return
99
+ }
100
+ // inline
101
+ const textNode = getHtmlNodeTextNode(script)
102
+ if (typeAttribute && typeAttribute.value === "module" && textNode) {
103
+ const scriptAssetUrl = generateCompiledFileAssetUrl(
104
+ compiledUrl,
105
+ getUniqueNameForInlineHtmlNode(script, scripts, `[id].js`),
106
+ )
107
+ const specifier = `./${urlToRelativeUrl(scriptAssetUrl, compiledUrl)}`
108
+ inlineScriptsContentMap[specifier] = textNode.value
127
109
 
128
- removeHtmlNodeAttribute(script, typeAttribute)
129
- removeHtmlNodeAttribute(script, srcAttribute)
130
- setHtmlNodeText(
131
- script,
132
- `window.__jsenv__.executeFileUsingSystemJs(${JSON.stringify(
133
- specifier,
134
- )})`,
135
- )
136
- return
137
- }
138
- })
139
- if (hasImportmap === false) {
140
- const defaultImportMap = getDefaultImportMap({
141
- importMapFileUrl: compiledFileUrl,
142
- projectDirectoryUrl,
143
- compileDirectoryRelativeUrl: `${outDirectoryRelativeUrl}${compileId}/`,
144
- })
110
+ removeHtmlNodeAttribute(script, typeAttribute)
111
+ removeHtmlNodeAttribute(script, srcAttribute)
112
+ setHtmlNodeText(
113
+ script,
114
+ `window.__jsenv__.executeFileUsingSystemJs(${JSON.stringify(
115
+ specifier,
116
+ )})`,
117
+ )
118
+ return
119
+ }
120
+ })
121
+ if (hasImportmap === false) {
122
+ const defaultImportMap = getDefaultImportMap({
123
+ importMapFileUrl: compiledUrl,
124
+ projectDirectoryUrl,
125
+ compileDirectoryRelativeUrl: `${outDirectoryRelativeUrl}${compileId}/`,
126
+ })
145
127
 
146
- manipulateHtmlAst(htmlAst, {
147
- scriptInjections: [
148
- {
149
- type: "jsenv-importmap",
150
- // in case there is no importmap, force the presence
151
- // so that '@jsenv/core/' are still remapped
152
- text: JSON.stringify(defaultImportMap, null, " "),
153
- },
154
- ],
155
- })
156
- }
128
+ manipulateHtmlAst(htmlAst, {
129
+ scriptInjections: [
130
+ {
131
+ type: "jsenv-importmap",
132
+ // in case there is no importmap, force the presence
133
+ // so that '@jsenv/core/' are still remapped
134
+ text: JSON.stringify(defaultImportMap, null, " "),
135
+ },
136
+ ],
137
+ })
138
+ }
157
139
 
158
- const htmlAfterTransformation = stringifyHtmlAst(htmlAst)
140
+ const htmlAfterTransformation = stringifyHtmlAst(htmlAst)
159
141
 
160
- let assets = []
161
- let assetsContent = []
162
- await Promise.all(
163
- Object.keys(inlineScriptsContentMap).map(async (scriptSrc) => {
164
- const scriptAssetUrl = resolveUrl(scriptSrc, compiledFileUrl)
165
- const scriptBasename = urlToRelativeUrl(
166
- scriptAssetUrl,
167
- compiledFileUrl,
168
- )
169
- const scriptOriginalFileUrl = resolveUrl(
170
- scriptBasename,
171
- originalFileUrl,
172
- )
173
- const scriptAfterTransformFileUrl = resolveUrl(
174
- scriptBasename,
175
- compiledFileUrl,
176
- )
142
+ let assets = []
143
+ let assetsContent = []
144
+ await Promise.all(
145
+ Object.keys(inlineScriptsContentMap).map(async (scriptSrc) => {
146
+ const scriptAssetUrl = resolveUrl(scriptSrc, compiledUrl)
147
+ const scriptBasename = urlToRelativeUrl(scriptAssetUrl, compiledUrl)
148
+ const scriptOriginalFileUrl = resolveUrl(scriptBasename, url)
149
+ const scriptCompiledFileUrl = resolveUrl(scriptBasename, compiledUrl)
177
150
 
178
- const scriptBeforeCompilation = inlineScriptsContentMap[scriptSrc]
179
- let scriptTransformResult
180
- try {
181
- scriptTransformResult = await transformJs({
182
- code: scriptBeforeCompilation,
183
- url: scriptOriginalFileUrl,
184
- urlAfterTransform: scriptAfterTransformFileUrl,
185
- projectDirectoryUrl,
151
+ const scriptBeforeCompilation = inlineScriptsContentMap[scriptSrc]
152
+ let scriptTransformResult
153
+ try {
154
+ scriptTransformResult = await transformJs({
155
+ code: scriptBeforeCompilation,
156
+ url: scriptOriginalFileUrl,
157
+ compiledUrl: scriptCompiledFileUrl,
158
+ projectDirectoryUrl,
186
159
 
187
- babelPluginMap: compileIdToBabelPluginMap(compileId, {
188
- groupMap,
189
- babelPluginMap,
190
- }),
191
- convertMap,
192
- transformTopLevelAwait,
193
- moduleOutFormat,
194
- importMetaFormat,
195
- })
196
- } catch (e) {
197
- // If there is a syntax error in inline script
198
- // we put the raw script without transformation.
199
- // when systemjs will try to instantiate to script it
200
- // will re-throw this syntax error.
201
- // Thanks to this we see the syntax error in the
202
- // document and livereloading still works
203
- // because we gracefully handle this error
204
- if (e.code === "PARSE_ERROR") {
205
- const code = scriptBeforeCompilation
206
- assets = [...assets, scriptAssetUrl]
207
- assetsContent = [...assetsContent, code]
208
- return
209
- }
210
- throw e
211
- }
212
- const sourcemapFileUrl = resolveUrl(
213
- `${scriptBasename}.map`,
214
- scriptAfterTransformFileUrl,
215
- )
160
+ transformTopLevelAwait,
161
+ moduleOutFormat,
162
+ importMetaFormat,
163
+ babelPluginMap,
164
+ })
165
+ } catch (e) {
166
+ // If there is a syntax error in inline script
167
+ // we put the raw script without transformation.
168
+ // when systemjs will try to instantiate to script it
169
+ // will re-throw this syntax error.
170
+ // Thanks to this we see the syntax error in the
171
+ // document and livereloading still works
172
+ // because we gracefully handle this error
173
+ if (e.code === "PARSE_ERROR") {
174
+ const code = scriptBeforeCompilation
175
+ assets = [...assets, scriptAssetUrl]
176
+ assetsContent = [...assetsContent, code]
177
+ return
178
+ }
179
+ throw e
180
+ }
181
+ const sourcemapFileUrl = resolveUrl(
182
+ `${scriptBasename}.map`,
183
+ scriptCompiledFileUrl,
184
+ )
216
185
 
217
- let { code, map } = scriptTransformResult
218
- const sourcemapFileRelativePathForModule = urlToRelativeUrl(
219
- sourcemapFileUrl,
220
- compiledFileUrl,
221
- )
222
- code = setJavaScriptSourceMappingUrl(
223
- code,
224
- sourcemapFileRelativePathForModule,
225
- )
226
- assets = [...assets, scriptAssetUrl, sourcemapFileUrl]
227
- assetsContent = [
228
- ...assetsContent,
229
- code,
230
- JSON.stringify(map, null, " "),
231
- ]
232
- }),
186
+ let { code, map } = scriptTransformResult
187
+ const sourcemapFileRelativePathForModule = urlToRelativeUrl(
188
+ sourcemapFileUrl,
189
+ compiledUrl,
190
+ )
191
+ code = setJavaScriptSourceMappingUrl(
192
+ code,
193
+ sourcemapFileRelativePathForModule,
233
194
  )
195
+ assets = [...assets, scriptAssetUrl, sourcemapFileUrl]
196
+ assetsContent = [...assetsContent, code, JSON.stringify(map, null, " ")]
197
+ }),
198
+ )
234
199
 
235
- return {
236
- compiledSource: htmlAfterTransformation,
237
- contentType: "text/html",
238
- sources: [originalFileUrl],
239
- sourcesContent: [htmlBeforeCompilation],
240
- assets,
241
- assetsContent,
242
- }
243
- },
200
+ return {
201
+ contentType: "text/html",
202
+ compiledSource: htmlAfterTransformation,
203
+ sources: [url],
204
+ sourcesContent: [code],
205
+ assets,
206
+ assetsContent,
244
207
  }
245
208
  }
246
209
 
@@ -304,7 +267,3 @@ const mutateRessourceHints = async (htmlAst) => {
304
267
  )
305
268
  mutations.forEach((mutation) => mutation())
306
269
  }
307
-
308
- export const jsenvCompilerForHtml = {
309
- "jsenv-compiler-html": compileHtmlFile,
310
- }
@@ -1,22 +1,88 @@
1
- import { urlToContentType } from "@jsenv/server"
2
- import { transformImportmap } from "./transformImportmap.js"
1
+ /**
2
+ * allows the following:
3
+ *
4
+ * import "@jsenv/core/helpers/regenerator-runtime/regenerator-runtime.js"
5
+ * -> searches a file inside @jsenv/core/*
6
+ *
7
+ */
3
8
 
4
- const compileImportmapFile = ({ originalFileUrl }) => {
5
- const contentType = urlToContentType(originalFileUrl)
9
+ import { urlToRelativeUrl, urlIsInsideOf } from "@jsenv/filesystem"
10
+ import { composeTwoImportMaps } from "@jsenv/import-map"
11
+ import { jsenvCoreDirectoryUrl } from "../jsenvCoreDirectoryUrl.js"
6
12
 
7
- if (contentType !== "application/importmap+json") {
8
- return null
13
+ export const compileImportmap = async ({ code, url }) => {
14
+ const importMapForProject = JSON.parse(code)
15
+
16
+ const topLevelRemappingForJsenvCore = {
17
+ "@jsenv/core/": urlToRelativeUrlRemapping(jsenvCoreDirectoryUrl, url),
18
+ }
19
+
20
+ const importmapForSelfImport = {
21
+ imports: topLevelRemappingForJsenvCore,
22
+ scopes: generateJsenvCoreScopes({
23
+ importMapForProject,
24
+ topLevelRemappingForJsenvCore,
25
+ }),
9
26
  }
10
27
 
28
+ const importMap = [importmapForSelfImport, importMapForProject].reduce(
29
+ (previous, current) => composeTwoImportMaps(previous, current),
30
+ {},
31
+ )
32
+
33
+ const scopes = importMap.scopes || {}
34
+ const projectTopLevelMappings = importMapForProject.imports || {}
35
+ Object.keys(scopes).forEach((scope) => {
36
+ const scopedMappings = scopes[scope]
37
+ Object.keys(projectTopLevelMappings).forEach((key) => {
38
+ if (key in scopedMappings) {
39
+ scopedMappings[key] = projectTopLevelMappings[key]
40
+ }
41
+ })
42
+ })
43
+
11
44
  return {
12
- compile: (importmapBeforeTransformation) => {
13
- return transformImportmap(importmapBeforeTransformation, {
14
- originalFileUrl,
15
- })
16
- },
45
+ contentType: "application/importmap+json",
46
+ compiledSource: JSON.stringify(importMap, null, " "),
47
+ sources: [url],
48
+ sourcesContent: [code],
49
+ assets: [],
50
+ assetsContent: [],
17
51
  }
18
52
  }
19
53
 
20
- export const jsenvCompilerForImportmap = {
21
- "jsenv-compiler-importmap": compileImportmapFile,
54
+ // this function just here to ensure relative urls starts with './'
55
+ // so that importmap do not consider them as bare specifiers
56
+ const urlToRelativeUrlRemapping = (url, baseUrl) => {
57
+ const relativeUrl = urlToRelativeUrl(url, baseUrl)
58
+
59
+ if (urlIsInsideOf(url, baseUrl)) {
60
+ if (relativeUrl.startsWith("../")) return relativeUrl
61
+ if (relativeUrl.startsWith("./")) return relativeUrl
62
+ return `./${relativeUrl}`
63
+ }
64
+
65
+ return relativeUrl
66
+ }
67
+
68
+ const generateJsenvCoreScopes = ({
69
+ importMapForProject,
70
+ topLevelRemappingForJsenvCore,
71
+ }) => {
72
+ const { scopes } = importMapForProject
73
+
74
+ if (!scopes) {
75
+ return undefined
76
+ }
77
+
78
+ // I must ensure jsenvCoreImports wins by default in every scope
79
+ // because scope may contains stuff like
80
+ // "/": "/"
81
+ // "/": "/folder/"
82
+ // to achieve this, we set jsenvCoreImports into every scope
83
+ const scopesForJsenvCore = {}
84
+ Object.keys(scopes).forEach((scopeKey) => {
85
+ scopesForJsenvCore[scopeKey] = topLevelRemappingForJsenvCore
86
+ })
87
+ return scopesForJsenvCore
22
88
  }
@@ -1,84 +1,47 @@
1
- import { urlToContentType } from "@jsenv/server"
2
1
  import { transformJs } from "./js-compilation-service/transformJs.js"
3
2
  import { transformResultToCompilationResult } from "./transformResultToCompilationResult.js"
4
3
 
5
- const compileJsFile = ({
4
+ export const compileJavascript = async ({
5
+ code,
6
+ map,
7
+ url,
8
+ compiledUrl,
6
9
  projectDirectoryUrl,
7
- originalFileUrl,
8
- compiledFileUrl,
9
- compileId,
10
- groupMap,
10
+
11
11
  babelPluginMap,
12
- convertMap,
13
12
  transformTopLevelAwait,
14
13
  moduleOutFormat,
15
14
  importMetaFormat,
16
- writeOnFilesystem,
15
+
17
16
  sourcemapExcludeSources,
18
17
  }) => {
19
- const contentType = urlToContentType(originalFileUrl)
20
-
21
- if (
22
- contentType !== "application/javascript" &&
23
- contentType !== "text/javascript"
24
- ) {
25
- return null
26
- }
27
-
28
- return {
29
- compile: async (originalFileContent) => {
30
- const transformResult = await transformJs({
31
- code: originalFileContent,
32
- url: originalFileUrl,
33
- urlAfterTransform: compiledFileUrl,
34
- projectDirectoryUrl,
35
-
36
- babelPluginMap: compileIdToBabelPluginMap(compileId, {
37
- groupMap,
38
- babelPluginMap,
39
- }),
40
- convertMap,
41
- transformTopLevelAwait,
42
- moduleOutFormat,
43
- importMetaFormat,
44
- })
45
- const sourcemapFileUrl = `${compiledFileUrl}.map`
46
-
47
- return transformResultToCompilationResult(transformResult, {
48
- projectDirectoryUrl,
49
- originalFileContent,
50
- originalFileUrl,
51
- compiledFileUrl,
52
- sourcemapFileUrl,
53
- sourcemapMethod: writeOnFilesystem ? "comment" : "inline",
54
- sourcemapExcludeSources,
55
- })
18
+ const transformResult = await transformJs({
19
+ code,
20
+ map,
21
+ url,
22
+ compiledUrl,
23
+ projectDirectoryUrl,
24
+
25
+ babelPluginMap,
26
+ transformTopLevelAwait,
27
+ moduleOutFormat,
28
+ importMetaFormat,
29
+ })
30
+
31
+ return transformResultToCompilationResult(
32
+ {
33
+ contentType: "application/javascript",
34
+ code: transformResult.code,
35
+ map: transformResult.map,
36
+ metadata: transformResult.metadata,
56
37
  },
57
- }
58
- }
59
-
60
- export const jsenvCompilerForJavaScript = {
61
- "jsenv-compiler-js": compileJsFile,
62
- }
63
-
64
- export const compileIdToBabelPluginMap = (
65
- compileId,
66
- { babelPluginMap, groupMap },
67
- ) => {
68
- const babelPluginMapForGroupMap = {}
69
-
70
- const groupBabelPluginMap = {}
71
- groupMap[compileId].babelPluginRequiredNameArray.forEach(
72
- (babelPluginRequiredName) => {
73
- if (babelPluginRequiredName in babelPluginMap) {
74
- groupBabelPluginMap[babelPluginRequiredName] =
75
- babelPluginMap[babelPluginRequiredName]
76
- }
38
+ {
39
+ projectDirectoryUrl,
40
+ originalFileContent: code,
41
+ originalFileUrl: url,
42
+ compiledFileUrl: compiledUrl,
43
+ sourcemapFileUrl: `${compiledUrl}.map`,
44
+ sourcemapExcludeSources,
77
45
  },
78
46
  )
79
-
80
- return {
81
- ...groupBabelPluginMap,
82
- ...babelPluginMapForGroupMap,
83
- }
84
47
  }
@@ -72,7 +72,6 @@ export const startCompileServer = async ({
72
72
  replaceGlobalDirname = false,
73
73
  replaceMap = {},
74
74
  babelPluginMap = jsenvBabelPluginMap,
75
- convertMap = {},
76
75
  customCompilers = {},
77
76
 
78
77
  // options related to the server itself
@@ -201,7 +200,6 @@ export const startCompileServer = async ({
201
200
  importDefaultExtension,
202
201
  compileServerGroupMap,
203
202
  env,
204
- convertMap,
205
203
  inlineImportMapIntoHTML,
206
204
  customCompilers,
207
205
  })
@@ -272,7 +270,6 @@ export const startCompileServer = async ({
272
270
  transformTopLevelAwait,
273
271
  groupMap: compileServerGroupMap,
274
272
  babelPluginMap,
275
- convertMap,
276
273
  customCompilers,
277
274
  moduleOutFormat,
278
275
  importMetaFormat,
@@ -874,7 +871,6 @@ const createOutJSONFiles = ({
874
871
  importDefaultExtension,
875
872
  compileServerGroupMap,
876
873
  babelPluginMap,
877
- convertMap,
878
874
  replaceProcessEnvNodeEnv,
879
875
  processEnvNodeEnv,
880
876
  env,
@@ -897,7 +893,6 @@ const createOutJSONFiles = ({
897
893
  const outDirectoryMeta = {
898
894
  jsenvCorePackageVersion,
899
895
  babelPluginMap,
900
- convertMap,
901
896
  compileServerGroupMap,
902
897
  replaceProcessEnvNodeEnv,
903
898
  processEnvNodeEnv,
@@ -914,8 +909,7 @@ const createOutJSONFiles = ({
914
909
  outDirectoryRelativeUrl,
915
910
  importDefaultExtension,
916
911
  inlineImportMapIntoHTML,
917
- customCompilerNames: Object.keys(customCompilers),
918
- convertPatterns: Object.keys(convertMap),
912
+ customCompilerPatterns: Object.keys(customCompilers),
919
913
  }
920
914
  outJSONFiles.env = {
921
915
  url: envOutFileUrl,