diff --git a/README.md b/README.md index 448fc80..70b5f90 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ $ pnpm design:build # build frontend/packages/design $ pnpm ... # install/preinstall scripts trigger during project setup ``` -## Project Structure +## Directory Structure ```bash . @@ -71,7 +71,7 @@ $ pnpm ... # install/preinstall scripts trigger during project setup │ │ ├── env.go # load os environment variable │ │ ├── logger.go # setup loggers │ ├── model # model module, data layer -│ │ ├── model # database setup +│ │ ├── model.go # database setup │ │ └── my_option.go # define application options for app config storage │ ├── pkg # pkg module, cross cutting │ │ ├── i18n # manage locale/translation strings for backend diff --git a/frontend/packages/components/Icon/index.ts b/frontend/packages/components/Icon/index.ts index dd9c38e..7041f7f 100644 --- a/frontend/packages/components/Icon/index.ts +++ b/frontend/packages/components/Icon/index.ts @@ -1,4 +1,5 @@ import { App } from "vue"; +import "@jinyaoma/my-app-icons"; import Icon from "./icon.vue"; Icon.install = (app: App) => { diff --git a/frontend/packages/components/package.json b/frontend/packages/components/package.json index 18dbd7f..120ddb2 100644 --- a/frontend/packages/components/package.json +++ b/frontend/packages/components/package.json @@ -2,7 +2,11 @@ "name": "@jinyaoma/my-app-components", "version": "0.1.0", "type": "module", + "main": "index.ts", "peerDependencies": { "vue": "^3.2.37" + }, + "dependencies": { + "@jinyaoma/my-app-icons": "workspace:*" } } diff --git a/frontend/packages/design/index.ts b/frontend/packages/design/index.ts index b0b53bb..34036ce 100644 --- a/frontend/packages/design/index.ts +++ b/frontend/packages/design/index.ts @@ -1,5 +1,5 @@ import { App, Plugin } from "vue"; -import { MyHelloWorld, MyIcon } from "../components"; +import { MyHelloWorld, MyIcon } from "@jinyaoma/my-app-components"; const components = [MyHelloWorld, MyIcon]; diff --git a/frontend/packages/design/package.json b/frontend/packages/design/package.json index 15dcd3b..79129b2 100644 --- a/frontend/packages/design/package.json +++ b/frontend/packages/design/package.json @@ -25,6 +25,7 @@ "vue": "^3.2.37" }, "devDependencies": { + "@jinyaoma/my-app-components": "workspace:*", "@vitejs/plugin-vue": "^3.1.0", "sass": "^1.54.9", "typescript": "^4.6.4", diff --git a/frontend/packages/design/tsconfig.json b/frontend/packages/design/tsconfig.json index 1c01612..7ed1063 100644 --- a/frontend/packages/design/tsconfig.json +++ b/frontend/packages/design/tsconfig.json @@ -16,8 +16,8 @@ ], "skipLibCheck": true, }, - "exclude": [ - "node_modules" + "include": [ + "*.ts" ], "references": [ { diff --git a/frontend/packages/icons/index.js b/frontend/packages/icons/index.js new file mode 100644 index 0000000..debc507 --- /dev/null +++ b/frontend/packages/icons/index.js @@ -0,0 +1 @@ +import "./dist/my-icon.css"; diff --git a/frontend/packages/icons/package.json b/frontend/packages/icons/package.json index 4f2d2cc..0d2938f 100644 --- a/frontend/packages/icons/package.json +++ b/frontend/packages/icons/package.json @@ -1,7 +1,13 @@ { "name": "@jinyaoma/my-app-icons", "version": "0.1.0", + "main": "index.js", + "module": "index.js", "exports": { + ".": { + "import": "./index.js", + "require": "./index.js" + }, "./dist/my-icon.css": { "import": "./dist/my-icon.css", "require": "./dist/my-icon.css" diff --git a/package.json b/package.json index a099b7e..431d876 100644 --- a/package.json +++ b/package.json @@ -39,5 +39,8 @@ "bugs": { "url": "https://github.com/jinyaoMa/my-app/issues" }, - "homepage": "https://github.com/jinyaoMa/my-app#readme" + "homepage": "https://github.com/jinyaoMa/my-app#readme", + "dependencies": { + "@jinyaoma/my-app-components": "workspace:^0.1.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b593264..dd507a7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,11 +4,14 @@ importers: .: specifiers: + '@jinyaoma/my-app-components': workspace:^0.1.0 '@types/node': ^18.7.16 cross-env: ^7.0.3 mkdirp: ^1.0.4 vitepress: ^1.0.0-alpha.15 vue: ^3.2.37 + dependencies: + '@jinyaoma/my-app-components': link:frontend/packages/components devDependencies: '@types/node': 18.7.18 cross-env: 7.0.3 @@ -45,8 +48,18 @@ importers: vite-plugin-vue-setup-extend: 0.4.0_vite@3.1.2 vue-tsc: 0.40.13_typescript@4.8.3 + frontend/packages/components: + specifiers: + '@jinyaoma/my-app-icons': workspace:* + vue: ^3.2.37 + dependencies: + '@jinyaoma/my-app-icons': link:../icons + devDependencies: + vue: 3.2.39 + frontend/packages/design: specifiers: + '@jinyaoma/my-app-components': workspace:* '@vitejs/plugin-vue': ^3.1.0 sass: ^1.54.9 typescript: ^4.6.4 @@ -55,6 +68,7 @@ importers: vue: ^3.2.37 vue-tsc: ^0.40.4 devDependencies: + '@jinyaoma/my-app-components': link:../components '@vitejs/plugin-vue': 3.1.0_vite@3.1.2+vue@3.2.39 sass: 1.54.9 typescript: 4.8.3 @@ -267,8 +281,8 @@ packages: resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==} dev: true - /@intlify/bundle-utils/3.1.0_vue-i18n@9.2.2: - resolution: {integrity: sha512-ghlJ0kR2cCQ8D+poKknC0Xx0ncOt3J3os7CcIAqqIWVF7k6AtGoCDnIru+YzlZcvFRNmP9wEZ7jKliojCdAWNg==} + /@intlify/bundle-utils/3.1.2_vue-i18n@9.2.2: + resolution: {integrity: sha512-amgSo0NN5OKWYdcgFmfJqo2tcUcZ6C66Bxm5ALQnB0m3MUQtS9aJzKoIo+EU9XQiOVmlBFxRtNoZm+psHa5FNA==} engines: {node: '>= 12'} peerDependencies: petite-vue-i18n: '*' @@ -341,7 +355,7 @@ packages: vue-i18n: optional: true dependencies: - '@intlify/bundle-utils': 3.1.0_vue-i18n@9.2.2 + '@intlify/bundle-utils': 3.1.2_vue-i18n@9.2.2 '@intlify/shared': 9.3.0-beta.3 '@rollup/pluginutils': 4.2.1 debug: 4.3.4