Skip to content

Commit

Permalink
Rename web -> frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
mairas committed Aug 13, 2024
1 parent 38653d8 commit 4bbe689
Show file tree
Hide file tree
Showing 79 changed files with 11,565 additions and 19,747 deletions.
10 changes: 5 additions & 5 deletions extra_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ def convert_files(root_file_path: pathlib.Path, target):
scripts.convert_html.convert_files(root_file_path, target)


def build_web_ui(*args, **kwargs) -> None:
def frontend(*args, **kwargs) -> None:
# install and build the web UI

scripts.convert_html.convert_files(
pathlib.Path("web/dist/index.html"),
"src/sensesp/net/web/autogen/web_ui_files.h",
"kWebUIFiles",
pathlib.Path("frontend/dist/index.html"),
"src/sensesp/net/web/autogen/frontend_files.h",
"kFrontendFiles",
"/",
)


env.AlwaysBuild(env.Alias("webUI", None, build_web_ui))
env.AlwaysBuild(env.Alias("frontend", None, frontend))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions web/mock/api-routes.mock.ts → frontend/mock/api-routes.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,39 @@ export default defineMock(
headers: {
'Content-Type': 'application/javascript'
},
body: await readFile('../webui-plugins/sample-plugin-js/dist/assets/sensesp-plugin.js', 'utf-8'),
body: await readFile('../frontend-plugins/sample-plugin-js/dist/assets/sensesp-plugin.js', 'utf-8'),
},
{
url: '/api/plugins/sensesp-plugin/__federation_fn_import.js',
method: 'GET',
headers: {
'Content-Type': 'application/javascript'
},
body: await readFile('../webui-plugins/sample-plugin-js/dist/assets/__federation_fn_import.js', 'utf-8'),
body: await readFile('../frontend-plugins/sample-plugin-js/dist/assets/__federation_fn_import.js', 'utf-8'),
},
{
url: '/api/plugins/sensesp-plugin/__federation_shared_preact-8_xvI4no.js',
method: 'GET',
headers: {
'Content-Type': 'application/javascript'
},
body: await readFile('../webui-plugins/sample-plugin-js/dist/assets/__federation_shared_preact-8_xvI4no.js', 'utf-8'),
body: await readFile('../frontend-plugins/sample-plugin-js/dist/assets/__federation_shared_preact-8_xvI4no.js', 'utf-8'),
},
{
url: '/api/plugins/sensesp-plugin/preload-helper-xR9xMGMN.js',
method: 'GET',
headers: {
'Content-Type': 'application/javascript'
},
body: await readFile('../webui-plugins/sample-plugin-js/dist/assets/preload-helper-xR9xMGMN.js', 'utf-8'),
body: await readFile('../frontend-plugins/sample-plugin-js/dist/assets/preload-helper-xR9xMGMN.js', 'utf-8'),
},
{
url: '/api/plugins/sensesp-plugin/__federation_expose_SensESPPlugin-jc4KNWOO.js',
method: 'GET',
headers: {
'Content-Type': 'application/javascript'
},
body: await readFile('../webui-plugins/sample-plugin-js/dist/assets/__federation_expose_SensESPPlugin-jc4KNWOO.js', 'utf-8'),
body: await readFile('../frontend-plugins/sample-plugin-js/dist/assets/__federation_expose_SensESPPlugin-jc4KNWOO.js', 'utf-8'),
}
]
)
File renamed without changes.
File renamed without changes.
56 changes: 56 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "sensesp-frontend",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"css-compile": "sass --style compressed --source-map --embed-sources --no-error-css --load-path=node_modules scss/:css/",
"css-lint": "stylelint scss/",
"css-prefix": "postcss --replace css/styles.css --use autoprefixer --map",
"css": "pnpm run css-compile && pnpm run css-prefix",
"preview": "vite preview",
"type-check": "tsc --noEmit",
"lint": "eslint --fix --ext .js,.jsx,.ts,.tsx ./src",
"format": "prettier --write ./src",
"purgecss": "node ./node_modules/purgecss/bin/purgecss.js --config ./purgecss.config.js",
"fix": "pnpm run format && pnpm run type-check && pnpm run lint"
},
"dependencies": {
"bootstrap": "^5.3.3",
"immer": "^10.1.1",
"preact": "^10.23.2",
"preact-render-to-string": "^6.5.8",
"preact-router": "^4.1.2"
},
"devDependencies": {
"@originjs/vite-plugin-federation": "^1.3.5",
"@preact/preset-vite": "^2.9.0",
"@types/bootstrap": "^5.2.10",
"@typescript-eslint/eslint-plugin": "^8.1.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.9.0",
"eslint-config-love": "^62.0.0",
"eslint-config-preact": "^1.4.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^28.8.0",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-preact": "^0.1.0",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-react": "^7.35.0",
"jest": "^29.7.0",
"postcss": "^8.4.41",
"postcss-cli": "^11.0.0",
"prettier": "3.3.3",
"prettier-plugin-organize-imports": "^4.0.0",
"purgecss": "^6.0.0",
"rollup-plugin-brotli": "^3.1.0",
"sass": "^1.77.8",
"sass-loader": "^16.0.0",
"typescript": "^5.5.4",
"vite": "^5.4.0",
"vite-plugin-mock-dev-server": "^1.7.0",
"vite-tsconfig-paths": "^5.0.1"
}
}
Loading

0 comments on commit 4bbe689

Please sign in to comment.