From f62bdd36c00a1cd8a43a033751f55a645b64654f Mon Sep 17 00:00:00 2001 From: Mathieu Davy <“mathieu.davy@nearform.com”> Date: Thu, 5 Oct 2023 11:49:19 +0100 Subject: [PATCH 1/2] fix: fix for tests There seems to be a process to publish the module that renames the bundle-esm.js file to bundle.js. I don't know why we need to name the webpack generated file with the -esm suffix. --- src/danfojs-browser/package.json | 2 +- src/danfojs-browser/webpack.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/danfojs-browser/package.json b/src/danfojs-browser/package.json index 8f34b05c..8bfb26f1 100644 --- a/src/danfojs-browser/package.json +++ b/src/danfojs-browser/package.json @@ -4,7 +4,7 @@ "description": "JavaScript library providing high performance, intuitive, and easy to use data structures for manipulating and processing structured data.", "main": "dist/danfojs-browser/src/index.js", "types": "dist/danfojs-browser/src/index.d.ts", - "module": "lib/bundle-esm.js", + "module": "lib/bundle.js", "directories": { "test": "tests" }, diff --git a/src/danfojs-browser/webpack.config.js b/src/danfojs-browser/webpack.config.js index 10f8b9d6..d1a1b413 100644 --- a/src/danfojs-browser/webpack.config.js +++ b/src/danfojs-browser/webpack.config.js @@ -12,7 +12,7 @@ const createConfig = () => { target: "web", output: { path: path.resolve(__dirname, "lib"), - filename: "bundle-esm.js", + filename: "bundle.js", library: "dfd" }, module: { From b26112a567f77b4165259f4a22d4fb04e285405c Mon Sep 17 00:00:00 2001 From: Mathieu Davy <“mathieu.davy@nearform.com”> Date: Thu, 5 Oct 2023 12:21:24 +0100 Subject: [PATCH 2/2] fix: allow independent execution of build and test scripts --- package.json | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5a37c7f3..05339c86 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,14 @@ ], "scripts": { "install": "cd src/danfojs-base && yarn && cd ../danfojs-browser && yarn && cd ../danfojs-node && yarn", - "build": "cd src/danfojs-node && yarn build:clean && cd ../danfojs-browser && yarn build:clean", - "test": "cd src/danfojs-base && yarn && cd ../danfojs-node && yarn && yarn test:clean && cd ../danfojs-browser && yarn && yarn test:clean" + "build": "yarn build:browser && yarn build:node", + "build:browser": "cd src/danfojs-browser && yarn build:clean", + "build:node": "cd src/danfojs-node && yarn build:clean", + "pretest": "cd src/danfojs-base && yarn", + "test": "yarn test:browser && yarn test:node", + "pretest:browser": "yarn pretest", + "test:browser": "cd src/danfojs-browser && yarn && yarn test:clean", + "pretest:node": "yarn pretest", + "test:node": "cd src/danfojs-node && yarn && yarn test:clean" } }