From fd8c610f239b4f8fd8380b159f8ffa5fcfa91ff1 Mon Sep 17 00:00:00 2001 From: Ward Peeters Date: Thu, 13 Aug 2020 14:54:53 +0200 Subject: [PATCH] Moving everthing to index --- packages/gatsby-cli/src/init-starter.ts | 2 +- packages/gatsby-core-utils/node.d.ts | 1 - packages/gatsby-core-utils/node.js | 1 - packages/gatsby-core-utils/package.json | 5 ++--- packages/gatsby-core-utils/src/index.ts | 2 ++ packages/gatsby-core-utils/src/node.ts | 2 -- .../gatsby-recipes/src/graphql-server/index.js | 2 +- .../gatsby-recipes/src/providers/gatsby/page.js | 2 +- packages/gatsby/src/commands/build.ts | 2 +- packages/gatsby/src/commands/develop.ts | 4 ++-- packages/gatsby/src/utils/develop-proxy.ts | 2 +- yarn.lock | 14 -------------- 12 files changed, 11 insertions(+), 28 deletions(-) delete mode 100644 packages/gatsby-core-utils/node.d.ts delete mode 100644 packages/gatsby-core-utils/node.js delete mode 100644 packages/gatsby-core-utils/src/node.ts diff --git a/packages/gatsby-cli/src/init-starter.ts b/packages/gatsby-cli/src/init-starter.ts index 4b78cc8491791..d1c3de9683b26 100644 --- a/packages/gatsby-cli/src/init-starter.ts +++ b/packages/gatsby-cli/src/init-starter.ts @@ -9,7 +9,7 @@ import isValid from "is-valid-path" import sysPath from "path" import prompts from "prompts" import url from "url" -import { updateSiteMetadata } from "gatsby-core-utils/node" +import { updateSiteMetadata } from "gatsby-core-utils" import report from "./reporter" import { getPackageManager, promptPackageManager } from "./util/package-manager" import { isTTY } from "./util/is-tty" diff --git a/packages/gatsby-core-utils/node.d.ts b/packages/gatsby-core-utils/node.d.ts deleted file mode 100644 index 48f27c8cc6eba..0000000000000 --- a/packages/gatsby-core-utils/node.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./dist/node" diff --git a/packages/gatsby-core-utils/node.js b/packages/gatsby-core-utils/node.js deleted file mode 100644 index 23b5a865fd852..0000000000000 --- a/packages/gatsby-core-utils/node.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./dist/node") diff --git a/packages/gatsby-core-utils/package.json b/packages/gatsby-core-utils/package.json index 8b16e781c5c9e..afa9e9cc079e2 100644 --- a/packages/gatsby-core-utils/package.json +++ b/packages/gatsby-core-utils/package.json @@ -27,9 +27,7 @@ }, "files": [ "dist/", - "dist/index.d.ts", - "node.js", - "node.d.ts" + "dist/index.d.ts" ], "dependencies": { "ci-info": "2.0.0", @@ -37,6 +35,7 @@ "fs-extra": "^8.1.0", "node-object-hash": "^2.0.0", "proper-lockfile": "^4.1.1", + "tmp": "^0.2.1", "xdg-basedir": "^4.0.0" }, "devDependencies": { diff --git a/packages/gatsby-core-utils/src/index.ts b/packages/gatsby-core-utils/src/index.ts index e7ee972f9057f..b60b5ff681e8b 100644 --- a/packages/gatsby-core-utils/src/index.ts +++ b/packages/gatsby-core-utils/src/index.ts @@ -6,3 +6,5 @@ export { getCIName, isCI } from "./ci" export { createRequireFromPath } from "./create-require-from-path" export { getConfigStore } from "./get-config-store" export { getGatsbyVersion } from "./get-gatsby-version" +export * from "./service-lock" +export * from "./site-metadata" diff --git a/packages/gatsby-core-utils/src/node.ts b/packages/gatsby-core-utils/src/node.ts deleted file mode 100644 index c2d13da4b55d0..0000000000000 --- a/packages/gatsby-core-utils/src/node.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./service-lock" -export * from "./site-metadata" diff --git a/packages/gatsby-recipes/src/graphql-server/index.js b/packages/gatsby-recipes/src/graphql-server/index.js index 2b800a8b8bc1b..e3ca634190d14 100644 --- a/packages/gatsby-recipes/src/graphql-server/index.js +++ b/packages/gatsby-recipes/src/graphql-server/index.js @@ -2,7 +2,7 @@ const execa = require(`execa`) const path = require(`path`) const fs = require(`fs`) const detectPort = require(`detect-port`) -const { getService, createServiceLock } = require(`gatsby-core-utils/node`) +const { getService, createServiceLock } = require(`gatsby-core-utils`) // NOTE(@mxstbr): The forceStart boolean enforces us to start the recipes graphql server // even if another instance might already be running. This is necessary to ensure the gatsby diff --git a/packages/gatsby-recipes/src/providers/gatsby/page.js b/packages/gatsby-recipes/src/providers/gatsby/page.js index ca4d0e500374d..6aedb0f8f8279 100644 --- a/packages/gatsby-recipes/src/providers/gatsby/page.js +++ b/packages/gatsby-recipes/src/providers/gatsby/page.js @@ -1,5 +1,5 @@ const Joi = require(`@hapi/joi`) -const { getService } = require(`gatsby-core-utils/node`) +const { getService } = require(`gatsby-core-utils`) const fetch = require(`node-fetch`) const { REQUIRES_KEYS } = require(`./utils/constants`) diff --git a/packages/gatsby/src/commands/build.ts b/packages/gatsby/src/commands/build.ts index 6c3bfa6830daf..06a5f065d51f3 100644 --- a/packages/gatsby/src/commands/build.ts +++ b/packages/gatsby/src/commands/build.ts @@ -36,7 +36,7 @@ import { markWebpackStatusAsPending, markWebpackStatusAsDone, } from "../utils/webpack-status" -import { updateSiteMetadata } from "gatsby-core-utils/node" +import { updateSiteMetadata } from "gatsby-core-utils" let cachedPageData let cachedWebpackCompilationHash diff --git a/packages/gatsby/src/commands/develop.ts b/packages/gatsby/src/commands/develop.ts index 85118b4833540..d9e99d8dce1e8 100644 --- a/packages/gatsby/src/commands/develop.ts +++ b/packages/gatsby/src/commands/develop.ts @@ -13,8 +13,8 @@ import { createServiceLock, getService, updateSiteMetadata, -} from "gatsby-core-utils/node" -import { UnlockFn } from "gatsby-core-utils/src/service-lock" + UnlockFn, +} from "gatsby-core-utils" import reporter from "gatsby-cli/lib/reporter" import { getSslCert } from "../utils/get-ssl-cert" import { startDevelopProxy } from "../utils/develop-proxy" diff --git a/packages/gatsby/src/utils/develop-proxy.ts b/packages/gatsby/src/utils/develop-proxy.ts index 12204df939fb1..9f46bf8fe78c4 100644 --- a/packages/gatsby/src/utils/develop-proxy.ts +++ b/packages/gatsby/src/utils/develop-proxy.ts @@ -3,7 +3,7 @@ import https from "https" import httpProxy from "http-proxy" import path from "path" import fs from "fs-extra" -import { getServices } from "gatsby-core-utils/node" +import { getServices } from "gatsby-core-utils" import st from "st" import restartingScreen from "./restarting-screen" import { IProgram } from "../commands/types" diff --git a/yarn.lock b/yarn.lock index 239e7d906b345..d487b0e506e11 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6139,20 +6139,6 @@ boxen@^1.2.1: term-size "^1.2.0" widest-line "^2.0.0" -boxen@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-3.2.0.tgz#fbdff0de93636ab4450886b6ff45b92d098f45eb" - integrity sha512-cU4J/+NodM3IHdSL2yN8bqYqnmlBTidDR4RC7nJs61ZmtGz8VZzM3HLQX0zY5mrSmPtR3xWwsq2jOUQqFZN8+A== - dependencies: - ansi-align "^3.0.0" - camelcase "^5.3.1" - chalk "^2.4.2" - cli-boxes "^2.2.0" - string-width "^3.0.0" - term-size "^1.2.0" - type-fest "^0.3.0" - widest-line "^2.0.0" - boxen@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64"