@nocobase/plugin-ai 2.1.0-beta.38 → 2.1.0-beta.41

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.
@@ -294,7 +294,7 @@ Log print format. Default is `console` in development and `json` in production.
294
294
  LOGGER_FORMAT=json
295
295
  ```
296
296
 
297
- Reference: [Log Format](/log-and-monitor/logger/index.md#log-format)
297
+ Reference: [Log Format](/log-and-monitor/logger/index.md#log-formats)
298
298
 
299
299
  ### CACHE_DEFAULT_STORE
300
300
 
@@ -375,8 +375,10 @@ Supported formats:
375
375
  Used to append preset local plugins. The value is the package name (the `name` parameter in `package.json`), with multiple plugins separated by commas.
376
376
 
377
377
  :::info
378
+
378
379
  1. Ensure the plugin is downloaded locally and can be found in the `node_modules` directory. For more details, see [Plugin Organization](/plugin-development/project-structure).
379
380
  2. After adding the environment variable, the plugin will appear on the plugin manager page only after an initial installation (`nocobase install`) or upgrade (`nocobase upgrade`).
381
+
380
382
  :::
381
383
 
382
384
  ```bash
@@ -388,8 +390,10 @@ APPEND_PRESET_LOCAL_PLUGINS=@my-project/plugin-foo,@my-project/plugin-bar
388
390
  Used to append built-in plugins that are installed by default. The value is the package name (the `name` parameter in `package.json`), with multiple plugins separated by commas.
389
391
 
390
392
  :::info
393
+
391
394
  1. Ensure the plugin is downloaded locally and can be found in the `node_modules` directory. For more details, see [Plugin Organization](/plugin-development/project-structure).
392
395
  2. After adding the environment variable, the plugin will be automatically installed or upgraded during the initial installation (`nocobase install`) or upgrade (`nocobase upgrade`).
396
+
393
397
  :::
394
398
 
395
399
  ```bash
@@ -472,7 +476,7 @@ yarn cross-env \
472
476
 
473
477
  ### WORKFLOW_SCRIPT_MODULES
474
478
 
475
- Workflow JavaScript node available modules list. For details, see "[JavaScript Node: Using External Modules](/workflow/nodes/javascript#using-external-modules)".
479
+ Workflow JavaScript node available modules list. For details, see "[JavaScript Node: Using External Modules](/workflow/nodes/javascript#unsafe-mode-module-support)".
476
480
 
477
481
  ### WORKFLOW_LOOP_LIMIT
478
482
 
@@ -44,6 +44,10 @@ yarn build @my-project/plugin-hello --tar
44
44
 
45
45
  Upload and extract the `.tar.gz` file to the target application's `./storage/plugins` directory. For detailed steps, see [Install and Upgrade Plugins](../get-started/install-upgrade-plugins.mdx).
46
46
 
47
+ ### Enable a Plugin by Default
48
+
49
+ After uploading, the plugin is not activated automatically — it appears in the Plugin Manager and must be enabled manually. If you are maintaining your own NocoBase application and want the plugin to be enabled by default along with the application, you can use the `APPEND_PRESET_BUILT_IN_PLUGINS` (append built-in plugins) environment variable. See [Make a Plugin Preset or Built-in by Default](./write-your-first-plugin.md#make-a-plugin-preset-or-built-in-by-default-optional) for usage.
50
+
47
51
  ## Custom Build Configuration
48
52
 
49
53
  In most cases, the default build configuration is sufficient. If you need to customize it — such as modifying the bundle entry, adding aliases, adjusting compression options, etc. — you can create a `build.config.ts` file in the plugin root directory:
@@ -84,3 +88,4 @@ Key points:
84
88
  - [Dependency Management](./dependency-management.md) — Plugin dependency declarations and global dependencies
85
89
  - [Plugin Development Overview](./index.md) — Overall introduction to plugin development
86
90
  - [Install and Upgrade Plugins](../get-started/install-upgrade-plugins.mdx) — Upload packaged files to target environments
91
+ - [Environment Variables](../get-started/installation/env.md) — Environment variable configuration for preset and built-in plugins
@@ -118,6 +118,33 @@ After activation, create a new "Modern page (v2)" page. When adding blocks, you'
118
118
 
119
119
  ![20250928174529](https://static-docs.nocobase.com/20250928174529.png)
120
120
 
121
+ ### Make a Plugin Preset or Built-in by Default (Optional)
122
+
123
+ The steps above describe manually enabling a single plugin. If you are maintaining your own NocoBase application and want certain plugins to be automatically ready after running `nocobase install` (first-time installation) or `nocobase upgrade` (upgrade), you can use two environment variables to control a plugin's default state:
124
+
125
+ - **`APPEND_PRESET_LOCAL_PLUGINS` (append preset local plugins)** — Adds the plugin to the preset local plugin list. After installation it appears in the Plugin Manager but is not activated by default; you need to enable it manually.
126
+ - **`APPEND_PRESET_BUILT_IN_PLUGINS` (append built-in plugins)** — Adds the plugin to the built-in plugin list. It is automatically activated on installation and, as a built-in plugin, **cannot be disabled or deleted from the Plugin Manager**.
127
+
128
+ The value for both variables is the plugin package name (the `name` field in `package.json`); separate multiple plugins with commas. Configure them in `.env` like this:
129
+
130
+ ```bash
131
+ # Preset: appears in the Plugin Manager list but is not activated automatically
132
+ APPEND_PRESET_LOCAL_PLUGINS=@my-project/plugin-hello,@my-project/plugin-hello-world
133
+
134
+ # Built-in: automatically installed and activated, and cannot be disabled from the UI
135
+ APPEND_PRESET_BUILT_IN_PLUGINS=@my-project/plugin-hello,@my-project/plugin-hello-world
136
+ ```
137
+
138
+ For day-to-day local development and debugging, `yarn pm enable` (described above) is usually sufficient. These two variables are better suited for "out-of-the-box" distribution scenarios — for example, when you are shipping a NocoBase application bundled with a fixed set of plugins and want those plugins to be ready immediately after initialization.
139
+
140
+ :::tip Note
141
+
142
+ - The plugin must already be downloaded locally and resolvable in `node_modules`. See [Project Structure](./project-structure.md) for details.
143
+ - After configuring, you need to re-run `nocobase install` or `nocobase upgrade` for the changes to take effect.
144
+ - For the full list of environment variable options, see [Environment Variables](../get-started/installation/env.md#append_preset_local_plugins).
145
+
146
+ :::
147
+
121
148
  ## Step 4: Build and Package
122
149
 
123
150
  When you're ready to distribute the plugin to other environments, you need to build and package it first:
@@ -158,4 +185,5 @@ Upload and extract the package file to the target application's `./storage/plugi
158
185
  - [Install using create-nocobase-app](../get-started/installation/create-nocobase-app) — One of the NocoBase installation methods
159
186
  - [Install from Git source](../get-started/installation/git) — Install NocoBase from source code
160
187
  - [Install and Upgrade Plugins](../get-started/install-upgrade-plugins.mdx) — Upload packaged plugins to other environments
188
+ - [Environment Variables](../get-started/installation/env.md) — Environment variable configuration for preset and built-in plugins
161
189