Skip to content

Commit

Permalink
merge delsec to test branch. feat: import client side modules from np…
Browse files Browse the repository at this point in the history
…m, build them with esbuilder, allowing for better updating and CI
  • Loading branch information
schiwaa committed Jul 22, 2024
2 parents aa1a229 + de7754c commit 496e3ad
Show file tree
Hide file tree
Showing 25 changed files with 187 additions and 951 deletions.
9 changes: 4 additions & 5 deletions frontend/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
## Project Structure

- `scripts/` - Utility scripts written in `node` to automate common tasks
- `copyVendor` - Copies the vendor files from `node_modules` to `www` so that it can be deployed to a server as a
standalone folder
- `requirements` - NPM libraries that should be available to the client can be im- and exported in this file.
After adding a requirement execute `npm run build` to build `www/src/css/libraries.js` and
`www/src/js/libraries.css`.
- `serve` - Starts a local web server to serve the `www` folder supporting hot reloading on file changes
- `types/` - Typescript type definitions. While we **DO NOT** use any TypeScript in the project, we do use the type
definitions with [JSDoc](https://jsdoc.app/) to get better code completion in our IDEs. Files in this folder only help
Expand All @@ -17,9 +18,7 @@
The `package.json` file contains the project metadata and the dependencies. The `package-lock.json` file pins the actual
versions of the dependencies that are installed. The `package-lock.json` file is automatically generated and should not
be edited manually. Distribution files from the node modules installed after `npm install` are copied to `www` by
executing `npm run build`. This step is required only after you add / change a dependency. In this case it is likely
that you also need to edit `scripts/copyVendor` to define the source path under `node_modules` and the destination path
in `www`.
executing `npm run build`.

## Code Formatting

Expand Down
79 changes: 59 additions & 20 deletions frontend/package-lock.json

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

9 changes: 6 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@
"license": "MIT",
"scripts": {
"postinstall": "patch-package",
"build": "scripts/copyVendor",
"build": "esbuild scripts/requirements.js --bundle --minify --global-name=libraries --outfile=www/src/js/libraries.js && mv www/src/js/libraries.css www/src/css/libraries.css",
"serve": "scripts/serve",
"serve:background": "scripts/serve &> /dev/null",
"format": "prettier --write './**/*.{js,ts,css,md,json,html}' --config ./.prettierrc.json --ignore-path ./.prettierignore"
},
"dependencies": {
"@hpcc-js/wasm": "^1.18.0",
"@hpcc-js/wasm": "^2.18.0",
"bootstrap": "^5.2.2",
"d3": "^7.6.1",
"d3-graphviz": "^5.0.2",
"dotparser": "^1.1.1",
"feather-icons": "^4.29.0",
"save-svg-as-png": "^1.4.17"
"save-svg-as-png": "^1.4.17",
"sortablejs": "^1.15.2",
"taboverride": "^4.0.3"
},
"devDependencies": {
"@types/bootstrap": "^5.2.5",
Expand Down
84 changes: 0 additions & 84 deletions frontend/scripts/copyVendor

This file was deleted.

18 changes: 18 additions & 0 deletions frontend/scripts/requirements.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'bootstrap/dist/css/bootstrap.min.css'
import { Modal } from 'bootstrap'
export const lib_bootstrap ={
'Modal': Modal
}

export { Graphviz } from '@hpcc-js/wasm/graphviz'
export * as lib_d3graphviz from 'd3-graphviz'
export * as lib_d3 from 'd3'

export * as lib_SaveSvgAsPng from 'save-svg-as-png'
export * as lib_TabOverride from 'taboverride'
export * as lib_Sortable from 'sortablejs'
export * as lib_Feather from 'feather-icons'

export const lib_DotParser = {
'parse': require( 'dotparser' )
}
Loading

0 comments on commit 496e3ad

Please sign in to comment.