Skip to content

Commit

Permalink
chore(gatsby): Monorepo cleanup (gatsbyjs#24114)
Browse files Browse the repository at this point in the history
* Monorepo cleanup

- Remove unused package
- Make TypeScript part of babel-preset-gatsby
- Remove unneeded peer dependency of `packages/gatsby` dependencies
- Add missing dev and normal dependencies (mostly babel stuff)

* Fix yarn.lock

* Fix review commentS

* Readd gatsby

Co-authored-by: Blaine Kasten <[email protected]>
  • Loading branch information
freiksenet and blainekasten authored May 20, 2020
1 parent 49133e2 commit 3aad172
Show file tree
Hide file tree
Showing 28 changed files with 328 additions and 1,187 deletions.
6 changes: 0 additions & 6 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,5 @@ if (process.env.NODE_ENV !== `test`) {
module.exports = {
sourceMaps: true,
presets: ["babel-preset-gatsby-package"],
overrides: [
{
test: "**/*.ts",
plugins: [["@babel/plugin-transform-typescript", { isTSX: true }]],
},
],
ignore,
}
7 changes: 3 additions & 4 deletions packages/babel-plugin-remove-graphql-queries/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
"babel-preset-gatsby-package": "^0.4.1",
"cross-env": "^5.2.1"
},
"license": "MIT",
"main": "index.js",
"peerDependencies": {
"gatsby": "^2.0.0",
"graphql": "^14.1.1"
"gatsby": "^2.0.0"
},
"license": "MIT",
"main": "index.js",
"scripts": {
"build": "babel src --out-dir . --ignore \"**/__tests__\" --extensions \".ts,.js\"",
"prepare": "cross-env NODE_ENV=production npm run build",
Expand Down
6 changes: 6 additions & 0 deletions packages/babel-preset-gatsby-package/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ function preset(context, options = {}) {
r(`@babel/plugin-syntax-dynamic-import`),
IS_TEST && r(`babel-plugin-dynamic-import-node`)
].filter(Boolean),
overrides: [
{
test: [`**/*.ts`, `**/*.tsx`],
plugins: [[`@babel/plugin-transform-typescript`, { isTSX: true }]],
},
],
}
}

Expand Down
7 changes: 4 additions & 3 deletions packages/babel-preset-gatsby-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@
"directory": "packages/babel-preset-gatsby-package"
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/babel-preset-gatsby-package#readme",
"peerDependencies": {
"@babel/core": "^7.0.0"
},
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.9.6",
"@babel/plugin-transform-typescript": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"@babel/preset-flow": "^7.9.0",
"@babel/preset-react": "^7.9.4",
"babel-plugin-dynamic-import-node": "^2.3.3",
"core-js": "^2.6.11"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
},
"license": "MIT",
"main": "index.js",
"engines": {
Expand Down
8 changes: 1 addition & 7 deletions packages/babel-preset-gatsby/.babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
"presets": [["babel-preset-gatsby-package"]],
"overrides": [
{
"test": ["**/*.ts", "**/*.tsx"],
"plugins": [["@babel/plugin-transform-typescript", { "isTSX": true }]]
}
]
"presets": [["babel-preset-gatsby-package"]]
}
15 changes: 1 addition & 14 deletions packages/gatsby-cli/.babelrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
{
"presets": [
[
"babel-preset-gatsby-package",
{
"nodeVersion": "6.0"
}
]
],
"overrides": [
{
"test": ["**/*.ts", "**/*.tsx"],
"plugins": [["@babel/plugin-transform-typescript", { "isTSX": true }]]
}
]
"presets": [["babel-preset-gatsby-package"]]
}
8 changes: 1 addition & 7 deletions packages/gatsby-core-utils/.babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
"presets": [["babel-preset-gatsby-package"]],
"overrides": [
{
"test": "**/*.ts",
"plugins": [["@babel/plugin-transform-typescript", { "isTSX": true }]]
}
]
"presets": [["babel-preset-gatsby-package"]]
}
2 changes: 1 addition & 1 deletion packages/gatsby-design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"devDependencies": {
"agadoo": "^1.1.0",
"cross-env": "^5.2.1",
"microbundle": "gatsbyjs/microbundle#brotli-try-catch-plus-dist",
"microbundle": "^0.12.0",
"preval.macro": "^3.0.0"
},
"engines": {
Expand Down
1 change: 0 additions & 1 deletion packages/gatsby-dev-cli/src/__tests__/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ const monoRepoPackages = [
`gatsby-transformer-toml`,
`gatsby-transformer-xml`,
`gatsby-transformer-yaml`,
`graphql-skip-limit`,
]

const mockDepsChanges = packagesWithChangedDeps => ({ packageName }) =>
Expand Down
11 changes: 5 additions & 6 deletions packages/gatsby-link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@
"babel-preset-gatsby-package": "^0.4.1",
"cross-env": "^5.2.1"
},
"peerDependencies": {
"@reach/router": "^1.3.3",
"react": "^16.4.2",
"react-dom": "^16.4.2"
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-link#readme",
"keywords": [
"gatsby"
],
"license": "MIT",
"main": "index.js",
"peerDependencies": {
"@reach/router": "^1.1.1",
"gatsby": "^2.0.0",
"react": "^16.4.2",
"react-dom": "^16.4.2"
},
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby.git",
Expand Down
3 changes: 0 additions & 3 deletions packages/gatsby-page-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
"babel-preset-gatsby-package": "^0.4.1",
"cross-env": "^5.2.1"
},
"peerDependencies": {
"gatsby": "^2.0.0"
},
"files": [
"dist/*"
],
Expand Down
2 changes: 2 additions & 0 deletions packages/gatsby-plugin-benchmark-reporting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-benchmark-reporting#readme",
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.6",
"babel-preset-gatsby-package": "^0.4.1"
},
"dependencies": {
Expand Down
10 changes: 5 additions & 5 deletions packages/gatsby-plugin-emotion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
"babel-preset-gatsby-package": "^0.4.1",
"cross-env": "^5.2.1"
},
"peerDependencies": {
"@babel/core": "^7.0.0",
"@emotion/core": "^10.0.5",
"gatsby": "^2.0.0"
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-emotion#readme",
"keywords": [
"gatsby",
Expand All @@ -25,11 +30,6 @@
],
"license": "MIT",
"main": "index.js",
"peerDependencies": {
"@babel/core": "^7.0.0",
"@emotion/core": "^10.0.5",
"gatsby": "^2.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby.git",
Expand Down
3 changes: 0 additions & 3 deletions packages/gatsby-plugin-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
],
"license": "MIT",
"main": "index.js",
"peerDependencies": {
"gatsby": "^2.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby.git",
Expand Down
1 change: 0 additions & 1 deletion packages/gatsby-react-router-scroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"main": "index.js",
"peerDependencies": {
"@reach/router": "^1.0.0",
"gatsby": "^2.0.0",
"react": "^16.4.2",
"react-dom": "^16.4.2"
},
Expand Down
15 changes: 1 addition & 14 deletions packages/gatsby-telemetry/.babelrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
{
"presets": [["babel-preset-gatsby-package"]],
"overrides": [
{
"test": "**/*.ts",
"plugins": [
[
"@babel/plugin-transform-typescript",
{
"isTSX": true
}
]
]
}
]
"presets": [["babel-preset-gatsby-package"]]
}
3 changes: 0 additions & 3 deletions packages/graphql-skip-limit/.babelrc

This file was deleted.

Loading

0 comments on commit 3aad172

Please sign in to comment.