-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: fix build * fix esm import
- Loading branch information
Showing
2 changed files
with
53 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
"ts:check": "tsc --project tsconfig.json --noEmit", | ||
"ci:lint": "eslint \"packages/**/*.{js,jsx,ts,tsx}\" --output-file eslint_report.json --format json", | ||
"build": "tsc --project tsconfig.json && bob build", | ||
"test": "jest", | ||
"test": "jest --config jest.config.base.js", | ||
"prerelease": "yarn build", | ||
"release": "changeset publish", | ||
"format": "prettier --cache --ignore-path .gitignore --ignore-path .prettierignore --check --write \"{packages,website}/**/*.{js,jsx,json,css,md,mdx,ts,tsx}\"", | ||
|
@@ -90,5 +90,6 @@ | |
"lint-staged": { | ||
"*.ts": "eslint", | ||
"*{js,json,css,md,ts,tsx}": "prettier --write" | ||
} | ||
}, | ||
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
import globby from 'globby'; | ||
import { dirname } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
import chalk from 'chalk'; | ||
|
||
async function main() { | ||
const mjsFiles = await globby(['../packages/*/dist/*.mjs'], { | ||
cwd: dirname(fileURLToPath(import.meta.url)), | ||
}); | ||
|
||
const ok = []; | ||
const fail = []; | ||
|
||
let i = 0; | ||
await Promise.all( | ||
mjsFiles.map((mjsFile) => { | ||
const mjsPath = `./${mjsFile}`; | ||
return import(mjsPath) | ||
.then(() => { | ||
ok.push(mjsPath); | ||
}) | ||
.catch((err) => { | ||
const color = i++ % 2 === 0 ? chalk.magenta : chalk.red; | ||
console.error(color('\n\n-----\n' + i + '\n')); | ||
console.error(mjsPath, err); | ||
console.error(color('\n-----\n\n')); | ||
fail.push(mjsPath); | ||
}); | ||
}) | ||
); | ||
ok.length && console.log(chalk.blue(`${ok.length} OK: ${ok.join(' | ')}`)); | ||
fail.length && | ||
console.error(chalk.red(`${fail.length} Fail: ${fail.join(' | ')}`)); | ||
|
||
if (fail.length) { | ||
console.error('\nFAILED'); | ||
process.exit(1); | ||
} else if (ok.length) { | ||
console.error('\nOK'); | ||
process.exit(0); | ||
} else { | ||
console.error('No files analyzed!'); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
main().catch((err) => { | ||
console.error(err); | ||
process.exit(1); | ||
}); | ||
import { globby } from 'globby'; | ||
import { dirname } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
import chalk from 'chalk'; | ||
|
||
async function main() { | ||
const mjsFiles = await globby(['../packages/*/dist/*.mjs'], { | ||
cwd: dirname(fileURLToPath(import.meta.url)), | ||
}); | ||
|
||
const ok = []; | ||
const fail = []; | ||
|
||
let i = 0; | ||
await Promise.all( | ||
mjsFiles.map((mjsFile) => { | ||
const mjsPath = `./${mjsFile}`; | ||
return import(mjsPath) | ||
.then(() => { | ||
ok.push(mjsPath); | ||
}) | ||
.catch((err) => { | ||
const color = i++ % 2 === 0 ? chalk.magenta : chalk.red; | ||
console.error(color('\n\n-----\n' + i + '\n')); | ||
console.error(mjsPath, err); | ||
console.error(color('\n-----\n\n')); | ||
fail.push(mjsPath); | ||
}); | ||
}) | ||
); | ||
ok.length && console.log(chalk.blue(`${ok.length} OK: ${ok.join(' | ')}`)); | ||
fail.length && | ||
console.error(chalk.red(`${fail.length} Fail: ${fail.join(' | ')}`)); | ||
|
||
if (fail.length) { | ||
console.error('\nFAILED'); | ||
process.exit(1); | ||
} else if (ok.length) { | ||
console.error('\nOK'); | ||
process.exit(0); | ||
} else { | ||
console.error('No files analyzed!'); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
main().catch((err) => { | ||
console.error(err); | ||
process.exit(1); | ||
}); |