@@ -9,6 +9,8 @@ function invariant(condition: boolean, message: string) {
99 }
1010}
1111
12+ const registry = 'http://localhost:4873' ;
13+
1214// Executing publish script: node path/to/publish.mjs {name} --version {version} --tag {tag}
1315// Default "tag" to "next" so we won't publish the "latest" tag by accident.
1416const [ , , name , version , tag = 'next' ] = process . argv ;
@@ -36,7 +38,6 @@ invariant(
3638
3739process . chdir ( outputPath ) ;
3840
39- // Updating the version in "package.json" before publishing
4041try {
4142 const json = JSON . parse ( readFileSync ( `package.json` ) . toString ( ) ) ;
4243 json . version = version ;
@@ -45,21 +46,14 @@ try {
4546 console . error ( `Error reading package.json file from library build output.` ) ;
4647}
4748
48- const host = 'localhost' ;
49- const port = 4873 ;
50- const registry = `http://${ host } :${ port } ` ;
51-
52- execSync (
53- `npm config set //${ host } :${ port } /:_authToken "secretVerdaccioToken"` ,
54- {
55- encoding : 'utf-8' ,
56- stdio : 'inherit' ,
57- env : {
58- ...process . env ,
59- npm_config_registry : registry ,
60- } ,
49+ execSync ( `npm config set //localhost:4873/:_authToken "secretVerdaccioToken"` , {
50+ encoding : 'utf-8' ,
51+ stdio : 'inherit' ,
52+ env : {
53+ ...process . env ,
54+ npm_config_registry : registry ,
6155 } ,
62- ) ;
56+ } ) ;
6357
6458// Execute "npm publish" to publish
6559execSync ( `npm publish --access public --tag ${ tag } --registry ${ registry } ` , {
0 commit comments