Skip to content

Commit

Permalink
[CHORE] generate npm bundles and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed Jul 5, 2024
1 parent d1d9c82 commit c1ee62b
Show file tree
Hide file tree
Showing 20 changed files with 132 additions and 62 deletions.
33 changes: 6 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,41 +1,20 @@
# Logs
npm-debug.log*

# generated files
.DS_Store
nats.js
jetstream.js
kv.js
os.js
svc.js
deno.lock
package-lock.json

**/build/
**/lib/
**/node_modules/

*.d.ts
nats.js.map
src/version.json
old_tests/
examples/certs/
.tsconfig
debug/
.idea/
.vscode/
# deno project file
settings.json

deno.lock

# nyc test coverage
.nyc_output
coverage/

# Dependency directories
**/node_modules/

# Optional npm cache directory
.npm

# ide crud
vcs.xml

# we copy package.json to read the version so ts, webpack, etc are happy
src/package.json

2 changes: 1 addition & 1 deletion bin/cjs-fix-imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if (!dirs.length || argv.h || argv.help) {
// create out if not exist
await Deno.lstat(out)
.catch(async () => {
await Deno.mkdir(out);
await Deno.mkdir(out, { recursive: true });
});

// process each file - remove extensions from requires/import
Expand Down
16 changes: 8 additions & 8 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "3.0.0-17",
"files": [
"lib/",
"esm/"
"build/src/"
],
"types": "./lib/mod.d.js",
"exports": {
Expand All @@ -13,11 +13,11 @@
"license": "Apache-2.0",
"private": false,
"scripts": {
"clean": "shx rm -Rf ./lib ./cjs ./esm ./docs && shx mkdir esm",
"pre-process": "npm run clean && deno run -A ../bin/cjs-fix-imports.ts -o ./cjs ./src",
"clean": "shx rm -Rf ./build ./lib ./docs",
"pre-process": "npm run clean && deno run -A ../bin/cjs-fix-imports.ts -o ./build/src ./src",
"build-cjs": "npm run pre-process && tsc",
"build": "npm run build-cjs",
"doc": "npm run clean && npm run build && node_modules/.bin/typedoc --out ./docs/ && touch ./docs/.nojekyll",
"doc": "npm run build && node_modules/.bin/typedoc --out ./docs/ && touch ./docs/.nojekyll",
"prepack": "npm run build"
},
"keywords": [],
Expand All @@ -27,12 +27,12 @@
"description": "nats-core library - this library implements all the base functionality for NATS javascript clients",
"dependencies": {
"@nats-io/nkeys": "1.2.0-4",
"@nats-io/nuid": "2.0.1-2",
"shx": "^0.3.4",
"typescript": "^5.4.5"
"@nats-io/nuid": "2.0.1-2"
},
"devDependencies": {
"@types/node": "^20.11.30",
"typedoc": "^0.25.12"
"typedoc": "^0.25.12",
"shx": "^0.3.4",
"typescript": "^5.4.5"
}
}
4 changes: 2 additions & 2 deletions core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"compilerOptions": {
"target": "esnext",
"module": "nodenext",
"outDir": "lib/",
"outDir": "./lib/",
"moduleResolution": "nodenext",
"sourceMap": true,
"declaration": true,
"allowJs": true,
"removeComments": false
},
"include": [
"cjs/**/*"
"./build/src/**/*"
]
}
2 changes: 1 addition & 1 deletion core/typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"readme": "./README.md",
"theme": "default",
"out": "./docs/",
"entryPoints": ["cjs/mod.ts"]
"entryPoints": ["build/src/mod.ts"]
}
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"test_helpers": "./test_helpers/mod.ts"
},
"tasks": {
"clean": "rm -rf ./coverage/",
"clean": "rm -Rf ./coverage",
"test": "deno task clean && deno task lint && deno task test-all",
"test-all": "deno task test-core && deno task test-jetstream && deno task test-kv && deno task test-obj && deno task test-services && deno task test-unsafe",
"test-unsafe": "deno test -A --parallel --reload --quiet --unsafely-ignore-certificate-errors --coverage=coverage core/unsafe_tests",
Expand Down
15 changes: 10 additions & 5 deletions jetstream/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@nats-io/jetstream",
"version": "3.0.0-3",
"files": [
"lib/"
"lib/",
"build/src/"
],
"types": "./lib/mod.d.js",
"exports": {
Expand All @@ -12,11 +13,11 @@
"license": "Apache-2.0",
"private": false,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"clean": "shx rm -Rf ./lib ./cjs ./esm && shx mkdir esm",
"pre-process": "npm run clean && deno run -A ../bin/cjs-fix-imports.ts -o ./cjs ./src",
"clean": "shx rm -Rf ./build ./lib ./docs",
"pre-process": "npm run clean && deno run -A ../bin/cjs-fix-imports.ts -o ./build/src ./src",
"build-cjs": "npm run pre-process && tsc",
"build": "npm run build-cjs",
"doc": "npm run build && node_modules/.bin/typedoc --out ./docs/ && touch ./docs/.nojekyll",
"prepack": "npm run build"
},
"keywords": [],
Expand All @@ -25,7 +26,11 @@
},
"description": "jetstream library - this library implements all the base functionality for NATS JetStream for javascript clients",
"dependencies": {
"@nats-io/nats-core": "3.0.0-17",
"@nats-io/nats-core": "3.0.0-17"
},
"devDependencies": {
"@types/node": "^20.11.30",
"typedoc": "^0.25.12",
"shx": "^0.3.4",
"typescript": "^5.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions jetstream/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"compilerOptions": {
"target": "esnext",
"module": "nodenext",
"outDir": "lib/",
"outDir": "./lib/",
"moduleResolution": "nodenext",
"sourceMap": true,
"declaration": true,
"allowJs": true,
"removeComments": false
},
"include": [
"cjs/**/*"
"./build/src/**/*"
]
}
6 changes: 6 additions & 0 deletions jetstream/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"readme": "./README.md",
"theme": "default",
"out": "./docs/",
"entryPoints": ["build/src/mod.ts"]
}
15 changes: 10 additions & 5 deletions kv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@nats-io/kv",
"version": "3.0.0-2",
"files": [
"lib/"
"lib/",
"build/src/"
],
"types": "./lib/mod.d.js",
"exports": {
Expand All @@ -12,11 +13,11 @@
"license": "Apache-2.0",
"private": false,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"clean": "shx rm -Rf ./lib ./cjs ./esm && shx mkdir esm",
"pre-process": "npm run clean && deno run -A ../bin/cjs-fix-imports.ts -o ./cjs ./src",
"clean": "shx rm -Rf ./build ./lib ./docs",
"pre-process": "npm run clean && deno run -A ../bin/cjs-fix-imports.ts -o ./build/src ./src",
"build-cjs": "npm run pre-process && tsc",
"build": "npm run build-cjs",
"doc": "npm run build && node_modules/.bin/typedoc --out ./docs/ && touch ./docs/.nojekyll",
"prepack": "npm run build"
},
"keywords": [],
Expand All @@ -26,7 +27,11 @@
"description": "kv library - this library implements all the base functionality for NATS KV javascript clients",
"dependencies": {
"@nats-io/nats-core": "3.0.0-17",
"@nats-io/jetstream": "3.0.0-3",
"@nats-io/jetstream": "3.0.0-3"
},
"devDependencies": {
"@types/node": "^20.11.30",
"typedoc": "^0.25.12",
"shx": "^0.3.4",
"typescript": "^5.4.5"
}
Expand Down
15 changes: 15 additions & 0 deletions kv/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "esnext",
"module": "nodenext",
"outDir": "./lib/",
"moduleResolution": "nodenext",
"sourceMap": true,
"declaration": true,
"allowJs": true,
"removeComments": false
},
"include": [
"./build/src/**/*"
]
}
6 changes: 6 additions & 0 deletions kv/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"readme": "./README.md",
"theme": "default",
"out": "./docs/",
"entryPoints": ["build/src/mod.ts"]
}
15 changes: 10 additions & 5 deletions obj/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@nats-io/obj",
"version": "3.0.0-1",
"files": [
"lib/"
"lib/",
"build/src/"
],
"types": "./lib/mod.d.js",
"exports": {
Expand All @@ -12,11 +13,11 @@
"license": "Apache-2.0",
"private": false,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"clean": "shx rm -Rf ./lib ./cjs ./esm && shx mkdir esm",
"pre-process": "npm run clean && deno run -A ../bin/cjs-fix-imports.ts -o ./cjs ./src",
"clean": "shx rm -Rf ./build ./lib ./docs",
"pre-process": "npm run clean && deno run -A ../bin/cjs-fix-imports.ts -o ./build/src ./src",
"build-cjs": "npm run pre-process && tsc",
"build": "npm run build-cjs",
"doc": "npm run build && node_modules/.bin/typedoc --out ./docs/ && touch ./docs/.nojekyll",
"prepack": "npm run build"
},
"keywords": [],
Expand All @@ -26,7 +27,11 @@
"description": "obj library - this library implements all the base functionality for NATS objectstore for javascript clients",
"dependencies": {
"@nats-io/nats-core": "3.0.0-17",
"@nats-io/jetstream": "3.0.0-3",
"@nats-io/jetstream": "3.0.0-3"
},
"devDependencies": {
"@types/node": "^20.11.30",
"typedoc": "^0.25.12",
"shx": "^0.3.4",
"typescript": "^5.4.5"
}
Expand Down
15 changes: 15 additions & 0 deletions obj/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "esnext",
"module": "nodenext",
"outDir": "./lib/",
"moduleResolution": "nodenext",
"sourceMap": true,
"declaration": true,
"allowJs": true,
"removeComments": false
},
"include": [
"./build/src/**/*"
]
}
6 changes: 6 additions & 0 deletions obj/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"readme": "./README.md",
"theme": "default",
"out": "./docs/",
"entryPoints": ["build/src/mod.ts"]
}
15 changes: 10 additions & 5 deletions services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "@nats-io/services",
"version": "3.0.0-1",
"files": [
"lib/"
"lib/",
"build/src/"
],
"types": "./lib/mod.d.js",
"exports": {
Expand All @@ -12,11 +13,11 @@
"license": "Apache-2.0",
"private": false,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"clean": "shx rm -Rf ./lib ./cjs ./esm && shx mkdir esm",
"pre-process": "npm run clean && deno run -A ../bin/cjs-fix-imports.ts -o ./cjs ./src",
"clean": "shx rm -Rf ./build ./lib ./docs",
"pre-process": "npm run clean && deno run -A ../bin/cjs-fix-imports.ts -o ./build/src ./src",
"build-cjs": "npm run pre-process && tsc",
"build": "npm run build-cjs",
"doc": "npm run build && node_modules/.bin/typedoc --out ./docs/ && touch ./docs/.nojekyll",
"prepack": "npm run build"
},
"keywords": [],
Expand All @@ -25,7 +26,11 @@
},
"description": "services library - this library implements all the base functionality for NATS services for javascript clients",
"dependencies": {
"@nats-io/nats-core": "3.0.0-17",
"@nats-io/nats-core": "3.0.0-17"
},
"devDependencies": {
"@types/node": "^20.11.30",
"typedoc": "^0.25.12",
"shx": "^0.3.4",
"typescript": "^5.4.5"
}
Expand Down
1 change: 1 addition & 0 deletions services/src/internal_mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type {
EndpointStats,
NamedEndpointStats,
Service,
ServiceClient,
ServiceConfig,
ServiceGroup,
ServiceHandler,
Expand Down
1 change: 1 addition & 0 deletions services/src/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type {
EndpointStats,
NamedEndpointStats,
Service,
ServiceClient,
ServiceConfig,
ServiceGroup,
ServiceHandler,
Expand Down
15 changes: 15 additions & 0 deletions services/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "esnext",
"module": "nodenext",
"outDir": "./lib/",
"moduleResolution": "nodenext",
"sourceMap": true,
"declaration": true,
"allowJs": true,
"removeComments": false
},
"include": [
"./build/src/**/*"
]
}
6 changes: 6 additions & 0 deletions services/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"readme": "./README.md",
"theme": "default",
"out": "./docs/",
"entryPoints": ["build/src/mod.ts"]
}

0 comments on commit c1ee62b

Please sign in to comment.