From 116812855cf463027005686fef3e65408f8233f5 Mon Sep 17 00:00:00 2001 From: Akshat Sharma <1529776+akshat1@users.noreply.github.com> Date: Mon, 27 May 2024 21:55:12 -0700 Subject: [PATCH] Fixed issues with the published npm package. 1. Updated main file in package.json 2. Moved js files from src to lib. Because we don't transpile anything, a source directory doesn't make sense. 3. Renamed Compute.js and Compute.test.js to index.js and index.test.js. 4. Added an npmignore file. --- .npmignore | 5 +++++ jsdoc.conf.json | 2 +- {src => lib}/Observable.js | 0 {src => lib}/Observable.test.js | 0 {src => lib}/SubscriptionManager.js | 0 src/Compute.js => lib/index.js | 0 src/Compute.test.js => lib/index.test.js | 2 +- {src => lib}/typedefs.js | 0 package.json | 6 +++--- 9 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .npmignore rename {src => lib}/Observable.js (100%) rename {src => lib}/Observable.test.js (100%) rename {src => lib}/SubscriptionManager.js (100%) rename src/Compute.js => lib/index.js (100%) rename src/Compute.test.js => lib/index.test.js (94%) rename {src => lib}/typedefs.js (100%) diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..7a5172a --- /dev/null +++ b/.npmignore @@ -0,0 +1,5 @@ +jsdoc.conf.json +.github +docs +coverage +lcov.info diff --git a/jsdoc.conf.json b/jsdoc.conf.json index 9ec21b7..a2f6e9e 100644 --- a/jsdoc.conf.json +++ b/jsdoc.conf.json @@ -4,7 +4,7 @@ "dictionaries": ["jsdoc","closure"] }, "source": { - "include": ["src"], + "include": ["lib"], "includePattern": ".+\\.js(doc|x)?$", "excludePattern": "(^|\\/|\\\\)_" }, diff --git a/src/Observable.js b/lib/Observable.js similarity index 100% rename from src/Observable.js rename to lib/Observable.js diff --git a/src/Observable.test.js b/lib/Observable.test.js similarity index 100% rename from src/Observable.test.js rename to lib/Observable.test.js diff --git a/src/SubscriptionManager.js b/lib/SubscriptionManager.js similarity index 100% rename from src/SubscriptionManager.js rename to lib/SubscriptionManager.js diff --git a/src/Compute.js b/lib/index.js similarity index 100% rename from src/Compute.js rename to lib/index.js diff --git a/src/Compute.test.js b/lib/index.test.js similarity index 94% rename from src/Compute.test.js rename to lib/index.test.js index 14f72a1..5fdf4ec 100644 --- a/src/Compute.test.js +++ b/lib/index.test.js @@ -1,6 +1,6 @@ import test from "node:test"; import assert from "node:assert"; -import { gather, isObservable, observable, from } from "./Compute.js"; +import { gather, isObservable, observable, from } from "./index.js"; test("Compute", async (t) => { await t.test("gather", async (t1) => { diff --git a/src/typedefs.js b/lib/typedefs.js similarity index 100% rename from src/typedefs.js rename to lib/typedefs.js diff --git a/package.json b/package.json index 38c7df6..dd1ab1b 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "homepage": "http://akshat1.github.io/compute/", "license": "MIT", "author": "akshat1", - "version": "1.0.1", - "main": "dist/compute-debug.js", + "version": "1.0.2", + "main": "lib/index.js", "type": "module", "bugs": { "url": "https://github.com/akshat1/compute/issues", @@ -20,7 +20,7 @@ "url": "https://github.com/akshat1/compute" }, "scripts": { - "clean": "rm -rf dist docs", + "clean": "rm -rf docs coverage lcov.info", "test": "node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info", "cov-html": "genhtml --output-directory=./coverage lcov.info", "doc": "jsdoc -c jsdoc.conf.json"