Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(webpack-config-compass): Replace exports.webpack with custom exports key COMPASS-5724 #2990

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion configs/eslint-config-compass/package.json
Expand Up @@ -5,7 +5,6 @@
"license": "SSPL",
"main": "index.js",
"exports": {
"webpack": "./index.js",
"require": "./index.js"
},
"files": [
Expand Down
1 change: 0 additions & 1 deletion configs/webpack-config-compass/package.json
Expand Up @@ -24,7 +24,6 @@
"license": "SSPL",
"main": "dist/index.js",
"exports": {
"webpack": "./src/index.ts",
"require": "./dist/index.js",
"import": "./dist/.esm-wrapper.mjs"
},
Expand Down
12 changes: 9 additions & 3 deletions configs/webpack-config-compass/src/index.ts
Expand Up @@ -30,6 +30,12 @@ import { sharedExternals } from './externals';
import { WebpackPluginMulticompilerProgress } from './webpack-plugin-multicompiler-progress';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';

const sharedResolveOptions = {
mainFields: ['compass:module', 'compass:main', 'module', 'main'],
exportsFields: ['compass:exports', 'exports'],
extensions: ['.jsx', '.tsx', '.ts', '...'],
};

export function createElectronMainConfig(
args: Partial<ConfigArgs>
): WebpackConfig {
Expand Down Expand Up @@ -60,7 +66,7 @@ export function createElectronMainConfig(
resolve: {
// To avoid resolving the `browser` field
aliasFields: [],
extensions: ['.jsx', '.tsx', '.ts', '...'],
...sharedResolveOptions,
},
plugins: [new WebpackPluginMulticompilerProgress()],
};
Expand Down Expand Up @@ -130,7 +136,7 @@ export function createElectronRendererConfig(
resolve: {
// To avoid resolving the `browser` field
aliasFields: [],
extensions: ['.jsx', '.tsx', '.ts', '...'],
...sharedResolveOptions,
},
};

Expand Down Expand Up @@ -235,7 +241,7 @@ export function createWebConfig(args: Partial<ConfigArgs>): WebpackConfig {
...toCommonJsExternal(builtinModules),
},
resolve: {
extensions: ['.jsx', '.tsx', '.ts', '...'],
...sharedResolveOptions,
},
};
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion packages/ace-mode/package.json
Expand Up @@ -3,10 +3,13 @@
"version": "1.6.0",
"description": "MongoDB Mode for the ACE Editor",
"main": "index.js",
"compass:main": "index.js",
"exports": {
"webpack": "./index.js",
"require": "./index.js"
},
"compass:exports": {
".": "./index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down
5 changes: 4 additions & 1 deletion packages/ace-theme-query/package.json
Expand Up @@ -3,10 +3,13 @@
"version": "1.6.0",
"description": "MongoDB Theme for the ACE Editor in the Query Bar",
"main": "index.js",
"compass:main": "index.js",
"exports": {
"webpack": "./index.js",
"require": "./index.js"
},
"compass:exports": {
".": "./index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down
5 changes: 4 additions & 1 deletion packages/ace-theme/package.json
Expand Up @@ -3,10 +3,13 @@
"version": "1.6.0",
"description": "MongoDB Theme for the ACE Editor",
"main": "index.js",
"compass:main": "index.js",
"exports": {
"webpack": "./index.js",
"require": "./index.js"
},
"compass:exports": {
".": "./index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down
5 changes: 4 additions & 1 deletion packages/app-migrations/package.json
Expand Up @@ -20,10 +20,13 @@
"email": "compass@mongodb.com"
},
"main": "index.js",
"compass:main": "index.js",
"exports": {
"webpack": "./index.js",
"require": "./index.js"
},
"compass:exports": {
".": "./index.js"
},
"dependencies": {
"@mongodb-js/compass-logging": "^0.10.0",
"async": "^3.2.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/bson-transpilers/package.json
Expand Up @@ -10,10 +10,13 @@
"Irina Shestak <irina.shestak@mongodb.com>"
],
"main": "index.js",
"compass:main": "index.js",
"exports": {
"webpack": "./index.js",
"require": "./index.js"
},
"compass:exports": {
".": "./index.js"
},
"scripts": {
"start": "node index.js",
"precompile": "node download-antlr.js",
Expand Down
5 changes: 4 additions & 1 deletion packages/collection-model/package.json
Expand Up @@ -17,11 +17,14 @@
"mongodb-js"
],
"main": "index.js",
"compass:main": "index.js",
"types": "./index.d.ts",
"exports": {
"webpack": "./index.js",
"require": "./index.js"
},
"compass:exports": {
".": "./index.js"
},
"scripts": {
"check": "npm run lint && npm run depcheck",
"test": "mocha",
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-aggregations/package.json
Expand Up @@ -5,11 +5,14 @@
"apiVersion": "3.0.0",
"description": "Compass Aggregation Pipeline Builder",
"main": "dist/index.js",
"compass:main": "src/index.js",
"exports": {
"webpack": "./src/index.js",
"browser": "./dist/browser.js",
"require": "./dist/index.js"
},
"compass:exports": {
".": "./src/index.js"
},
"scripts": {
"prepublishOnly": "npm run compile",
"compile": "npm run webpack -- --mode production",
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-app-stores/package.json
Expand Up @@ -5,10 +5,13 @@
"apiVersion": "3.0.0",
"description": "The external stores repo for compass",
"main": "lib/index.js",
"compass:main": "src/index.js",
"exports": {
"webpack": "./src/index.js",
"require": "./lib/index.js"
},
"compass:exports": {
".": "./src/index.js"
},
"scripts": {
"clean": "rimraf lib",
"precompile": "npm run clean",
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-auto-updates/package.json
Expand Up @@ -5,10 +5,13 @@
"apiVersion": "3.0.0",
"description": "Compass Auto Updates Plugin",
"main": "lib/index.js",
"compass:main": "src/index.js",
"exports": {
"webpack": "./src/index.js",
"require": "./lib/index.js"
},
"compass:exports": {
".": "./src/index.js"
},
"scripts": {
"clean": "rimraf lib",
"precompile": "npm run clean",
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-collection-stats/package.json
Expand Up @@ -20,10 +20,13 @@
"dist"
],
"main": "dist/index.js",
"compass:main": "src/index.ts",
"exports": {
"webpack": "./src/index.ts",
"require": "./dist/index.js"
},
"compass:exports": {
".": "./src/index.ts"
},
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-collection/package.json
Expand Up @@ -25,10 +25,13 @@
],
"license": "SSPL",
"main": "dist/index.js",
"compass:main": "src/index.ts",
"exports": {
"webpack": "./src/index.ts",
"require": "./dist/index.js"
},
"compass:exports": {
".": "./src/index.ts"
},
"types": "./dist/index.d.ts",
"scripts": {
"bootstrap": "npm run compile",
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-components/package.json
Expand Up @@ -4,12 +4,15 @@
"description": "React Components used in Compass",
"license": "SSPL",
"main": "lib/index.js",
"compass:main": "src/index.ts",
"exports": {
"types": "./lib/index.d.ts",
"webpack": "./src/index.ts",
"require": "./lib/index.js",
"import": "./lib/.esm-wrapper.mjs"
},
"compass:exports": {
".": "./src/index.ts"
},
"types": "./lib/index.d.ts",
"files": [
"lib"
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-connections/package.json
Expand Up @@ -23,11 +23,14 @@
],
"license": "SSPL",
"main": "dist/index.js",
"compass:main": "src/index.ts",
"exports": {
"webpack": "./src/index.ts",
"require": "./dist/index.js",
"import": "./dist/.esm-wrapper.mjs"
},
"compass:exports": {
".": "./src/index.ts"
},
"types": "./dist/index.d.ts",
"scripts": {
"bootstrap": "npm run compile",
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-crud/package.json
Expand Up @@ -8,11 +8,14 @@
"url": "https://github.com/mongodb-js/compass.git"
},
"main": "lib/index.js",
"compass:main": "src/index.js",
"types": "lib/index.d.ts",
"exports": {
"webpack": "./src/index.js",
"require": "./lib/index.js"
},
"compass:exports": {
".": "./src/index.js"
},
"apiVersion": "3.0.0",
"scripts": {
"clean": "rimraf lib",
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-database/package.json
Expand Up @@ -5,10 +5,13 @@
"apiVersion": "3.0.0",
"description": "Compass Database Plugin",
"main": "lib/index.js",
"compass:main": "src/index.js",
"exports": {
"webpack": "./src/index.js",
"require": "./lib/index.js"
},
"compass:exports": {
".": "./src/index.js"
},
"scripts": {
"clean": "rimraf lib",
"precompile": "npm run clean",
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-databases-navigation/package.json
Expand Up @@ -23,11 +23,14 @@
],
"license": "SSPL",
"main": "dist/index.js",
"compass:main": "src/index.ts",
"exports": {
"webpack": "./src/index.ts",
"require": "./dist/index.js",
"import": "./dist/.esm-wrapper.mjs"
},
"compass:exports": {
".": "./src/index.ts"
},
"scripts": {
"bootstrap": "npm run compile",
"prepublishOnly": "npm run compile",
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-deployment-awareness/package.json
Expand Up @@ -5,10 +5,13 @@
"apiVersion": "3.0.0",
"description": "Compass Deployment Awareness Plugin",
"main": "lib/index.js",
"compass:main": "src/index.js",
"exports": {
"webpack": "./src/index.js",
"require": "./lib/index.js"
},
"compass:exports": {
".": "./src/index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/mongodb-js/compass.git"
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-explain-plan/package.json
Expand Up @@ -5,10 +5,13 @@
"apiVersion": "3.0.0",
"description": "Evaluate the performance of your quer",
"main": "lib/index.js",
"compass:main": "src/index.js",
"exports": {
"webpack": "./src/index.js",
"require": "./lib/index.js"
},
"compass:exports": {
".": "./src/index.js"
},
"scripts": {
"clean": "rimraf lib",
"precompile": "npm run clean",
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-export-to-language/package.json
Expand Up @@ -5,10 +5,13 @@
"apiVersion": "3.0.0",
"description": "export to language modal",
"main": "lib/index.js",
"compass:main": "src/index.js",
"exports": {
"webpack": "./src/index.js",
"require": "./lib/index.js"
},
"compass:exports": {
".": "./src/index.js"
},
"scripts": {
"clean": "rimraf lib",
"precompile": "npm run clean",
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-field-store/package.json
Expand Up @@ -5,10 +5,13 @@
"apiVersion": "3.0.0",
"description": "FieldStore keeps track of available fields in a collection.",
"main": "lib/index.js",
"compass:main": "src/index.js",
"exports": {
"webpack": "./src/index.js",
"require": "./lib/index.js"
},
"compass:exports": {
".": "./src/index.js"
},
"scripts": {
"clean": "rimraf lib",
"precompile": "npm run clean",
Expand Down
5 changes: 4 additions & 1 deletion packages/compass-find-in-page/package.json
Expand Up @@ -23,10 +23,13 @@
"dist"
],
"main": "dist/index.js",
"compass:main": "src/index.ts",
"exports": {
"webpack": "./src/index.ts",
"require": "./dist/index.js"
},
"compass:exports": {
".": "./src/index.ts"
},
"types": "./dist/index.d.ts",
"scripts": {
"prepublishOnly": "npm run compile",
Expand Down