From d139f80ab37eb3a8a2038b1cd0309b9157addcb2 Mon Sep 17 00:00:00 2001 From: Prozilla Date: Thu, 20 Jun 2024 18:19:28 +0200 Subject: [PATCH] Fixed package dependencies --- package.json | 4 - packages/apps/text-editor/package.json | 6 +- packages/core/package.json | 4 +- .../virtual-drive/folder/virtualFolder.ts | 2 +- .../virtual-drive/root/defaultData.ts | 2 +- .../src/hooks/system/systemManagerContext.ts | 7 +- packages/prozilla-os/package.json | 4 +- packages/prozilla-os/vite.config.ts | 2 +- pnpm-lock.yaml | 166 +++--------------- .../standalone/StandaloneHeader.tsx | 2 +- vite.config.ts | 3 +- 11 files changed, 49 insertions(+), 153 deletions(-) diff --git a/package.json b/package.json index e047c27..9c5dc4b 100644 --- a/package.json +++ b/package.json @@ -33,15 +33,11 @@ "@fortawesome/fontawesome-svg-core": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.2", "@fortawesome/react-fontawesome": "^0.2.2", - "anser": "^2.1.1", - "escape-carriage": "^1.3.1", - "markdown-to-jsx": "^7.4.7", "prozilla-os": "workspace:*", "react": "^18.3.1", "react-dom": "^18.3.1", "react-router-dom": "^6.23.1", "react-svg": "^16.1.34", - "react-syntax-highlighter": "^15.5.0", "react-tabs": "^6.0.2", "vite": "^5.3.1", "vite-plugin-svgr": "^4.2.0" diff --git a/packages/apps/text-editor/package.json b/packages/apps/text-editor/package.json index 660e875..a7b6dab 100644 --- a/packages/apps/text-editor/package.json +++ b/packages/apps/text-editor/package.json @@ -21,8 +21,12 @@ }, "license": "MIT", "dependencies": { + "@fortawesome/free-solid-svg-icons": "^6.5.2", + "@fortawesome/react-fontawesome": "^0.2.2", "@prozilla-os/core": "workspace:*", - "react": "^18.3.1" + "markdown-to-jsx": "^7.4.7", + "react": "^18.3.1", + "react-syntax-highlighter": "^15.5.0" }, "devDependencies": { "@types/node": "^20.14.5", diff --git a/packages/core/package.json b/packages/core/package.json index 13104be..72fefea 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -37,8 +37,8 @@ "@vitejs/plugin-react-swc": "^3.7.0", "typescript": "^5.4.5", "vite": "^5.3.1", - "vite-plugin-css-modules": "^0.0.1", - "vite-plugin-dts": "^3.9.1" + "vite-plugin-dts": "^3.9.1", + "vite-plugin-lib-inject-css": "^2.1.1" }, "peerDependencies": { "react": "^18.3.1" diff --git a/packages/core/src/features/virtual-drive/folder/virtualFolder.ts b/packages/core/src/features/virtual-drive/folder/virtualFolder.ts index 6123956..b4538c7 100644 --- a/packages/core/src/features/virtual-drive/folder/virtualFolder.ts +++ b/packages/core/src/features/virtual-drive/folder/virtualFolder.ts @@ -351,7 +351,7 @@ export class VirtualFolder extends VirtualBase { getIconUrl(): string { if (this.iconUrl != null) return this.iconUrl; - + const { virtualDriveConfig } = this.getRoot().systemManager; return virtualDriveConfig.folderIcon; } diff --git a/packages/core/src/features/virtual-drive/root/defaultData.ts b/packages/core/src/features/virtual-drive/root/defaultData.ts index 7714bea..6de7840 100644 --- a/packages/core/src/features/virtual-drive/root/defaultData.ts +++ b/packages/core/src/features/virtual-drive/root/defaultData.ts @@ -9,7 +9,7 @@ import { VirtualRoot } from "./virtualRoot"; export function loadDefaultData(systemManager: SystemManager, virtualRoot: VirtualRoot) { const { desktopConfig, virtualDriveConfig } = systemManager; const linkedPaths: Record = {}; - + virtualRoot.createFolder("home", (folder) => { folder.createFolder("prozilla-os", (folder) => { folder.setAlias("~") diff --git a/packages/core/src/hooks/system/systemManagerContext.ts b/packages/core/src/hooks/system/systemManagerContext.ts index 868bfdb..e02aa30 100644 --- a/packages/core/src/hooks/system/systemManagerContext.ts +++ b/packages/core/src/hooks/system/systemManagerContext.ts @@ -4,5 +4,10 @@ import { SystemManager } from "../../features/system/systemManager"; export const SystemManagerContext = createContext(undefined); export function useSystemManager(): SystemManager { - return useContext(SystemManagerContext) as SystemManager; + const systemManager = useContext(SystemManagerContext); + + if (systemManager == null) + throw new Error("SystemManager is missing"); + + return systemManager; } \ No newline at end of file diff --git a/packages/prozilla-os/package.json b/packages/prozilla-os/package.json index 42c53ef..fc54300 100644 --- a/packages/prozilla-os/package.json +++ b/packages/prozilla-os/package.json @@ -21,10 +21,12 @@ }, "license": "MIT", "dependencies": { + "@fortawesome/fontawesome-svg-core": "^6.5.2", "@prozilla-os/core": "workspace:*", "@prozilla-os/file-explorer": "workspace:*", "@prozilla-os/terminal": "workspace:*", - "@prozilla-os/text-editor": "workspace:*" + "@prozilla-os/text-editor": "workspace:*", + "react-ga4": "^2.1.0" }, "devDependencies": { "@types/node": "^20.14.5", diff --git a/packages/prozilla-os/vite.config.ts b/packages/prozilla-os/vite.config.ts index 5a25b8b..2bfebf2 100644 --- a/packages/prozilla-os/vite.config.ts +++ b/packages/prozilla-os/vite.config.ts @@ -24,7 +24,7 @@ export default defineConfig({ formats: ["es"], }, rollupOptions: { - external: ["react", "react/jsx-runtime", /^@prozilla-os\//g], + external: ["react", "react/jsx-runtime", /@prozilla-os\//g], output: { assetFileNames: "assets/[name][extname]", entryFileNames: "[name].js", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 30bb3ee..ea4e46e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,15 +17,6 @@ importers: '@fortawesome/react-fontawesome': specifier: ^0.2.2 version: 0.2.2(@fortawesome/fontawesome-svg-core@6.5.2)(react@18.3.1) - anser: - specifier: ^2.1.1 - version: 2.1.1 - escape-carriage: - specifier: ^1.3.1 - version: 1.3.1 - markdown-to-jsx: - specifier: ^7.4.7 - version: 7.4.7(react@18.3.1) prozilla-os: specifier: workspace:* version: link:packages/prozilla-os @@ -41,9 +32,6 @@ importers: react-svg: specifier: ^16.1.34 version: 16.1.34(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react-syntax-highlighter: - specifier: ^15.5.0 - version: 15.5.0(react@18.3.1) react-tabs: specifier: ^6.0.2 version: 6.0.2(react@18.3.1) @@ -188,12 +176,24 @@ importers: packages/apps/text-editor: dependencies: + '@fortawesome/free-solid-svg-icons': + specifier: ^6.5.2 + version: 6.5.2 + '@fortawesome/react-fontawesome': + specifier: ^0.2.2 + version: 0.2.2(@fortawesome/fontawesome-svg-core@6.5.2)(react@18.3.1) '@prozilla-os/core': specifier: workspace:* version: link:../../core + markdown-to-jsx: + specifier: ^7.4.7 + version: 7.4.7(react@18.3.1) react: specifier: ^18.3.1 version: 18.3.1 + react-syntax-highlighter: + specifier: ^15.5.0 + version: 15.5.0(react@18.3.1) devDependencies: '@types/node': specifier: ^20.14.5 @@ -262,15 +262,18 @@ importers: vite: specifier: ^5.3.1 version: 5.3.1(@types/node@20.14.6)(less@4.2.0) - vite-plugin-css-modules: - specifier: ^0.0.1 - version: 0.0.1(@babel/generator@7.24.7)(@babel/parser@7.24.7)(@babel/traverse@7.24.7)(less@4.2.0)(postcss-modules@4.3.1(postcss@8.4.38))(postcss@8.4.38)(vite@5.3.1(@types/node@20.14.6)(less@4.2.0)) vite-plugin-dts: specifier: ^3.9.1 version: 3.9.1(@types/node@20.14.6)(rollup@4.18.0)(typescript@5.4.5)(vite@5.3.1(@types/node@20.14.6)(less@4.2.0)) + vite-plugin-lib-inject-css: + specifier: ^2.1.1 + version: 2.1.1(vite@5.3.1(@types/node@20.14.6)(less@4.2.0)) packages/prozilla-os: dependencies: + '@fortawesome/fontawesome-svg-core': + specifier: ^6.5.2 + version: 6.5.2 '@prozilla-os/core': specifier: workspace:* version: link:../core @@ -286,6 +289,9 @@ importers: react: specifier: ^18.3.1 version: 18.3.1 + react-ga4: + specifier: ^2.1.0 + version: 2.1.0 devDependencies: '@types/node': specifier: ^20.14.5 @@ -1843,9 +1849,6 @@ packages: functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - generic-names@4.0.0: - resolution: {integrity: sha512-ySFolZQfw9FoDb3ed9d80Cm9f0+r7qj+HJkWjeD9RBfpxEVTlVhol+gvaQB/78WbwYfbnNh8nWHHBSlg072y6A==} - gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} @@ -1990,15 +1993,6 @@ packages: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} - icss-replace-symbols@1.1.0: - resolution: {integrity: sha512-chIaY3Vh2mh2Q3RGXttaDIzeiPvaVXJ+C4DAh/w3c37SKZ/U6PGMmuicR2EQQp9bKG8zLMCl7I+PtIoOOPp8Gg==} - - icss-utils@5.1.0: - resolution: {integrity: sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==} - engines: {node: ^10 || ^12 || >= 14} - peerDependencies: - postcss: ^8.1.0 - ignore@5.3.1: resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} @@ -2271,10 +2265,6 @@ packages: resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} engines: {node: '>=6'} - loader-utils@3.3.1: - resolution: {integrity: sha512-FMJTLMXfCLMLfJxcX9PFqX5qD88Z5MRGaZCVzfuqeZSPsyiBzs+pahDQjbIWz2QIzPZz0NX9Zy4FX3lmK6YHIg==} - engines: {node: '>= 12.13.0'} - locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -2283,9 +2273,6 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} - lodash.camelcase@4.3.0: - resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} - lodash.get@4.4.2: resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} @@ -2575,35 +2562,6 @@ packages: resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} engines: {node: '>= 0.4'} - postcss-modules-extract-imports@3.1.0: - resolution: {integrity: sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==} - engines: {node: ^10 || ^12 || >= 14} - peerDependencies: - postcss: ^8.1.0 - - postcss-modules-local-by-default@4.0.5: - resolution: {integrity: sha512-6MieY7sIfTK0hYfafw1OMEG+2bg8Q1ocHCpoWLqOKj3JXlKu4G7btkmM/B7lFubYkYWmRSPLZi5chid63ZaZYw==} - engines: {node: ^10 || ^12 || >= 14} - peerDependencies: - postcss: ^8.1.0 - - postcss-modules-scope@3.2.0: - resolution: {integrity: sha512-oq+g1ssrsZOsx9M96c5w8laRmvEu9C3adDSjI8oTcbfkrTE8hx/zfyobUoWIxaKPO8bt6S62kxpw5GqypEw1QQ==} - engines: {node: ^10 || ^12 || >= 14} - peerDependencies: - postcss: ^8.1.0 - - postcss-modules-values@4.0.0: - resolution: {integrity: sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==} - engines: {node: ^10 || ^12 || >= 14} - peerDependencies: - postcss: ^8.1.0 - - postcss-modules@4.3.1: - resolution: {integrity: sha512-ItUhSUxBBdNamkT3KzIZwYNNRFKmkJrofvC2nWab3CPKhYBQ1f27XXh1PAPE27Psx58jeelPsxWB/+og+KEH0Q==} - peerDependencies: - postcss: ^8.0.0 - postcss-resolve-nested-selector@0.1.1: resolution: {integrity: sha512-HvExULSwLqHLgUy1rl3ANIqCsvMS0WHss2UOsXhXnQaZ9VCc2oBvIpXrl00IUFT5ZDITME0o6oiXeiHr2SAIfw==} @@ -2936,9 +2894,6 @@ packages: resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} engines: {node: '>=0.6.19'} - string-hash@1.1.3: - resolution: {integrity: sha512-kJUvRUFK49aub+a7T1nNE66EJbZBMnBgoC1UbCZ5n6bsZKBRga4KgBRTMn/pFkeCZSYtNeSyMxPDM0AXWELk2A==} - string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -3190,18 +3145,6 @@ packages: vue-tsc: optional: true - vite-plugin-css-modules@0.0.1: - resolution: {integrity: sha512-032ydX4sl5iwaPLwEsSHBFIHfHax80tiOYIZI2qxUtafBIBIhGP5RwvfEPsW3C4DNzmwf7pBKDWK27W4Kb742A==} - engines: {node: '>=8', npm: '>=5'} - peerDependencies: - '@babel/generator': ^7.15.4 - '@babel/parser': ^7.15.6 - '@babel/traverse': ^7.15.4 - less: ^4.1.1 - postcss: ^8.3.6 - postcss-modules: ^4.2.2 - vite: '>2.0.0-0' - vite-plugin-dts@3.9.1: resolution: {integrity: sha512-rVp2KM9Ue22NGWB8dNtWEr+KekN3rIgz1tWD050QnRGlriUCmaDwa7qA5zDEjbXg5lAXhYMSBJtx3q3hQIJZSg==} engines: {node: ^14.18.0 || >=16.0.0} @@ -4655,6 +4598,7 @@ snapshots: copy-anything@2.0.6: dependencies: is-what: 3.14.1 + optional: true cosmiconfig@8.3.6(typescript@5.4.5): dependencies: @@ -5152,10 +5096,6 @@ snapshots: functions-have-names@1.2.3: {} - generic-names@4.0.0: - dependencies: - loader-utils: 3.3.1 - gensync@1.0.0-beta.2: {} get-caller-file@2.0.5: {} @@ -5308,12 +5248,6 @@ snapshots: safer-buffer: 2.1.2 optional: true - icss-replace-symbols@1.1.0: {} - - icss-utils@5.1.0(postcss@8.4.38): - dependencies: - postcss: 8.4.38 - ignore@5.3.1: {} image-size@0.5.5: @@ -5464,7 +5398,8 @@ snapshots: call-bind: 1.0.7 get-intrinsic: 1.2.4 - is-what@3.14.1: {} + is-what@3.14.1: + optional: true is-windows@1.0.2: {} @@ -5549,6 +5484,7 @@ snapshots: mime: 1.6.0 needle: 3.3.1 source-map: 0.6.1 + optional: true levn@0.4.1: dependencies: @@ -5564,8 +5500,6 @@ snapshots: pify: 4.0.1 strip-bom: 3.0.0 - loader-utils@3.3.1: {} - locate-path@5.0.0: dependencies: p-locate: 4.1.0 @@ -5574,8 +5508,6 @@ snapshots: dependencies: p-locate: 5.0.0 - lodash.camelcase@4.3.0: {} - lodash.get@4.4.2: {} lodash.isequal@4.5.0: {} @@ -5821,7 +5753,8 @@ snapshots: json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 - parse-node-version@1.0.1: {} + parse-node-version@1.0.1: + optional: true path-browserify@1.0.1: {} @@ -5855,39 +5788,6 @@ snapshots: possible-typed-array-names@1.0.0: {} - postcss-modules-extract-imports@3.1.0(postcss@8.4.38): - dependencies: - postcss: 8.4.38 - - postcss-modules-local-by-default@4.0.5(postcss@8.4.38): - dependencies: - icss-utils: 5.1.0(postcss@8.4.38) - postcss: 8.4.38 - postcss-selector-parser: 6.1.0 - postcss-value-parser: 4.2.0 - - postcss-modules-scope@3.2.0(postcss@8.4.38): - dependencies: - postcss: 8.4.38 - postcss-selector-parser: 6.1.0 - - postcss-modules-values@4.0.0(postcss@8.4.38): - dependencies: - icss-utils: 5.1.0(postcss@8.4.38) - postcss: 8.4.38 - - postcss-modules@4.3.1(postcss@8.4.38): - dependencies: - generic-names: 4.0.0 - icss-replace-symbols: 1.1.0 - lodash.camelcase: 4.3.0 - postcss: 8.4.38 - postcss-modules-extract-imports: 3.1.0(postcss@8.4.38) - postcss-modules-local-by-default: 4.0.5(postcss@8.4.38) - postcss-modules-scope: 3.2.0(postcss@8.4.38) - postcss-modules-values: 4.0.0(postcss@8.4.38) - string-hash: 1.1.3 - postcss-resolve-nested-selector@0.1.1: {} postcss-safe-parser@7.0.0(postcss@8.4.38): @@ -6250,8 +6150,6 @@ snapshots: string-argv@0.3.2: {} - string-hash@1.1.3: {} - string-width@4.2.3: dependencies: emoji-regex: 8.0.0 @@ -6551,16 +6449,6 @@ snapshots: typescript: 5.4.5 vue-tsc: 1.8.27(typescript@5.4.5) - vite-plugin-css-modules@0.0.1(@babel/generator@7.24.7)(@babel/parser@7.24.7)(@babel/traverse@7.24.7)(less@4.2.0)(postcss-modules@4.3.1(postcss@8.4.38))(postcss@8.4.38)(vite@5.3.1(@types/node@20.14.6)(less@4.2.0)): - dependencies: - '@babel/generator': 7.24.7 - '@babel/parser': 7.24.7 - '@babel/traverse': 7.24.7 - less: 4.2.0 - postcss: 8.4.38 - postcss-modules: 4.3.1(postcss@8.4.38) - vite: 5.3.1(@types/node@20.14.6)(less@4.2.0) - vite-plugin-dts@3.9.1(@types/node@20.14.6)(rollup@4.18.0)(typescript@5.4.5)(vite@5.3.1(@types/node@20.14.6)(less@4.2.0)): dependencies: '@microsoft/api-extractor': 7.43.0(@types/node@20.14.6) diff --git a/src/components/standalone/StandaloneHeader.tsx b/src/components/standalone/StandaloneHeader.tsx index c0fe71e..8daebd8 100644 --- a/src/components/standalone/StandaloneHeader.tsx +++ b/src/components/standalone/StandaloneHeader.tsx @@ -2,7 +2,7 @@ import { ReactSVG } from "react-svg"; import { NAME } from "../../config/branding.config"; import styles from "./StandaloneHeader.module.css"; import { faTimes } from "@fortawesome/free-solid-svg-icons"; -import { Button } from "@prozilla-os/core"; +import { Button } from "prozilla-os"; interface StandaloneHeaderProps { exit: Function; diff --git a/vite.config.ts b/vite.config.ts index b05424d..befa781 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,6 +6,7 @@ import { resolve } from "path"; /** * Loads packages from their local path instead of node_modules + * You must run `pnpm link ` to make this work correctly */ const ENABLE_ALIASES = true; @@ -65,7 +66,7 @@ export default defineConfig(({ command }) => { port: 3000, }, optimizeDeps: { - force: (devMode && !ENABLE_ALIASES) + exclude: devMode ? ["prozilla-os"] : [] } }; }); \ No newline at end of file