@eclipse-docks/create-app

中文文档
0.8.15发布于 2026/11/06EPL-2.0ES Module零依赖构建来源已验证近 30 天下载 2602

Scaffold a new Eclipse Docks app (monorepo with app + example extension)

原始使用文档
文档目录5 节
  1. Testing locally
  2. Usage (published package)
  3. Next steps
  4. What you get
  5. Example extension

@eclipse-docks/create-app

Scaffold a new Eclipse Docks app with a single command.

Testing locally

From the Eclipse Docks monorepo root, run the CLI with Node (no publish needed):

node packages/create-app/index.js my-app
# or non-interactive:
node packages/create-app/index.js my-app --yes

Or use npx with the package path:

npx file:./packages/create-app my-app --yes

Then cd my-app && npm run dev to run the scaffolded app.

Usage (published package)

npm create @eclipse-docks/app

With a project name (directory):

npm create @eclipse-docks/app my-app

To skip prompts when a project name is provided:

npm create @eclipse-docks/app my-app -- --yes

Next steps

After scaffolding:

cd my-app
npm run dev

From the created project root, npm run dev runs the app (Vite). Use npm run build and npm run preview to build and preview.

What you get

  • A monorepo with two workspace packages:
    • packages/app – the Docks app (Vite, core + extensions from npm), including PWA (web app manifest, injectManifest service worker, @eclipse-docks/extension-pwa for install/update in the toolbar).
    • packages/example-extension – a minimal example extension you can copy or extend.
  • The app registers a logo contribution on the left main toolbar (slot start) with the text my!app; you can change it in packages/app/src/main.ts.
  • The example extension is loaded by the app and adds an "Example" view in the left side panel.

Example extension

The template includes an example extension in packages/example-extension to show how to build your own extensions without publishing a separate npm package.

  • src/index.ts – Registers the extension with extensionRegistry.registerExtension() (id, name, description, loader, icon). Same pattern as published extensions like @eclipse-docks/extension-howto-system and @eclipse-docks/extension-utils.
  • src/example-extension-loader.ts – Loaded when the extension is activated. Registers a TabContribution to SIDEBAR_MAIN (the left side panel), so the "Example" tab appears alongside the workspace file browser.
  • tsconfig.json – TypeScript config for the extension (IDE and type-checking).
  • vite.config.ts – Vite lib build; run npm run build -w example-extension to output dist/ when you want to publish the extension.

You can edit packages/example-extension in place, add more views or contributions, or copy it to start a new extension. The app depends on it via "example-extension": "*" in packages/app/package.json (npm links the workspace package). The app compiles the extension from source in dev; use the extension’s build script if you publish it as a separate package.

版本与发布记录

@eclipse-docks/create-app 共发布 73 个版本,首次发布于 2026/04/09;过去 12 个月发布了 73 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.8.15latest2026/11/067 天前
0.8.142026/11/067 天前
0.8.132026/11/058 天前
0.8.122026/11/058 天前
0.8.112026/11/049 天前
0.8.102026/11/049 天前

关于 @eclipse-docks/create-app 的常见问题

@eclipse-docks/create-app 是什么?

Scaffold a new Eclipse Docks app (monorepo with app + example extension)

如何安装 @eclipse-docks/create-app?

在项目目录运行 npm install @eclipse-docks/create-app,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 create-app,可以用 npx create-app 直接运行。

@eclipse-docks/create-app 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/eclipse-docks__create-app 是否存在。

@eclipse-docks/create-app 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@eclipse-docks/create-app 可以商用吗?

@eclipse-docks/create-app 使用 EPL-2.0 许可。声明的许可为 EPL-2.0,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@eclipse-docks/create-app 的下载量有多少?

根据 npm 官方下载统计,@eclipse-docks/create-app 在 2026/10/13 – 2026/11/11 这 30 天内被下载 2,602 次,日均约 87 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@eclipse-docks/create-app 还在维护吗?

最新版本 0.8.15 发布于 2026/11/06(7 天前);至今共发布 73 个版本,其中过去 12 个月发布了 73 个;首次发布于 2026/04/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。