@one2x/playwright 1.57.0-alpha.1 → 1.57.0-alpha.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/lib/mcp/sdk/http.js +12 -12
- package/package.json +2 -2
- package/lib/agents/generateAgents.js.map +0 -7
- package/lib/common/config.js.map +0 -7
- package/lib/common/configLoader.js.map +0 -7
- package/lib/common/esmLoaderHost.js.map +0 -7
- package/lib/common/expectBundle.js.map +0 -7
- package/lib/common/expectBundleImpl.js.map +0 -7
- package/lib/common/fixtures.js.map +0 -7
- package/lib/common/globals.js.map +0 -7
- package/lib/common/ipc.js.map +0 -7
- package/lib/common/poolBuilder.js.map +0 -7
- package/lib/common/process.js.map +0 -7
- package/lib/common/suiteUtils.js.map +0 -7
- package/lib/common/test.js.map +0 -7
- package/lib/common/testLoader.js.map +0 -7
- package/lib/common/testType.js.map +0 -7
- package/lib/common/validators.js.map +0 -7
- package/lib/fsWatcher.js.map +0 -7
- package/lib/index.js.map +0 -7
- package/lib/internalsForTest.js.map +0 -7
- package/lib/isomorphic/events.js.map +0 -7
- package/lib/isomorphic/folders.js.map +0 -7
- package/lib/isomorphic/stringInternPool.js.map +0 -7
- package/lib/isomorphic/teleReceiver.js.map +0 -7
- package/lib/isomorphic/teleSuiteUpdater.js.map +0 -7
- package/lib/isomorphic/testServerConnection.js.map +0 -7
- package/lib/isomorphic/testServerInterface.js.map +0 -7
- package/lib/isomorphic/testTree.js.map +0 -7
- package/lib/isomorphic/types.d.js.map +0 -7
- package/lib/loader/loaderMain.js.map +0 -7
- package/lib/matchers/expect.js.map +0 -7
- package/lib/matchers/matcherHint.js.map +0 -7
- package/lib/matchers/matchers.js.map +0 -7
- package/lib/matchers/toBeTruthy.js.map +0 -7
- package/lib/matchers/toEqual.js.map +0 -7
- package/lib/matchers/toHaveURL.js.map +0 -7
- package/lib/matchers/toMatchAriaSnapshot.js.map +0 -7
- package/lib/matchers/toMatchSnapshot.js.map +0 -7
- package/lib/matchers/toMatchText.js.map +0 -7
- package/lib/mcp/browser/actions.d.js.map +0 -7
- package/lib/mcp/browser/browserContextFactory.js.map +0 -7
- package/lib/mcp/browser/browserServerBackend.js.map +0 -7
- package/lib/mcp/browser/codegen.js.map +0 -7
- package/lib/mcp/browser/config.js.map +0 -7
- package/lib/mcp/browser/context.js.map +0 -7
- package/lib/mcp/browser/response.js.map +0 -7
- package/lib/mcp/browser/sessionLog.js.map +0 -7
- package/lib/mcp/browser/tab.js.map +0 -7
- package/lib/mcp/browser/tools/actionRetry.js.map +0 -7
- package/lib/mcp/browser/tools/common.js.map +0 -7
- package/lib/mcp/browser/tools/console.js.map +0 -7
- package/lib/mcp/browser/tools/dialogs.js.map +0 -7
- package/lib/mcp/browser/tools/evaluate.js.map +0 -7
- package/lib/mcp/browser/tools/files.js.map +0 -7
- package/lib/mcp/browser/tools/form.js.map +0 -7
- package/lib/mcp/browser/tools/install.js.map +0 -7
- package/lib/mcp/browser/tools/keyboard.js.map +0 -7
- package/lib/mcp/browser/tools/mouse.js.map +0 -7
- package/lib/mcp/browser/tools/navigate.js.map +0 -7
- package/lib/mcp/browser/tools/network.js.map +0 -7
- package/lib/mcp/browser/tools/pdf.js.map +0 -7
- package/lib/mcp/browser/tools/screenshot.js.map +0 -7
- package/lib/mcp/browser/tools/snapshot.js.map +0 -7
- package/lib/mcp/browser/tools/tabs.js.map +0 -7
- package/lib/mcp/browser/tools/tool.js.map +0 -7
- package/lib/mcp/browser/tools/tracing.js.map +0 -7
- package/lib/mcp/browser/tools/utils.js.map +0 -7
- package/lib/mcp/browser/tools/verify.js.map +0 -7
- package/lib/mcp/browser/tools/wait.js.map +0 -7
- package/lib/mcp/browser/tools.js.map +0 -7
- package/lib/mcp/browser/watchdog.js.map +0 -7
- package/lib/mcp/config.d.js.map +0 -7
- package/lib/mcp/extension/cdpRelay.js.map +0 -7
- package/lib/mcp/extension/extensionContextFactory.js.map +0 -7
- package/lib/mcp/extension/protocol.js.map +0 -7
- package/lib/mcp/index.js.map +0 -7
- package/lib/mcp/log.js.map +0 -7
- package/lib/mcp/program.js.map +0 -7
- package/lib/mcp/sdk/bundle.js.map +0 -7
- package/lib/mcp/sdk/exports.js.map +0 -7
- package/lib/mcp/sdk/http.js.map +0 -7
- package/lib/mcp/sdk/inProcessTransport.js.map +0 -7
- package/lib/mcp/sdk/mdb.js.map +0 -7
- package/lib/mcp/sdk/proxyBackend.js.map +0 -7
- package/lib/mcp/sdk/server.js.map +0 -7
- package/lib/mcp/sdk/tool.js.map +0 -7
- package/lib/mcp/test/browserBackend.js.map +0 -7
- package/lib/mcp/test/generatorTools.js.map +0 -7
- package/lib/mcp/test/plannerTools.js.map +0 -7
- package/lib/mcp/test/seed.js.map +0 -7
- package/lib/mcp/test/streams.js.map +0 -7
- package/lib/mcp/test/testBackend.js.map +0 -7
- package/lib/mcp/test/testContext.js.map +0 -7
- package/lib/mcp/test/testTool.js.map +0 -7
- package/lib/mcp/test/testTools.js.map +0 -7
- package/lib/mcpBundleImpl.js.map +0 -7
- package/lib/plugins/gitCommitInfoPlugin.js.map +0 -7
- package/lib/plugins/index.js.map +0 -7
- package/lib/plugins/webServerPlugin.js.map +0 -7
- package/lib/program.js.map +0 -7
- package/lib/reporters/base.js.map +0 -7
- package/lib/reporters/blob.js.map +0 -7
- package/lib/reporters/dot.js.map +0 -7
- package/lib/reporters/empty.js.map +0 -7
- package/lib/reporters/github.js.map +0 -7
- package/lib/reporters/html.js.map +0 -7
- package/lib/reporters/internalReporter.js.map +0 -7
- package/lib/reporters/json.js.map +0 -7
- package/lib/reporters/junit.js.map +0 -7
- package/lib/reporters/line.js.map +0 -7
- package/lib/reporters/list.js.map +0 -7
- package/lib/reporters/listModeReporter.js.map +0 -7
- package/lib/reporters/markdown.js.map +0 -7
- package/lib/reporters/merge.js.map +0 -7
- package/lib/reporters/multiplexer.js.map +0 -7
- package/lib/reporters/reporterV2.js.map +0 -7
- package/lib/reporters/teleEmitter.js.map +0 -7
- package/lib/reporters/versions/blobV1.js.map +0 -7
- package/lib/runner/dispatcher.js.map +0 -7
- package/lib/runner/failureTracker.js.map +0 -7
- package/lib/runner/lastRun.js.map +0 -7
- package/lib/runner/loadUtils.js.map +0 -7
- package/lib/runner/loaderHost.js.map +0 -7
- package/lib/runner/processHost.js.map +0 -7
- package/lib/runner/projectUtils.js.map +0 -7
- package/lib/runner/rebase.js.map +0 -7
- package/lib/runner/reporters.js.map +0 -7
- package/lib/runner/runner.js +0 -110
- package/lib/runner/sigIntWatcher.js.map +0 -7
- package/lib/runner/taskRunner.js.map +0 -7
- package/lib/runner/tasks.js.map +0 -7
- package/lib/runner/testGroups.js.map +0 -7
- package/lib/runner/testRunner.js.map +0 -7
- package/lib/runner/testServer.js.map +0 -7
- package/lib/runner/uiModeReporter.js.map +0 -7
- package/lib/runner/vcs.js.map +0 -7
- package/lib/runner/watchMode.js.map +0 -7
- package/lib/runner/workerHost.js.map +0 -7
- package/lib/third_party/pirates.js.map +0 -7
- package/lib/third_party/tsconfig-loader.js.map +0 -7
- package/lib/transform/babelBundle.js.map +0 -7
- package/lib/transform/babelBundleImpl.js.map +0 -7
- package/lib/transform/compilationCache.js.map +0 -7
- package/lib/transform/esmLoader.js.map +0 -7
- package/lib/transform/portTransport.js.map +0 -7
- package/lib/transform/transform.js.map +0 -7
- package/lib/util.js.map +0 -7
- package/lib/utilsBundle.js.map +0 -7
- package/lib/utilsBundleImpl.js.map +0 -7
- package/lib/worker/fixtureRunner.js.map +0 -7
- package/lib/worker/testInfo.js.map +0 -7
- package/lib/worker/testTracing.js.map +0 -7
- package/lib/worker/timeoutManager.js.map +0 -7
- package/lib/worker/util.js.map +0 -7
- package/lib/worker/workerMain.js.map +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/runner/workerHost.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { removeFolders } from 'playwright-core/lib/utils';\n\nimport { ProcessHost } from './processHost';\nimport { stdioChunkToParams } from '../common/ipc';\nimport { artifactsFolderName } from '../isomorphic/folders';\n\nimport type { TestGroup } from './testGroups';\nimport type { RunPayload, SerializedConfig, WorkerInitParams } from '../common/ipc';\n\n\nlet lastWorkerIndex = 0;\n\ntype WorkerHostOptions = {\n parallelIndex: number;\n config: SerializedConfig;\n extraEnv: Record<string, string | undefined>;\n outputDir: string;\n pauseOnError: boolean;\n pauseAtEnd: boolean;\n};\n\nexport class WorkerHost extends ProcessHost {\n readonly parallelIndex: number;\n readonly workerIndex: number;\n private _hash: string;\n private _params: WorkerInitParams;\n private _didFail = false;\n\n constructor(testGroup: TestGroup, options: WorkerHostOptions) {\n const workerIndex = lastWorkerIndex++;\n super(require.resolve('../worker/workerMain.js'), `worker-${workerIndex}`, {\n ...options.extraEnv,\n FORCE_COLOR: '1',\n DEBUG_COLORS: process.env.DEBUG_COLORS === undefined ? '1' : process.env.DEBUG_COLORS,\n });\n this.workerIndex = workerIndex;\n this.parallelIndex = options.parallelIndex;\n this._hash = testGroup.workerHash;\n\n this._params = {\n workerIndex: this.workerIndex,\n parallelIndex: options.parallelIndex,\n repeatEachIndex: testGroup.repeatEachIndex,\n projectId: testGroup.projectId,\n config: options.config,\n artifactsDir: path.join(options.outputDir, artifactsFolderName(workerIndex)),\n pauseOnError: options.pauseOnError,\n pauseAtEnd: options.pauseAtEnd,\n };\n }\n\n async start() {\n await fs.promises.mkdir(this._params.artifactsDir, { recursive: true });\n return await this.startRunner(this._params, {\n onStdOut: chunk => this.emit('stdOut', stdioChunkToParams(chunk)),\n onStdErr: chunk => this.emit('stdErr', stdioChunkToParams(chunk)),\n });\n }\n\n override async onExit() {\n await removeFolders([this._params.artifactsDir]);\n }\n\n override async stop(didFail?: boolean) {\n if (didFail)\n this._didFail = true;\n await super.stop();\n }\n\n runTestGroup(runPayload: RunPayload) {\n this.sendMessageNoReply({ method: 'runTestGroup', params: runPayload });\n }\n\n hash() {\n return this._hash;\n }\n\n projectId() {\n return this._params.projectId;\n }\n\n didFail() {\n return this._didFail;\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,gBAAe;AACf,kBAAiB;AAEjB,mBAA8B;AAE9B,yBAA4B;AAC5B,iBAAmC;AACnC,qBAAoC;AAMpC,IAAI,kBAAkB;AAWf,MAAM,mBAAmB,+BAAY;AAAA,EAO1C,YAAY,WAAsB,SAA4B;AAC5D,UAAM,cAAc;AACpB,UAAM,gBAAgB,yBAAyB,GAAG,UAAU,WAAW,IAAI;AAAA,MACzE,GAAG,QAAQ;AAAA,MACX,aAAa;AAAA,MACb,cAAc,QAAQ,IAAI,iBAAiB,SAAY,MAAM,QAAQ,IAAI;AAAA,IAC3E,CAAC;AARH,SAAQ,WAAW;AASjB,SAAK,cAAc;AACnB,SAAK,gBAAgB,QAAQ;AAC7B,SAAK,QAAQ,UAAU;AAEvB,SAAK,UAAU;AAAA,MACb,aAAa,KAAK;AAAA,MAClB,eAAe,QAAQ;AAAA,MACvB,iBAAiB,UAAU;AAAA,MAC3B,WAAW,UAAU;AAAA,MACrB,QAAQ,QAAQ;AAAA,MAChB,cAAc,YAAAA,QAAK,KAAK,QAAQ,eAAW,oCAAoB,WAAW,CAAC;AAAA,MAC3E,cAAc,QAAQ;AAAA,MACtB,YAAY,QAAQ;AAAA,IACtB;AAAA,EACF;AAAA,EAEA,MAAM,QAAQ;AACZ,UAAM,UAAAC,QAAG,SAAS,MAAM,KAAK,QAAQ,cAAc,EAAE,WAAW,KAAK,CAAC;AACtE,WAAO,MAAM,KAAK,YAAY,KAAK,SAAS;AAAA,MAC1C,UAAU,WAAS,KAAK,KAAK,cAAU,+BAAmB,KAAK,CAAC;AAAA,MAChE,UAAU,WAAS,KAAK,KAAK,cAAU,+BAAmB,KAAK,CAAC;AAAA,IAClE,CAAC;AAAA,EACH;AAAA,EAEA,MAAe,SAAS;AACtB,cAAM,4BAAc,CAAC,KAAK,QAAQ,YAAY,CAAC;AAAA,EACjD;AAAA,EAEA,MAAe,KAAK,SAAmB;AACrC,QAAI;AACF,WAAK,WAAW;AAClB,UAAM,MAAM,KAAK;AAAA,EACnB;AAAA,EAEA,aAAa,YAAwB;AACnC,SAAK,mBAAmB,EAAE,QAAQ,gBAAgB,QAAQ,WAAW,CAAC;AAAA,EACxE;AAAA,EAEA,OAAO;AACL,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,YAAY;AACV,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,UAAU;AACR,WAAO,KAAK;AAAA,EACd;AACF;",
|
|
6
|
-
"names": ["path", "fs"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/third_party/pirates.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * MIT License\n *\n * Copyright (c) 2016-2018 Ari Porad\n * Modifications copyright (c) Microsoft Corporation.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport Module from 'module';\nimport path from 'path';\n\nexport function addHook(transformHook: (code: string, filename: string) => string, shouldTransform: (filename: string) => boolean, extensions: string[]) {\n // This is a shortened and slightly changed version of https://github.com/danez/pirates.\n //\n // We cannot use pirates directly due to https://github.com/microsoft/playwright/issues/35812.\n // If we overwrite the '.cjs', the following code does not run because there is a custom loader defined:\n // https://github.com/nodejs/node/blob/b1973550e09d5a2a07c70be5de6e3ae4722ad230/lib/internal/modules/esm/translators.js#L397-L403\n //\n // Here we rely on the default '.js' loader to handle '.cjs' files.\n const extensionsToOverwrite = extensions.filter(e => e !== '.cjs');\n const allSupportedExtensions = new Set(extensions);\n const loaders = (Module as any)._extensions;\n const jsLoader = loaders['.js'];\n for (const extension of extensionsToOverwrite) {\n const originalLoader = loaders[extension] || jsLoader;\n function newLoader(this: any, mod: any, filename: string, ...loaderArgs: any[]) {\n if (allSupportedExtensions.has(path.extname(filename)) && shouldTransform(filename)) {\n const oldCompile = mod._compile;\n function newCompile(this: any, code: string, file: string, ...ignoredArgs: any[]) {\n // Note: we do not pass |args| downstream to make sure \"esm modules\" loaded through here\n // are treated as \"commonjs\", for example for \".mjs\" files.\n // In theory, we should fix this, but it is a breaking change, even for playwright's own tests.\n mod._compile = oldCompile;\n return oldCompile.call(this, transformHook(code, filename), file);\n }\n mod._compile = newCompile;\n }\n originalLoader.call(this, mod, filename, ...loaderArgs);\n }\n loaders[extension] = newLoader;\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBA,oBAAmB;AACnB,kBAAiB;AAEV,SAAS,QAAQ,eAA2D,iBAAgD,YAAsB;AAQvJ,QAAM,wBAAwB,WAAW,OAAO,OAAK,MAAM,MAAM;AACjE,QAAM,yBAAyB,IAAI,IAAI,UAAU;AACjD,QAAM,UAAW,cAAAA,QAAe;AAChC,QAAM,WAAW,QAAQ,KAAK;AAC9B,aAAW,aAAa,uBAAuB;AAE7C,QAASC,aAAT,SAA8B,KAAU,aAAqB,YAAmB;AAC9E,UAAI,uBAAuB,IAAI,YAAAC,QAAK,QAAQ,QAAQ,CAAC,KAAK,gBAAgB,QAAQ,GAAG;AAEnF,YAASC,cAAT,SAA+B,MAAc,SAAiB,aAAoB;AAIhF,cAAI,WAAW;AACf,iBAAO,WAAW,KAAK,MAAM,cAAc,MAAM,QAAQ,GAAG,IAAI;AAAA,QAClE;AANS,yBAAAA;AADT,cAAM,aAAa,IAAI;AAQvB,YAAI,WAAWA;AAAA,MACjB;AACA,qBAAe,KAAK,MAAM,KAAK,UAAU,GAAG,UAAU;AAAA,IACxD;AAbS,oBAAAF;AADT,UAAM,iBAAiB,QAAQ,SAAS,KAAK;AAe7C,YAAQ,SAAS,IAAIA;AAAA,EACvB;AACF;",
|
|
6
|
-
"names": ["Module", "newLoader", "path", "newCompile"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/third_party/tsconfig-loader.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2016 Jonas Kello\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/* eslint-disable */\n\nimport path from 'path';\nimport fs from 'fs';\nimport { json5 } from '../utilsBundle';\n\n/**\n * Typing for the parts of tsconfig that we care about\n */\ninterface TsConfig {\n extends?: string;\n compilerOptions?: {\n baseUrl?: string;\n paths?: { [key: string]: Array<string> };\n strict?: boolean;\n allowJs?: boolean;\n };\n references?: { path: string }[];\n}\n\nexport interface LoadedTsConfig {\n tsConfigPath: string;\n paths?: {\n mapping: { [key: string]: Array<string> };\n pathsBasePath: string; // absolute path\n };\n absoluteBaseUrl?: string;\n allowJs?: boolean;\n}\n\nexport function loadTsConfig(configPath: string): LoadedTsConfig[] {\n try {\n const references: LoadedTsConfig[] = [];\n const config = innerLoadTsConfig(configPath, references);\n return [config, ...references];\n } catch (e) {\n throw new Error(`Failed to load tsconfig file at ${configPath}:\\n${e.message}`);\n }\n}\n\nfunction resolveConfigFile(baseConfigFile: string, referencedConfigFile: string) {\n if (!referencedConfigFile.endsWith('.json'))\n referencedConfigFile += '.json';\n const currentDir = path.dirname(baseConfigFile);\n let resolvedConfigFile = path.resolve(currentDir, referencedConfigFile);\n // TODO: I don't see how this makes sense, delete in the next minor release.\n if (referencedConfigFile.includes('/') && referencedConfigFile.includes('.') && !fs.existsSync(resolvedConfigFile))\n resolvedConfigFile = path.join(currentDir, 'node_modules', referencedConfigFile);\n return resolvedConfigFile;\n}\n\nfunction innerLoadTsConfig(\n configFilePath: string,\n references: LoadedTsConfig[],\n visited = new Map<string, LoadedTsConfig>(),\n): LoadedTsConfig {\n if (visited.has(configFilePath))\n return visited.get(configFilePath)!;\n\n let result: LoadedTsConfig = {\n tsConfigPath: configFilePath,\n };\n // Retain result instance below, so that caching works.\n visited.set(configFilePath, result);\n\n if (!fs.existsSync(configFilePath))\n return result;\n\n const configString = fs.readFileSync(configFilePath, 'utf-8');\n const cleanedJson = StripBom(configString);\n const parsedConfig: TsConfig = json5.parse(cleanedJson);\n\n const extendsArray = Array.isArray(parsedConfig.extends) ? parsedConfig.extends : (parsedConfig.extends ? [parsedConfig.extends] : []);\n for (const extendedConfig of extendsArray) {\n const extendedConfigPath = resolveConfigFile(configFilePath, extendedConfig);\n const base = innerLoadTsConfig(extendedConfigPath, references, visited);\n // Retain result instance, so that caching works.\n Object.assign(result, base, { tsConfigPath: configFilePath });\n }\n\n if (parsedConfig.compilerOptions?.allowJs !== undefined)\n result.allowJs = parsedConfig.compilerOptions.allowJs;\n if (parsedConfig.compilerOptions?.paths !== undefined) {\n // We must store pathsBasePath from the config that defines \"paths\" and later resolve\n // based on this absolute path, when no \"baseUrl\" is specified. See tsc for reference:\n // https://github.com/microsoft/TypeScript/blob/353ccb7688351ae33ccf6e0acb913aa30621eaf4/src/compiler/commandLineParser.ts#L3129\n // https://github.com/microsoft/TypeScript/blob/353ccb7688351ae33ccf6e0acb913aa30621eaf4/src/compiler/moduleSpecifiers.ts#L510\n result.paths = {\n mapping: parsedConfig.compilerOptions.paths,\n pathsBasePath: path.dirname(configFilePath),\n };\n }\n if (parsedConfig.compilerOptions?.baseUrl !== undefined) {\n // Follow tsc and resolve all relative file paths in the config right away.\n // This way it is safe to inherit paths between the configs.\n result.absoluteBaseUrl = path.resolve(path.dirname(configFilePath), parsedConfig.compilerOptions.baseUrl);\n }\n\n for (const ref of parsedConfig.references || [])\n references.push(innerLoadTsConfig(resolveConfigFile(configFilePath, ref.path), references, visited));\n\n if (path.basename(configFilePath) === 'jsconfig.json' && result.allowJs === undefined)\n result.allowJs = true;\n return result;\n}\n\nfunction StripBom(string: string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a string, got ${typeof string}`);\n\t}\n\n\t// Catches EFBBBF (UTF-8 BOM) because the buffer-to-string\n\t// conversion translates it to FEFF (UTF-16 BOM).\n\tif (string.charCodeAt(0) === 0xFEFF) {\n\t\treturn string.slice(1);\n\t}\n\n\treturn string;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BA,kBAAiB;AACjB,gBAAe;AACf,yBAAsB;AA0Bf,SAAS,aAAa,YAAsC;AACjE,MAAI;AACF,UAAM,aAA+B,CAAC;AACtC,UAAM,SAAS,kBAAkB,YAAY,UAAU;AACvD,WAAO,CAAC,QAAQ,GAAG,UAAU;AAAA,EAC/B,SAAS,GAAG;AACV,UAAM,IAAI,MAAM,mCAAmC,UAAU;AAAA,EAAM,EAAE,OAAO,EAAE;AAAA,EAChF;AACF;AAEA,SAAS,kBAAkB,gBAAwB,sBAA8B;AAC/E,MAAI,CAAC,qBAAqB,SAAS,OAAO;AACxC,4BAAwB;AAC1B,QAAM,aAAa,YAAAA,QAAK,QAAQ,cAAc;AAC9C,MAAI,qBAAqB,YAAAA,QAAK,QAAQ,YAAY,oBAAoB;AAEtE,MAAI,qBAAqB,SAAS,GAAG,KAAK,qBAAqB,SAAS,GAAG,KAAK,CAAC,UAAAC,QAAG,WAAW,kBAAkB;AAC/G,yBAAqB,YAAAD,QAAK,KAAK,YAAY,gBAAgB,oBAAoB;AACjF,SAAO;AACT;AAEA,SAAS,kBACP,gBACA,YACA,UAAU,oBAAI,IAA4B,GAC1B;AAChB,MAAI,QAAQ,IAAI,cAAc;AAC5B,WAAO,QAAQ,IAAI,cAAc;AAEnC,MAAI,SAAyB;AAAA,IAC3B,cAAc;AAAA,EAChB;AAEA,UAAQ,IAAI,gBAAgB,MAAM;AAElC,MAAI,CAAC,UAAAC,QAAG,WAAW,cAAc;AAC/B,WAAO;AAET,QAAM,eAAe,UAAAA,QAAG,aAAa,gBAAgB,OAAO;AAC5D,QAAM,cAAc,SAAS,YAAY;AACzC,QAAM,eAAyB,yBAAM,MAAM,WAAW;AAEtD,QAAM,eAAe,MAAM,QAAQ,aAAa,OAAO,IAAI,aAAa,UAAW,aAAa,UAAU,CAAC,aAAa,OAAO,IAAI,CAAC;AACpI,aAAW,kBAAkB,cAAc;AACzC,UAAM,qBAAqB,kBAAkB,gBAAgB,cAAc;AAC3E,UAAM,OAAO,kBAAkB,oBAAoB,YAAY,OAAO;AAEtE,WAAO,OAAO,QAAQ,MAAM,EAAE,cAAc,eAAe,CAAC;AAAA,EAC9D;AAEA,MAAI,aAAa,iBAAiB,YAAY;AAC5C,WAAO,UAAU,aAAa,gBAAgB;AAChD,MAAI,aAAa,iBAAiB,UAAU,QAAW;AAKrD,WAAO,QAAQ;AAAA,MACb,SAAS,aAAa,gBAAgB;AAAA,MACtC,eAAe,YAAAD,QAAK,QAAQ,cAAc;AAAA,IAC5C;AAAA,EACF;AACA,MAAI,aAAa,iBAAiB,YAAY,QAAW;AAGvD,WAAO,kBAAkB,YAAAA,QAAK,QAAQ,YAAAA,QAAK,QAAQ,cAAc,GAAG,aAAa,gBAAgB,OAAO;AAAA,EAC1G;AAEA,aAAW,OAAO,aAAa,cAAc,CAAC;AAC5C,eAAW,KAAK,kBAAkB,kBAAkB,gBAAgB,IAAI,IAAI,GAAG,YAAY,OAAO,CAAC;AAErG,MAAI,YAAAA,QAAK,SAAS,cAAc,MAAM,mBAAmB,OAAO,YAAY;AAC1E,WAAO,UAAU;AACnB,SAAO;AACT;AAEA,SAAS,SAAS,QAAgB;AACjC,MAAI,OAAO,WAAW,UAAU;AAC/B,UAAM,IAAI,UAAU,0BAA0B,OAAO,MAAM,EAAE;AAAA,EAC9D;AAIA,MAAI,OAAO,WAAW,CAAC,MAAM,OAAQ;AACpC,WAAO,OAAO,MAAM,CAAC;AAAA,EACtB;AAEA,SAAO;AACR;",
|
|
6
|
-
"names": ["path", "fs"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/transform/babelBundle.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { BabelFileResult, ParseResult } from '../../bundles/babel/node_modules/@types/babel__core';\nexport const codeFrameColumns: typeof import('../../bundles/babel/node_modules/@types/babel__code-frame').codeFrameColumns = require('./babelBundleImpl').codeFrameColumns;\nexport const declare: typeof import('../../bundles/babel/node_modules/@types/babel__helper-plugin-utils').declare = require('./babelBundleImpl').declare;\nexport const types: typeof import('../../bundles/babel/node_modules/@types/babel__core').types = require('./babelBundleImpl').types;\nexport const traverse: typeof import('../../bundles/babel/node_modules/@types/babel__traverse').default = require('./babelBundleImpl').traverse;\nexport type BabelPlugin = [string, any?];\nexport type BabelTransformFunction = (code: string, filename: string, isModule: boolean, pluginsPrefix: BabelPlugin[], pluginsSuffix: BabelPlugin[]) => BabelFileResult | null;\nexport const babelTransform: BabelTransformFunction = require('./babelBundleImpl').babelTransform;\nexport type BabelParseFunction = (code: string, filename: string, isModule: boolean) => ParseResult;\nexport const babelParse: BabelParseFunction = require('./babelBundleImpl').babelParse;\nexport type { NodePath, PluginObj, types as T } from '../../bundles/babel/node_modules/@types/babel__core';\nexport type { BabelAPI } from '../../bundles/babel/node_modules/@types/babel__helper-plugin-utils';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBO,MAAM,mBAAgH,QAAQ,mBAAmB,EAAE;AACnJ,MAAM,UAAuG,QAAQ,mBAAmB,EAAE;AAC1I,MAAM,QAAoF,QAAQ,mBAAmB,EAAE;AACvH,MAAM,WAA6F,QAAQ,mBAAmB,EAAE;AAGhI,MAAM,iBAAyC,QAAQ,mBAAmB,EAAE;AAE5E,MAAM,aAAiC,QAAQ,mBAAmB,EAAE;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|