Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename web(UI) to frontend #721

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
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
Loading