Skip to content

feat: implement server platform externalization plan#8

Merged
ksojecki merged 11 commits into
feature/extract-platform-for-serverfrom
copilot/create-externalization-plan-doc
Apr 15, 2026
Merged

feat: implement server platform externalization plan#8
ksojecki merged 11 commits into
feature/extract-platform-for-serverfrom
copilot/create-externalization-plan-doc

Conversation

Copilot AI commented Apr 14, 2026

Copy link
Copy Markdown
Contributor
  • Step 1: Create libs/server-platform and move server composition from apps/api/src/app/app.ts
  • Step 2: Introduce ServerPlatformPlugin contract and plugin registry
  • Step 3: Refactor apps/api/src/main.ts to bootstrap-only host
  • Step 4: Extract pages routes and store into libs/plugins/pages/server
  • Step 5: Add paired WebPlatform extension in libs/plugins/pages/ui
  • Step 6: Move pages migrations to plugin package
  • Step 7: Keep auth/session store (including store.ts) in core package
  • Step 8: Add contract tests for pages DTOs and error responses
  • Fix: Remove .js extensions from relative imports in libs/server-platform and libs/plugins/pages/server (switched to moduleResolution: "bundler" + module: "esnext" in lib tsconfigs)
  • Fix: Loosen pinned fastify version to ^5.8.3 in apps/api and libs/server-platform; remove "type": "module" (CJS) from new server libs

Copilot AI and others added 9 commits April 14, 2026 21:01
…ps/api

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread apps/api/package.json Outdated
"dotenv": "^16.4.7",
"fastify": "5.8.3",
"fastify-plugin": "~5.0.1"
"fastify": "5.8.3"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dependencies in applications and libraries should have loose version to avoid problems with reusing packages

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 06a28aefastify now uses ^5.8.3 in apps/api/package.json and libs/server-platform/package.json. All other external deps in the new packages also use caret (^) ranges.

Comment thread libs/plugins/pages/server/src/index.ts Outdated
@@ -0,0 +1 @@
export { pagesServerPlugin } from './lib/plugin.js';

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not like imports with .js. You can try to adapt this library to be compliant only with node. Or find other solution

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 06a28ae — switched the new server-side libs (libs/server-platform, libs/plugins/pages/server) to "module": "esnext" + "moduleResolution": "bundler" in their tsconfig.lib.json. This removes the NodeNext requirement for explicit .js extensions on relative imports. Also removed "type": "module" from their package.json so they are treated as CommonJS at runtime.

PageStore,
} from './types';
export { createSessionExpiration } from './types';
} from './types.js';

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I preferred to have type instead of type.js

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 06a28ae — all .js suffixes removed from relative imports across libs/server-platform and libs/plugins/pages/server (including the ./types.js side-effect import in session/index.ts).

Copilot AI commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/FiloSottile/mkcert/releases/latest
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node /home/REDACTED/work/rod-manager/rod-manager/node_modules/mkcert-cli/cli.js -o .cert -k localhost-key.pem -c localhost-cert.pem --host localhost --host 127.0.0.1 --host ::1 (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from ksojecki April 15, 2026 10:07
@ksojecki ksojecki force-pushed the copilot/create-externalization-plan-doc branch 4 times, most recently from d84b7b4 to 7d99fdf Compare April 15, 2026 22:11
@ksojecki ksojecki force-pushed the copilot/create-externalization-plan-doc branch from 7d99fdf to 766325e Compare April 15, 2026 22:14
@ksojecki ksojecki marked this pull request as ready for review April 15, 2026 22:17
@ksojecki ksojecki merged commit 38ea880 into feature/extract-platform-for-server Apr 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants