Skip to content

Commit

Permalink
[CHANGE] bundle building with @nats-io/nats-core dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed May 29, 2024
1 parent 04a23e1 commit 6339c16
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 49 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
*/
"use strict";

module.exports = require("./lib/src/mod");
module.exports = require("./lib/mod");
68 changes: 37 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,14 @@
],
"scripts": {
"build": "tsc",
"cjs-nbc": "deno run --allow-all ./bin/cjs-fix-imports.ts -o nats-base-client/ ./.deps/nats.deno/nats-base-client",
"cjs-jetstream": "deno run --allow-all ./bin/cjs-fix-imports.ts -o jetstream/ ./.deps/nats.deno/jetstream/",
"cjs": "npm run cjs-nbc && npm run cjs-jetstream",
"clean": "shx rm -Rf ./lib/* ./nats-base-client ./.deps",
"clone-nbc": "shx mkdir -p ./.deps && cd ./.deps && git clone --branch v1.26.0 https://github.com/nats-io/nats.deno.git",
"clean": "shx rm -Rf ./lib/*",
"fmt": "deno fmt ./src/ ./examples/ ./test/",
"prepack": "npm run clone-nbc && npm run cjs && npm run check-package && npm run build",
"prepack": "npm run check-package && npm run build",
"ava": "nyc ava --verbose -T 60000",
"test": "npm run check-package && npm run build && npm run ava",
"debug-test": "node node_modules/.bin/ava --verbose -T 6500000 --match",
"setup": "curl -fsSL https://deno.land/x/install/install.sh | sh",
"setup_win": "choco install deno",
"stage": "npm run clean && npm run clone-nbc && npm run cjs && shx rm -Rf ./deps/ && npm run build",
"cover:html": "nyc report --reporter=html && open coverage/index.html",
"coveralls": "shx mkdir -p ./coverage && nyc report --reporter=text-lcov > ./coverage/lcov.info",
"check-package": "deno run --allow-all bin/check-bundle-version.ts",
Expand All @@ -60,10 +55,12 @@
"bump-release": "npm version patch --no-commit-hooks --no-git-tag-version"
},
"engines": {
"node": ">= 14.0.0"
"node": ">= 16.0.0"
},
"dependencies": {
"nkeys.js": "1.1.0"
"@nats-io/nats-core": "^3.0.0-16",
"nkeys.js": "1.1.0",
"nuid": "^2.0.1-1"
},
"devDependencies": {
"@types/node": "^20.12.12",
Expand Down
3 changes: 1 addition & 2 deletions src/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ if (typeof globalThis.ReadableStream === "undefined") {
}

export { connect } from "./connect";
export * from "../nats-base-client/mod";
export * from "../jetstream/mod";
export * from "./nats-base-client";
3 changes: 1 addition & 2 deletions src/nats-base-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from "../nats-base-client/internal_mod";
export * from "../jetstream/internal_mod";
export * from "@nats-io/nats-core/internal";
2 changes: 1 addition & 1 deletion src/node_transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import {
render,
ServerInfo,
Transport,
extend,
} from "./nats-base-client";

import type { ConnectionOptions } from "./nats-base-client";
import { createConnection, Socket } from "net";
import { extend } from "../nats-base-client/util";
import { connect as tlsConnect, TlsOptions, TLSSocket } from "tls";
const { resolve } = require("path");
const { readFile, existsSync } = require("fs");
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"compilerOptions": {
"target": "ES6",
"module": "CommonJS",
"target": "esnext",
"module": "nodenext",
"outDir": "lib/",
"moduleResolution": "node",
"moduleResolution": "nodenext",
"sourceMap": true,
"declaration": true,
"allowJs": true,
Expand Down

0 comments on commit 6339c16

Please sign in to comment.