Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update module publish scripts #478

Merged
merged 10 commits into from
Jan 24, 2023
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",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh! Any idea why this was 0.0.3?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think from the adx era

"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())
}