Skip to content

Commit 51af0b9

Browse files
authored
fix: don't import from other package src (even just types) (#32234)
* fix: don't import from other package src (even just types) * check if .d.ts file exist
1 parent 94777e4 commit 51af0b9

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

packages/gatsby/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@
247247
"build:rawfiles": "copyfiles -u 1 src/internal-plugins/**/raw_* dist",
248248
"build:cjs": "babel cache-dir --out-dir cache-dir/commonjs --ignore \"**/__tests__\" --ignore \"**/__mocks__\" && copyfiles -u 1 cache-dir/**/*.json cache-dir/commonjs",
249249
"build:src": "babel src --out-dir dist --source-maps --verbose --ignore \"**/gatsby-cli.js,src/internal-plugins/dev-404-page/raw_dev-404-page.js,**/__tests__,**/__mocks__\" --extensions \".ts,.js\"",
250-
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist",
250+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist && node scripts/check-declaration.js",
251251
"clean-test-bundles": "find test/ -type f -name bundle.js* -exec rm -rf {} +",
252252
"prebuild": "rimraf dist && rimraf cache-dir/commonjs",
253253
"postinstall": "node scripts/postinstall.js",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const fs = require(`fs-extra`)
2+
const path = require(`path`)
3+
4+
const absPath = path.join(__dirname, '..', `./dist/internal.d.ts`)
5+
6+
if (!fs.existsSync(absPath)) {
7+
console.error(`Expected "internal.d.ts" file doesn't exist at "${absPath}`)
8+
process.exit(1)
9+
}

packages/gatsby/src/utils/node-manifest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ErrorId } from "./../../../gatsby-cli/src/structured-errors/error-map"
1+
import type { ErrorId } from "gatsby-cli/lib/structured-errors/error-map"
22
import { getNode } from "./../datastore"
33
import { IGatsbyPage, INodeManifest } from "./../redux/types"
44
import reporter from "gatsby-cli/lib/reporter"

0 commit comments

Comments
 (0)