@regira/modules
v6.3.3
Published
Regira front-end library: TypeScript utility modules and Vue 3 components for building SPAs against a Regira.Entities API.
Readme
Regira Modules
@regira/modules — the Regira front-end library: TypeScript and Vue 3 building blocks (entities/CRUD,
http, ioc, auth, ui, formatters, …) that pair with the Regira back-end packages.
Documentation
regira.github.io/Regira-Modules publishes all of the below as a searchable site — the same markdown, cross-linked, with a module sidebar.
Each module ships a developer README (linked below) with deeper guides under its docs/ folder where
present. Building a Vue 3 SPA against a Regira.Entities API? Start with the
entities client; otherwise pick a module from the tables.
Vue modules
| Module | Developer docs | | -------------------------------- | -------------------------------------------------- | | Entities (Vue CRUD client) | src/vue/entities | | HTTP (shared axios + helpers) | src/vue/http | | IoC (service container) | src/vue/ioc | | Auth (JWT bearer auth) | src/vue/auth | | UI (components & plugins) | src/vue/ui | | App (lifecycle & culture) | src/vue/app | | Lang (i18n) | src/vue/lang | | Formatters | src/vue/formatters | | Directives | src/vue/directives | | Online (connectivity) | src/vue/online | | Debug | src/vue/debug | | Vue Helper (composition helpers) | src/vue/vue-helper |
Core (framework-agnostic)
| Module | Developer docs |
| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| Utilities | src/utilities |
| Extensions | src/extensions |
| TreeList | src/treelist |
| Events | src/events |
| IO (file/image helpers) | src/io |
| Entities (dormant — legacy entity client; the @regira/modules/entities subpath exists, but its barrel currently exports nothing) | src/entities |
| Firebase (dormant — Realtime Database REST EntityService + AuthenticationService) | src/firebase |
| Identity (dormant — IdentityManager: login/refresh state with auto-refresh, broadcasting via Events) | src/identity |
Consuming the library is covered under Install below.
Updating
npx npm-check-updates
npx npm-check-updates -u
npm install
npm audit fixPublish
Publishing to the npm registry runs through .github/workflows/publish-npm.yml. Release flow:
- Bump the version (or verify it already exceeds the last published release):
(npm version patch --no-git-tag-versionpatchcovers fixes and doc-only changes,minorbackward-compatible features,majorbreaking changes. Published npm versions are immutable, so the new version must exceed the last release — if it was already bumped since the last publish, reuse that bump rather than adding another.) - In
CHANGELOG.md, turn the Unreleased block into a## <version> — <date>heading. - Commit, then tag and push:
The workflow verifies the tag matchesgit tag v<version> && git push origin main v<version> # <version> = the version in package.jsonpackage.json, the version is not already on npm, and the changelog has the release heading; it then type-checks, tests, builds (viaprepare), and publishes with provenance. It can also be run manually from the Actions tab.
The workflow needs the NPM_TOKEN repository secret. For the first publish this must be an
all-packages (or org-scoped) npm access token — a granular token cannot be scoped to a package that
does not exist on the registry yet. After the first publish it can be swapped for a granular token
narrowed to read/write on the @regira/modules package.
Install
Published to the npm registry as @regira/modules
(source: https://github.com/Regira/Regira-Modules):
npm install @regira/modulesnpm install resolves the latest published version and writes the caret range to package.json —
don't pin a specific version by hand.
package.json defines full exports subpaths, so consumers import the published specifiers directly — no
Vite alias or tsconfig path required:
import { EntityBase } from "@regira/modules/vue/entities"
import { useAxios } from "@regira/modules/vue/http"Redundant with the exports subpaths above — use it only for an app already written against the
@/regira/* specifier.
vite.config.ts
resolve: {
alias: [
// order is important!
{ find: "@/regira", replacement: fileURLToPath(new URL("./node_modules/@regira/modules/dist", import.meta.url)) },
{ find: "@", replacement: fileURLToPath(new URL("./src", import.meta.url)) },
]
}tsconfig.app.json
"compilerOptions": {
"paths": {
"@/regira/*": ["./node_modules/@regira/modules/dist/*"],
"@/*": ["./src/*"]
},
}Symlinks (legacy)
mkdir "node_modules\@regira"
mklink /J "node_modules\@regira\modules" "C:\Projects\Regira\Regira-Modules\src"The junction has to sit at the scoped path — a directory name cannot contain
/, so the@regirafolder must exist before the link is created.
vite.config.ts
// ...
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
preserveSymlinks: true
},
// ...
server: {
fs: {
allow: [
"C:/Projects/Regira" // add to enable symlink...
]
}
}License
Apache License 2.0 — see LICENSE. This library contains no license validation. The Regira back-end packages have their own licensing — see Regira-Packages licensing.
