└── boilerplates ├── fast-vite-nestjs-electron ├── .npmrc ├── src │ ├── render │ │ ├── vite-env.d.ts │ │ ├── main.ts │ │ ├── assets │ │ │ └── logo.png │ │ ├── public │ │ │ └── favicon.ico │ │ ├── index.html │ │ ├── App.vue │ │ └── components │ │ │ └── HelloWorld.vue │ ├── main │ │ ├── app.service.ts │ │ ├── app.controller.ts │ │ ├── app.module.ts │ │ └── index.ts │ └── preload │ │ ├── index.d.ts │ │ └── index.ts ├── logo.png ├── renovate.json ├── .gitignore ├── eslint.config.js ├── electron-builder.config.js ├── tsconfig.json ├── vite.config.ts ├── LICENSE ├── .github │ └── workflows │ │ └── ci.yml ├── package.json └── README.md └── ts-webpack-react-electron ├── scripts ├── tools │ ├── publish_pkgs.sh │ ├── release_pkgs.sh │ ├── start_mono.sh │ ├── start_micro.sh │ ├── upgrade_pkgs.sh │ └── lint_pkgs.sh ├── docker │ ├── Dockerfile.local │ ├── Dockerfile.gitlab │ ├── start-container.sh │ ├── build-locally-dev.sh │ └── build-locally-release.sh ├── jest │ └── jest.config.js ├── helm │ ├── deploy-web-client.sh │ ├── README.md │ ├── upgrade-web-client.sh │ └── charts │ │ ├── Chart.yaml │ │ ├── .helmignore │ │ ├── templates │ │ ├── api-svc.yaml │ │ ├── ingress.yaml │ │ ├── deployment.yaml │ │ └── _helpers.tpl │ │ └── values.yaml └── webpack │ └── webpack.config.js ├── packages ├── rte-host-app │ ├── src │ │ ├── apps │ │ │ ├── shared │ │ │ │ ├── index.ts │ │ │ │ └── components │ │ │ │ │ ├── Copyright │ │ │ │ │ ├── index.less │ │ │ │ │ └── index.tsx │ │ │ │ │ └── FieldsDetail │ │ │ │ │ └── index.less │ │ │ ├── home │ │ │ │ ├── containers │ │ │ │ │ ├── Home │ │ │ │ │ │ ├── index.less │ │ │ │ │ │ ├── manifest.tsx │ │ │ │ │ │ └── index.scss │ │ │ │ │ ├── Mobile │ │ │ │ │ │ ├── index.tsx │ │ │ │ │ │ └── index.scss │ │ │ │ │ ├── SoftwareMesh │ │ │ │ │ │ ├── index.scss │ │ │ │ │ │ └── index.tsx │ │ │ │ │ └── Support │ │ │ │ │ │ └── index.tsx │ │ │ │ └── components │ │ │ │ │ ├── Toolbar │ │ │ │ │ ├── index.scss │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── InstallableAppSeriesView │ │ │ │ │ ├── index.scss │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── Menu │ │ │ │ │ ├── index.scss │ │ │ │ │ └── index.tsx │ │ │ │ │ └── InstallableAppView │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── index.scss │ │ │ ├── auth │ │ │ │ └── containers │ │ │ │ │ └── LoginPage │ │ │ │ │ ├── index.less │ │ │ │ │ └── index.tsx │ │ │ └── user │ │ │ │ ├── components │ │ │ │ └── PersonTable │ │ │ │ │ ├── index.less │ │ │ │ │ └── index.tsx │ │ │ │ ├── ducks │ │ │ │ └── user.ts │ │ │ │ └── containers │ │ │ │ └── PersonList │ │ │ │ ├── index.less │ │ │ │ └── index.tsx │ │ ├── skeleton │ │ │ ├── utils │ │ │ │ ├── index.ts │ │ │ │ └── errors.ts │ │ │ ├── api │ │ │ │ ├── index.ts │ │ │ │ ├── axios │ │ │ │ │ ├── notice.ts │ │ │ │ │ └── agent.ts │ │ │ │ └── umi │ │ │ │ │ └── request.ts │ │ │ ├── hocs │ │ │ │ └── index.ts │ │ │ ├── styles │ │ │ │ ├── mixins.less │ │ │ │ └── animation.less │ │ │ ├── hooks │ │ │ │ ├── index.ts │ │ │ │ ├── pagination.ts │ │ │ │ ├── interval.ts │ │ │ │ └── state.ts │ │ │ ├── containers │ │ │ │ ├── AppContainer │ │ │ │ │ ├── index.less │ │ │ │ │ └── index.tsx │ │ │ │ ├── App │ │ │ │ │ ├── index.less │ │ │ │ │ └── index.tsx │ │ │ │ ├── index.ts │ │ │ │ ├── IntervalComponent │ │ │ │ │ └── index.tsx │ │ │ │ └── PromiseComp │ │ │ │ │ └── index.tsx │ │ │ ├── layouts │ │ │ │ ├── index.ts │ │ │ │ ├── BlankLayout.tsx │ │ │ │ ├── NavContext.tsx │ │ │ │ └── index.less │ │ │ ├── components │ │ │ │ ├── exception │ │ │ │ │ ├── 403 │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── 404 │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── 500 │ │ │ │ │ │ └── index.tsx │ │ │ │ │ ├── index.ts │ │ │ │ │ └── SimpleException.tsx │ │ │ │ ├── PageLoading │ │ │ │ │ └── index.tsx │ │ │ │ ├── HeaderDropdown │ │ │ │ │ ├── index.less │ │ │ │ │ └── index.tsx │ │ │ │ ├── PageHeader │ │ │ │ │ ├── index.less │ │ │ │ │ └── index.tsx │ │ │ │ ├── Label │ │ │ │ │ ├── index.less │ │ │ │ │ └── index.tsx │ │ │ │ ├── index.ts │ │ │ │ ├── LangSelector │ │ │ │ │ ├── index.less │ │ │ │ │ └── index.tsx │ │ │ │ ├── NoticeIcon │ │ │ │ │ ├── index.less │ │ │ │ │ └── NoticeList.less │ │ │ │ ├── CopyBlock │ │ │ │ │ ├── index.less │ │ │ │ │ └── index.tsx │ │ │ │ ├── HeaderSearch │ │ │ │ │ └── index.less │ │ │ │ └── GlobalHeader │ │ │ │ │ ├── UserDropdown.tsx │ │ │ │ │ └── RightContent.tsx │ │ │ ├── env │ │ │ │ ├── history.ts │ │ │ │ ├── index.ts │ │ │ │ ├── dev.ts │ │ │ │ ├── theme.ts │ │ │ │ ├── store.ts │ │ │ │ └── sw-notify.tsx │ │ │ ├── types │ │ │ │ ├── index.ts │ │ │ │ ├── pagination.ts │ │ │ │ ├── module.ts │ │ │ │ ├── comp.tsx │ │ │ │ └── props.ts │ │ │ ├── auth │ │ │ │ ├── index.tsx │ │ │ │ ├── Authorized.tsx │ │ │ │ ├── __test__ │ │ │ │ │ └── authority.test.ts │ │ │ │ ├── AuthorizedRoute.tsx │ │ │ │ ├── authority.ts │ │ │ │ ├── token.ts │ │ │ │ ├── withAuth.tsx │ │ │ │ └── permissions.tsx │ │ │ └── index.ts │ │ ├── apis │ │ │ ├── index.ts │ │ │ └── user │ │ │ │ └── index.ts │ │ ├── models │ │ │ ├── index.ts │ │ │ ├── UserModel.ts │ │ │ └── global.ts │ │ ├── typings │ │ │ ├── less.d.ts │ │ │ ├── utils.d.ts │ │ │ ├── global.d.ts │ │ │ ├── typings.d.ts │ │ │ └── shim.d.ts │ │ ├── assets │ │ │ ├── bg1.png │ │ │ ├── bg2.png │ │ │ ├── bg3.png │ │ │ ├── bg4.png │ │ │ ├── bg5.png │ │ │ ├── qrcode.png │ │ │ ├── no-record.png │ │ │ ├── malfunction.svg │ │ │ ├── defectives.svg │ │ │ ├── up.svg │ │ │ ├── device.svg │ │ │ ├── logo_u.svg │ │ │ ├── consumable.svg │ │ │ ├── dns.svg │ │ │ └── qq.svg │ │ ├── i18n │ │ │ └── index.ts │ │ ├── ducks │ │ │ ├── index.ts │ │ │ └── common.ts │ │ ├── schema │ │ │ ├── helpers.ts │ │ │ └── datetime.ts │ │ └── index.tsx │ ├── tslint.json │ ├── tsconfig.test.json │ ├── .eslintignore │ ├── public │ │ ├── favicon.ico │ │ ├── manifest.json │ │ ├── index.html │ │ └── service-worker.js │ ├── tsconfig.json │ ├── .gitignore │ ├── .vscode │ │ └── settings.json │ ├── babel.config.js │ ├── scripts │ │ └── webpack │ │ │ ├── webpack.config.resolve.js │ │ │ ├── webpack.config.umd.js │ │ │ ├── webpack.config.prod.js │ │ │ ├── webpack.config.umd.dev.js │ │ │ ├── webpack.config.dev.js │ │ │ └── webpack.config.theme.js │ └── .eslintrc.js ├── rte-node │ ├── public │ │ ├── style.css │ │ ├── favicon.ico │ │ └── index.html │ ├── src │ │ ├── shim.d.ts │ │ ├── service │ │ │ ├── DownloadService.ts │ │ │ └── UpdateService.ts │ │ ├── env.ts │ │ └── index.ts │ ├── tslint.json │ ├── tsconfig.test.json │ ├── .eslintignore │ ├── tsconfig.json │ ├── babel.config.js │ ├── .eslintrc.js │ ├── .gitignore │ ├── .eslintrc │ ├── scripts │ │ └── webpack │ │ │ └── webpack.config.js │ └── package.json └── rte-core │ ├── .eslintrc.js │ ├── tslint.json │ ├── tsconfig.json │ ├── src │ ├── models │ │ ├── index.ts │ │ ├── InstallableAppSeries.ts │ │ └── InstallableApp.ts │ ├── index.ts │ └── funcs │ │ └── index.ts │ ├── tsconfig.test.json │ ├── scripts │ ├── jest │ │ └── jest.config.js │ └── webpack │ │ └── webpack.config.umd.js │ ├── .eslintignore │ ├── tsconfig.cjs.json │ ├── babel.config.js │ ├── tsconfig.es.json │ ├── .vscode │ └── setting.json │ └── package.json ├── .huskyrc.js ├── .lintstagedrc.js ├── .postcssrc.js ├── jsconfig.json ├── .dockerignore ├── .prettierignore ├── tsconfig.test.json ├── .eslintignore ├── .github └── ISSUE_TEMPLATE │ ├── custom.md │ ├── feature_request.md │ └── bug_report.md ├── .editorconfig ├── .vscode └── setting.json ├── .gitignore ├── .eslintrc.js ├── extra └── regedit │ └── vbs │ ├── JsonSafeTest.wsf │ ├── regDeleteKey.wsf │ ├── regCreateKey.wsf │ ├── regList.wsf │ ├── regListStream.wsf │ └── regPutValue.wsf ├── tsconfig.json ├── tslint.json ├── electron-builder.yml ├── .gitlab-ci.yml └── LICENSE /boilerplates/fast-vite-nestjs-electron/.npmrc: -------------------------------------------------------------------------------- 1 | node-linker=hoisted -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/tools/publish_pkgs.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/tools/release_pkgs.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/shared/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.huskyrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@m-fe/husky-config'); 2 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/src/render/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.lintstagedrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@m-fe/lint-staged'); 2 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.postcssrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@m-fe/postcss-config'); 2 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@m-fe/tsconfig/jsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/public/style.css: -------------------------------------------------------------------------------- 1 | .app { 2 | color: grey; 3 | } 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require("../../.eslintrc.js") -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './errors'; 2 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../tslint.json"] 3 | } 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/api/index.ts: -------------------------------------------------------------------------------- 1 | export * from './umi/request'; 2 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/hocs/index.ts: -------------------------------------------------------------------------------- 1 | export * from './reactable'; 2 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../tslint.json"] 3 | } 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/src/shim.d.ts: -------------------------------------------------------------------------------- 1 | declare module '@ravshansbox/browser-crypto'; 2 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../tslint.json"] 3 | } 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/docker/Dockerfile.local: -------------------------------------------------------------------------------- 1 | FROM abiosoft/caddy 2 | COPY . /srv 3 | EXPOSE 2015 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/jest/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@m-fe/jest-config/jest.config'); 2 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.dockerignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.tsbuildinfo 3 | .cache 4 | .vscode 5 | coverage 6 | dist 7 | node_modules 8 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apis/index.ts: -------------------------------------------------------------------------------- 1 | export * from './auth/login'; 2 | export * from './user'; 3 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from './UserModel'; 2 | export * from './global'; 3 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/styles/mixins.less: -------------------------------------------------------------------------------- 1 | .container { 2 | position: relative; 3 | } 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/tools/start_mono.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | (cd packages/rte-host-app && npm start) 5 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/src/service/DownloadService.ts: -------------------------------------------------------------------------------- 1 | export class DownloadService { 2 | download() {} 3 | } 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/tools/start_micro.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | (cd packages/rte-host-app && npm start) 5 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.prettierignore: -------------------------------------------------------------------------------- 1 | !/.vscode/settings.json 2 | *.min.* 3 | *.production.* 4 | coverage 5 | dist 6 | node_modules 7 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["src/**/*"] 4 | } 5 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/home/containers/Home/index.less: -------------------------------------------------------------------------------- 1 | .container { 2 | position: relative; 3 | } 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export * from './pagination'; 2 | export * from './state'; 3 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/src/models/index.ts: -------------------------------------------------------------------------------- 1 | export * from './InstallableApp'; 2 | export * from './InstallableAppSeries'; 3 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/auth/containers/LoginPage/index.less: -------------------------------------------------------------------------------- 1 | .container { 2 | position: relative; 3 | } 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/containers/AppContainer/index.less: -------------------------------------------------------------------------------- 1 | .container { 2 | position: relative; 3 | } 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/layouts/index.ts: -------------------------------------------------------------------------------- 1 | export * from './NavContext'; 2 | export * from './NavLayout'; 3 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/electron-examples/master/boilerplates/fast-vite-nestjs-electron/logo.png -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/src/render/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | 4 | createApp(App).mount('#app') 5 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/containers/App/index.less: -------------------------------------------------------------------------------- 1 | .container { 2 | color: black; 3 | height: 100%; 4 | } 5 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apis/user/index.ts: -------------------------------------------------------------------------------- 1 | export const getUsers = async (): Promise => { 2 | return []; 3 | }; 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './funcs'; 2 | export * from './models'; 3 | 4 | export const library = 'rteCore'; 5 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/exception/index.ts: -------------------------------------------------------------------------------- 1 | export * from './403'; 2 | export * from './404'; 3 | export * from './500'; 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/typings/less.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.less' { 2 | const styles: Record; 3 | export = styles; 4 | } 5 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/env/history.ts: -------------------------------------------------------------------------------- 1 | import { createHashHistory } from 'history'; 2 | 3 | export const history = createHashHistory(); 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/helm/deploy-web-client.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd `dirname $0` 4 | 5 | helm install --namespace test --name test-web-client ./charts/ 6 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/src/render/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/electron-examples/master/boilerplates/fast-vite-nestjs-electron/src/render/assets/logo.png -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/scripts/jest/jest.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../../../scripts/jest/jest.config'); 2 | 3 | module.exports = baseConfig; 4 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/helm/README.md: -------------------------------------------------------------------------------- 1 | # Web Client 2 | 3 | ```sh 4 | # 初始安装 5 | $ ./deploy-web-client.sh 6 | 7 | # 执行更新 8 | $ ./upgrade-web-client.sh 9 | ``` 10 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/helm/upgrade-web-client.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd `dirname $0` 4 | 5 | helm upgrade --namespace test --name test-web-client ./charts/ 6 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.eslintignore: -------------------------------------------------------------------------------- 1 | !/.*.js 2 | *.min.* 3 | *.production.* 4 | *.md 5 | *.js 6 | *.json 7 | 8 | coverage 9 | dist 10 | node_modules 11 | build 12 | scripts 13 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/env/index.ts: -------------------------------------------------------------------------------- 1 | export * from './dev'; 2 | export * from './history'; 3 | export * from './store'; 4 | export * from './theme'; 5 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/src/render/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/electron-examples/master/boilerplates/fast-vite-nestjs-electron/src/render/public/favicon.ico -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/helm/charts/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | appVersion: '1.0' 3 | description: A Helm chart for UnionFab Cloud 4 | name: test-web-client 5 | version: 0.1.0 6 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from './comp'; 2 | export * from './module'; 3 | export * from './pagination'; 4 | export * from './props'; 5 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/src/env.ts: -------------------------------------------------------------------------------- 1 | export const NODE_ENV = process.env.NODE_ENV || 'development'; 2 | export const __DEV__ = NODE_ENV === 'development' || NODE_ENV === 'dev'; 3 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/user/components/PersonTable/index.less: -------------------------------------------------------------------------------- 1 | .editButton { 2 | display: flex; 3 | justify-content: flex-start; 4 | align-items: center; 5 | } 6 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/electron-examples/master/boilerplates/ts-webpack-react-electron/packages/rte-node/public/favicon.ico -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/.eslintignore: -------------------------------------------------------------------------------- 1 | !/.*.js 2 | *.min.* 3 | *.production.* 4 | *.md 5 | *.js 6 | *.json 7 | 8 | coverage 9 | dist 10 | node_modules 11 | build 12 | scripts 13 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/shared/components/Copyright/index.less: -------------------------------------------------------------------------------- 1 | .container { 2 | position: absolute; 3 | bottom: 0; 4 | width: 100vw; 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/.eslintignore: -------------------------------------------------------------------------------- 1 | !/.*.js 2 | *.min.* 3 | *.production.* 4 | *.md 5 | *.js 6 | *.json 7 | 8 | coverage 9 | dist 10 | node_modules 11 | build 12 | scripts 13 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/.eslintignore: -------------------------------------------------------------------------------- 1 | !/.*.js 2 | *.min.* 3 | *.production.* 4 | *.md 5 | *.js 6 | *.json 7 | 8 | coverage 9 | dist 10 | node_modules 11 | build 12 | scripts 13 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/electron-examples/master/boilerplates/ts-webpack-react-electron/packages/rte-host-app/public/favicon.ico -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/bg1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/electron-examples/master/boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/bg1.png -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/bg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/electron-examples/master/boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/bg2.png -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/bg3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/electron-examples/master/boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/bg3.png -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/bg4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/electron-examples/master/boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/bg4.png -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/bg5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/electron-examples/master/boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/bg5.png -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/electron-examples/master/boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/qrcode.png -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/containers/index.ts: -------------------------------------------------------------------------------- 1 | export * from './App'; 2 | export * from './AppContainer'; 3 | export * from './IntervalComponent'; 4 | export * from './PromiseComp'; 5 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "paths": {} 6 | }, 7 | "include": ["src/**/*"] 8 | } 9 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/no-record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wx-chevalier/electron-examples/master/boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/no-record.png -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/types/pagination.ts: -------------------------------------------------------------------------------- 1 | export interface Pagination { 2 | pageNum: number; 3 | pageSize?: number; 4 | totalElements: number; 5 | totalPages: number; 6 | } 7 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ], 6 | "automerge": true, 7 | "automergeStrategy": "squash" 8 | } 9 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/src/main/app.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@nestjs/common' 2 | 3 | @Injectable() 4 | export class AppService { 5 | public getTime(): number { 6 | return new Date().getTime() 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "outDir": "dist/cjs", 6 | "declaration": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/exception/SimpleException.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export const SimpleException = ({ ...args }) => ( 4 |
Simple Exception
5 | ); 6 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | tab_width = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/home/components/Toolbar/index.scss: -------------------------------------------------------------------------------- 1 | .toolbar-container { 2 | position: fixed; 3 | right: 10px; 4 | top: 10px; 5 | z-index: 100; 6 | color: #000; 7 | -webkit-app-region: no-drag; 8 | } 9 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.vscode/setting.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": [ 3 | "javascript", 4 | "javascriptreact", 5 | { "language": "typescript", "autoFix": true }, 6 | { "language": "typescriptreact", "autoFix": true } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.gitignore: -------------------------------------------------------------------------------- 1 | # Node files 2 | node_modules 3 | 4 | # OS junk files 5 | .DS_Store 6 | .stylelintcache 7 | .eslintcache 8 | 9 | # Project specific stuff 10 | .cache-loader 11 | @coverage 12 | *.log 13 | dist 14 | build 15 | out 16 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/hooks/pagination.ts: -------------------------------------------------------------------------------- 1 | import { useLiteState } from '.'; 2 | 3 | export const usePagination = (pageNum = 1, pageSize = 20) => 4 | useLiteState(() => ({ 5 | pageNum, 6 | pageSize, 7 | })); 8 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/src/preload/index.d.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface Window { 3 | electron: { 4 | sendMsg(msg: string): Promise 5 | onReplyMsg(cb: (msg: string) => any): void 6 | } 7 | } 8 | } 9 | 10 | export { } 11 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/tsconfig.es.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "es6", 5 | "outDir": "dist/es", 6 | "declaration": true, 7 | "declarationDir": "dist/types" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/layouts/BlankLayout.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | const Layout: React.FC = ({ children }) => ( 4 | <> 5 |
{children}
6 | 7 | ); 8 | 9 | export default Layout; 10 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "paths": { 6 | "@/*": ["./src/*"] 7 | } 8 | }, 9 | "include": ["src/**/*"] 10 | } 11 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: false, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Hello World! 7 | 8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/.gitignore: -------------------------------------------------------------------------------- 1 | # Node files 2 | node_modules 3 | 4 | # OS junk files 5 | .DS_Store 6 | .stylelintcache 7 | .eslintcache 8 | 9 | # Project specific stuff 10 | .cache-loader 11 | @coverage 12 | *.log 13 | dist 14 | build 15 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": [ 3 | "javascript", 4 | "javascriptreact", 5 | { "language": "typescript", "autoFix": true }, 6 | { "language": "typescriptreact", "autoFix": true } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@m-fe', 5 | { 6 | import: true, 7 | react: true, 8 | typescript: true, 9 | }, 10 | ], 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/scripts/webpack/webpack.config.resolve.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | resolve: { 5 | alias: { 6 | '@': path.resolve(__dirname, '../..', 'src/'), 7 | }, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/auth/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './authority'; 2 | export * from './withAuth'; 3 | export * from './Authorized'; 4 | export * from './AuthorizedRoute'; 5 | export * from './permissions'; 6 | export * from './token'; 7 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '@m-fe/eslint-config/base', 3 | parserOptions: { 4 | ecmaVersion: 2018, 5 | sourceType: 'module', 6 | project: './tsconfig.json', 7 | tsconfigRootDir: __dirname, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/home/components/Toolbar/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import './index.scss'; 4 | 5 | export const Toolbar = (props: any) => { 6 | return
{props.children}
; 7 | }; 8 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/tools/upgrade_pkgs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | ncu -u 5 | 6 | (cd ./packages/rte-core && ncu -u) 7 | (cd ./packages/rte-bootstrap && ncu -u) 8 | (cd ./packages/rte-host-app && ncu -u) 9 | (cd ./packages/rte-mobx-app && ncu -u) 10 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/extra/regedit/vbs/JsonSafeTest.wsf: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/tools/lint_pkgs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | cd ./packages 5 | 6 | for file in *; do 7 | [ -d "$file" ] || continue 8 | 9 | if [ "$file" == "config" ]; then 10 | continue 11 | fi 12 | 13 | echo "cd $file" 14 | cd ./$file 15 | yarn lint 16 | cd .. 17 | done 18 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/.vscode/setting.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": [ 3 | "javascript", 4 | "javascriptreact", 5 | { 6 | "language": "typescript", 7 | "autoFix": true 8 | }, 9 | { 10 | "language": "typescriptreact", 11 | "autoFix": true 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@m-fe/tsconfig/tsconfig.json", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "paths": {}, 6 | "strictFunctionTypes": false, 7 | "strictNullChecks": false, 8 | "suppressImplicitAnyIndexErrors": true 9 | }, 10 | "include": ["**/*.ts", "**/*.tsx"] 11 | } 12 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/home/containers/Mobile/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import './index.scss'; 4 | 5 | export const Mobile = () => ( 6 |
7 |
8 |
9 |
10 |
11 | ); 12 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/index.ts: -------------------------------------------------------------------------------- 1 | export * from './api'; 2 | export * from './auth'; 3 | export * from './components'; 4 | export * from './containers'; 5 | export * from './env'; 6 | export * from './hocs'; 7 | export * from './hooks'; 8 | export * from './layouts'; 9 | export * from './types'; 10 | export * from './utils'; 11 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/src/models/InstallableAppSeries.ts: -------------------------------------------------------------------------------- 1 | import { Base } from 'ueact-utils'; 2 | 3 | import { InstallableApp } from './InstallableApp'; 4 | 5 | export class InstallableAppSeries extends Base { 6 | name: string; 7 | 8 | key: string; 9 | 10 | apps: InstallableApp[]; 11 | 12 | order: number; 13 | 14 | description: string; 15 | } 16 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/eslint.config.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | const lightwing = require('@lightwing/eslint-config').default 3 | 4 | module.exports = lightwing( 5 | { 6 | ignores: [ 7 | 'dist', 8 | 'node_modules', 9 | '*.svelte', 10 | '*.snap', 11 | '*.d.ts', 12 | 'coverage', 13 | 'js_test', 14 | 'local-data', 15 | ], 16 | }, 17 | ) 18 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/src/preload/index.ts: -------------------------------------------------------------------------------- 1 | import { contextBridge, ipcRenderer } from 'electron' 2 | 3 | contextBridge.exposeInMainWorld( 4 | 'electron', 5 | { 6 | sendMsg: (msg: string): Promise => ipcRenderer.invoke('msg', msg), 7 | onReplyMsg: (cb: (msg: string) => any) => ipcRenderer.on('reply-msg', (e, msg: string) => { 8 | cb(msg) 9 | }), 10 | }, 11 | ) 12 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/typings/utils.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * From `T`, `omit` a set of properties whose keys are in the union `K`. 3 | * 4 | * @example 5 | ``` 6 | type Foo = { 7 | a: number; 8 | b: string; 9 | }; 10 | type FooWithoutA = Omit; // { b: string } 11 | ``` 12 | */ 13 | export type Omit = Pick>; 14 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/docker/Dockerfile.gitlab: -------------------------------------------------------------------------------- 1 | FROM mhart/alpine-node:latest as builder 2 | 3 | # 安装与编译代码 4 | COPY . /app 5 | WORKDIR /app 6 | 7 | RUN yarn install --frozen-lockfile --registry https://registry.npm.taobao.org/ 8 | RUN yarn build 9 | RUN find . -name '*.map' -type f -exec rm -f {} \; 10 | 11 | # 最终的应用 12 | FROM abiosoft/caddy 13 | COPY --from=builder /app/build /srv 14 | EXPOSE 2015 15 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/PageLoading/index.tsx: -------------------------------------------------------------------------------- 1 | import { Spin } from 'antd'; 2 | import * as React from 'react'; 3 | 4 | // loading components from code split 5 | // https://umijs.org/plugin/umi-plugin-react.html#dynamicimport 6 | export const PageLoading: React.FC = () => ( 7 |
8 | 9 |
10 | ); 11 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/scripts/webpack/webpack.config.umd.js: -------------------------------------------------------------------------------- 1 | const merge = require('webpack-merge'); 2 | 3 | const themeConfig = require('./webpack.config.theme'); 4 | const umdConfig = require('../../../../scripts/webpack/webpack.config') 5 | .umdConfig; 6 | 7 | module.exports = merge(umdConfig, themeConfig, { 8 | entry: { 9 | index: path.resolve(__dirname, '../../src/index.umd'), 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "RTW", 3 | "name": "Micro Frontend Boilerplate", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const baseConfig = require('../../.eslintrc.js'); 4 | 5 | module.exports = { 6 | ...baseConfig, 7 | settings: { 8 | 'import/resolver': { 9 | webpack: { 10 | config: path.resolve( 11 | __dirname, 12 | './scripts/webpack/webpack.config.resolve.js', 13 | ), 14 | }, 15 | }, 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/src/render/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Fast Vite Electron App 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const baseConfig = require('../../.eslintrc.js'); 4 | 5 | module.exports = { 6 | ...baseConfig, 7 | settings: { 8 | 'import/resolver': { 9 | webpack: { 10 | config: path.resolve( 11 | __dirname, 12 | './scripts/webpack/webpack.config.resolve.js', 13 | ), 14 | }, 15 | }, 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/HeaderDropdown/index.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .container > * { 4 | background-color: #fff; 5 | border-radius: 4px; 6 | box-shadow: @shadow-1-down; 7 | } 8 | 9 | @media screen and (max-width: @screen-xs) { 10 | .container { 11 | width: 100% !important; 12 | } 13 | .container > * { 14 | border-radius: 0 !important; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/PageHeader/index.less: -------------------------------------------------------------------------------- 1 | .container { 2 | border-bottom: 1px solid #e8e8e8; 3 | :global { 4 | .ant-page-header { 5 | padding: 10px; 6 | } 7 | .ant-page-header-heading-title { 8 | font-size: 16px; 9 | font-weight: normal; 10 | } 11 | .ant-page-header-back { 12 | margin-right: 16px; 13 | font-weight: normal; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/electron-builder.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {import('electron-builder').Configuration} 3 | * @see https://www.electron.build/configuration/configuration 4 | */ 5 | const config = { 6 | directories: { 7 | output: 'dist/electron', 8 | }, 9 | publish: null, 10 | npmRebuild: false, 11 | files: [ 12 | 'dist/main/**/*', 13 | 'dist/preload/**/*', 14 | 'dist/render/**/*', 15 | ], 16 | } 17 | 18 | module.exports = config 19 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/Label/index.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | @import '~@/skeleton/styles/variables.less'; 3 | 4 | .coloredLabel { 5 | color: @primary-color; 6 | display: inline-block; 7 | } 8 | 9 | .titleWrapper { 10 | font-size: 18px; 11 | font-weight: bold; 12 | display: inline-block; 13 | } 14 | 15 | .emptyPlaceholder { 16 | background: #e9e9e9; 17 | 18 | .flexCenter; 19 | } 20 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/docker/start-container.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | NAME="m-fe-rtw" 3 | 4 | git pull --rebase --prune 5 | 6 | echo 'start build docker image.' 7 | docker build -t ${NAME}:latest -f ./scripts/docker/Dockerfile dist 8 | 9 | echo 'stop and remove the current container.' 10 | docker container stop ${NAME} 11 | docker container rm ${NAME} 12 | 13 | echo 'run a new container.' 14 | docker run -d --restart always -p 2015:2015 --name ${NAME} ${NAME}:latest 15 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/api/axios/notice.ts: -------------------------------------------------------------------------------- 1 | import { notification } from 'antd'; 2 | 3 | export type NoticeType = 'success' | 'error' | 'info' | 'trusteeship'; 4 | 5 | export type Notice = (type: NoticeType, title: string, content: string) => void; 6 | 7 | const notice: Notice = (type, title, content) => { 8 | notification[type]({ 9 | message: title, 10 | description: content, 11 | }); 12 | }; 13 | 14 | export default notice; 15 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/scripts/webpack/webpack.config.umd.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const merge = require('webpack-merge'); 3 | 4 | const umdConfig = require('../../../../scripts/webpack/webpack.config') 5 | .umdConfig; 6 | 7 | const rootPath = process.cwd(); 8 | 9 | module.exports = merge(umdConfig, { 10 | output: { 11 | library: 'rtwCore', 12 | }, 13 | entry: { 14 | index: path.resolve(rootPath, './src/index.ts'), 15 | }, 16 | }); 17 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/helm/charts/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | .vscode/ 23 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-core/src/funcs/index.ts: -------------------------------------------------------------------------------- 1 | import { InstallableApp } from '../models/InstallableApp'; 2 | 3 | export type searchLocationFunc = ( 4 | rPath: string, 5 | exe: string, 6 | ) => Promise; 7 | export type runFunc = (exePath: string, uninstall?: boolean) => void; 8 | export type downloadFunc = (product: InstallableApp) => void; 9 | export type readCALockFunc = () => Promise<{ name: string; key: string }>; 10 | export type getVersionFunc = () => string; 11 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/i18n/index.ts: -------------------------------------------------------------------------------- 1 | /** Mock i18n 相关操作,详情参考 */ 2 | 3 | export function i18nFormat(id: string) { 4 | return id; 5 | } 6 | 7 | export function formatMessage({ 8 | id, 9 | defaultMessage, 10 | }: { 11 | id: string; 12 | defaultMessage?: string; 13 | }) { 14 | return defaultMessage || id; 15 | } 16 | 17 | export function setLocale(...args: any) { 18 | console.log(args); 19 | } 20 | 21 | export function getLocale() { 22 | return 'zh-CN'; 23 | } 24 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/models/UserModel.ts: -------------------------------------------------------------------------------- 1 | export interface CurrentUser { 2 | avatar?: string; 3 | name?: string; 4 | title?: string; 5 | group?: string; 6 | signature?: string; 7 | tags?: { 8 | key: string; 9 | label: string; 10 | }[]; 11 | userid?: string; 12 | unreadCount?: number; 13 | } 14 | 15 | export interface UserModelState { 16 | currentUser?: CurrentUser; 17 | } 18 | 19 | export class UserModel implements CurrentUser { 20 | name = 'test'; 21 | } 22 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/index.ts: -------------------------------------------------------------------------------- 1 | export * from './CopyBlock'; 2 | export * from './exception'; 3 | export * from './GlobalHeader/NoticeIconView'; 4 | export * from './GlobalHeader/RightContent'; 5 | export * from './GlobalHeader/UserDropdown'; 6 | export * from './HeaderDropdown'; 7 | export * from './HeaderSearch'; 8 | export * from './LangSelector'; 9 | export * from './NoticeIcon'; 10 | export * from './PageLoading'; 11 | export * from './Label'; 12 | export * from './PageHeader'; 13 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/auth/containers/LoginPage/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames'; 2 | import React from 'react'; 3 | 4 | import styles from './index.less'; 5 | 6 | export interface LoginPageProps { 7 | className?: string; 8 | style?: Record; 9 | } 10 | 11 | export const LoginPage = ({ className, style }: LoginPageProps) => { 12 | return ( 13 |
14 | LoginPage 15 |
16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/helm/charts/templates/api-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "context.fullname" . }} 5 | labels: 6 | {{ include "context.labels" . | indent 4 }} 7 | spec: 8 | type: {{ .Values.context.service.type }} 9 | ports: 10 | - port: {{ .Values.context.service.port }} 11 | targetPort: http 12 | protocol: TCP 13 | name: http 14 | selector: 15 | app.kubernetes.io/name: {{ include "context.name" . }} 16 | app.kubernetes.io/instance: {{ .Release.Name }} 17 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/scripts/webpack/webpack.config.prod.js: -------------------------------------------------------------------------------- 1 | const merge = require('webpack-merge'); 2 | const path = require('path'); 3 | const themeConfig = require('./webpack.config.theme'); 4 | 5 | const prodConfig = require('../../../../scripts/webpack/webpack.config') 6 | .prodConfig; 7 | 8 | const config = merge(themeConfig, prodConfig, { 9 | entry: { 10 | index: path.resolve(__dirname, '../../src/index'), 11 | }, 12 | output: { 13 | publicPath: 'a/b', 14 | }, 15 | }); 16 | 17 | module.exports = config; 18 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/PageHeader/index.tsx: -------------------------------------------------------------------------------- 1 | import { PageHeader as AntdPageHeader } from 'antd'; 2 | import { PageHeaderProps as AntdPageHeaderProps } from 'antd/es/page-header'; 3 | import React from 'react'; 4 | 5 | import styles from './index.less'; 6 | 7 | export interface PageHeaderProps extends AntdPageHeaderProps {} 8 | 9 | export function PageHeader(props: PageHeaderProps) { 10 | return ( 11 |
12 | 13 |
14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/types/module.ts: -------------------------------------------------------------------------------- 1 | import { MenuDataItem } from '@ant-design/pro-layout'; 2 | import { ComponentType } from 'react'; 3 | 4 | export interface ResolvedModule { 5 | default: ComponentType; 6 | reducer?: object; 7 | } 8 | 9 | export interface Module { 10 | id: string; 11 | getName: () => string; 12 | type: 'page' | 'module' | 'app' | 'widget' | 'extension'; 13 | 14 | getMenu?: () => MenuDataItem; 15 | component?: React.ComponentType; 16 | loader?: () => Promise; 17 | } 18 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/home/containers/Mobile/index.scss: -------------------------------------------------------------------------------- 1 | .mobile-container { 2 | width: 100%; 3 | height: 100%; 4 | background-image: url('../../../../assets/bg4.png'); 5 | background-size: cover; 6 | padding: 85px 30px; 7 | 8 | .qrcode-wrapper { 9 | opacity: 0.92; 10 | background: #fff; 11 | border: 1px solid #9b9b9b; 12 | border-radius: 10px; 13 | height: 100%; 14 | } 15 | 16 | .qrcode { 17 | background-size: cover; 18 | width: 690px; 19 | height: 410px; 20 | margin: 10px auto; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/docker/build-locally-dev.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # 本地构建并推送项目镜像 4 | # 5 | # Globals: 6 | # DOCKER_REGISTRY_SERVER 7 | # TAG 8 | 9 | set -e 10 | 11 | cd $(dirname $0)/../.. 12 | 13 | DOCKER_REGISTRY_SERVER=${DOCKER_REGISTRY_SERVER:=registry.yourbiz.com} 14 | IMAGE=${DOCKER_REGISTRY_SERVER}/m-fe-rtw 15 | TAG=${TAG:=latest} 16 | 17 | yarn build 18 | 19 | echo "[*] Finished building" 20 | 21 | docker build --tag $IMAGE:$TAG -f scripts/docker/Dockerfile.local ./build 22 | 23 | echo "[*] Pushing $IMAGE:$TAG" 24 | 25 | docker push $IMAGE:$TAG 26 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/LangSelector/index.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .menu { 4 | :global(.anticon) { 5 | margin-right: 8px; 6 | } 7 | :global(.ant-dropdown-menu-item) { 8 | min-width: 160px; 9 | } 10 | } 11 | 12 | .dropDown { 13 | line-height: @layout-header-height; 14 | vertical-align: top; 15 | cursor: pointer; 16 | > i { 17 | font-size: 16px !important; 18 | transform: none !important; 19 | svg { 20 | position: relative; 21 | top: -1px; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/models/global.ts: -------------------------------------------------------------------------------- 1 | export interface NoticeIconData { 2 | avatar?: string | React.ReactNode; 3 | title?: React.ReactNode; 4 | description?: React.ReactNode; 5 | datetime?: React.ReactNode; 6 | extra?: React.ReactNode; 7 | style?: React.CSSProperties; 8 | key?: string | number; 9 | read?: boolean; 10 | } 11 | 12 | export interface NoticeItem extends NoticeIconData { 13 | id: string; 14 | type: string; 15 | status: string; 16 | } 17 | 18 | export interface GlobalModelState { 19 | collapsed: boolean; 20 | notices: NoticeItem[]; 21 | } 22 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/hooks/interval.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useRef } from 'react'; 2 | 3 | export const useInterval = (callback: Function, delay: number) => { 4 | const savedCallback = useRef(); 5 | 6 | useEffect(() => { 7 | savedCallback.current = callback; 8 | }, [callback]); 9 | 10 | useEffect(() => { 11 | const handler = (...args: any[]) => savedCallback.current(...args); 12 | 13 | if (delay !== null) { 14 | const id = setInterval(handler, delay); 15 | return () => clearInterval(id); 16 | } 17 | }, [delay]); 18 | }; 19 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/layouts/NavContext.tsx: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react'; 2 | 3 | import { IAuthorityType } from '@/skeleton/auth/permissions'; 4 | 5 | export interface NavContextProps { 6 | authority?: IAuthorityType; 7 | onAuthorityChange?: (authority: IAuthorityType) => void; 8 | tabUtil?: { 9 | addTab: (id: string) => void; 10 | removeTab: (id: string) => void; 11 | }; 12 | updateActive?: (activeItem: { [key: string]: string } | string) => void; 13 | } 14 | 15 | export const NavContext: React.Context = createContext({}); 16 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | RTW 7 | 8 | 9 | 10 | 11 |
12 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/scripts/webpack/webpack.config.umd.dev.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const merge = require('webpack-merge'); 3 | 4 | const themeConfig = require('./webpack.config.theme'); 5 | const { umdConfig } = require('../../../../scripts/webpack/webpack.config'); 6 | 7 | module.exports = merge(umdConfig, themeConfig, { 8 | entry: { 9 | index: path.resolve(__dirname, '../../src/index.umd'), 10 | }, 11 | devServer: { 12 | contentBase: path.resolve(__dirname, '../../public'), 13 | port: 8081, 14 | }, 15 | output: { 16 | libraryTarget: 'umd', 17 | }, 18 | }); 19 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/ducks/index.ts: -------------------------------------------------------------------------------- 1 | import { connectRouter } from 'connected-react-router'; 2 | import { History } from 'history'; 3 | import { ReducersMapObject, combineReducers } from 'redux'; 4 | 5 | import userReducer, { IState as UserState } from '../apps/user/ducks/user'; 6 | 7 | export interface AppState { 8 | user: UserState; 9 | } 10 | 11 | export const configReducer = (partialReducers: ReducersMapObject = {}) => ( 12 | history: History, 13 | ) => 14 | combineReducers({ 15 | user: userReducer, 16 | router: connectRouter(history), 17 | ...partialReducers, 18 | }); 19 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/NoticeIcon/index.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .popover { 4 | position: relative; 5 | width: 336px; 6 | } 7 | 8 | .noticeButton { 9 | display: inline-block; 10 | cursor: pointer; 11 | transition: all 0.3s; 12 | } 13 | .icon { 14 | padding: 4px; 15 | vertical-align: middle; 16 | } 17 | 18 | .badge { 19 | font-size: 16px; 20 | } 21 | 22 | .tabs { 23 | :global { 24 | .ant-tabs-nav-scroll { 25 | text-align: center; 26 | } 27 | .ant-tabs-bar { 28 | margin-bottom: 0; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@m-fe/tslint-config/react", "tslint-config-eslint/prettier"], 3 | "rules": { 4 | "jsx-no-lambda": false, 5 | "ordered-imports": [ 6 | true, 7 | { 8 | "grouped-imports": true, 9 | "import-sources-order": "lowercase-first", 10 | "named-imports-order": "lowercase-last", 11 | "groups": [ 12 | "^(?!rte-)(@[^/]|[^@.])", 13 | "^(@/|rte-)", 14 | "^(../)+", 15 | "^(?!\\./.*\\.less)" 16 | ] 17 | } 18 | ] 19 | }, 20 | "linterOptions": { 21 | "exclude": ["**/*.d.ts"] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/auth/Authorized.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import { IAuthorityType, checkPermissions } from './permissions'; 4 | 5 | interface AuthorizedProps { 6 | authority: IAuthorityType; 7 | noMatch?: React.ReactNode; 8 | } 9 | 10 | export const Authorized: React.FunctionComponent = ({ 11 | children, 12 | authority, 13 | noMatch = null, 14 | }) => { 15 | const childrenRender: React.ReactNode = 16 | typeof children === 'undefined' ? null : children; 17 | const dom = checkPermissions(authority, childrenRender, noMatch); 18 | return <>{dom}; 19 | }; 20 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/scripts/webpack/webpack.config.dev.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const merge = require('webpack-merge'); 3 | 4 | const { devConfig } = require('../../../../scripts/webpack/webpack.config'); 5 | 6 | const themeConfig = require('./webpack.config.theme'); 7 | 8 | const config = merge(devConfig, themeConfig, { 9 | entry: { 10 | index: [ 11 | 'react-hot-loader/patch', 12 | path.resolve(__dirname, '../../src/index'), 13 | ], 14 | }, 15 | devServer: { 16 | contentBase: path.resolve(__dirname, '../../public'), 17 | hot: false, 18 | }, 19 | }); 20 | 21 | module.exports = config; 22 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/auth/__test__/authority.test.ts: -------------------------------------------------------------------------------- 1 | import { getAuthority } from '../authority'; 2 | 3 | describe('getAuthority should be strong', () => { 4 | it('string', () => { 5 | expect(getAuthority('admin')).toEqual(['admin']); 6 | }); 7 | it('array with double quotes', () => { 8 | expect(getAuthority('"admin"')).toEqual(['admin']); 9 | }); 10 | it('array with single item', () => { 11 | expect(getAuthority('["admin"]')).toEqual(['admin']); 12 | }); 13 | it('array with multiple items', () => { 14 | expect(getAuthority('["admin", "guest"]')).toEqual(['admin', 'guest']); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/containers/IntervalComponent/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export abstract class IntervalComponent extends React.PureComponent< 4 | P, 5 | S 6 | > { 7 | intervalHandler: any; 8 | interval: number; 9 | 10 | componentDidMount() { 11 | this.onInterval(); 12 | 13 | this.intervalHandler = setInterval(() => { 14 | this.onInterval(); 15 | }, this.interval || 15 * 1000); 16 | } 17 | 18 | componentWillUnmount() { 19 | if (this.intervalHandler) { 20 | clearInterval(this.intervalHandler); 21 | } 22 | } 23 | 24 | onInterval: Function; 25 | } 26 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/electron-builder.yml: -------------------------------------------------------------------------------- 1 | appId: com.biz 2 | buildVersion: 0.0.1 3 | productName: Biz App 4 | artifactName: ${productName}-${version}.${ext} 5 | extraResources: extra/ 6 | directories: 7 | output: './out' 8 | files: 9 | - '**/*' 10 | - '!**/*.map' 11 | mac: 12 | target: pkg 13 | win: 14 | target: nsis 15 | requestedExecutionLevel: requireAdministrator 16 | nsis: 17 | oneClick: false 18 | perMachine: true 19 | allowToChangeInstallationDirectory: true 20 | installerLanguages: zh-CN 21 | language: 2052 22 | menuCategory: Biz App 23 | deleteAppDataOnUninstall: true 24 | publish: 25 | provider: generic 26 | url: http://tool.bizapp 27 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/malfunction.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/home/components/InstallableAppSeriesView/index.scss: -------------------------------------------------------------------------------- 1 | .product-line-container { 2 | width: 100%; 3 | border-bottom: 1px solid #f1f1f1; 4 | padding: 10px 60px 10px 40px; 5 | -webkit-app-region: no-drag; 6 | 7 | &:last-child { 8 | border: none; 9 | } 10 | 11 | .product-line-name { 12 | font-size: 16px; 13 | color: #2e72b8; 14 | letter-spacing: 0.57px; 15 | line-height: 22px; 16 | margin: 0 0 15px; 17 | font-weight: 300; 18 | } 19 | 20 | .product-list { 21 | display: grid; 22 | grid-template-columns: repeat(5, 1fr); 23 | grid-column-gap: 68px; 24 | grid-row-gap: 12px; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/src/render/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 9 | 10 | 25 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/hooks/state.ts: -------------------------------------------------------------------------------- 1 | import { merge } from 'lodash'; 2 | import { useCallback, useState } from 'react'; 3 | 4 | import { DeepPartial } from '@/schema/helpers'; 5 | 6 | export const useLiteState = ( 7 | initialState?: T | (() => T), 8 | ): [T, (newState: DeepPartial) => void] => { 9 | const [state, setState] = useState(initialState); 10 | const setLiteState = useCallback( 11 | (newState: DeepPartial | null) => { 12 | if (newState == null) { 13 | setState(newState as null); 14 | return; 15 | } 16 | setState(merge({}, state, newState)); 17 | }, 18 | [state], 19 | ); 20 | return [state, setLiteState]; 21 | }; 22 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/docker/build-locally-release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # 本地构建并推送项目镜像 4 | # 5 | # Globals: 6 | # DOCKER_REGISTRY_SERVER 7 | # TAG 8 | 9 | set -e 10 | 11 | cd $(dirname $0)/../.. 12 | 13 | PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') 14 | 15 | DOCKER_REGISTRY_SERVER=${DOCKER_REGISTRY_SERVER:=registry.yourbiz.com} 16 | IMAGE=${DOCKER_REGISTRY_SERVER}/m-fe-rtw 17 | TAG=${PACKAGE_VERSION:=latest} 18 | 19 | yarn build 20 | 21 | echo "[*] Finished building" 22 | 23 | docker build --tag $IMAGE:$TAG -f scripts/docker/Dockerfile.local ./build 24 | 25 | echo "[*] Pushing $IMAGE:$TAG" 26 | 27 | docker push $IMAGE:$TAG 28 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/defectives.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/shared/components/Copyright/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'classnames'; 2 | import React from 'react'; 3 | 4 | import styles from './index.less'; 5 | 6 | export interface CopyrightProps { 7 | className?: string; 8 | style?: Record; 9 | } 10 | 11 | export const Copyright = ({ className, style }: CopyrightProps) => { 12 | return ( 13 |
14 | © 2019-2020 Unionfab 版权所有 15 | 16 | ICP 证: 17 | 18 | 沪ICP备17023219号 19 | 20 | 21 |
22 | ); 23 | }; 24 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/env/dev.ts: -------------------------------------------------------------------------------- 1 | import MobileDetect from 'mobile-detect'; 2 | 3 | window.gConfig = {}; 4 | 5 | // 如果是在本地开发,则默认为开发环境服务器 6 | export const HOST = __DEV__ 7 | ? 'https://api.unionfab.com' 8 | : window.gConfig.HOST 9 | ? `https://${window.gConfig.HOST}` 10 | : 'https://api.test.unionfab.com'; 11 | 12 | export const UFI_HOST = `https://${(window.gConfig || {}).UFI_HOST}`; 13 | 14 | export const NODE_HOST = __DEV__ 15 | ? 'https://node-api.unionfab.com' 16 | : window.gConfig.HOST 17 | ? `https://${window.gConfig.NODE_HOST}` 18 | : 'https://node-api.test.unionfab.com'; 19 | 20 | export const WITH_AUTH = true; 21 | 22 | const md = new MobileDetect(window.navigator.userAgent); 23 | 24 | export const isMobile = !!md.mobile(); 25 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | build/ 3 | dist/ 4 | node_modules/ 5 | out/ 6 | 7 | # Logs 8 | logs 9 | *.log 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Yarn Integrity file 15 | .yarn-integrity 16 | 17 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 18 | .grunt 19 | 20 | # Optional npm cache directory 21 | .npm 22 | 23 | # Optional eslint cache 24 | .eslintcache 25 | 26 | # Windows thumbnail cache files 27 | Thumbs.db 28 | 29 | # OS X files 30 | .DS_Store 31 | ._* 32 | 33 | # Node files 34 | node_modules 35 | 36 | # OS junk files 37 | .DS_Store 38 | .stylelintcache 39 | .eslintcache 40 | 41 | # Project specific stuff 42 | .cache-loader 43 | @coverage 44 | *.log 45 | dist 46 | build 47 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/CopyBlock/index.less: -------------------------------------------------------------------------------- 1 | .copy-block { 2 | position: fixed; 3 | right: 80px; 4 | bottom: 40px; 5 | z-index: 99; 6 | display: flex; 7 | flex-direction: column; 8 | align-items: center; 9 | justify-content: center; 10 | width: 40px; 11 | height: 40px; 12 | font-size: 20px; 13 | background: #fff; 14 | border-radius: 40px; 15 | box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 16 | 0 1px 10px 0 rgba(0, 0, 0, 0.12); 17 | cursor: pointer; 18 | } 19 | 20 | .copy-block-view { 21 | position: relative; 22 | .copy-block-code { 23 | display: inline-block; 24 | margin: 0 0.2em; 25 | padding: 0.2em 0.4em 0.1em; 26 | font-size: 85%; 27 | border-radius: 3px; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/typings/global.d.ts: -------------------------------------------------------------------------------- 1 | import 'dayjs/plugin/relativeTime'; 2 | import HtmlWebpackPlugin from 'html-webpack-plugin'; 3 | import { Plugin } from 'webpack'; 4 | import * as S from 'ufc-schema'; 5 | 6 | declare global { 7 | const __DEV__: boolean; 8 | 9 | interface Window { 10 | Sentry: any; 11 | System: SystemJSLoader.System; 12 | gConfig: { 13 | pwa?: false; 14 | user?: S.User; 15 | HOST?: string; 16 | UFI_HOST?: string; 17 | NODE_HOST?: string; 18 | }; 19 | } 20 | } 21 | 22 | declare module 'html-webpack-plugin' { 23 | namespace HtmlWebpackPlugin { 24 | interface Options { 25 | alwaysWriteToDisk?: boolean; 26 | inlineSource?: string | RegExp; 27 | } 28 | } 29 | 30 | export = HtmlWebpackPlugin; 31 | } 32 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "node": true 5 | }, 6 | "extends": "airbnb", 7 | "rules": { 8 | "no-unused-vars": "warn", 9 | "max-len": [ 10 | "error", 11 | { 12 | "ignoreUrls": true 13 | } 14 | ], 15 | "import/no-extraneous-dependencies": [ 16 | "error", 17 | { 18 | "devDependencies": [ 19 | "webpack.*.js", 20 | "test/**/*.js" 21 | ] 22 | } 23 | ], 24 | "sort-imports": 2, 25 | "import/prefer-default-export": 0, 26 | "import/no-default-export": 2, 27 | "import/no-named-default": 0, 28 | "react/jsx-no-bind": false 29 | }, 30 | "plugins": [ 31 | "import" 32 | ], 33 | "settings": { 34 | "import/resolver": "webpack" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/HeaderSearch/index.less: -------------------------------------------------------------------------------- 1 | @import '~antd/es/style/themes/default.less'; 2 | 3 | .headerSearch { 4 | :global(.anticon-search) { 5 | font-size: 16px; 6 | cursor: pointer; 7 | } 8 | .input { 9 | width: 0; 10 | background: transparent; 11 | border-radius: 0; 12 | transition: width 0.3s, margin-left 0.3s; 13 | :global(.ant-select-selection) { 14 | background: transparent; 15 | } 16 | input { 17 | padding-right: 0; 18 | padding-left: 0; 19 | border: 0; 20 | box-shadow: none !important; 21 | } 22 | &, 23 | &:hover, 24 | &:focus { 25 | border-bottom: 1px solid @border-color-base; 26 | } 27 | &.show { 28 | width: 210px; 29 | margin-left: 8px; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/HeaderDropdown/index.tsx: -------------------------------------------------------------------------------- 1 | import { Dropdown } from 'antd'; 2 | import { DropDownProps } from 'antd/es/dropdown'; 3 | import classNames from 'classnames'; 4 | import * as React from 'react'; 5 | 6 | import styles from './index.less'; 7 | 8 | export interface HeaderDropdownProps extends DropDownProps { 9 | overlayClassName?: string; 10 | placement?: 11 | | 'bottomLeft' 12 | | 'bottomRight' 13 | | 'topLeft' 14 | | 'topCenter' 15 | | 'topRight' 16 | | 'bottomCenter'; 17 | } 18 | 19 | const HeaderDropdown: React.FC = ({ 20 | overlayClassName: cls, 21 | ...restProps 22 | }) => ( 23 | 27 | ); 28 | 29 | export default HeaderDropdown; 30 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/exception/500/index.tsx: -------------------------------------------------------------------------------- 1 | import { Button, Result } from 'antd'; 2 | import * as React from 'react'; 3 | import { Link } from 'react-router-dom'; 4 | 5 | import { formatMessage } from '@/i18n'; 6 | 7 | export default () => ( 8 | 20 | 26 | 27 | } 28 | /> 29 | ); 30 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/extra/regedit/vbs/regDeleteKey.wsf: -------------------------------------------------------------------------------- 1 | 2 | 29 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/home/components/Menu/index.scss: -------------------------------------------------------------------------------- 1 | .menu-container { 2 | width: 100%; 3 | display: flex; 4 | flex-direction: column; 5 | font-weight: 300; 6 | -webkit-app-region: no-drag; 7 | } 8 | 9 | .memu-item-container { 10 | width: 100%; 11 | height: 36px; 12 | cursor: pointer; 13 | transition: all 0.2s ease; 14 | color: #fff; 15 | margin-bottom: 18px; 16 | 17 | &:last-child { 18 | margin-bottom: 0; 19 | } 20 | 21 | .menu-item-content { 22 | max-width: 90px; 23 | height: 100%; 24 | margin: 0 auto; 25 | display: flex; 26 | justify-content: space-between; 27 | align-items: center; 28 | letter-spacing: 0.5px; 29 | } 30 | } 31 | 32 | .memu-item-container.menu-item-selected, 33 | .memu-item-container:hover { 34 | background-color: #fff; 35 | color: #2e72b8; 36 | } 37 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/exception/403/index.tsx: -------------------------------------------------------------------------------- 1 | import { Button, Result } from 'antd'; 2 | import * as React from 'react'; 3 | import { Link } from 'react-router-dom'; 4 | 5 | import { formatMessage } from '@/i18n'; 6 | 7 | export const Exception403 = () => ( 8 | 20 | 26 | 27 | } 28 | /> 29 | ); 30 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/scripts/webpack/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const CopyPkgJsonPlugin = require('copy-pkg-json-webpack-plugin'); 3 | const merge = require('webpack-merge'); 4 | 5 | const config = merge( 6 | require('@m-fe/webpack-config/webpack.config.node')({ 7 | rootPath: path.resolve(__dirname, '../../'), 8 | }), 9 | { 10 | target: 'electron-main', 11 | node: { 12 | __dirname: false, 13 | __filename: false, 14 | }, 15 | plugins: [ 16 | new CopyPkgJsonPlugin({ 17 | remove: ['scripts', 'devDependencies', 'build'], 18 | replace: { 19 | main: './index.js', 20 | scripts: { start: 'electron ./index.js' }, 21 | postinstall: 'electron-builder install-app-deps', 22 | }, 23 | }), 24 | ], 25 | }, 26 | ); 27 | 28 | module.exports = config; 29 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/src/main/app.controller.ts: -------------------------------------------------------------------------------- 1 | import { Controller } from '@nestjs/common' 2 | import { IpcHandle, Window } from '@doubleshot/nest-electron' 3 | import { Payload } from '@nestjs/microservices' 4 | import { type Observable, of } from 'rxjs' 5 | import type { BrowserWindow } from 'electron' 6 | import { AppService } from './app.service' 7 | 8 | @Controller() 9 | export class AppController { 10 | constructor( 11 | private readonly appService: AppService, 12 | @Window() private readonly mainWin: BrowserWindow, 13 | ) { } 14 | 15 | @IpcHandle('msg') 16 | public handleSendMsg(@Payload() msg: string): Observable { 17 | const { webContents } = this.mainWin 18 | webContents.send('reply-msg', 'this is msg from webContents.send') 19 | return of(`The main process received your message: ${msg} at time: ${this.appService.getTime()}`) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/user/ducks/user.ts: -------------------------------------------------------------------------------- 1 | import { createActions, handleActions } from 'redux-actions'; 2 | import { handle } from 'redux-pack-fsa'; 3 | import * as S from 'ufc-schema'; 4 | 5 | import { getUsers } from '@/apis'; 6 | 7 | export interface IState { 8 | users: S.User[]; 9 | } 10 | 11 | const initialState: IState = { 12 | users: [], 13 | }; 14 | 15 | export const actions = createActions({ 16 | async loadUsers() { 17 | return getUsers(); 18 | }, 19 | }); 20 | 21 | export const userActions = actions; 22 | 23 | export default handleActions( 24 | { 25 | [actions.loadUsers.toString()](state: IState, action) { 26 | const { payload } = action; 27 | 28 | return handle(state, action, { 29 | success: (prevState: IState) => ({ ...prevState, users: payload }), 30 | }); 31 | }, 32 | }, 33 | 34 | initialState, 35 | ); 36 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | DOCKER_DRIVER: overlay2 3 | EFF_NO_LINK_RULES: 'true' 4 | GIT_CLEAN_FLAGS: -ffdx -e /dist/ 5 | NODE_OPTIONS: --max-old-space-size=2048 6 | PARSER_NO_WATCH: 'true' 7 | 8 | build image: 9 | only: 10 | - dev 11 | - master 12 | stage: build 13 | image: docker:git 14 | services: 15 | - name: docker:dind 16 | before_script: 17 | - docker info 18 | - docker login ${DOCKER_REGISTRY_SERVER} -u ${DOCKER_REGISTRY_USER} -p ${DOCKER_REGISTRY_PASSWORD} 19 | script: 20 | # - if [ "master" == "$CI_COMMIT_REF_NAME" ]; then export IMAGE_SUFFIX="-prod"; fi 21 | - export IMAGE=${DOCKER_REGISTRY_SERVER}/m-fe-rtw 22 | # - docker build --tag $IMAGE:$CI_COMMIT_SHA --tag $IMAGE:latest -f scripts/docker/Dockerfile . 23 | # - docker push $IMAGE:$CI_COMMIT_SHA 24 | # - docker push $IMAGE:latest 25 | - sh ./scripts/docker/build-on-gitlab.sh 26 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "jsx": "preserve", 5 | "lib": [ 6 | "esnext", 7 | "dom" 8 | ], 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "baseUrl": ".", 12 | "module": "ESNext", 13 | "moduleResolution": "node", 14 | "paths": { 15 | "@render/*": [ 16 | "src/render/*" 17 | ], 18 | "@main/*": [ 19 | "src/main/*" 20 | ] 21 | }, 22 | "resolveJsonModule": true, 23 | "types": [ 24 | "vite/client", 25 | "./src/preload" 26 | ], 27 | "strict": false, 28 | "noImplicitAny": false, 29 | "noEmit": true, 30 | "sourceMap": true, 31 | "esModuleInterop": true, 32 | "skipLibCheck": true 33 | }, 34 | "include": [ 35 | "src/**/*.ts", 36 | "src/**/*.d.ts", 37 | "src/**/*.tsx", 38 | "src/**/*.vue" 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/extra/regedit/vbs/regCreateKey.wsf: -------------------------------------------------------------------------------- 1 | 2 | 32 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/components/exception/404/index.tsx: -------------------------------------------------------------------------------- 1 | import { Button, Result } from 'antd'; 2 | import * as React from 'react'; 3 | import { Link } from 'react-router-dom'; 4 | 5 | import { formatMessage } from '@/i18n'; 6 | 7 | export const Exception404 = () => ( 8 | 20 |
21 |
22 | 28 |
29 | 30 | } 31 | /> 32 | ); 33 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/src/index.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | 3 | import { app } from 'electron'; 4 | import log from 'electron-log'; 5 | 6 | import * as R from 'rte-core'; 7 | 8 | import { getVersion } from './provider'; 9 | import { AppManager } from './AppManager'; 10 | 11 | if (process.env.NODE_ENV !== 'production') { 12 | // eslint-disable-next-line @typescript-eslint/no-require-imports 13 | require('electron-debug')({ showDevTools: true }); 14 | } 15 | 16 | process.on('uncaughtException', error => { 17 | // Handle the error 18 | log.error(error); 19 | }); 20 | 21 | declare const global: { 22 | searchLocation: R.searchLocationFunc; 23 | run: R.runFunc; 24 | download: R.downloadFunc; 25 | getVersion: R.getVersionFunc; 26 | }; 27 | 28 | global.getVersion = getVersion; 29 | 30 | const url = 31 | process.env.ELECTRON_START_URL || `file://${__dirname}/assets/index.html`; 32 | const appManager = new AppManager(app, url); 33 | appManager.initApp(); 34 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/user/containers/PersonList/index.less: -------------------------------------------------------------------------------- 1 | @import '~@/skeleton/styles/variables.less'; 2 | 3 | .container { 4 | .appContainer; 5 | 6 | overflow-y: auto; 7 | overflow-x: hidden; 8 | padding: 24px; 9 | } 10 | 11 | .filters { 12 | width: 100%; 13 | height: 36px; 14 | display: flex; 15 | margin-bottom: 16px; 16 | align-items: center; 17 | 18 | .count { 19 | width: 100%; 20 | font-size: 18px; 21 | color: rgb(0, 0, 0, 0.75); 22 | line-height: 50px; 23 | 24 | .num { 25 | color: #6874e2; 26 | } 27 | } 28 | 29 | .item { 30 | display: flex; 31 | justify-content: center; 32 | align-items: center; 33 | 34 | .field { 35 | font-size: 14px; 36 | margin-left: 28px; 37 | white-space: nowrap; 38 | } 39 | 40 | .input { 41 | .flexCenter; 42 | 43 | margin-left: 14px; 44 | } 45 | } 46 | 47 | .actions { 48 | .flexCenter; 49 | 50 | margin-left: 14px; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/home/components/InstallableAppSeriesView/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import { InstallableApp, InstallableAppSeries } from 'rte-core'; 4 | 5 | import { InstallableAppView } from '../InstallableAppView'; 6 | 7 | import './index.scss'; 8 | 9 | export interface InstallableAppSeriesView { 10 | name: string; 11 | id: string; 12 | children: InstallableApp[]; 13 | } 14 | 15 | interface InstallableAppSeriesViewProps { 16 | data: InstallableAppSeries; 17 | } 18 | 19 | export const InstallableAppSeriesView = ( 20 | props: InstallableAppSeriesViewProps, 21 | ): JSX.Element => { 22 | const appSeries = props.data; 23 | return ( 24 |
25 |

{appSeries.name}

26 |
27 | {appSeries.apps.map(p => ( 28 | 29 | ))} 30 |
31 |
32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-node/src/service/UpdateService.ts: -------------------------------------------------------------------------------- 1 | import { autoUpdater } from 'electron-updater'; 2 | 3 | export interface ProgressInfo { 4 | total: number; 5 | delta: number; 6 | transferred: number; 7 | percent: number; 8 | bytesPerSecond: number; 9 | } 10 | 11 | export abstract class AbstractUpdateService { 12 | abstract checkUpdate( 13 | onDownloading: (progress: ProgressInfo) => void, 14 | onDownloaded: () => void, 15 | ): void; 16 | abstract installUpdate(): void; 17 | 18 | downloadUpdate() {} 19 | } 20 | 21 | export default class UpdateService extends AbstractUpdateService { 22 | checkUpdate( 23 | onDownloading: (progress: ProgressInfo) => void, 24 | onDownloaded: () => void, 25 | ) { 26 | autoUpdater.on('download-progress', onDownloading); 27 | autoUpdater.on('update-downloaded', onDownloaded); 28 | autoUpdater.checkForUpdatesAndNotify(); 29 | } 30 | 31 | installUpdate() { 32 | setImmediate(() => autoUpdater.quitAndInstall(true, true)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/auth/AuthorizedRoute.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { Redirect, Route } from 'react-router'; 3 | 4 | import { IAuthorityType } from './permissions'; 5 | import { Authorized } from './Authorized'; 6 | 7 | interface AuthorizedRoutePops { 8 | currentAuthority: string; 9 | component: React.ComponentClass; 10 | render: (props: any) => React.ReactNode; 11 | redirectPath: string; 12 | authority: IAuthorityType; 13 | } 14 | 15 | export const AuthorizedRoute: React.SFC = ({ 16 | component: Component, 17 | render, 18 | authority, 19 | redirectPath, 20 | ...rest 21 | }) => ( 22 | } 28 | /> 29 | } 30 | > 31 | 34 | Component ? : render(props) 35 | } 36 | /> 37 | 38 | ); 39 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/containers/App/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { connect } from 'react-redux'; 3 | import { Route, RouteComponentProps, Switch } from 'react-router'; 4 | import { withRouter } from 'react-router-dom'; 5 | 6 | import { LoginPage } from '@/apps/auth/containers/LoginPage'; 7 | import { Home } from '@/apps/home/containers/Home'; 8 | import { Exception403 } from '@/skeleton'; 9 | 10 | export interface IAppProps extends RouteComponentProps {} 11 | 12 | export interface IAppState {} 13 | 14 | export class App extends React.Component { 15 | constructor(props: IAppProps) { 16 | super(props); 17 | 18 | this.state = {}; 19 | } 20 | 21 | render() { 22 | return ( 23 | 24 | 25 | } /> 26 | 27 | 28 | ); 29 | } 30 | } 31 | 32 | export default connect(_state => ({}), {})(withRouter(App)); 33 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/home/containers/SoftwareMesh/index.scss: -------------------------------------------------------------------------------- 1 | .home-container { 2 | width: 100%; 3 | height: 100%; 4 | 5 | .banner { 6 | height: 183px; 7 | background-image: url('../../../../assets/bg1.png'); 8 | background-size: cover; 9 | padding-top: 22px; 10 | padding-left: 100px; 11 | color: #fff; 12 | 13 | p { 14 | margin: 0; 15 | padding: 0; 16 | font-weight: 100; 17 | } 18 | 19 | .slogon-big { 20 | font-size: 22px; 21 | letter-spacing: 1.18px; 22 | margin-bottom: 19px; 23 | line-height: 30px; 24 | } 25 | 26 | .slogon-small { 27 | font-size: 10px; 28 | letter-spacing: 0.54px; 29 | line-height: 14px; 30 | } 31 | } 32 | 33 | #sg-tools { 34 | grid-template-areas: 'yhwsgzb yhwyqzb sgtb . .'; 35 | grid-template-columns: repeat(3, auto) 1fr 1fr; 36 | grid-template-rows: auto; 37 | } 38 | 39 | #jl-tools { 40 | grid-template-rows: auto; 41 | grid-template-columns: repeat(2, auto) 1fr; 42 | grid-template-areas: 'jlzb jltb'; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/scripts/helm/charts/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.ingress.enabled -}} 2 | {{- $serviceName := include "context.fullname" . -}} 3 | apiVersion: extensions/v1beta1 4 | kind: Ingress 5 | metadata: 6 | name: {{ include "context.fullname" . }} 7 | labels: 8 | {{ include "context.labels" . | indent 4 }} 9 | {{- with .Values.ingress.annotations }} 10 | annotations: 11 | {{- toYaml . | nindent 4 }} 12 | {{- end }} 13 | spec: 14 | {{- if .Values.ingress.tls }} 15 | tls: 16 | {{- range .Values.ingress.tls }} 17 | - hosts: 18 | {{- range .hosts }} 19 | - {{ . | quote }} 20 | {{- end }} 21 | secretName: {{ .secretName }} 22 | {{- end }} 23 | {{- end }} 24 | rules: 25 | # test api ingress rules 26 | {{- range .Values.ingress.context.hosts }} 27 | - host: {{ .host | quote }} 28 | http: 29 | paths: 30 | {{- range .paths }} 31 | - path: {{ . }} 32 | backend: 33 | serviceName: {{ $serviceName }} 34 | servicePort: http 35 | {{- end }} 36 | {{- end }} 37 | {{- end }} 38 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { join } from 'node:path' 2 | import { defineConfig } from 'vite' 3 | import vue from '@vitejs/plugin-vue' 4 | import { VitePluginDoubleshot } from 'vite-plugin-doubleshot' 5 | 6 | // https://vitejs.dev/config/ 7 | export default defineConfig({ 8 | root: join(__dirname, 'src/render'), 9 | plugins: [ 10 | vue(), 11 | VitePluginDoubleshot({ 12 | type: 'electron', 13 | main: 'dist/main/index.js', 14 | entry: 'src/main/index.ts', 15 | outDir: 'dist/main', 16 | external: ['electron'], 17 | electron: { 18 | build: { 19 | config: './electron-builder.config.js', 20 | }, 21 | preload: { 22 | entry: 'src/preload/index.ts', 23 | outDir: 'dist/preload', 24 | }, 25 | }, 26 | }), 27 | ], 28 | resolve: { 29 | alias: { 30 | '@render': join(__dirname, 'src/render'), 31 | '@main': join(__dirname, 'src/main'), 32 | }, 33 | }, 34 | base: './', 35 | build: { 36 | outDir: join(__dirname, 'dist/render'), 37 | emptyOutDir: true, 38 | }, 39 | }) 40 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/apps/home/containers/SoftwareMesh/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | 3 | import { InstallableAppSeries } from 'rte-core'; 4 | 5 | import { InstallableAppSeriesView } from '../../components/InstallableAppSeriesView'; 6 | 7 | import './index.scss'; 8 | 9 | interface SoftwareMeshProps {} 10 | 11 | export class SoftwareMesh extends Component { 12 | componentDidMount() {} 13 | 14 | render() { 15 | return ( 16 |
17 |
18 |
19 |

简单、易操作

20 |

生成文件全面、清晰

21 |

智能查错

22 |
23 |
24 |

专用工具软件,兼容性强,支持XP/WIN7/WIN8/WIN10环境下运行。

25 |
26 |
27 |
28 | {[].map((pl: InstallableAppSeries) => ( 29 | 30 | ))} 31 |
32 |
33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/assets/device.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/layouts/index.less: -------------------------------------------------------------------------------- 1 | :global(.ant-pro-sider-menu-sider) { 2 | flex: 0 0 220px; 3 | max-width: 220px; 4 | min-width: 220px; 5 | width: 220px; 6 | 7 | :global(.ant-pro-sider-menu-logo) { 8 | display: flex; 9 | align-items: center; 10 | justify-content: center; 11 | padding-left: 0; 12 | h1 { 13 | display: none; 14 | } 15 | } 16 | } 17 | 18 | :global(.ant-layout-header) { 19 | margin: 0 24px; 20 | box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35); 21 | width: unset !important; 22 | } 23 | 24 | :global(.ant-layout-content) { 25 | box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35); 26 | background-color: white; 27 | margin: 24px; 28 | } 29 | 30 | .selectedMenu { 31 | color: white; 32 | background: #6874e2; 33 | box-shadow: 0 0 7px 0 rgba(255, 255, 255, 0.36), 34 | 0 2px 10px 0 rgba(104, 116, 226, 0.44); 35 | border-radius: 0 10px 10px 0; 36 | transform: translateX(-24px); 37 | padding-left: 24px; 38 | } 39 | 40 | .selectedMenuCollapsed { 41 | border-radius: 10px; 42 | transform: translateX(-16px); 43 | padding-left: 16px; 44 | } 45 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/env/theme.ts: -------------------------------------------------------------------------------- 1 | import generate from '@ant-design/colors/lib/generate'; 2 | import * as client from 'webpack-theme-color-replacer/client'; 3 | 4 | export const themeClient = { 5 | getAntdSerials(color: string): string[] { 6 | const lightCount = 9; 7 | const divide = 10; 8 | // 淡化(即less的tint) 9 | let lightens = new Array(lightCount).fill(0); 10 | lightens = lightens.map((_, i) => 11 | client.varyColor.lighten(color, i / divide), 12 | ); 13 | const colorPalettes = generate(color); 14 | return lightens.concat(colorPalettes); 15 | }, 16 | 17 | changeColor(color?: string): Promise { 18 | if (!color) { 19 | return Promise.resolve(); 20 | } 21 | const options = { 22 | // new colors array, one-to-one corresponde with `matchColors` 23 | newColors: this.getAntdSerials(color), 24 | changeUrl(cssUrl: string): string { 25 | // while router is not `hash` mode, it needs absolute path 26 | return `/${cssUrl}`; 27 | }, 28 | }; 29 | return client.changer.changeColor(options, Promise); 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /boilerplates/ts-webpack-react-electron/packages/rte-host-app/src/skeleton/types/comp.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export const isComponentClass = ( 4 | component: React.ComponentClass | React.ReactNode, 5 | ): boolean => { 6 | if (!component) return false; 7 | const proto = Object.getPrototypeOf(component); 8 | if (proto === React.Component || proto === Function.prototype) return true; 9 | return isComponentClass(proto); 10 | }; 11 | 12 | // Determine whether the incoming component has been instantiated 13 | // AuthorizedRoute is already instantiated 14 | // Authorized render is already instantiated, children is no instantiated 15 | // Secured is not instantiated 16 | export const checkIsInstantiation = ( 17 | target: React.ComponentClass | React.ReactNode, 18 | ) => { 19 | if (isComponentClass(target)) { 20 | const Target = target as React.ComponentClass; 21 | return (props: any) => ; 22 | } 23 | if (React.isValidElement(target)) { 24 | return (props: any) => React.cloneElement(target, props); 25 | } 26 | return () => target; 27 | }; 28 | 29 | export type StyleObject = Record; 30 | -------------------------------------------------------------------------------- /boilerplates/fast-vite-nestjs-electron/src/render/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 |