File tree Expand file tree Collapse file tree 5 files changed +614
-802
lines changed Expand file tree Collapse file tree 5 files changed +614
-802
lines changed Original file line number Diff line number Diff line change
1
+ // eslint-disable-next-line
1
2
// @ts -nocheck
2
3
3
4
import React from 'react'
Original file line number Diff line number Diff line change 29
29
"demo:package" : " yarn build-package && cd demo && yarn && yarn start:package" ,
30
30
"prebuild" : " yarn lint" ,
31
31
"build" : " rollup -c && rm -R build/dts" ,
32
+ "postbuild" : " node ./scripts/cleanBuildTypes.cjs" ,
32
33
"build-package" : " yarn build && yarn pack --filename package.tgz && tar -xzf package.tgz -C demo/src && rm package.tgz" ,
33
34
"lint" : " eslint" ,
34
- "postbuild" : " node ./scripts/cleanBuildTypes.cjs" ,
35
35
"prepareReadme" : " python3 scripts/build_npm_readme.py" ,
36
36
"prepublishOnly" : " yarn build && yarn prepareReadme && python3 scripts/use_npm_readme.py prepare" ,
37
37
"postpublish" : " python3 scripts/use_npm_readme.py restore && cd demo && yarn add json-edit-react@latest" ,
42
42
"peerDependencies" : {
43
43
"react" : " >=16.0.0"
44
44
},
45
- "resolutions" : {
46
- "strip-ansi" : " 6.0.1" ,
47
- "string-width" : " 4.2.2" ,
48
- "wrap-ansi" : " 7.0.0"
49
- },
50
45
"dependencies" : {
51
46
"object-property-assigner" : " ^1.3.5" ,
52
47
"object-property-extractor" : " ^1.0.13"
Original file line number Diff line number Diff line change @@ -25,7 +25,12 @@ export default [
25
25
del ( { targets : 'build/*' } ) ,
26
26
styles ( { minimize : true } ) ,
27
27
peerDepsExternal ( { includeDependencies : true } ) ,
28
- typescript ( { module : 'ESNext' , target : 'es6' } ) ,
28
+ typescript ( {
29
+ module : 'ESNext' ,
30
+ target : 'es6' ,
31
+ declaration : true ,
32
+ declarationDir : 'build/dts' ,
33
+ } ) ,
29
34
terser ( ) ,
30
35
bundleSize ( ) ,
31
36
sizes ( ) ,
@@ -34,7 +39,7 @@ export default [
34
39
} ,
35
40
// Types
36
41
{
37
- input : './ build/dts/index.d.ts' ,
42
+ input : 'build/dts/index.d.ts' ,
38
43
output : [ { file : 'build/index.d.ts' , format : 'es' } ] ,
39
44
external : [ / \. c s s $ / ] ,
40
45
plugins : [ dts ( ) ] ,
Original file line number Diff line number Diff line change 19
19
20
20
const fs = require ( 'fs-extra' )
21
21
22
- const exportTextMatch = / ^ e x p o r t { t y p e .+ } ; $ / m
22
+ const exportTextMatch = / ^ e x p o r t t y p e { .+ } ; $ / m
23
23
24
24
const cleanBuildTypes = async ( ) => {
25
25
const data = await fs . readFile ( 'build/index.d.ts' , 'utf8' )
26
26
const exportText = exportTextMatch . exec ( data ) [ 0 ]
27
- const cleanedText = exportText . replace ( / t y p e ( . + ? ) / gm , '$1 ' )
27
+ const cleanedText = '\n// Types\n' + exportText . replace ( 'export type ' , 'export ' )
28
28
const newData = data . replace ( exportText , cleanedText )
29
29
console . log ( 'Cleaning up type declarations...' )
30
30
You can’t perform that action at this time.
0 commit comments