Skip to content

Commit

Permalink
chore: ensure setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ambar committed Oct 6, 2021
1 parent 0eee513 commit 848b02a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion @recommended/eslint-plugin-import/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ const fs = require('fs')
const pkg = require('./package.json')
const dep = require('eslint-plugin-import/package.json')

if (dep.name === pkg.name) {
throw new Error('Do not link to the bundled package')
}

const dynamic = [
// dynamic required
'typescript',
Expand All @@ -20,7 +24,7 @@ const externals = [
'debug',
]

pkg.scripts.build = `esbuild . --outfile=$npm_package_main --bundle --platform=node ${dynamic
pkg.scripts.build = `node setup && esbuild . --outfile=$npm_package_main --bundle --platform=node ${dynamic
.concat(externals)
.map((x) => `--external:${x}`)
.join(' ')}`
Expand Down
2 changes: 1 addition & 1 deletion @recommended/eslint-plugin-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"prepack": "yarn build",
"prebuild": "rm -rf dist",
"build": "node setup && esbuild . --outfile=$npm_package_main --bundle --platform=node --external:doctrine --external:minimatch --external:estraverse --external:semver --external:prop-types",
"build": "esbuild . --outfile=$npm_package_main --bundle --platform=node --external:doctrine --external:minimatch --external:estraverse --external:semver --external:prop-types",
"build:inspect": "yarn build --sourcemap && source-map-explorer $npm_package_main"
},
"dependencies": {
Expand Down
6 changes: 5 additions & 1 deletion @recommended/eslint-plugin-react/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ const fs = require('fs')
const pkg = require('./package.json')
const dep = require('eslint-plugin-react/package.json')

if (dep.name === pkg.name) {
throw new Error('Do not link to the bundled package')
}

const externals = [
// used by eslint-plugin-react(@2), eslint(@3)
'doctrine',
Expand All @@ -13,7 +17,7 @@ const externals = [
'prop-types',
]

pkg.scripts.build = `esbuild . --outfile=$npm_package_main --bundle --platform=node ${externals
pkg.scripts.build = `node setup && esbuild . --outfile=$npm_package_main --bundle --platform=node ${externals
.map((x) => `--external:${x}`)
.join(' ')}`

Expand Down

0 comments on commit 848b02a

Please sign in to comment.