mirror of
https://github.com/hanzoai/esbuild.git
synced 2026-09-24 16:58:50 +00:00
fix make compat-table to install dependencies
This commit is contained in:
@@ -692,7 +692,7 @@ scripts/browser/node_modules:
|
||||
################################################################################
|
||||
# This generates browser support mappings
|
||||
|
||||
compat-table: esbuild
|
||||
compat-table: esbuild | compat-table/node_modules
|
||||
./esbuild compat-table/src/index.ts --bundle --platform=node --external:./compat-table/repos/* --outfile=compat-table/out.js --log-level=warning --sourcemap
|
||||
node --enable-source-maps compat-table/out.js
|
||||
|
||||
@@ -701,6 +701,9 @@ update-compat-table: esbuild
|
||||
./esbuild compat-table/src/index.ts --bundle --platform=node --external:./compat-table/repos/* --outfile=compat-table/out.js --log-level=warning --sourcemap
|
||||
node --enable-source-maps compat-table/out.js --update
|
||||
|
||||
compat-table/node_modules:
|
||||
cd compat-table && npm ci
|
||||
|
||||
################################################################################
|
||||
# This runs the test262 official JavaScript test suite through esbuild
|
||||
|
||||
|
||||
@@ -302,7 +302,8 @@ const supportMapToVersionRanges = <F extends string>(supportMap: SupportMap<F>):
|
||||
return [versionRangeMap, whyNotMap]
|
||||
}
|
||||
|
||||
const updateGithubDependencies = (): void => {
|
||||
const installGitHubDependencies = (): void => {
|
||||
const updateCommits = process.argv.includes('--update')
|
||||
const jsonPath = path.join(__dirname, 'package.json')
|
||||
const jsonData = JSON.parse(fs.readFileSync(jsonPath, 'utf8'))
|
||||
|
||||
@@ -314,18 +315,24 @@ const updateGithubDependencies = (): void => {
|
||||
}
|
||||
|
||||
child_process.execFileSync('git', ['fetch'], { cwd: fullPath, stdio: 'inherit' })
|
||||
child_process.execFileSync('git', ['reset', '--hard', '--quiet', 'origin/gh-pages'], { cwd: fullPath, stdio: 'inherit' })
|
||||
|
||||
const commit = child_process.execFileSync('git', ['rev-parse', 'HEAD'], { cwd: fullPath }).toString().trim()
|
||||
jsonData.githubDependencies[repo] = commit
|
||||
if (updateCommits) {
|
||||
child_process.execFileSync('git', ['reset', '--hard', '--quiet', 'origin/gh-pages'], { cwd: fullPath, stdio: 'inherit' })
|
||||
const commit = child_process.execFileSync('git', ['rev-parse', 'HEAD'], { cwd: fullPath }).toString().trim()
|
||||
jsonData.githubDependencies[repo] = commit
|
||||
} else {
|
||||
const commit = jsonData.githubDependencies[repo]
|
||||
child_process.execFileSync('git', ['reset', '--hard', '--quiet', commit], { cwd: fullPath, stdio: 'inherit' })
|
||||
}
|
||||
})
|
||||
|
||||
fs.writeFileSync(jsonPath, JSON.stringify(jsonData, null, 2) + '\n')
|
||||
if (updateCommits) {
|
||||
fs.writeFileSync(jsonPath, JSON.stringify(jsonData, null, 2) + '\n')
|
||||
}
|
||||
}
|
||||
|
||||
if (process.argv.includes('--update')) {
|
||||
updateGithubDependencies()
|
||||
}
|
||||
// These dependencies are not published on npm and are instead pulled from GitHub (but pinned to a specific commit)
|
||||
installGitHubDependencies()
|
||||
|
||||
import('./kangax').then(kangax => {
|
||||
const js: SupportMap<JSFeature> = {} as SupportMap<JSFeature>
|
||||
|
||||
Reference in New Issue
Block a user