You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f5d0b24
Browse filesBrowse the repository at this point in the historyBrowse files
description: A skill that helps users upgrade their npm packages to the latest versions.
4
+
---
5
+
6
+
# Upgrade NPM Packages Skill
7
+
8
+
## Instructions
9
+
10
+
[Clear, step-by-step guidance for Claude to follow]
11
+
12
+
1. Open `packages/create-vitnode-app/src/create/package-versions.ts` file and read it.
13
+
2. Run `pnpm outdated` to check for outdated packages in the project - do it for all projects in the turborepo (monorepo) including with root.
14
+
3. For each outdated package, run `pnpm up <package-name>@<version>` to upgrade it.
15
+
4. For each package, check if there are any breaking changes in the new version. If there are, ask the user if they want to proceed with the upgrade or skip it.
16
+
5. After upgrading all packages, update the `package-versions.ts` file with the new versions of the packages.
17
+
6. Run `pnpm install` to ensure all dependencies are correctly installed.
18
+
19
+
## Examples
20
+
21
+
I'm working on a project that uses a monorepo structure with multiple packages. I want to ensure that all my npm packages are up-to-date. I will use the "upgrade-npm-packages" skill to check for outdated packages, upgrade them, and handle any breaking changes appropriately.
Copy file name to clipboardExpand all lines: apps/web/content/docs/dev/i18n/index.mdx
+56-17Lines changed: 56 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,16 +67,16 @@ Because `buildConfig` keeps those codes as literal types, `'de'` is now part of
67
67
68
68
A `() => import('./de.json')` reads a file out of a package's build output, so it is the one part of i18n that must never reach a browser. Two files own it, and both are registered through the **server-only** config:
de: async () =>awaitimport('@vitnode/core/locales/de.json'), // [!code ++]
95
-
},
91
+
Registering a plugin is the whole step. Every VitNode build reads the `plugins` in your `vitnode.config.ts`, takes the `localeFiles` each factory declares, and writes `src/package-messages.gen.ts` - core's own languages plus one block per plugin:
Don't edit it - it is rewritten on every `dev` and `build`, which is why it sits in your `.gitignore`. Every specifier is a literal because that is the only kind a bundler can resolve: `import(pkg + '/locales/' + locale + '.json')` resolves to nothing. Every loader stays dynamic, so a language's JSON is a chunk of its own and the server loads only the locale a request asked for.
105
+
106
+
<Callouttype="info"title="Packages ship English">
107
+
`@vitnode/core` and the plugins in this repository ship `en` and nothing else.
108
+
Every other language is the install's own, which is what the next section is
109
+
for - and it is why a language you add is a file in **your** app rather than a
110
+
pull request against a package.
111
+
</Callout>
112
+
98
113
---
99
114
100
115
## Overriding Strings
101
116
102
-
To customize existing text from core or a third-party plugin, add an override file in `apps/web/src/locales/{pluginId}/{locale}.json` and register it in `src/locales/app.ts`:
117
+
Your own translations live in `apps/web/src/locales/{pluginId}/{locale}.json`, registered in `src/locales/app.ts`. The same file does both jobs: a whole language a package does not ship, and a reword of a string it does.
118
+
119
+
One file per package per language, holding that package's web **and** email strings together - an app keeps them in one tree where a package ships two, so the copy in an email cannot drift from the copy on the page.
Because your app overrides are merged last, only the keys you specify are overwritten. Everything else continues to fall back to the package defaults.
124
143
144
+
A whole language looks exactly the same, because it is the same mechanism - this repository's own Polish is a pair of files nobody's `node_modules` contains:
A plugin owns its languages, and it splits them the same way the framework does: frontend strings in `src/locales/`, server strings (emails) in `src/locales/api/`. Each tree gets a barrel and is registered with the matching config - the frontend tree with `buildPlugin` in `config.tsx`, the server tree with `buildApiPlugin` in `config.api.ts`.
151
151
152
-
Most plugins render nothing server-side, so they ship only the frontend tree and register `messages` in `config.tsx` alone. Add the `api/` tree only when your plugin sends email:
152
+
Most plugins render nothing server-side, so they ship only the frontend tree. That one is registered twice, and the two halves are not interchangeable:
`messages` is your own barrel, whose `import('./en.json')` is relative to your build output - right for anything running inside your package, and a specifier no host bundler can follow. `localeFiles` is the same list written as the subpaths your `package.json` exports, and it is what an app's translations are actually loaded from: the app's build turns it into literal imports in `src/package-messages.gen.ts`. Ship both, and keep them in step.
169
+
170
+
Add the `api/` tree only when your plugin sends email:
Adding a language later is a new file plus one line in the barrel - apps pick it up on their next install, and can translate your plugin without forking it by dropping a file in their own `src/locales/{your_plugin}/`.
193
+
Adding a language later is a new file plus one line in each list that names it - apps pick it up on their next install, and can translate your plugin without forking it by dropping a file in their own `src/locales/{your_plugin}/`.
Copy file name to clipboardExpand all lines: apps/web/content/docs/dev/plugins/api/modules.mdx
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,12 @@ Start with [a plugin](/docs/dev/plugins/create), not a host endpoint. A module
10
10
groups the plugin's Hono routes under one URL prefix and gives OpenAPI a tidy
11
11
place to describe them.
12
12
13
+
<Callouttype="info"title="A generated plugin already has one">
14
+
`create-vitnode-app --plugin` writes a `hello` module, its `config.api.ts` and
15
+
a page that calls it. Read on for what each piece does—then rename them, or add
16
+
a second module beside them.
17
+
</Callout>
18
+
13
19
{/* Image prompt: Dark-theme API ownership diagram. A Site notes plugin contains a Hono route, notes module, and config.api file; the app API configuration composes the plugin once. Show resulting GET endpoint, 1600x900. */}
0 commit comments