Skip to content

Commit

Permalink
fix publishing with 2FA + version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
loveirobert committed Jul 9, 2024
1 parent 7fbd26c commit 51c6843
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 27 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ It will show tasks that you can run with Nx.
- [Follow us on Twitter](https://twitter.com/nxdevtools)

## Create new module

```bash
nx g @nx/js:lib common --buildable=true --publishable=true --importPath=@one-beyond-ai/common
```

## Build all modules

```bash
npx nx run-many -t build
```

## Publish all modules

```bash
npx nx run-many -t publish --ver=0.1.54 --tag=latest --otp=425437
```

otp is optinal if you have 2FA enabled on your NPM account.
2 changes: 1 addition & 1 deletion modules/azure-openai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@one-beyond-ai/azure-openai",
"version": "0.1.53",
"version": "0.1.54",
"dependencies": {
"@azure/openai": "^1.0.0-beta.11",
"@one-beyond-ai/common": "*"
Expand Down
2 changes: 1 addition & 1 deletion modules/azure-openai/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
},
"publish": {
"command": "node tools/scripts/publish.mjs azure-openai {args.ver} {args.tag}",
"command": "node tools/scripts/publish.mjs azure-openai {args.ver} {args.tag} {args.otp}",
"dependsOn": ["build"]
},
"install": {
Expand Down
2 changes: 1 addition & 1 deletion modules/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@one-beyond-ai/common",
"version": "0.1.53",
"version": "0.1.54",
"dependencies": {
"tslib": "^2.3.0"
},
Expand Down
2 changes: 1 addition & 1 deletion modules/common/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
},
"publish": {
"command": "node tools/scripts/publish.mjs common {args.ver} {args.tag}",
"command": "node tools/scripts/publish.mjs common {args.ver} {args.tag} {args.otp}",
"dependsOn": ["build"]
},
"install": {
Expand Down
2 changes: 1 addition & 1 deletion modules/cost/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@one-beyond-ai/cost",
"version": "0.1.53",
"version": "0.1.54",
"dependencies": {
"@one-beyond-ai/common": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion modules/cost/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
},
"publish": {
"command": "node tools/scripts/publish.mjs cost {args.ver} {args.tag}",
"command": "node tools/scripts/publish.mjs cost {args.ver} {args.tag} {args.otp}",
"dependsOn": ["build"]
},
"install": {
Expand Down
2 changes: 1 addition & 1 deletion modules/embed/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@one-beyond-ai/embed",
"version": "0.1.53",
"version": "0.1.54",
"main": "./index.js",
"module": "./index.mjs",
"typings": "./index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion modules/embed/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
},
"publish": {
"command": "node tools/scripts/publish.mjs embed {args.ver} {args.tag}",
"command": "node tools/scripts/publish.mjs embed {args.ver} {args.tag} {args.otp}",
"dependsOn": ["build"]
},
"install": {
Expand Down
2 changes: 1 addition & 1 deletion modules/openai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@one-beyond-ai/openai",
"version": "0.1.53",
"version": "0.1.54",
"dependencies": {
"openai": "^4.29.2",
"@one-beyond-ai/common": "*"
Expand Down
2 changes: 1 addition & 1 deletion modules/openai/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
},
"publish": {
"command": "node tools/scripts/publish.mjs openai {args.ver} {args.tag}",
"command": "node tools/scripts/publish.mjs openai {args.ver} {args.tag} {args.otp}",
"dependsOn": ["build"]
},
"install": {
Expand Down
2 changes: 1 addition & 1 deletion modules/text-document-extractor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@one-beyond-ai/text-document-extractor",
"version": "0.1.53",
"version": "0.1.54",
"dependencies": {
"langchain": "^0.1.26",
"mammoth": "^1.7.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/text-document-extractor/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
},
"publish": {
"command": "node tools/scripts/publish.mjs text-document-extractor {args.ver} {args.tag}",
"command": "node tools/scripts/publish.mjs text-document-extractor {args.ver} {args.tag} {args.otp}",
"dependsOn": ["build"]
},
"install": {
Expand Down
2 changes: 1 addition & 1 deletion modules/tokenizer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@one-beyond-ai/tokenizer",
"version": "0.1.53",
"version": "0.1.54",
"dependencies": {
"js-tiktoken": "^1.0.10",
"langchain": "^0.1.30",
Expand Down
2 changes: 1 addition & 1 deletion modules/tokenizer/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
},
"publish": {
"command": "node tools/scripts/publish.mjs tokenizer {args.ver} {args.tag}",
"command": "node tools/scripts/publish.mjs tokenizer {args.ver} {args.tag} {args.otp}",
"dependsOn": ["build"]
},
"install": {
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"private": true,
"devDependencies": {
"@azure/openai": "^1.0.0-beta.11",
"openai": "^4.29.2",
"@nx/eslint": "18.0.4",
"@nx/eslint-plugin": "18.0.4",
"@nx/js": "^18.0.4",
Expand All @@ -23,18 +22,19 @@
"@vitest/ui": "^1.0.4",
"eslint": "~8.48.0",
"eslint-config-prettier": "^9.0.0",
"js-tiktoken": "^1.0.10",
"langchain": "^0.1.30",
"mammoth": "^1.7.0",
"nx": "18.0.4",
"openai": "^4.29.2",
"pdf-parse": "^1.1.1",
"prettier": "^2.6.2",
"ts-node": "10.9.1",
"typescript": "~5.3.2",
"verdaccio": "^5.0.4",
"vite": "~5.0.0",
"vite-plugin-dts": "~2.3.0",
"vitest": "^1.0.4",
"mammoth": "^1.7.0",
"pdf-parse": "^1.1.1",
"js-tiktoken": "^1.0.10",
"langchain": "^0.1.30"
"vitest": "^1.0.4"
},
"dependencies": {
"tslib": "^2.3.0"
Expand Down
10 changes: 5 additions & 5 deletions samples/one-beyond-ai-aws/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
"dependencies": {
"@aws-sdk/client-sns": "^3.556.0",
"@elastic/elasticsearch": "^8.13.1",
"@one-beyond-ai/azure-openai": "^0.1.53",
"@one-beyond-ai/common": "^0.1.53",
"@one-beyond-ai/embed": "^0.1.53",
"@one-beyond-ai/text-document-extractor": "^0.1.53",
"@one-beyond-ai/tokenizer": "^0.1.53",
"@one-beyond-ai/azure-openai": "^0.1.54",
"@one-beyond-ai/common": "^0.1.54",
"@one-beyond-ai/embed": "^0.1.54",
"@one-beyond-ai/text-document-extractor": "^0.1.54",
"@one-beyond-ai/tokenizer": "^0.1.54",
"@types/aws-lambda": "^8.10.137",
"aws-cdk-lib": "2.133.0",
"aws-sdk": "^2.1598.0",
Expand Down
4 changes: 2 additions & 2 deletions tools/scripts/publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function invariant(condition, message) {

// Executing publish script: node path/to/publish.mjs {name} --version {version} --tag {tag}
// Default "tag" to "next" so we won't publish the "latest" tag by accident.
const [, , name, version, tag = 'next'] = process.argv;
const [, , name, version, tag = 'next', otp] = process.argv;

// A simple SemVer validation to validate the version
const validVersion = /^\d+\.\d+\.\d+(-\w+\.\d+)?/;
Expand Down Expand Up @@ -54,4 +54,4 @@ try {
}

// Execute "npm publish" to publish
execSync(`npm publish --access public --tag ${tag}`);
execSync(`npm publish --access public --tag ${tag} ${otp ? `--otp ${otp}` : ''}`);

0 comments on commit 51c6843

Please sign in to comment.