@owdproject/core 3.0.0-alpha.9 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,148 +1,124 @@
1
1
  <p align="center">
2
- <img width="160" height="160" alt="Open Web Desktop logo" src="https://avatars.githubusercontent.com/u/65117737?s=160&v=4" />
2
+ <img width="160" height="160" src="https://avatars.githubusercontent.com/u/65117737?s=160&v=4" />
3
3
  </p>
4
4
  <h1 align="center">Open Web Desktop</h1>
5
5
  <h3 align="center">
6
- A framework for building web-based desktop experiences.
6
+ A modular framework for building web-based desktop experiences.
7
7
  </h3>
8
8
 
9
9
  ## Overview
10
- Open Web Desktop (OWD) is a framework designed to provide a simple environment for building web-based desktop experiences. It's built with TypeScript on top of the Nuxt.js framework.
11
10
 
12
- [Check out the demo](https://owdproject.github.io/docs) of the `client` base repository, decked with a couple of modules.
11
+ Open Web Desktop (OWD) is a framework designed to provide a simple environment for building web-based desktop experiences. It's built with Vue.js & TypeScript, and it leverages the extensible Nuxt.js architecture.
12
+
13
+ [Demo](https://atproto-os.pages.dev/) · [Documentation](https://owdproject.org/)
13
14
 
14
15
  ## Features
16
+
15
17
  - Open-source web desktop environment built with Nuxt.js
16
18
  - Fully extendable through themes, apps, and modules
17
- - Bundled with popular libraries like Pinia, VueUse, Mitt
19
+ - Bundled with popular Vue.js libraries like Pinia and VueUse
18
20
  - Designed to make the most of the Nuxt.js ecosystem
19
21
  - Styled with PrimeVue and Tailwind for a consistent UI
20
- - Fully localizable with i18n support
22
+ - Fully localizable with nuxt-i18n support
21
23
 
22
24
  ## Getting started
23
- Required software:
24
25
 
25
- - [Git](https://git-scm.com)
26
- - [Node](https://nodejs.org)
26
+ Bootstrap a new project by running:
27
27
 
28
- When you are ready, bootstrap a new project by running:
29
28
  ```bash
30
29
  npm create owd
31
30
  ```
32
- Once the process is complete, you can start to develop:
33
- ```bash
34
- # Run the dev server with hot-reload
35
- npm run dev
36
31
 
37
- # Build for production
38
- npm run generate
39
- ```
32
+ Once the process is done, you can start to develop:
40
33
 
41
- ## Modules
42
- Open Web Desktop projects can be extended with themes, plugins, and desktop apps.
34
+ ```bash
35
+ cd owd-client
43
36
 
44
- ### Install a new app
45
- You can simply install a new application and define it this way.
37
+ # Run the dev server with hot-reload
38
+ pnpm install
39
+ pnpm run dev
46
40
 
47
- ```typescript
48
- // owd.config.ts
49
- export default defineDesktopConfig({
50
- apps: [
51
- "@owdproject/app-about",
52
- "@owdproject/app-todo",
53
- ]
54
- })
41
+ # Build for production
42
+ pnpm run generate
55
43
  ```
56
44
 
57
- ## Themes
58
- Themes allow you to customize the look and feel of your Open Web Desktop instance.
59
- You can explore available themes, ranging from popular OS designs to fully custom creations, at [topics/owd-themes](https://github.com/topics/owd-themes).
45
+ ## Extend your desktop
60
46
 
61
- ### Install a new theme
62
- You can install a new theme by defining it in the `owd.config.ts` configuration.
63
- Themes can be loaded from a local path or directly from a GitHub repository.
47
+ Open Web Desktop can be extended with themes, modules and applications.
64
48
 
65
- #### Using a local theme
49
+ ### Install an application
66
50
 
67
- Clone it first in a folder of your project like `./desktop/theme/theme-gnome`.
51
+ You can install a new [application](https://github.com/topics/owd-apps) with:
68
52
 
69
53
  ```bash
70
- git clone git@github.com:owdproject/theme-gnome.git ./desktop/theme/theme-gnome
54
+ pnpm install @owdproject/app-todo
71
55
  ```
72
56
 
73
- Then specify the path theme in `owd.config.ts`:
57
+ Then, define it in the desktop configuration:
74
58
 
75
59
  ```typescript
76
- // owd.config.ts
60
+ // desktop/owd.config.ts
77
61
  export default defineDesktopConfig({
78
- theme: './dev/themes/theme-gnome', // define here the theme you just cloned
62
+ theme: "@owdproject/theme-win95",
79
63
  apps: [
80
- ...
64
+ "@owdproject/app-about",
65
+ "@owdproject/app-todo", // define here the app you just installed
66
+ ],
67
+ modules: []
68
+ })
81
69
  ```
82
70
 
83
- #### Using a theme package
71
+ ### Install a module
84
72
 
85
- Use npm to install the theme package as a dependency of your Open Web Desktop client:
73
+ You can install a new [module](https://github.com/topics/owd-modules) with:
86
74
 
87
75
  ```bash
88
- npm install @owdproject/theme-gnome
76
+ pnpm install @owdproject/module-pinia-localforage
89
77
  ```
90
78
 
91
- Then specify the path theme in `owd.config.ts`:
79
+ Then, define it in the desktop configuration:
92
80
 
93
81
  ```typescript
94
- // owd.config.ts
95
- import {defineDesktopConfig} from "@owdproject/core/runtime/utils/utilDesktop"
96
-
82
+ // desktop/owd.config.ts
97
83
  export default defineDesktopConfig({
98
- theme: '@owdproject/theme-gnome', // define here the theme you just installed
84
+ theme: "@owdproject/theme-win95",
99
85
  apps: [
100
- ...
86
+ "@owdproject/app-about",
87
+ "@owdproject/app-todo",
88
+ ],
89
+ modules: [
90
+ "@owdproject/module-pinia-localforage", // define here the module you just installed
91
+ ]
92
+ })
101
93
  ```
102
94
 
103
- ## Contributing
104
-
105
- **Any contribution is welcome!** Open Web Desktop is built with Nuxt and follows a modular architecture, making it easy to contribute to the core codebase or create new modules.
106
-
107
- ### Local Development Setup
108
-
109
- If you'd like to contribute, here's how to set up your local development environment:
110
-
111
- **Prerequisites:**
112
-
113
- - [Git](https://git-scm.com)
114
- - [Node](https://nodejs.org)
115
-
116
- **Cloning the Repository:**
117
-
118
- To contribute, start by forking the Open Web Desktop client repository on GitHub.
119
- Then, clone your fork using HTTPS or SSH:
95
+ ## Themes
96
+ You can install a new [theme](https://github.com/topics/owd-themes) in the same way.
120
97
 
121
98
  ```bash
122
- # Clone using HTTPS
123
- git clone https://github.com/<your-username>/client.git
124
-
125
- # Clone using SSH
126
- git clone git@github.com:<your-username>/client.git
99
+ pnpm install @owdproject/theme-gnome
127
100
  ```
128
101
 
129
- Once you have cloned the repository, navigate to the project folder.
130
- Install the dependencies, then start the development server:
102
+ Define the theme in `owd.config.ts`:
131
103
 
132
- ```bash
133
- cd owd-client
134
-
135
- npm install
136
- npm run dev
104
+ ```typescript
105
+ // desktop/owd.config.ts
106
+ export default defineDesktopConfig({
107
+ theme: "@owdproject/theme-gnome", // define here the theme you just installed
108
+ apps: [
109
+ "@owdproject/app-about",
110
+ "@owdproject/app-todo",
111
+ ],
112
+ modules: [
113
+ "@owdproject/module-pinia-localforage"
114
+ ]
115
+ })
137
116
  ```
138
117
 
139
- This will launch Open Web Desktop in development mode, allowing you to test your changes and see them reflected in real-time.
140
- The dev server will be available at http://localhost:3000.
141
-
142
- ## Sponsoring
118
+ ## Sponsors
143
119
 
144
- Open Web Desktop is a vast project. The code has been totally rewritten and is now actively being developed, but your support is what makes it all possible. If you're enjoying it and want to see more, consider donating. Your contribution helps keep the project alive and awesome.
120
+ Make this project sustainable, your support is crucial to keep it moving forward.
145
121
 
146
122
  ## License
147
123
 
148
- Open Web Desktop is released under the [GNU General Public License v3](LICENSE).
124
+ Open Web Desktop is released under the [MIT License](LICENSE).
@@ -0,0 +1,30 @@
1
+ import { FlatCompat } from '@eslint/eslintrc';
2
+ import { dirname } from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import js from '@eslint/js';
5
+ import baseConfig from '../../eslint.config.mjs';
6
+ const compat = new FlatCompat({
7
+ baseDirectory: dirname(fileURLToPath(import.meta.url)),
8
+ recommendedConfig: js.configs.recommended,
9
+ });
10
+
11
+ export default [
12
+ ...baseConfig,
13
+ {
14
+ files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx', '**/*.vue'],
15
+ // Override or add rules here
16
+ rules: {},
17
+ },
18
+ //...compat.extends('@nuxt/eslint-config'),
19
+ {
20
+ files: ['**/*.vue'],
21
+ languageOptions: {
22
+ parserOptions: {
23
+ parser: await import('@typescript-eslint/parser'),
24
+ },
25
+ },
26
+ },
27
+ {
28
+ ignores: ['.nuxt/**', '.output/**', 'node_modules'],
29
+ },
30
+ ];
package/index.ts CHANGED
@@ -1,192 +1,2 @@
1
- import {defineNuxtModule, createResolver, addComponentsDir, addImportsDir, installModule, addPlugin} from '@nuxt/kit'
2
- import {deepMerge} from '@owdproject/core/runtime/utils/utilCommon'
3
- import pkg from './package.json'
4
-
5
- export default defineNuxtModule({
6
- meta: {
7
- name: 'owd-core',
8
- priority: 9999,
9
- },
10
- async setup(options, nuxt) {
11
- const {resolve} = createResolver(import.meta.url)
12
-
13
- const desktopConfig = (await import(nuxt.options.rootDir + '/owd.config.ts')).default
14
-
15
- // set core version to runtime config
16
-
17
- nuxt.options.runtimeConfig.public.coreVersion = pkg.version
18
-
19
- {
20
-
21
- // install open web desktop theme
22
-
23
- if (desktopConfig.theme) {
24
- await installModule(desktopConfig.theme)
25
- }
26
-
27
- // install open web desktop modules
28
-
29
- if (desktopConfig.modules) {
30
- for (const modulePath of desktopConfig.modules) {
31
- await installModule(modulePath)
32
- }
33
- }
34
-
35
- // install open web desktop apps
36
-
37
- if (desktopConfig.apps) {
38
- for (const appPath of desktopConfig.apps) {
39
- await installModule(appPath)
40
- }
41
- }
42
-
43
- // assign open web desktop config to runtime config
44
- nuxt.options.runtimeConfig.public.desktop = deepMerge(
45
- nuxt.options.runtimeConfig.public.desktop,
46
- desktopConfig
47
- )
48
-
49
- }
50
-
51
- {
52
-
53
- // install primevue
54
-
55
- nuxt.options.primevue = nuxt.options.primevue || {};
56
- nuxt.options.primevue.options = nuxt.options.primevue.options || {};
57
- nuxt.options.primevue.options.theme = nuxt.options.primevue.options.theme || {};
58
-
59
- await installModule("@primevue/nuxt-module")
60
-
61
- }
62
-
63
- {
64
-
65
- // install tailwind
66
-
67
- const tailwindPaths = nuxt.options.runtimeConfig?.owd?.tailwindPaths || []
68
- tailwindPaths.push('./runtime/components/**/*.{vue,mjs,ts}') // Aggiungi sempre questo al core
69
-
70
- nuxt.options.tailwindcss = nuxt.options.tailwindcss || {}
71
- nuxt.options.tailwindcss.config = nuxt.options.tailwindcss.config || {}
72
- // @ts-ignore
73
- nuxt.options.tailwindcss.config.content = tailwindPaths
74
-
75
- await installModule('@nuxtjs/tailwindcss', {
76
- viewer: false,
77
- })
78
-
79
- }
80
-
81
- {
82
-
83
- // install pinia
84
-
85
- await installModule("@pinia/nuxt")
86
-
87
- }
88
-
89
- {
90
-
91
- // install @nuxt/fonts
92
-
93
- await installModule("@nuxt/fonts")
94
-
95
- }
96
-
97
- {
98
-
99
- // install @nuxt/icon
100
-
101
- await installModule("@nuxt/icon", {
102
- clientBundle: {
103
- scan: true,
104
- sizeLimitKb: 256,
105
- },
106
- })
107
-
108
- }
109
-
110
- {
111
-
112
- // install @vueuse/nuxt
113
-
114
- await installModule("@vueuse/nuxt")
115
-
116
- }
117
-
118
- {
119
-
120
- // install @nuxtjs/i18n
121
-
122
- await installModule("@nuxtjs/i18n")
123
-
124
- }
125
-
126
- {
127
-
128
- // configure scss for vite
129
-
130
- nuxt.hook('vite:extendConfig', (viteConfig) => {
131
- viteConfig.css = viteConfig.css || {}
132
- viteConfig.css.preprocessorOptions = viteConfig.css.preprocessorOptions || {}
133
- viteConfig.css.preprocessorOptions.scss = {
134
- api: 'modern-compiler',
135
- }
136
- })
137
-
138
- }
139
-
140
- {
141
-
142
- // add css
143
-
144
- nuxt.options.css.push('sanitize.css')
145
-
146
- }
147
-
148
- {
149
-
150
- // add components
151
-
152
- addComponentsDir({
153
- path: resolve("./runtime/components"),
154
- prefix: "",
155
- global: true,
156
- })
157
-
158
- }
159
-
160
- {
161
-
162
- // install plugins
163
-
164
- addPlugin(resolve('./runtime/plugins/resize.client.ts'))
165
-
166
- // add other files
167
-
168
- addImportsDir(resolve('./runtime/composables'))
169
- addImportsDir(resolve('./runtime/core'))
170
- addImportsDir(resolve('./runtime/stores'))
171
- addImportsDir(resolve('./runtime/utils'))
172
-
173
- }
174
- }
175
- })
176
-
177
- export * from './runtime/composables/useAppEntries'
178
- export * from './runtime/composables/useApplicationManager'
179
- export * from './runtime/composables/useDesktopManager'
180
- export * from './runtime/composables/useTerminalManager'
181
- export * from './runtime/utils/utilApp'
182
- export * from './runtime/utils/utilCommon'
183
- export * from './runtime/utils/utilDebug'
184
- export * from './runtime/utils/utilDesktop'
185
- export * from './runtime/utils/utilTerminal'
186
- export * from './runtime/utils/utilWindow'
187
- export * from './runtime/stores/storeApplicationMeta'
188
- export * from './runtime/stores/storeApplicationWindows'
189
- export * from './runtime/stores/storeDesktop'
190
- export * from './runtime/stores/storeDesktopVolume'
191
- export * from './runtime/stores/storeDesktopWindow'
192
- export * from './runtime/stores/storeDesktopWorkspace'
1
+ export { defineDesktopApp, defineDesktopConfig } from "./runtime/utils/utilDesktop"
2
+ export { registerTailwindPath } from "./runtime/utils/utilApp"
package/module.ts ADDED
@@ -0,0 +1,181 @@
1
+ import {defineNuxtModule, createResolver, addComponentsDir, addImportsDir, installModule, addPlugin} from '@nuxt/kit'
2
+ import {deepMerge} from './runtime/utils/utilCommon'
3
+ import pkg from './package.json'
4
+
5
+ export default defineNuxtModule({
6
+ meta: {
7
+ name: 'owd-core',
8
+ },
9
+ async setup(_options, _nuxt) {
10
+ const {resolve} = createResolver(import.meta.url)
11
+
12
+ // get open web desktop config
13
+
14
+ const desktopConfig = (await import(_nuxt.options.rootDir + '/owd.config.ts')).default
15
+
16
+ // extend nuxt.config.ts with owd.config.ts
17
+
18
+ _nuxt.options = {
19
+ ..._nuxt.options,
20
+ ...desktopConfig,
21
+ }
22
+
23
+ // set core version to runtime config
24
+
25
+ _nuxt.options.runtimeConfig.public.coreVersion = pkg.version
26
+
27
+ {
28
+
29
+ // install open web desktop theme
30
+
31
+ if (desktopConfig.theme) {
32
+ await installModule(desktopConfig.theme)
33
+ }
34
+
35
+ // install open web desktop modules
36
+
37
+ if (desktopConfig.modules) {
38
+ for (const modulePath of desktopConfig.modules) {
39
+ await installModule(modulePath)
40
+ }
41
+ }
42
+
43
+ // install open web desktop apps
44
+
45
+ if (desktopConfig.apps) {
46
+ for (const appPath of desktopConfig.apps) {
47
+ await installModule(appPath)
48
+ }
49
+ }
50
+
51
+ // assign open web desktop config to runtime config
52
+ _nuxt.options.runtimeConfig.public.desktop = deepMerge(
53
+ _nuxt.options.runtimeConfig.public.desktop,
54
+ desktopConfig
55
+ )
56
+
57
+ }
58
+
59
+ {
60
+
61
+ // install primevue
62
+
63
+ _nuxt.options.primevue = _nuxt.options.primevue || {};
64
+ _nuxt.options.primevue.options = _nuxt.options.primevue.options || {};
65
+ _nuxt.options.primevue.options.theme = _nuxt.options.primevue.options.theme || {};
66
+
67
+ await installModule("@primevue/nuxt-module")
68
+
69
+ }
70
+
71
+ {
72
+
73
+ // install tailwind
74
+
75
+ const tailwindPaths = _nuxt.options.runtimeConfig.app.owd?.tailwindPaths || []
76
+ tailwindPaths.push('./runtime/components/**/*.{vue,mjs,ts}') // Aggiungi sempre questo al core
77
+
78
+ _nuxt.options.tailwindcss = _nuxt.options.tailwindcss || {}
79
+ _nuxt.options.tailwindcss.config = _nuxt.options.tailwindcss.config || {}
80
+ // @ts-ignore
81
+ _nuxt.options.tailwindcss.config.content = tailwindPaths
82
+
83
+ await installModule('@nuxtjs/tailwindcss', {
84
+ viewer: false,
85
+ })
86
+
87
+ }
88
+
89
+ {
90
+
91
+ // install pinia
92
+
93
+ await installModule("@pinia/nuxt")
94
+
95
+ }
96
+
97
+ {
98
+
99
+ // install @nuxt/fonts
100
+
101
+ await installModule("@nuxt/fonts")
102
+
103
+ }
104
+
105
+ {
106
+
107
+ // install @nuxt/icon
108
+
109
+ await installModule("@nuxt/icon", {
110
+ clientBundle: {
111
+ scan: true,
112
+ sizeLimitKb: 256,
113
+ },
114
+ })
115
+
116
+ }
117
+
118
+ {
119
+
120
+ // install @vueuse/nuxt
121
+
122
+ await installModule("@vueuse/nuxt")
123
+
124
+ }
125
+
126
+ {
127
+
128
+ // install @nuxtjs/i18n
129
+
130
+ await installModule("@nuxtjs/i18n")
131
+
132
+ }
133
+
134
+ {
135
+
136
+ // configure scss for vite
137
+
138
+ _nuxt.hook('vite:extendConfig', (viteConfig) => {
139
+ viteConfig.css = viteConfig.css || {}
140
+ viteConfig.css.preprocessorOptions = viteConfig.css.preprocessorOptions || {}
141
+ viteConfig.css.preprocessorOptions.scss = {
142
+ api: 'modern-compiler',
143
+ }
144
+ })
145
+
146
+ }
147
+
148
+ {
149
+
150
+ // add css
151
+
152
+ _nuxt.options.css.push('sanitize.css')
153
+
154
+ }
155
+
156
+ {
157
+
158
+ // add components
159
+
160
+ addComponentsDir({
161
+ path: resolve("./runtime/components"),
162
+ prefix: "",
163
+ global: true,
164
+ })
165
+
166
+ }
167
+
168
+ {
169
+
170
+ addPlugin(resolve('./runtime/plugins/resize.client.ts'))
171
+
172
+ // add other files
173
+
174
+ addImportsDir(resolve('./runtime/composables'))
175
+ addImportsDir(resolve('./runtime/core'))
176
+ addImportsDir(resolve('./runtime/stores'))
177
+ addImportsDir(resolve('./runtime/utils'))
178
+
179
+ }
180
+ }
181
+ })
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@owdproject/core",
3
- "version": "3.0.0-alpha.9",
4
- "description": "Open Web Desktop core",
3
+ "version": "3.1.1",
5
4
  "keywords": [
6
5
  "web",
7
6
  "desktop",
@@ -18,33 +17,32 @@
18
17
  "type": "git",
19
18
  "url": "git+https://github.com/owdproject/client.git"
20
19
  },
21
- "license": "GPL-3.0-or-later",
20
+ "license": "MIT",
22
21
  "author": {
23
- "name": "dxlliv",
24
- "url": "https://github.com/dxlliv"
22
+ "name": "Open Web Desktop Team",
23
+ "url": "https://github.com/owdproject"
25
24
  },
25
+ "type": "module",
26
+ "types": "types/index.d.ts",
26
27
  "dependencies": {
27
- "@nuxt/fonts": "^0.11.0",
28
- "@nuxt/icon": "^1.11.0",
29
- "@nuxtjs/i18n": "^9.4.0",
30
- "@nuxtjs/tailwindcss": "^6.13.2",
31
- "@pinia/nuxt": "^0.10.1",
32
- "@primeuix/themes": "^1.0.0",
33
- "@primevue/forms": "^4.3.3",
34
- "@primevue/nuxt-module": "^4.3.3",
35
- "@vueuse/components": "^13.0.0",
36
- "@vueuse/core": "^13.0.0",
37
- "@vueuse/nuxt": "^13.0.0",
38
- "memfs": "^4.17.0",
28
+ "@nuxt/kit": "^3.17.2",
29
+ "@nuxt/fonts": "^0.11.3",
30
+ "@nuxt/icon": "^1.12.0",
31
+ "@nuxtjs/i18n": "^9.5.4",
32
+ "@nuxtjs/tailwindcss": "^6.14.0",
33
+ "@pinia/nuxt": "^0.11.0",
34
+ "@primeuix/themes": "^1.1.1",
35
+ "@primevue/forms": "^4.3.4",
36
+ "@primevue/nuxt-module": "^4.3.4",
37
+ "@vueuse/components": "^13.1.0",
38
+ "@vueuse/core": "^13.1.0",
39
+ "@vueuse/nuxt": "^13.1.0",
39
40
  "mitt": "^3.0.1",
40
41
  "nanoid": "^5.1.5",
41
- "nuxt": "^3.16.1",
42
- "pinia": "^3.0.1",
42
+ "nuxt": "^3.17.2",
43
+ "pinia": "^3.0.2",
43
44
  "sanitize.css": "^13.0.0",
44
- "sass": "^1.86.0",
45
+ "sass": "^1.88.0",
45
46
  "vue-resizable": "^2.1.7"
46
- },
47
- "resolutions": {
48
- "vite": "^6.3.2"
49
47
  }
50
48
  }
@@ -80,4 +80,4 @@ const classes = computed(() => {
80
80
  height: 100dvh;
81
81
  user-select: none;
82
82
  }
83
- </style>
83
+ </style>