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

Explicitly mark all packages with commonjs type #2414

Merged
merged 2 commits into from
May 21, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/babel-plugin-transform-sx-tailwind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "0.18.0",
"main": "./src/index.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@adeira/murmur-hash": "^2.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/babel-preset-adeira/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"license": "MIT",
"version": "3.0.0",
"main": "./src/index.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.12.13",
Expand Down
1 change: 1 addition & 0 deletions src/css-colors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"sideEffects": false,
"private": false,
"main": "./src/index.js",
"type": "commonjs",
"license": "MIT",
"dependencies": {
"@adeira/js": "^2.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/eslint-config-adeira/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "6.0.0",
"main": "./index.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@babel/runtime": "^7.14.0",
Expand Down
1 change: 1 addition & 0 deletions src/eslint-fixtures-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"homepage": "https://github.com/adeira/universe/tree/master/src/eslint-fixtures-tester",
"version": "0.1.0",
"main": "./src/index.js",
"type": "commonjs",
"license": "MIT",
"private": false,
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions src/eslint-plugin-adeira/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "0.13.0",
"main": "./src/index.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@babel/runtime": "^7.14.0",
Expand Down
1 change: 1 addition & 0 deletions src/eslint-plugin-sx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"eslint-plugin"
],
"main": "./src/index.js",
"type": "commonjs",
"dependencies": {
"@babel/runtime": "^7.14.0"
},
Expand Down
1 change: 1 addition & 0 deletions src/fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"license": "MIT",
"version": "2.1.0",
"main": "./src/fetchWithRetries.js",
"type": "commonjs",
"sideEffects": false,
"homepage": "https://github.com/adeira/universe/tree/master/src/fetch",
"description": "Production ready fetch function with advanced capabilities like retries with delay and request cancellation after timeout.",
Expand Down
1 change: 1 addition & 0 deletions src/fixtures-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "1.0.1",
"main": "./src/index.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@adeira/js": "^2.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/flow-config-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"license": "MIT",
"main": "./src/index.js",
"type": "commonjs",
"dependencies": {
"@adeira/fixtures-tester": "^1.0.1",
"@adeira/js": "^2.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/flow-types-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"version": "0.0.0",
"private": true,
"main": "./src/index.js",
"type": "commonjs",
"license": "MIT",
"dependencies": {}
}
1 change: 1 addition & 0 deletions src/graphql-bc-checker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "0.3.0",
"main": "./src/index.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@adeira/signed-source": "^2.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/graphql-global-id/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "2.0.1",
"main": "./src/index.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@adeira/js": "^2.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/graphql-relay-fauna/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": false,
"version": "0.3.0",
"main": "./src/index.js",
"type": "commonjs",
"sideEffects": false,
"homepage": "https://github.com/adeira/universe/tree/master/src/graphql-relay-fauna",
"description": "Helpers for Relay compliant GraphQL server with FaunaDB backend",
Expand Down
1 change: 1 addition & 0 deletions src/graphql-relay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"url": "http://github.com/adeira/universe.git"
},
"main": "./src/index.js",
"type": "commonjs",
"peerDependencies": {
"graphql": "^15.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions src/graphql-resolve-wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "0.3.0",
"main": "./src/index.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@babel/runtime": "^7.14.0"
Expand Down
1 change: 1 addition & 0 deletions src/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "2.1.0",
"main": "./src/index.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@babel/runtime": "^7.14.0"
Expand Down
1 change: 1 addition & 0 deletions src/monorepo-npm-publisher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "2.0.0",
"main": "./src/index.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@adeira/babel-preset-adeira": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,24 @@ Workspaces.iterateWorkspaces((packageJSONLocation) => {
test(`${packageJson.name}`, () => {
const dirname = path.dirname(packageJSONLocation);
const main = packageJson.main;
const type = packageJson.type;

if (main != null) {
const mainEntrypoint = path.join(dirname, main);
// $FlowIssue[incompatible-call]: https://github.com/facebook/flow/issues/3018
expect(fs.existsSync(mainEntrypoint)).toGiveHelp(
`The file specified in main field does not exist (${mainEntrypoint}). If this is intentional, you can remove this field from package.json`,
);

// $FlowIssue[incompatible-call]: https://github.com/facebook/flow/issues/3018
expect(type != null).toGiveHelp(
`Each package must specify "type" to be either "commonjs" or "module".`,
);

// $FlowIssue[incompatible-call]: https://github.com/facebook/flow/issues/3018
expect(['commonjs', 'module'].includes(type)).toGiveHelp(
`Package type must be either "commonjs" or "module" (given "${type}").`,
);
}
});
});
1 change: 1 addition & 0 deletions src/monorepo-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "0.11.0",
"main": "./src/index.js",
"type": "commonjs",
"sideEffects": false,
"bin": {
"monorepo-babel-node": "bin/monorepo-babel-node.js",
Expand Down
1 change: 1 addition & 0 deletions src/murmur-hash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "2.0.0",
"main": "./src/murmurHash.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@babel/runtime": "^7.14.0"
Expand Down
1 change: 1 addition & 0 deletions src/relay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": false,
"version": "3.2.4",
"main": "./src/index.js",
"type": "commonjs",
"sideEffects": false,
"homepage": "https://github.com/adeira/universe/tree/master/src/relay",
"description": "Opinionated wrapper around Relay - a JavaScript framework for building data-driven React applications",
Expand Down
1 change: 1 addition & 0 deletions src/signed-source/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "2.0.0",
"main": "./src/SignedSource.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@babel/runtime": "^7.14.0"
Expand Down
1 change: 1 addition & 0 deletions src/sx-design/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "0.10.0",
"main": "./index.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@adeira/js": "^2.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/sx-jest-snapshot-serializer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "0.1.0",
"main": "./index.js",
"type": "commonjs",
"sideEffects": true,
"dependencies": {
"@adeira/sx": "^0.25.0",
Expand Down
1 change: 1 addition & 0 deletions src/sx-tailwind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "0.12.0",
"main": "./index.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@adeira/js": "^2.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/sx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"private": false,
"version": "0.25.0",
"main": "./index.js",
"type": "commonjs",
"sideEffects": false,
"dependencies": {
"@adeira/css-colors": "^2.0.0",
Expand Down