Skip to content

Commit 52cc710

Browse files
authored
fix: ESM / CJS bundlers etc. (#2144)
1 parent d68d53b commit 52cc710

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1047
-977
lines changed

.changeset/gorgeous-experts-double.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'react-spring': patch
3+
'@react-spring/animated': patch
4+
'@react-spring/parallax': patch
5+
'@react-spring/shared': patch
6+
'@react-spring/types': patch
7+
'@react-spring/native': patch
8+
'@react-spring/core': patch
9+
'@react-spring/rafz': patch
10+
'@react-spring/konva': patch
11+
'@react-spring/three': patch
12+
'@react-spring/zdog': patch
13+
'@react-spring/web': patch
14+
---
15+
16+
fix: mjs exports

.github/publish-ci/are-the-types-wrong/main.tsx

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
} from '@arethetypeswrong/core'
1717
import React from 'react'
1818
import { render, Text, Box, Static } from 'ink'
19+
import yargs from 'yargs/yargs'
1920

2021
const allResolutionKinds: ResolutionKind[] = [
2122
'node10',
@@ -74,9 +75,9 @@ interface Checks {
7475
problems?: Problem[]
7576
}
7677

77-
const packagePath = path.join(__dirname, './package.tgz')
78+
const rsPackagePath = path.join(__dirname, './web/package.tgz')
7879

79-
const packageTgzBytes = fs.readFileSync(packagePath)
80+
const rsPackageTgzBytes = fs.readFileSync(rsPackagePath)
8081

8182
function Header({ text, width }: { text: string; width: number | string }) {
8283
return (
@@ -232,8 +233,19 @@ function ChecksTable(props: { checks?: Checks }) {
232233
)
233234
}
234235

235-
;(async function main() {
236-
const analysis = await checkTgz(packageTgzBytes)
236+
const { argv } = yargs(process.argv).option('nonErrorProblems', {
237+
alias: 'n',
238+
type: 'array',
239+
description: 'Do not treat these problems as errors for CLI exit codes',
240+
choices: Object.keys(problemShortDescriptions) as ProblemKind[],
241+
})
242+
243+
interface CLIOptions {
244+
nonErrorProblems?: ProblemKind[]
245+
}
246+
247+
;(async function main({ nonErrorProblems = [] }: CLIOptions) {
248+
const analysis = await checkTgz(rsPackageTgzBytes)
237249

238250
const checks: Checks = {
239251
analysis,
@@ -263,6 +275,32 @@ function ChecksTable(props: { checks?: Checks }) {
263275
</Static>
264276
)
265277

266-
const exitCode = checks.problems?.length ?? 0
278+
const { problems = [] } = checks
279+
280+
console.log('\n\nProblem results:')
281+
282+
if (nonErrorProblems.length) {
283+
console.log(
284+
'Treating these problem categories as non-errors: ',
285+
nonErrorProblems
286+
)
287+
}
288+
289+
const filteredProblems = problems.filter(
290+
p => !nonErrorProblems.includes(p.kind)
291+
)
292+
293+
if (filteredProblems.length) {
294+
console.error(
295+
'Remaining problems: ',
296+
filteredProblems.map(p => p.kind)
297+
)
298+
} else {
299+
console.log('No errors found!')
300+
}
301+
302+
const exitCode = filteredProblems.length
267303
process.exit(exitCode)
268-
})()
304+
})({
305+
nonErrorProblems: argv.nonErrorProblems as ProblemKind[],
306+
})

.github/publish-ci/are-the-types-wrong/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@
77
"test": "yarn tsx main.tsx"
88
},
99
"dependencies": {
10+
"@react-spring/web": "*",
1011
"ink": "^4.0.0",
1112
"object-hash": "^3.0.0",
12-
"react": "^18.2.0",
13-
"react-dom": "^18.2.0",
14-
"react-spring": "^9.7.1"
13+
"react": "^18.2.0"
1514
},
1615
"devDependencies": {
1716
"@arethetypeswrong/core": "^0.0.4",
1817
"@types/react": "^18.0.28",
19-
"@types/react-dom": "^18.0.11",
2018
"shelljs": "^0.8.5",
21-
"tsx": "^3.12.5"
19+
"tsx": "^3.12.5",
20+
"yargs": "^17.7.1"
2221
},
2322
"resolutions": {
2423
"@arethetypeswrong/core@^0.0.4": "patch:@arethetypeswrong/core@npm%3A0.0.4#./.yarn/patches/@arethetypeswrong-core-npm-0.0.4-edb717a66b.patch"

0 commit comments

Comments
 (0)