Skip to content
Braulio Diez edited this page Nov 11, 2022 · 3 revisions

Running examples with a local version dev version of promise tracker

Right now this process is a bit cumbersome, we expect to update it in the future.

In order to test an example with the current local build cut:

  • Generate a build on the root project:
npm run build
  • Update the following section on the lib (root) project:

./package.json

-  "browser": "build/lib/index.js",
-  "main": "build/lib/index.js",
-  "types": "build/index.d.ts",
-  "module": "build/es/index.js",
-  "jsnext:main": "build/es/index.js",
+  "browser": "build/lib/index.js",
+  "main": "build/lib/index.js",
+  "types": "build/index.d.ts",
+  "module": "build/es/index.js",
+  "jsnext:main": "build/es/index.js",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/Lemoncode/react-promise-tracker.git"
  },
  • Now go to the example project that you want to run using the current development version, e.g. let's say we want to execute the 00 example, we need to update the package.json and on the react-promise-tracker entry remove the verson and point to the root folder relative path:

./src/examnples/00-example-basic/package.json

  "dependencies": {
    "react": "^16.8.4",
    "react-dom": "^16.8.4",
    "react-loader-spinner": "^2.3.0",
-    "react-promise-tracker": "^3.0.0"
+    "react-promise-tracker": "file:../../"
  }

Now you can just install the packages for that example and execute an start:

cd examples/00-example-basic
npm install
npm start
Clone this wiki locally