diff --git a/alias.ts b/alias.ts index a47ae93..a0e951a 100644 --- a/alias.ts +++ b/alias.ts @@ -4,6 +4,7 @@ import { join, relative } from 'pathe' const root = fileURLToPath(new URL('.', import.meta.url)) const r = (path: string) => fileURLToPath(new URL(`./packages/${path}`, import.meta.url)) +const p = (path: string) => fileURLToPath(new URL(`./plugins/${path}`, import.meta.url)) export const alias = { 'devframe/rpc/transports/ws-server': r('devframe/src/rpc/transports/ws-server.ts'), @@ -44,6 +45,14 @@ export const alias = { '@devframes/hub': r('hub/src/index.ts'), '@devframes/nuxt/runtime/plugin.client': r('nuxt/src/runtime/plugin.client.ts'), '@devframes/nuxt': r('nuxt/src/index.ts'), + '@devframes/plugin-code-server/client': p('code-server/src/client/index.ts'), + '@devframes/plugin-code-server/node': p('code-server/src/node/index.ts'), + '@devframes/plugin-code-server/constants': p('code-server/src/constants.ts'), + '@devframes/plugin-code-server/types': p('code-server/src/types.ts'), + '@devframes/plugin-code-server/rpc': p('code-server/src/rpc/index.ts'), + '@devframes/plugin-code-server/cli': p('code-server/src/cli.ts'), + '@devframes/plugin-code-server/vite': p('code-server/src/vite.ts'), + '@devframes/plugin-code-server': p('code-server/src/index.ts'), 'devframe/recipes/open-helpers': r('devframe/src/recipes/open-helpers.ts'), 'devframe/client': r('devframe/src/client/index.ts'), 'devframe': r('devframe/src'), diff --git a/eslint.config.js b/eslint.config.js index b01f4f8..3098aae 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -6,6 +6,7 @@ export default antfu({ ignores: [ 'skills', '**/dist', + '**/storybook-static', '**/.next', '**/out', '**/next-env.d.ts', diff --git a/plugins/code-server/.gitignore b/plugins/code-server/.gitignore new file mode 100644 index 0000000..418cf91 --- /dev/null +++ b/plugins/code-server/.gitignore @@ -0,0 +1,4 @@ +dist +storybook-static +.turbo +*.tsbuildinfo diff --git a/plugins/code-server/.storybook/main.ts b/plugins/code-server/.storybook/main.ts new file mode 100644 index 0000000..769ec5c --- /dev/null +++ b/plugins/code-server/.storybook/main.ts @@ -0,0 +1,11 @@ +import type { StorybookConfig } from '@storybook/html-vite' + +const config: StorybookConfig = { + stories: ['../src/**/*.stories.@(ts|tsx)'], + framework: { + name: '@storybook/html-vite', + options: {}, + }, +} + +export default config diff --git a/plugins/code-server/.storybook/preview.ts b/plugins/code-server/.storybook/preview.ts new file mode 100644 index 0000000..20b90ba --- /dev/null +++ b/plugins/code-server/.storybook/preview.ts @@ -0,0 +1,11 @@ +import type { Preview } from '@storybook/html-vite' +import '../src/client/style.css' + +const preview: Preview = { + parameters: { + layout: 'fullscreen', + controls: { expanded: true }, + }, +} + +export default preview diff --git a/plugins/code-server/README.md b/plugins/code-server/README.md new file mode 100644 index 0000000..730e19e --- /dev/null +++ b/plugins/code-server/README.md @@ -0,0 +1,80 @@ +# @devframes/plugin-code-server + +Run [code-server](https://github.com/coder/code-server) (VS Code in the +browser) as a devframe panel. The plugin detects a local `code-server` +install, launches it on demand, and embeds the editor in an +auto-authenticated `