jmap-infortu-js

2.4.4 • Public • Published

Info-RTU and JMap NG Lima works with Node.js 18.

The first time, install dependencies :

npm i
npm install -g validator

To run on windows, cross-env (https://www.npmjs.com/package/cross-env) can/must be used to set the environment variable

npm install --save-dev cross-env

To start the application :

For Linux environment:

npm start

For Windows:

npm run wstart

The application is accessible at this location : https://localhost:8083?isFromInfoEx=true or https://localhost:8083/dev/index.html?isFromInfoEx=true

When code is changed, it's automatically built and the web page refresh by its own (thanks webpack dev server).

When running in dev, copy file /build/env-config.js.example to /build/env-config.js and modify accordingly for dev or prod.

webpack environment notes :

Two folders relate to webpack configuration and running process::

  1. src/resources, which contains the initial source index.html files for dev and prod (only used for initial copy)
  2. public/, the directory served by webpack web server which should contain the index.html files and application index.js files.

When the npm start commands is first executed, if the /public directory does not exist, the /dev files should be copied to /public directory (see buildfile.js).

Webpack will create and update the public/index.js file automatically, so the dev/index.html file should contain this file for source of Info-RTU extension

<script defer type="text/javascript" src="/index.js"></script>

The index.html window.JMAP_OPTIONS restBaseUrl value can also be changed to connect to either the Info-Ex Dev JMap server or a local JMap server.

Install the following vs-code extensions :

- "ESLint" extention
- "Prettier - Code formatter" extention (Author : Esben Petersen)

Configure vscode

- Create or edit app/.vscode/settings.json
- Add the following content :

{
  "javascript.format.enable": false,
  "typescript.format.enable": false,
  "eslint.format.enable": true,
  "eslint.lintTask.enable": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  },
  "eslint.workingDirectories": [
    {
      "mode": "auto"
    }
  ],
  "eslint.validate": ["javascript", "typescript", "javascriptreact", "typescriptreact"],
  "editor.formatOnSave": true,
  "editor.formatOnPaste": true,
  "editor.tabSize": 2,
  "editor.detectIndentation": false,
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.codeActionsOnSave": {
      "source.organizeImports": "explicit"
    }
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.codeActionsOnSave": {
      "source.organizeImports": "explicit"
    }
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript][typescriptreact]": {
    "editor.codeActionsOnSave": {
      "source.organizeImports": "explicit"
    }
  }
}

Publish new version to NPM

  • If not logged to npm (use 1pass): npm login
  • Update extension the version in package.json
  • npm install
  • rename /build/env-config.js to /build/_env-config.js or change NODE_ENV to 'production'
  • to publish, npm run build or for windows: npm run build-win

Readme

Keywords

none

Package Sidebar

Install

npm i jmap-infortu-js

Weekly Downloads

15

Version

2.4.4

License

ISC

Unpacked Size

3.01 MB

Total Files

9

Last publish

Collaborators

  • k2-dev