Add Git-installable shared code package
Lint / Lint (Go) (push) Successful in 31s
Lint / Lint (Python) (push) Successful in 9s
Tests / Test (Node/Svelte) (push) Successful in 14s
Tests / Test (Go) (push) Successful in 14s
Tests / Test (Python) (push) Successful in 16s
Lint / Lint (Node/Svelte) (push) Successful in 13s

This commit is contained in:
Gabriel20xx committed 2026-08-04 15:38:26 +02:00
1 parent fbbdab49bc
commit 4baa4dccd7
5 files changed
+654 -6

No files matched your search

+26 -2
View File
@@ -33,7 +33,31 @@ go test ./...
go vet ./...
```
## Publish the packages
## Consume from the Gitea repository
The repository is the canonical source and is installable directly from Gitea. The root package
builds the Svelte package during installation and exposes the runtime packages as subpaths:
```bash
npm install --save-exact git+https://repos.gfranz.ch/Gabriel20xx/SharedCode.git#<commit>
```
Use the shared UI from the root package:
```ts
import { AppShell, AuthPage, Header, SettingsDialog } from '@gabriel20xx/shared-code/web-ui';
```
Import the shared stylesheet once from the application's global stylesheet:
```css
@import '@gabriel20xx/shared-code/web-ui/styles.css';
```
The dependency should be pinned to a commit in application lockfiles. Update it when a new
SharedCode version has been validated.
## Publish the individual packages
The package names use the `@gabriel20xx` npm scope. That scope must belong to the npm account used to publish. If a different scope is preferred, replace the scope consistently in both package manifests and imports before publishing.
@@ -48,7 +72,7 @@ npm publish --workspace=@gabriel20xx/node-backend --access public
For a private registry, configure that registry and omit `--access public` if the registry does not use npm's public scoped-package rules.
## Install in a project
## Install individual packages from a registry
From a project's frontend directory, install the published UI package: