From 300f46c48e02c2c1b65a8aa387e6aed294299f78 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 8 Nov 2024 15:46:19 -0800 Subject: [PATCH] feat(compartment-mapper): Workspace language-for-extension options --- packages/compartment-mapper/src/archive.js | 24 ++ packages/compartment-mapper/src/bundle.js | 23 ++ packages/compartment-mapper/src/import.js | 6 + .../compartment-mapper/src/node-modules.js | 44 ++- .../compartment-mapper/src/types/external.ts | 16 +- .../packages/commonjs-app/module.xsonp | 1 + .../packages/commonjs-app/package.json | 7 + .../packages/module-app/module.xsonp | 1 + .../packages/module-app/package.json | 7 + .../packages/parsers-app/module.xsonp | 1 + .../packages/parsers-app/package.json | 9 + .../test/language-for-extension.test.js | 248 ++++++++++--- .../test/missing-entry.test.js | 8 +- packages/compartment-mapper/test/scaffold.js | 42 +++ .../language-for-extension.test.js.md | 329 ++++++++++++++++++ .../language-for-extension.test.js.snap | Bin 0 -> 1110 bytes 16 files changed, 709 insertions(+), 57 deletions(-) create mode 100644 packages/compartment-mapper/test/fixtures-language-for-extension/packages/commonjs-app/module.xsonp create mode 100644 packages/compartment-mapper/test/fixtures-language-for-extension/packages/commonjs-app/package.json create mode 100644 packages/compartment-mapper/test/fixtures-language-for-extension/packages/module-app/module.xsonp create mode 100644 packages/compartment-mapper/test/fixtures-language-for-extension/packages/module-app/package.json create mode 100644 packages/compartment-mapper/test/fixtures-language-for-extension/packages/parsers-app/module.xsonp create mode 100644 packages/compartment-mapper/test/fixtures-language-for-extension/packages/parsers-app/package.json create mode 100644 packages/compartment-mapper/test/snapshots/language-for-extension.test.js.md create mode 100644 packages/compartment-mapper/test/snapshots/language-for-extension.test.js.snap diff --git a/packages/compartment-mapper/src/archive.js b/packages/compartment-mapper/src/archive.js index 992449b25f..b9b4af7837 100644 --- a/packages/compartment-mapper/src/archive.js +++ b/packages/compartment-mapper/src/archive.js @@ -90,6 +90,9 @@ export const makeArchive = async (powers, moduleLocation, options = {}) => { languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, parserForLanguage, languages, ...otherOptions @@ -102,6 +105,9 @@ export const makeArchive = async (powers, moduleLocation, options = {}) => { languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, languages, }); @@ -130,6 +136,9 @@ export const mapLocation = async (powers, moduleLocation, options = {}) => { languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...otherOptions } = assignParserForLanguage(options); @@ -142,6 +151,9 @@ export const mapLocation = async (powers, moduleLocation, options = {}) => { languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, }); return mapFromMap(powers, compartmentMap, { @@ -169,6 +181,9 @@ export const hashLocation = async (powers, moduleLocation, options = {}) => { languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...otherOptions } = assignParserForLanguage(options); @@ -181,6 +196,9 @@ export const hashLocation = async (powers, moduleLocation, options = {}) => { languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, }); return hashFromMap(powers, compartmentMap, { @@ -215,6 +233,9 @@ export const writeArchive = async ( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...otherOptions } = assignParserForLanguage(options); const compartmentMap = await mapNodeModules(readPowers, moduleLocation, { @@ -225,6 +246,9 @@ export const writeArchive = async ( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, languages, }); return writeArchiveFromMap( diff --git a/packages/compartment-mapper/src/bundle.js b/packages/compartment-mapper/src/bundle.js index 068f205433..fe63135f1b 100644 --- a/packages/compartment-mapper/src/bundle.js +++ b/packages/compartment-mapper/src/bundle.js @@ -237,6 +237,11 @@ export const makeBundle = async (readPowers, moduleLocation, options) => { languageForExtension: languageForExtensionOption = {}, commonjsLanguageForExtension: commonjsLanguageForExtensionOption = {}, moduleLanguageForExtension: moduleLanguageForExtensionOption = {}, + workspaceLanguageForExtension: workspaceLanguageForExtensionOption = {}, + workspaceCommonjsLanguageForExtension: + workspaceCommonjsLanguageForExtensionOption = {}, + workspaceModuleLanguageForExtension: + workspaceModuleLanguageForExtensionOption = {}, } = options || {}; const conditions = new Set(conditionsOption); @@ -256,6 +261,21 @@ export const makeBundle = async (readPowers, moduleLocation, options) => { const moduleLanguageForExtension = Object.freeze( Object.assign(Object.create(null), moduleLanguageForExtensionOption), ); + const workspaceLanguageForExtension = Object.freeze( + Object.assign(Object.create(null), workspaceLanguageForExtensionOption), + ); + const workspaceCommonjsLanguageForExtension = Object.freeze( + Object.assign( + Object.create(null), + workspaceCommonjsLanguageForExtensionOption, + ), + ); + const workspaceModuleLanguageForExtension = Object.freeze( + Object.assign( + Object.create(null), + workspaceModuleLanguageForExtensionOption, + ), + ); const { packageLocation, @@ -280,6 +300,9 @@ export const makeBundle = async (readPowers, moduleLocation, options) => { languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, }, ); diff --git a/packages/compartment-mapper/src/import.js b/packages/compartment-mapper/src/import.js index faf7c48bc3..1c6c3cedef 100644 --- a/packages/compartment-mapper/src/import.js +++ b/packages/compartment-mapper/src/import.js @@ -83,6 +83,9 @@ export const loadLocation = async ( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...otherOptions } = assignParserForLanguage(options); // conditions are not present in SyncArchiveOptions @@ -96,6 +99,9 @@ export const loadLocation = async ( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, languages, }); return loadFromMap(readPowers, compartmentMap, { diff --git a/packages/compartment-mapper/src/node-modules.js b/packages/compartment-mapper/src/node-modules.js index f8754c681c..a3f41ace75 100644 --- a/packages/compartment-mapper/src/node-modules.js +++ b/packages/compartment-mapper/src/node-modules.js @@ -61,6 +61,8 @@ * @typedef {object} LanguageOptions * @property {LanguageForExtension} commonjsLanguageForExtension * @property {LanguageForExtension} moduleLanguageForExtension + * @property {LanguageForExtension} workspaceCommonjsLanguageForExtension + * @property {LanguageForExtension} workspaceModuleLanguageForExtension * @property {Set} languages */ @@ -217,12 +219,22 @@ const defaultModuleLanguageForExtension = /** @type {const} */ ({ * @returns {Record} */ const inferParsers = (descriptor, location, languageOptions) => { + let { moduleLanguageForExtension, commonjsLanguageForExtension } = + languageOptions; const { languages, - moduleLanguageForExtension, - commonjsLanguageForExtension, + workspaceModuleLanguageForExtension, + workspaceCommonjsLanguageForExtension, } = languageOptions; + // Select languageForExtension options based on whether they are physically + // under node_modules, indicating that they have not been built for npm, + // so any languages that compile to JavaScript may need additional parsers. + if (!location.includes('/node_modules/')) { + moduleLanguageForExtension = workspaceModuleLanguageForExtension; + commonjsLanguageForExtension = workspaceCommonjsLanguageForExtension; + } + const { type, module, @@ -771,6 +783,9 @@ const translateGraph = ( * 'languageForExtension' | * 'moduleLanguageForExtension' | * 'commonjsLanguageForExtension' | + * 'workspaceLanguageForExtension' | + * 'workspaceModuleLanguageForExtension' | + * 'workspaceCommonjsLanguageForExtension' | * 'languages' * >} options */ @@ -778,6 +793,11 @@ const makeLanguageOptions = ({ languageForExtension: additionalLanguageForExtension = {}, moduleLanguageForExtension: additionalModuleLanguageForExtension = {}, commonjsLanguageForExtension: additionalCommonjsLanguageForExtension = {}, + workspaceLanguageForExtension: additionalWorkspaceLanguageForExtension = {}, + workspaceModuleLanguageForExtension: + additionalWorkspaceModuleLanguageForExtension = {}, + workspaceCommonjsLanguageForExtension: + additionalWorkspaceCommonjsLanguageForExtension = {}, languages: additionalLanguages = [], }) => { const commonjsLanguageForExtension = { @@ -792,10 +812,28 @@ const makeLanguageOptions = ({ ...defaultModuleLanguageForExtension, ...additionalModuleLanguageForExtension, }; + const workspaceCommonjsLanguageForExtension = { + ...defaultLanguageForExtension, + ...additionalLanguageForExtension, + ...defaultCommonjsLanguageForExtension, + ...additionalCommonjsLanguageForExtension, + ...additionalWorkspaceLanguageForExtension, + ...additionalWorkspaceCommonjsLanguageForExtension, + }; + const workspaceModuleLanguageForExtension = { + ...defaultLanguageForExtension, + ...additionalLanguageForExtension, + ...defaultModuleLanguageForExtension, + ...additionalModuleLanguageForExtension, + ...additionalWorkspaceLanguageForExtension, + ...additionalWorkspaceModuleLanguageForExtension, + }; const languages = new Set([ ...Object.values(moduleLanguageForExtension), ...Object.values(commonjsLanguageForExtension), + ...Object.values(workspaceModuleLanguageForExtension), + ...Object.values(workspaceCommonjsLanguageForExtension), ...additionalLanguages, ]); @@ -803,6 +841,8 @@ const makeLanguageOptions = ({ languages, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, }; }; diff --git a/packages/compartment-mapper/src/types/external.ts b/packages/compartment-mapper/src/types/external.ts index b922cb66f7..d0de4e9916 100644 --- a/packages/compartment-mapper/src/types/external.ts +++ b/packages/compartment-mapper/src/types/external.ts @@ -71,10 +71,22 @@ type MapNodeModulesOptionsOmitPolicy = Partial<{ commonDependencies: Record; /** Maps extensions to languages for all packages, like `txt` to `text` */ languageForExtension: LanguageForExtension; - /** Maps extensions to languages for all type=module packages */ + /** Maps additional extensions to languages for all type=module packages */ moduleLanguageForExtension: LanguageForExtension; - /** Maps extensions to languages for all type=commonjs packages (default) */ + /** Maps additional extensions to languages for all type=commonjs packages (default) */ commonjsLanguageForExtension: LanguageForExtension; + /** Maps extensions to languages for packages not under node_modules */ + workspaceLanguageForExtension: LanguageForExtension; + /** + * Maps additional extensions to languages for all type=module packages that + * are not under node_modules + */ + workspaceModuleLanguageForExtension: LanguageForExtension; + /** + * Maps additional extensions to languages for all type=commonjs packages + * (default) + */ + workspaceCommonjsLanguageForExtension: LanguageForExtension; /** * Accounts for languages not present as values in any of the extension to * language mappings. diff --git a/packages/compartment-mapper/test/fixtures-language-for-extension/packages/commonjs-app/module.xsonp b/packages/compartment-mapper/test/fixtures-language-for-extension/packages/commonjs-app/module.xsonp new file mode 100644 index 0000000000..f1dad2cdf6 --- /dev/null +++ b/packages/compartment-mapper/test/fixtures-language-for-extension/packages/commonjs-app/module.xsonp @@ -0,0 +1 @@ +exports({ meaning: 42 }); diff --git a/packages/compartment-mapper/test/fixtures-language-for-extension/packages/commonjs-app/package.json b/packages/compartment-mapper/test/fixtures-language-for-extension/packages/commonjs-app/package.json new file mode 100644 index 0000000000..cec862f1c0 --- /dev/null +++ b/packages/compartment-mapper/test/fixtures-language-for-extension/packages/commonjs-app/package.json @@ -0,0 +1,7 @@ +{ + "name": "app", + "type": "commonjs", + "scripts": { + "preinstall": "echo DO NOT INSTALL TEST FIXTURES; exit -1" + } +} diff --git a/packages/compartment-mapper/test/fixtures-language-for-extension/packages/module-app/module.xsonp b/packages/compartment-mapper/test/fixtures-language-for-extension/packages/module-app/module.xsonp new file mode 100644 index 0000000000..f1dad2cdf6 --- /dev/null +++ b/packages/compartment-mapper/test/fixtures-language-for-extension/packages/module-app/module.xsonp @@ -0,0 +1 @@ +exports({ meaning: 42 }); diff --git a/packages/compartment-mapper/test/fixtures-language-for-extension/packages/module-app/package.json b/packages/compartment-mapper/test/fixtures-language-for-extension/packages/module-app/package.json new file mode 100644 index 0000000000..68d335f7bd --- /dev/null +++ b/packages/compartment-mapper/test/fixtures-language-for-extension/packages/module-app/package.json @@ -0,0 +1,7 @@ +{ + "name": "app", + "type": "module", + "scripts": { + "preinstall": "echo DO NOT INSTALL TEST FIXTURES; exit -1" + } +} diff --git a/packages/compartment-mapper/test/fixtures-language-for-extension/packages/parsers-app/module.xsonp b/packages/compartment-mapper/test/fixtures-language-for-extension/packages/parsers-app/module.xsonp new file mode 100644 index 0000000000..f1dad2cdf6 --- /dev/null +++ b/packages/compartment-mapper/test/fixtures-language-for-extension/packages/parsers-app/module.xsonp @@ -0,0 +1 @@ +exports({ meaning: 42 }); diff --git a/packages/compartment-mapper/test/fixtures-language-for-extension/packages/parsers-app/package.json b/packages/compartment-mapper/test/fixtures-language-for-extension/packages/parsers-app/package.json new file mode 100644 index 0000000000..8004f6bd58 --- /dev/null +++ b/packages/compartment-mapper/test/fixtures-language-for-extension/packages/parsers-app/package.json @@ -0,0 +1,9 @@ +{ + "name": "app", + "parsers": { + "xsonp": "jsonp" + }, + "scripts": { + "preinstall": "echo DO NOT INSTALL TEST FIXTURES; exit -1" + } +} diff --git a/packages/compartment-mapper/test/language-for-extension.test.js b/packages/compartment-mapper/test/language-for-extension.test.js index 591cae76d3..6e6d3ae4c6 100644 --- a/packages/compartment-mapper/test/language-for-extension.test.js +++ b/packages/compartment-mapper/test/language-for-extension.test.js @@ -1,6 +1,6 @@ import 'ses'; import test from 'ava'; -import { scaffold } from './scaffold.js'; +import { scaffold, sanitizePaths } from './scaffold.js'; import jsonp from './_parse-jsonp.js'; // The JSONP parser uses harden, as a bit. @@ -9,6 +9,22 @@ lockdown({ errorTrapping: 'none', }); +const meaningfulModule = { + default: { + meaning: 42, + }, + __proto__: { + __proto__: null, + [Symbol.toStringTag]: 'Module', + }, +}; + +const assertions = (t, { namespace }) => { + t.deepEqual(namespace, meaningfulModule); +}; + +const assertionCount = 1; + scaffold( 'languageForExtension', test, @@ -16,18 +32,8 @@ scaffold( 'fixtures-language-for-extension/node_modules/module-app/module.xsonp', import.meta.url, ).href, - (t, { namespace }) => { - t.deepEqual(namespace, { - default: { - meaning: 42, - }, - __proto__: { - __proto__: null, - [Symbol.toStringTag]: 'Module', - }, - }); - }, - 1, + assertions, + assertionCount, { parserForLanguage: { jsonp }, languageForExtension: { xsonp: 'jsonp' }, @@ -41,21 +47,30 @@ scaffold( 'fixtures-language-for-extension/node_modules/module-app/module.xsonp', import.meta.url, ).href, - (t, { namespace }) => { - t.deepEqual(namespace, { - default: { - meaning: 42, - }, - __proto__: { - __proto__: null, - [Symbol.toStringTag]: 'Module', - }, - }); - }, - 1, + assertions, + assertionCount, + { + parserForLanguage: { jsonp }, + moduleLanguageForExtension: { xsonp: 'jsonp' }, + }, +); + +scaffold( + 'moduleLanguageForExtension should not be available in commonjs package', + test, + new URL( + 'fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp', + import.meta.url, + ).href, + assertions, + 1, // expected number of assertions { parserForLanguage: { jsonp }, moduleLanguageForExtension: { xsonp: 'jsonp' }, + shouldFailBeforeArchiveOperations: true, + onError(t, { error }) { + t.snapshot(sanitizePaths(error.message)); + }, }, ); @@ -66,21 +81,30 @@ scaffold( 'fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp', import.meta.url, ).href, - (t, { namespace }) => { - t.deepEqual(namespace, { - default: { - meaning: 42, - }, - __proto__: { - __proto__: null, - [Symbol.toStringTag]: 'Module', - }, - }); - }, - 1, + assertions, + assertionCount, + { + parserForLanguage: { jsonp }, + commonjsLanguageForExtension: { xsonp: 'jsonp' }, + }, +); + +scaffold( + 'commonjsLanguageForExtension should not be available in module package', + test, + new URL( + 'fixtures-language-for-extension/node_modules/module-app/module.xsonp', + import.meta.url, + ).href, + assertions, + 1, // expected number of assertions { parserForLanguage: { jsonp }, commonjsLanguageForExtension: { xsonp: 'jsonp' }, + shouldFailBeforeArchiveOperations: true, + onError(t, { error }) { + t.snapshot(sanitizePaths(error.message)); + }, }, ); @@ -91,20 +115,146 @@ scaffold( 'fixtures-language-for-extension/node_modules/parsers-app/module.xsonp', import.meta.url, ).href, - (t, { namespace }) => { - t.deepEqual(namespace, { - default: { - meaning: 42, - }, - __proto__: { - __proto__: null, - [Symbol.toStringTag]: 'Module', - }, - }); - }, - 1, + assertions, + assertionCount, { parserForLanguage: { jsonp }, languageForExtension: { xsonp: 'text' }, }, ); + +scaffold( + 'workspaceLanguageForExtension', + test, + new URL( + 'fixtures-language-for-extension/packages/module-app/module.xsonp', + import.meta.url, + ).href, + assertions, + assertionCount, + { + parserForLanguage: { jsonp }, + workspaceLanguageForExtension: { xsonp: 'jsonp' }, + }, +); + +scaffold( + 'workspaceModuleLanguageForExtension', + test, + new URL( + 'fixtures-language-for-extension/packages/module-app/module.xsonp', + import.meta.url, + ).href, + assertions, + assertionCount, + { + parserForLanguage: { jsonp }, + workspaceModuleLanguageForExtension: { xsonp: 'jsonp' }, + }, +); + +scaffold( + 'workspaceModuleLanguageForExtension should not be available in commonjs package', + test, + new URL( + 'fixtures-language-for-extension/package/commonjs-app/module.xsonp', + import.meta.url, + ).href, + assertions, + 1, // expected number of assertions + { + parserForLanguage: { jsonp }, + workspaceModuleLanguageForExtension: { xsonp: 'jsonp' }, + shouldFailBeforeArchiveOperations: true, + onError(t, { error }) { + t.snapshot(sanitizePaths(error.message)); + }, + }, +); + +scaffold( + 'workspaceModuleLanguageForExtension should not be available under node_modules', + test, + new URL( + 'fixtures-language-for-extension/node_modules/module-app/module.xsonp', + import.meta.url, + ).href, + assertions, + 1, // expected number of assertions + { + parserForLanguage: { jsonp }, + workspaceModuleLanguageForExtension: { xsonp: 'jsonp' }, + shouldFailBeforeArchiveOperations: true, + onError(t, { error }) { + t.snapshot(sanitizePaths(error.message)); + }, + }, +); + +scaffold( + 'workspaceCommonjsLanguageForExtension', + test, + new URL( + 'fixtures-language-for-extension/packages/commonjs-app/module.xsonp', + import.meta.url, + ).href, + assertions, + assertionCount, + { + parserForLanguage: { jsonp }, + workspaceCommonjsLanguageForExtension: { xsonp: 'jsonp' }, + }, +); + +scaffold( + 'workspaceCommonjsLanguageForExtension should not be available in module package', + test, + new URL( + 'fixtures-language-for-extension/packages/module-app/module.xsonp', + import.meta.url, + ).href, + assertions, + 1, // expected number of assertions + { + parserForLanguage: { jsonp }, + workspaceCommonjsLanguageForExtension: { xsonp: 'jsonp' }, + shouldFailBeforeArchiveOperations: true, + onError(t, { error }) { + t.snapshot(sanitizePaths(error.message)); + }, + }, +); + +scaffold( + 'workspaceCommonjsLanguageForExtension should not be available under node_modules', + test, + new URL( + 'fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp', + import.meta.url, + ).href, + assertions, + 1, // expected number of assertions + { + parserForLanguage: { jsonp }, + workspaceCommonjsLanguageForExtension: { xsonp: 'jsonp' }, + shouldFailBeforeArchiveOperations: true, + onError(t, { error }) { + t.snapshot(sanitizePaths(error.message)); + }, + }, +); + +scaffold( + 'package.json parsers override workspaceLanguageForExtension', + test, + new URL( + 'fixtures-language-for-extension/packages/parsers-app/module.xsonp', + import.meta.url, + ).href, + assertions, + assertionCount, + { + parserForLanguage: { jsonp }, + workspaceLanguageForExtension: { xsonp: 'text' }, + }, +); diff --git a/packages/compartment-mapper/test/missing-entry.test.js b/packages/compartment-mapper/test/missing-entry.test.js index f53cff9bdd..4c2f70becc 100644 --- a/packages/compartment-mapper/test/missing-entry.test.js +++ b/packages/compartment-mapper/test/missing-entry.test.js @@ -1,6 +1,5 @@ import 'ses'; import test from 'ava'; -import path from 'path'; import fs from 'fs'; import url from 'url'; import crypto from 'crypto'; @@ -11,9 +10,10 @@ import { makeReadPowers } from '../node-powers.js'; const readPowers = makeReadPowers({ fs, url, crypto }); test('missing entry', async t => { - const entry = url.pathToFileURL( - path.resolve('i-solemnly-swear-i-do-not-exist.js'), - ); + const entry = new URL( + 'fixtures-missing/i-solemnly-swear-i-do-not-exist.js', + import.meta.url, + ).href; await t.throwsAsync( makeAndHashArchive(readPowers, entry, {}).then(() => {}), { diff --git a/packages/compartment-mapper/test/scaffold.js b/packages/compartment-mapper/test/scaffold.js index a150378726..00ee4ea127 100644 --- a/packages/compartment-mapper/test/scaffold.js +++ b/packages/compartment-mapper/test/scaffold.js @@ -101,6 +101,9 @@ export function scaffold( languageForExtension = undefined, commonjsLanguageForExtension = undefined, moduleLanguageForExtension = undefined, + workspaceLanguageForExtension = undefined, + workspaceCommonjsLanguageForExtension = undefined, + workspaceModuleLanguageForExtension = undefined, additionalOptions = {}, } = {}, ) { @@ -148,6 +151,9 @@ export function scaffold( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...additionalOptions, }); const { namespace } = await application.import({ @@ -180,6 +186,9 @@ export function scaffold( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...additionalOptions, }); @@ -221,6 +230,9 @@ export function scaffold( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...additionalOptions, }); @@ -262,6 +274,9 @@ export function scaffold( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...additionalOptions, }); return namespace; @@ -283,6 +298,9 @@ export function scaffold( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...additionalOptions, }); const application = await parseArchive(archive, '', { @@ -325,6 +343,9 @@ export function scaffold( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...additionalOptions, }); const prefixArchive = new Uint8Array(archive.length + 10); @@ -375,6 +396,9 @@ export function scaffold( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...additionalOptions, }); const application = await loadArchive(fakeRead, 'app.agar', { @@ -434,6 +458,9 @@ export function scaffold( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...additionalOptions, }); @@ -478,6 +505,9 @@ export function scaffold( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...additionalOptions, }); @@ -529,6 +559,9 @@ export function scaffold( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...additionalOptions, }); @@ -541,6 +574,9 @@ export function scaffold( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...additionalOptions, }); @@ -575,6 +611,9 @@ export function scaffold( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...additionalOptions, }); @@ -587,6 +626,9 @@ export function scaffold( languageForExtension, commonjsLanguageForExtension, moduleLanguageForExtension, + workspaceLanguageForExtension, + workspaceCommonjsLanguageForExtension, + workspaceModuleLanguageForExtension, ...additionalOptions, }); diff --git a/packages/compartment-mapper/test/snapshots/language-for-extension.test.js.md b/packages/compartment-mapper/test/snapshots/language-for-extension.test.js.md new file mode 100644 index 0000000000..684f541900 --- /dev/null +++ b/packages/compartment-mapper/test/snapshots/language-for-extension.test.js.md @@ -0,0 +1,329 @@ +# Snapshot report for `test/language-for-extension.test.js` + +The actual snapshot is saved in `language-for-extension.test.js.snap`. + +Generated by [AVA](https://avajs.dev). + +## moduleLanguageForExtension should not be available in commonjs package / loadLocation + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## moduleLanguageForExtension should not be available in commonjs package / mapNodeModules / importFromMap + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## moduleLanguageForExtension should not be available in commonjs package / mapNodeModules / loadFromMap / import + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## moduleLanguageForExtension should not be available in commonjs package / importLocation + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## moduleLanguageForExtension should not be available in commonjs package / makeArchive / parseArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## moduleLanguageForExtension should not be available in commonjs package / makeArchive / parseArchive with a prefix + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## moduleLanguageForExtension should not be available in commonjs package / writeArchive / loadArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## moduleLanguageForExtension should not be available in commonjs package / writeArchive / importArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## moduleLanguageForExtension should not be available in commonjs package / mapNodeModules / makeArchiveFromMap / importArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## commonjsLanguageForExtension should not be available in module package / loadLocation + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## commonjsLanguageForExtension should not be available in module package / mapNodeModules / importFromMap + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## commonjsLanguageForExtension should not be available in module package / mapNodeModules / loadFromMap / import + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## commonjsLanguageForExtension should not be available in module package / importLocation + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## commonjsLanguageForExtension should not be available in module package / makeArchive / parseArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## commonjsLanguageForExtension should not be available in module package / makeArchive / parseArchive with a prefix + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## commonjsLanguageForExtension should not be available in module package / writeArchive / loadArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## commonjsLanguageForExtension should not be available in module package / writeArchive / importArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## commonjsLanguageForExtension should not be available in module package / mapNodeModules / makeArchiveFromMap / importArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceModuleLanguageForExtension should not be available in commonjs package / loadLocation + +> Snapshot 1 + + 'Failed to load module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" in package "file://.../compartment-mapper/" (1 underlying failures: Cannot find file for internal module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" (with candidates "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.node", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.node") in package file://.../compartment-mapper/' + +## workspaceModuleLanguageForExtension should not be available in commonjs package / mapNodeModules / importFromMap + +> Snapshot 1 + + 'Failed to load module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" in package "file://.../compartment-mapper/" (1 underlying failures: Cannot find file for internal module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" (with candidates "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.node", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.node") in package file://.../compartment-mapper/' + +## workspaceModuleLanguageForExtension should not be available in commonjs package / mapNodeModules / loadFromMap / import + +> Snapshot 1 + + 'Failed to load module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" in package "file://.../compartment-mapper/" (1 underlying failures: Cannot find file for internal module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" (with candidates "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.node", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.node") in package file://.../compartment-mapper/' + +## workspaceModuleLanguageForExtension should not be available in commonjs package / importLocation + +> Snapshot 1 + + 'Failed to load module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" in package "file://.../compartment-mapper/" (1 underlying failures: Cannot find file for internal module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" (with candidates "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.node", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.node") in package file://.../compartment-mapper/' + +## workspaceModuleLanguageForExtension should not be available in commonjs package / makeArchive / parseArchive + +> Snapshot 1 + + 'Failed to load module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" in package "file://.../compartment-mapper/" (1 underlying failures: Cannot find file for internal module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" (with candidates "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.node", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.node") in package file://.../compartment-mapper/' + +## workspaceModuleLanguageForExtension should not be available in commonjs package / makeArchive / parseArchive with a prefix + +> Snapshot 1 + + 'Failed to load module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" in package "file://.../compartment-mapper/" (1 underlying failures: Cannot find file for internal module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" (with candidates "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.node", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.node") in package file://.../compartment-mapper/' + +## workspaceModuleLanguageForExtension should not be available in commonjs package / writeArchive / loadArchive + +> Snapshot 1 + + 'Failed to load module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" in package "file://.../compartment-mapper/" (1 underlying failures: Cannot find file for internal module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" (with candidates "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.node", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.node") in package file://.../compartment-mapper/' + +## workspaceModuleLanguageForExtension should not be available in commonjs package / writeArchive / importArchive + +> Snapshot 1 + + 'Failed to load module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" in package "file://.../compartment-mapper/" (1 underlying failures: Cannot find file for internal module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" (with candidates "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.node", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.node") in package file://.../compartment-mapper/' + +## workspaceModuleLanguageForExtension should not be available in commonjs package / mapNodeModules / makeArchiveFromMap / importArchive + +> Snapshot 1 + + 'Failed to load module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" in package "file://.../compartment-mapper/" (1 underlying failures: Cannot find file for internal module "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp" (with candidates "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp.node", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.js", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.json", "./test/fixtures-language-for-extension/package/commonjs-app/module.xsonp/index.node") in package file://.../compartment-mapper/' + +## workspaceModuleLanguageForExtension should not be available under node_modules / loadLocation + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceModuleLanguageForExtension should not be available under node_modules / mapNodeModules / importFromMap + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceModuleLanguageForExtension should not be available under node_modules / mapNodeModules / loadFromMap / import + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceModuleLanguageForExtension should not be available under node_modules / importLocation + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceModuleLanguageForExtension should not be available under node_modules / makeArchive / parseArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceModuleLanguageForExtension should not be available under node_modules / makeArchive / parseArchive with a prefix + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceModuleLanguageForExtension should not be available under node_modules / writeArchive / loadArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceModuleLanguageForExtension should not be available under node_modules / writeArchive / importArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceModuleLanguageForExtension should not be available under node_modules / mapNodeModules / makeArchiveFromMap / importArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available in module package / loadLocation + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available in module package / mapNodeModules / importFromMap + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available in module package / mapNodeModules / loadFromMap / import + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available in module package / importLocation + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available in module package / makeArchive / parseArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available in module package / makeArchive / parseArchive with a prefix + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available in module package / writeArchive / loadArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available in module package / writeArchive / importArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available in module package / mapNodeModules / makeArchiveFromMap / importArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../module-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../module-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available under node_modules / loadLocation + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available under node_modules / mapNodeModules / importFromMap + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available under node_modules / mapNodeModules / loadFromMap / import + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available under node_modules / importLocation + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available under node_modules / makeArchive / parseArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available under node_modules / makeArchive / parseArchive with a prefix + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available under node_modules / writeArchive / loadArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available under node_modules / writeArchive / importArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' + +## workspaceCommonjsLanguageForExtension should not be available under node_modules / mapNodeModules / makeArchiveFromMap / importArchive + +> Snapshot 1 + + 'Failed to load module "./module.xsonp" in package "file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/" (1 underlying failures: Cannot parse module ./module.xsonp at file://.../compartment-mapper/test/fixtures-language-for-extension/node_modules/commonjs-app/module.xsonp, no parser configured for the language xsonp' diff --git a/packages/compartment-mapper/test/snapshots/language-for-extension.test.js.snap b/packages/compartment-mapper/test/snapshots/language-for-extension.test.js.snap new file mode 100644 index 0000000000000000000000000000000000000000..35fa4cc350c95c923aff06061659cef99ec2f480 GIT binary patch literal 1110 zcmV-c1gZN$RzV>rB=00000000B+ok36AFcinj(6sZufz=a}Xro;;&@W=6wH@}Fc znvvOYB!USehnNp1ct{R}dNkHmxphzpGd1mR0e86Gf#C`Z1CBEipNB(Xon zLxMcS1P%^`k2MvX#vIFdBy{}sJ_xYJAGapkofn08>T+q(%CNDC-95 z_Py+<{wx+;c9U!6m*|F+kv-4r_xqkNB8iob2-m#`OG%WcNvyq)&h$i)xX0!<)C+~` zk^GiCE&_6zT_N`Jo9JOFy)N2$jV3%Gid|7YL?NauX=xAbW1fUSVil9TpUd4uSR<>Q zTfEpV;v(yeLcZW39ZnPpP$(4ABZBg_QTod{=Akjn5ti>oK#sC*A`j6>3Z)N}h>oxX z@Q#7!_P{6j=GY%(0Q?=}e`1V(1{fUPQP94@L?4s4${*3o<#7@{Qv(kJ*dG=H5}*7 zmDR)iepfEtTr6Q8xPUqP?j+=eu5DhnF^0Hw*#@B31)bZ2zGBG+*w@AW#2EX+at%PP z3$kx8!Aq2C0C-)%FDd|DSf&B|&CmBzB^m%;7jR+=c+rF$kk^I$#@?WPtq&tt>Q32wB(ByCJK=usY!nc>@hXw>Y@&zns{@M6WqE@6s(7XQGii^QMhju zw-qdWtn)k#_y_n0_=o%c@o5wPNOK4+J{Sgj|o z7w+pS!(A|2Ze8##XuZT7wRPd<*2DeuJfL*}zpY@Pvc`O@bsSDN