File tree 2 files changed +24
-12
lines changed
2 files changed +24
-12
lines changed Original file line number Diff line number Diff line change
1
+ // This is meant to run in a hook before npm pack.
2
+ // Reporting an error from the hook interrupts the command.
3
+ if ( process . env . BYPASS_SAFETY_CHECK === 'false' || process . env . BYPASS_SAFETY_CHECK === undefined ) {
4
+ console . error ( 'Run `npm run build:tarball` or `npm run publish:tarball` to pack or publish the package' ) ;
5
+ process . exit ( 1 ) ;
6
+ } else if ( process . env . BYPASS_SAFETY_CHECK !== 'true' ) {
7
+ console . error ( 'Invalid value of the BYPASS_SAFETY_CHECK variable. Must be "true", "false" or unset.' ) ;
8
+ process . exit ( 1 ) ;
9
+ }
Original file line number Diff line number Diff line change 2
2
"name" : " solc" ,
3
3
"version" : " 0.8.11" ,
4
4
"description" : " Solidity compiler" ,
5
- "main" : " dist/ index.js" ,
5
+ "main" : " index.js" ,
6
6
"bin" : {
7
- "solcjs" : " dist/ solc.js"
7
+ "solcjs" : " solc.js"
8
8
},
9
9
"scripts" : {
10
10
"build" : " tsc" ,
11
11
"postbuild" : " node build/postbuild.js" ,
12
12
"lint" : " eslint --ext .js,.ts ." ,
13
13
"lint:fix" : " eslint --fix --ext .js,.ts ." ,
14
14
"updateBinary" : " node build/clean.js && ts-node ./downloadCurrentVersion.ts && ts-node ./verifyVersion.ts" ,
15
- "prepublishOnly" : " npm run updateBinary npm && npm run build" ,
15
+ "prepack" : " node build/pack-publish-block.js" ,
16
+ "build:tarball" : " npm run updateBinary && npm run build && BYPASS_SAFETY_CHECK=true npm pack ./dist" ,
17
+ "publish:tarball" : " tarball=$(npm run --silent tarballName) && ls \" $tarball\" && BYPASS_SAFETY_CHECK=true npm publish \" $tarball\" " ,
18
+ "tarballName" : " jq --raw-output '.name + \" -\" + .version + \" .tgz\" ' package.json" ,
16
19
"copyTestFiles" : " cp -r ./test/resources ./dist/test/" ,
17
20
"pretest" : " npm run lint && npm run build && npm run copyTestFiles" ,
18
21
"test" : " cd dist && tape ./test/index.js" ,
32
35
"node" : " >=10.0.0"
33
36
},
34
37
"files" : [
35
- " dist/ abi.js" ,
36
- " dist/ index.js" ,
37
- " dist/ linker.js" ,
38
- " dist/ smtchecker.js" ,
39
- " dist/ smtsolver.js" ,
40
- " dist/ solc.js" ,
41
- " dist/ soljson.js" ,
42
- " dist/ translate.js" ,
43
- " dist/ wrapper.js"
38
+ " abi.js" ,
39
+ " index.js" ,
40
+ " linker.js" ,
41
+ " smtchecker.js" ,
42
+ " smtsolver.js" ,
43
+ " solc.js" ,
44
+ " soljson.js" ,
45
+ " translate.js" ,
46
+ " wrapper.js"
44
47
],
45
48
"author" : " chriseth" ,
46
49
"license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments