mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3.0 KiB
3.0 KiB
CLAUDE.md
Project Rules
- This is a fork of Wiki.js (AGPL-3.0) with Couchbase-specific extensions. Keep custom code isolated.
- Node ≥20 required. Pin exact versions —
save-exact = truein.npmrc, no^prefixes. - Use
yarn, notnpm. Lock file isyarn.lock. - Never commit
config.yml(sensitive). Onlyconfig.sample.ymlis tracked. NODE_OPTIONS=--openssl-legacy-providerrequired for webpack commands (set viacross-envin scripts).
Commands
yarn install— install deps (runspatch-packagepostinstall automatically)yarn dev— start dev server with HMR (webpack dev middleware + Node server on port 3000)yarn build— production webpack buildyarn watch— webpack watch mode (client only, no server restart)yarn test— ESLint + pug-lint + Jest (full suite)node server— start production server (requires built assets +config.yml)
Workflow
- Client code lives in
client/(Vue 2 + Vuetify 2 + Apollo). Server inserver/. - GraphQL API defined in
server/graph/schemas/(SDL) andserver/graph/resolvers/. - New rendering modules go in
server/modules/rendering/— see existing modules for pattern. - New client components go in
client/components/as.vueSFCs. - After client changes: run
yarn buildor verify viayarn devbefore marking done. - Tests in
server/test/— runyarn testbefore finishing any server-side change.
Code Style
- ESLint config:
eslint-config-requarks+plugin:vue/strongly-recommended. No overrides without reason. - Pug templates: 2-space indent, single-quote attrs,
validateDivTagsenforced (seepugLintConfiginpackage.json). - No TypeScript — plain JS (babel-eslint parser, ES2017+).
- Apollo GraphQL queries defined inline with
graphql-tagbabel plugin (tag:gql).
Architecture Notes
- Vue 2 + Vuex + Vue Router + Apollo Client (not Vue 3). Do not introduce Vue 3 APIs.
@couchbaselabs/topology-uiis a custom Couchbase package for topology diagram rendering.- Server uses Objection.js (Knex-based ORM). DB migrations live in
server/db/migrations/. - Auth uses Passport.js with many strategies — new auth modules go in
server/modules/authentication/. - GraphQL subscriptions via
subscriptions-transport-ws(notgraphql-ws). - Custom markdown renderers registered as modules in
server/modules/rendering/.
Safety / Stop Conditions
- Ask before touching
server/db/migrations/— migrations are irreversible once run. - Ask before modifying
server/graph/schemas/in a breaking way — schema changes affect all clients. - Do not modify
patches/files without understanding the patched package's behavior. - Ask before changing auth or permission middleware (
server/middlewares/). yarn.lockchanges fromyarn upgradeneed explicit user approval.
Context Management
- Keep context lean: read only files relevant to the current feature area.
- Use skills for occasional workflows (PR creation, review, deployment).
- On compact: preserve modified file list, commands run, test output, and any migration state.