Skip to content

Commit

Permalink
Update module publish scripts (#478)
Browse files Browse the repository at this point in the history
* Update pds package publishing scripts

* Update auth package publishing scripts

* Update crypto package publishing scripts

* Update did-resolver package publishing scripts

* Update handle package publishing scripts

* Update xrpc-server package publishing scripts

* Update common package publishing scripts

* Update plc package publishing scripts

* Update uri package publishing scripts

* Update repo package publishing scripts
  • Loading branch information
pfrazee authored Jan 24, 2023
1 parent 292f41c commit e44c98e
Show file tree
Hide file tree
Showing 30 changed files with 203 additions and 13 deletions.
8 changes: 6 additions & 2 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@atproto/auth",
"version": "0.0.3",
"version": "0.0.1",
"main": "src/index.ts",
"license": "MIT",
"scripts": {
Expand All @@ -12,7 +12,11 @@
"verify": "run-p prettier lint",
"verify:fix": "yarn prettier:fix && yarn lint:fix",
"build": "node ./build.js",
"postbuild": "tsc --build tsconfig.build.json"
"postbuild": "tsc --build tsconfig.build.json",
"update-main-to-dist": "node ./update-pkg.js --update-main-to-dist",
"update-main-to-src": "node ./update-pkg.js --update-main-to-src",
"prepublish": "npm run update-main-to-dist",
"postpublish": "npm run update-main-to-src"
},
"dependencies": {
"@atproto/crypto": "*",
Expand Down
1 change: 1 addition & 0 deletions packages/auth/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist", // Your outDir,
"emitDeclarationOnly": true
},
Expand Down
14 changes: 14 additions & 0 deletions packages/auth/update-pkg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const pkgJson = require('@npmcli/package-json')

if (process.argv.includes('--update-main-to-dist')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'dist/index.js' }))
.then((pkg) => pkg.save())
}
if (process.argv.includes('--update-main-to-src')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'src/index.ts' }))
.then((pkg) => pkg.save())
}
6 changes: 5 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
"verify": "run-p prettier lint",
"verify:fix": "yarn prettier:fix && yarn lint:fix",
"build": "node ./build.js",
"postbuild": "tsc --build tsconfig.build.json"
"postbuild": "tsc --build tsconfig.build.json",
"update-main-to-dist": "node ./update-pkg.js --update-main-to-dist",
"update-main-to-src": "node ./update-pkg.js --update-main-to-src",
"prepublish": "npm run update-main-to-dist",
"postpublish": "npm run update-main-to-src"
},
"dependencies": {
"@ipld/dag-cbor": "^7.0.3",
Expand Down
1 change: 1 addition & 0 deletions packages/common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist", // Your outDir,
"emitDeclarationOnly": true
},
Expand Down
14 changes: 14 additions & 0 deletions packages/common/update-pkg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const pkgJson = require('@npmcli/package-json')

if (process.argv.includes('--update-main-to-dist')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'dist/index.js' }))
.then((pkg) => pkg.save())
}
if (process.argv.includes('--update-main-to-src')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'src/index.ts' }))
.then((pkg) => pkg.save())
}
8 changes: 6 additions & 2 deletions packages/crypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@
"verify": "run-p prettier lint",
"verify:fix": "yarn prettier:fix && yarn lint:fix",
"build": "node ./build.js",
"postbuild": "tsc --build tsconfig.build.json"
"postbuild": "tsc --build tsconfig.build.json",
"update-main-to-dist": "node ./update-pkg.js --update-main-to-dist",
"update-main-to-src": "node ./update-pkg.js --update-main-to-src",
"prepublish": "npm run update-main-to-dist",
"postpublish": "npm run update-main-to-src"
},
"dependencies": {
"@noble/secp256k1": "^1.7.0",
"@ucans/core": "0.11.0",
"big-integer": "^1.6.51",
"multiformats": "^9.6.4",
"multiformats": "^9.6.4",
"one-webcrypto": "^1.0.3",
"uint8arrays": "3.0.0"
}
Expand Down
1 change: 1 addition & 0 deletions packages/crypto/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist", // Your outDir,
"emitDeclarationOnly": true
},
Expand Down
14 changes: 14 additions & 0 deletions packages/crypto/update-pkg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const pkgJson = require('@npmcli/package-json')

if (process.argv.includes('--update-main-to-dist')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'dist/index.js' }))
.then((pkg) => pkg.save())
}
if (process.argv.includes('--update-main-to-src')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'src/index.ts' }))
.then((pkg) => pkg.save())
}
6 changes: 5 additions & 1 deletion packages/did-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
"verify": "run-p prettier lint",
"verify:fix": "yarn prettier:fix && yarn lint:fix",
"build": "node ./build.js",
"postbuild": "tsc --build tsconfig.build.json"
"postbuild": "tsc --build tsconfig.build.json",
"update-main-to-dist": "node ./update-pkg.js --update-main-to-dist",
"update-main-to-src": "node ./update-pkg.js --update-main-to-src",
"prepublish": "npm run update-main-to-dist",
"postpublish": "npm run update-main-to-src"
},
"dependencies": {
"@atproto/common": "*",
Expand Down
1 change: 1 addition & 0 deletions packages/did-resolver/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist", // Your outDir,
"emitDeclarationOnly": true
},
Expand Down
14 changes: 14 additions & 0 deletions packages/did-resolver/update-pkg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const pkgJson = require('@npmcli/package-json')

if (process.argv.includes('--update-main-to-dist')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'dist/index.js' }))
.then((pkg) => pkg.save())
}
if (process.argv.includes('--update-main-to-src')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'src/index.ts' }))
.then((pkg) => pkg.save())
}
6 changes: 5 additions & 1 deletion packages/handle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
"verify": "run-p prettier lint",
"verify:fix": "yarn prettier:fix && yarn lint:fix",
"build": "node ./build.js",
"postbuild": "tsc --build tsconfig.build.json"
"postbuild": "tsc --build tsconfig.build.json",
"update-main-to-dist": "node ./update-pkg.js --update-main-to-dist",
"update-main-to-src": "node ./update-pkg.js --update-main-to-src",
"prepublish": "npm run update-main-to-dist",
"postpublish": "npm run update-main-to-src"
},
"license": "MIT",
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/handle/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist", // Your outDir,
"emitDeclarationOnly": true
},
Expand Down
14 changes: 14 additions & 0 deletions packages/handle/update-pkg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const pkgJson = require('@npmcli/package-json')

if (process.argv.includes('--update-main-to-dist')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'dist/index.js' }))
.then((pkg) => pkg.save())
}
if (process.argv.includes('--update-main-to-src')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'src/index.ts' }))
.then((pkg) => pkg.save())
}
8 changes: 6 additions & 2 deletions packages/pds/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@atproto/pds",
"version": "0.0.2",
"version": "0.0.1",
"main": "src/index.ts",
"bin": "dist/bin.ts",
"scripts": {
Expand All @@ -18,7 +18,11 @@
"lint:fix": "yarn lint --fix",
"verify": "run-p prettier lint",
"verify:fix": "yarn prettier:fix && yarn lint:fix",
"migration:create": "ts-node ./bin/migration-create.ts"
"migration:create": "ts-node ./bin/migration-create.ts",
"update-main-to-dist": "node ./update-pkg.js --update-main-to-dist",
"update-main-to-src": "node ./update-pkg.js --update-main-to-src",
"prepublish": "npm run update-main-to-dist",
"postpublish": "npm run update-main-to-src"
},
"dependencies": {
"@atproto/auth": "*",
Expand Down
1 change: 1 addition & 0 deletions packages/pds/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist", // Your outDir,
"emitDeclarationOnly": true,
},
Expand Down
14 changes: 14 additions & 0 deletions packages/pds/update-pkg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const pkgJson = require('@npmcli/package-json')

if (process.argv.includes('--update-main-to-dist')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'dist/index.js' }))
.then((pkg) => pkg.save())
}
if (process.argv.includes('--update-main-to-src')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'src/index.ts' }))
.then((pkg) => pkg.save())
}
6 changes: 5 additions & 1 deletion packages/plc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
"build": "node ./build.js",
"postbuild": "tsc --build tsconfig.build.json",
"low": "node dist/scripts/low_pid.js",
"migration:create": "ts-node ./bin/migration-create.ts"
"migration:create": "ts-node ./bin/migration-create.ts",
"update-main-to-dist": "node ./update-pkg.js --update-main-to-dist",
"update-main-to-src": "node ./update-pkg.js --update-main-to-src",
"prepublish": "npm run update-main-to-dist",
"postpublish": "npm run update-main-to-src"
},
"dependencies": {
"@atproto/common": "*",
Expand Down
1 change: 1 addition & 0 deletions packages/plc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist", // Your outDir,
"emitDeclarationOnly": true,
},
Expand Down
14 changes: 14 additions & 0 deletions packages/plc/update-pkg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const pkgJson = require('@npmcli/package-json')

if (process.argv.includes('--update-main-to-dist')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'dist/index.js' }))
.then((pkg) => pkg.save())
}
if (process.argv.includes('--update-main-to-src')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'src/index.ts' }))
.then((pkg) => pkg.save())
}
6 changes: 5 additions & 1 deletion packages/repo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
"verify": "run-p prettier lint",
"verify:fix": "yarn prettier:fix && yarn lint:fix",
"build": "node ./build.js",
"postbuild": "tsc --build tsconfig.build.json"
"postbuild": "tsc --build tsconfig.build.json",
"update-main-to-dist": "node ./update-pkg.js --update-main-to-dist",
"update-main-to-src": "node ./update-pkg.js --update-main-to-src",
"prepublish": "npm run update-main-to-dist",
"postpublish": "npm run update-main-to-src"
},
"dependencies": {
"@atproto/auth": "*",
Expand Down
1 change: 1 addition & 0 deletions packages/repo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist", // Your outDir,
"emitDeclarationOnly": true
},
Expand Down
14 changes: 14 additions & 0 deletions packages/repo/update-pkg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const pkgJson = require('@npmcli/package-json')

if (process.argv.includes('--update-main-to-dist')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'dist/index.js' }))
.then((pkg) => pkg.save())
}
if (process.argv.includes('--update-main-to-src')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'src/index.ts' }))
.then((pkg) => pkg.save())
}
6 changes: 5 additions & 1 deletion packages/uri/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
"verify": "run-p prettier lint",
"verify:fix": "yarn prettier:fix && yarn lint:fix",
"build": "node ./build.js",
"postbuild": "tsc --build tsconfig.build.json"
"postbuild": "tsc --build tsconfig.build.json",
"update-main-to-dist": "node ./update-pkg.js --update-main-to-dist",
"update-main-to-src": "node ./update-pkg.js --update-main-to-src",
"prepublish": "npm run update-main-to-dist",
"postpublish": "npm run update-main-to-src"
},
"license": "MIT",
"dependencies": {}
Expand Down
1 change: 1 addition & 0 deletions packages/uri/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist", // Your outDir,
"emitDeclarationOnly": true
},
Expand Down
14 changes: 14 additions & 0 deletions packages/uri/update-pkg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const pkgJson = require('@npmcli/package-json')

if (process.argv.includes('--update-main-to-dist')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'dist/index.js' }))
.then((pkg) => pkg.save())
}
if (process.argv.includes('--update-main-to-src')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'src/index.ts' }))
.then((pkg) => pkg.save())
}
6 changes: 5 additions & 1 deletion packages/xrpc-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
"verify": "run-p prettier lint",
"verify:fix": "yarn prettier:fix && yarn lint:fix",
"build": "node ./build.js",
"postbuild": "tsc --build tsconfig.build.json"
"postbuild": "tsc --build tsconfig.build.json",
"update-main-to-dist": "node ./update-pkg.js --update-main-to-dist",
"update-main-to-src": "node ./update-pkg.js --update-main-to-src",
"prepublish": "npm run update-main-to-dist",
"postpublish": "npm run update-main-to-src"
},
"license": "MIT",
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/xrpc-server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist", // Your outDir,
"emitDeclarationOnly": true
},
Expand Down
14 changes: 14 additions & 0 deletions packages/xrpc-server/update-pkg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const pkgJson = require('@npmcli/package-json')

if (process.argv.includes('--update-main-to-dist')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'dist/index.js' }))
.then((pkg) => pkg.save())
}
if (process.argv.includes('--update-main-to-src')) {
return pkgJson
.load(__dirname)
.then((pkg) => pkg.update({ main: 'src/index.ts' }))
.then((pkg) => pkg.save())
}

0 comments on commit e44c98e

Please sign in to comment.