Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# every published library, in the order they depend on each other, as tests/global-setup.ts builds them:
# a library is published after the ones it names as peers, so it can always be installed.
# tests/release-version.spec.ts checks it names every library that isn't private.
LIBRARIES: ui ngx-change-sets ngx-persistence-logger ngx-tracking ngx-pwa ngx-auth ngx-error-handling ngx-navigation ngx-entity ngx-ecommerce
LIBRARIES: ui ngx-persistence-logger ngx-tracking ngx-pwa ngx-auth ngx-error-handling ngx-navigation ngx-entity ngx-change-sets ngx-ecommerce ngx-approval-requests ngx-bookkeeping ngx-bank ngx-websocket ngx-web-dav ngx-backup ngx-projects
steps:
# the merge itself rather than the branch, which may have moved on by the time this runs
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
9 changes: 9 additions & 0 deletions CODE_STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and the linter disagree, the linter wins and this file is wrong; open an issue.
- [Styling](#styling)
- [Accessibility](#accessibility)
- [Types](#types)
- [Backends](#backends)
- [Comments and JSDoc](#comments-and-jsdoc)
- [Tests](#tests)

Expand Down Expand Up @@ -310,6 +311,14 @@ not match what the code takes, which is the thing worth knowing.

**Prefer a named type to an inline one**, and declare the type of every non-trivial local.

# Backends

**A library talks to a backend through models, never through a backend.** Where it sends or reads data, it describes
what it expects with the shared models of `zibri-contract`, which any api can implement. zibri implements them, and a
README may name it as one api that does, but zibri is never a requirement, a dependency or a name: an entry point, a
provider, a service or an option is named for what it does, like `@service-soft/ngx-tracking/analytics`, not for the
backend it was first built with.

# Comments and JSDoc

These are two different audiences and the split is strict.
Expand Down
35 changes: 28 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ All development is done using github.
- [Special Notes for bugs](#special-notes-for-bugs)
- [Writing code](#writing-code)
- [Adding a library](#adding-a-library)
- [Texts and their German translation](#texts-and-their-german-translation)
- [Workflow for submitting Code Changes](#workflow-for-submitting-code-changes)
- [Releasing](#releasing)
- [License](#license)
Expand Down Expand Up @@ -47,7 +48,15 @@ Every library is published under the `@service-soft` npm organisation. Start wit
7. Add a `tailwind.css` containing `@source "./fesm2022";`, list it under `assets` in `ng-package.json` and export it in `package.json` (`"exports": { ".": { "style": "./tailwind.css" } }`).
8. In `tests/global-setup.ts`, build the library after `ui` is linked and link it into `node_modules` as `@service-soft/<name>`, so the showcase consumes it like an external project. To build it on its own, build and link `ui` first by running `npm run test:workspace` once. Add it to the libraries of `tests/entry-points.spec.ts`, and to `LIBRARIES` in `.github/workflows/cd.yml`, after the libraries it depends on.
9. Add its stories to the one Storybook in `projects/ui/.storybook`: its folder to `stories` in `main.ts`, to `include` and `exclude` in `tsconfig.json`, and as `@source` in `styles.css`. AXE then checks them with all others.
10. Write its documentation in a `README.md` in the library's root. The build copies it into the package, so it is also its page on npm: it has to work on its own, with links to other packages on npm instead of to files in this repository. The root README only gets a row in its packages table that links to it.
10. Write its documentation in a `README.md` in the library's root. The build copies it into the package, so it is also its page on npm: it has to work on its own, with links to other packages on npm instead of to files in this repository. The root README only gets a row in its packages table that links to it. Start its `CHANGELOG.md` with the version of its first release (see [Releasing](#releasing)), and list it under `assets` in `ng-package.json`, so it ships with the package.
11. Once it has [texts](#texts-and-their-german-translation), list `locale/messages.de.xlf` under `assets` in `ng-package.json` and name it in `package.json` (`"translations": { "de": "./locale/messages.de.xlf" }`).

## Texts and their German translation
Every text a user sees is `$localize` with an id of its own that starts with the name of the library, like `` $localize`:@@ui.table.selectAllLabel:Select all rows of this page` ``. Each library ships the German translation of its texts in `locale/messages.de.xlf`, so apps don't translate them. After adding, changing or removing a text:

1. Run `npm run translations:update`. It extracts the texts of every library with the extraction of Angular, the one `ng extract-i18n` of an app uses, and updates its file: a new text gets a unit without a target, the unit of a removed text is removed, and every other unit keeps its target. It lists the texts to translate, and those whose English changed, which kept their old target.
2. Write the German `<target state="translated">` of each listed text, right after its `<source>`, and review the targets of the changed ones. Use the formal "Sie", the words the other texts use, and keep labels for screen readers short. A placeholder like `<x id="count" equiv-text="count"/>` goes into the target as it is in the source, wherever it belongs in German.
3. Run `npm run test:workspace`. `tests/translations.spec.ts` fails while a text has no German target, while a file has a unit of a text the code doesn't have or a source that differs from the code, and while the placeholders of a target don't match its source.

# Workflow for submitting Code Changes
1. Create an issue if it not already exists.
Expand All @@ -63,13 +72,25 @@ Every library is published under the `@service-soft` npm organisation. Start wit
9. Issue that pull request!

# Releasing
Every library is released with the same version, and its major is always the major of Angular it is built for, whether a
release has breaking changes or not: `22.x.x` is for Angular 22. A new major of Angular starts the next major, a release
in between only bumps the minor or the patch.

1. Bump every published library: `npm run release:bump -- <major.minor.patch>`. It sets the version of each library that
Every library is released with the same version, `<angular>.<breaking>.<non-breaking>`:

- The major is always the major of Angular it is built for: `22.x.x` is for Angular 22. A new major of Angular starts the
next major, with the minor and the patch at 0.
- The minor counts the releases with a breaking change, in any library: a removed or renamed export, input, config key
or token, a new required peer dependency, a raised minimum version of a peer, or a changed default or behaviour an app
has to adapt to. It sets the patch back to 0.
- The patch counts every other release: new features, new entry points, new libraries and fixes.

- `zibri-contract` is updated in every library at once, like the release itself: every library that uses it requires
the same range, and so does the root `devDependency`, even a library that needs nothing of the new version. A raised
range is a breaking change of each library whose range it raises.

1. Add what changed to the `CHANGELOG.md` of each library that changed, under a heading with the new version, like
`## 22.4.0`, in the sections `### Breaking changes`, `### Features` and `### Fixes` that have entries. Each breaking
change says what an app has to do. The changelog ships with the package.
2. Bump every published library: `npm run release:bump -- <major.minor.patch>`. It sets the version of each library that
isn't `"private"` (so not `testing`), and the ranges the libraries require each other in to `^<version>`.
2. Merge a pull request with the bump into `release` (a fix for an older major goes into `release-<major>`). The `CD`
3. Merge a pull request with the bump into `release` (a fix for an older major goes into `release-<major>`). The `CD`
workflow then runs `npm test`, which builds every library into `dist`, and publishes each one the registry doesn't
have at that version yet, in the order they depend on each other (`LIBRARIES` in `.github/workflows/cd.yml`), with
provenance and under the npm tag `latest`, `latest-<major>` for an older major or `next` for a prerelease. Then it
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@ Each package documents itself in its README, which is also its page on npm.
| Package | Does |
|---|---|
| [@service-soft/ui](./projects/ui/README.md) | The design system every other library builds on: the design tokens, theming, dark mode and the basic components, like buttons, inputs, dialogs and menus |
| [@service-soft/ngx-auth](./projects/ngx-auth/README.md) | Logs in at the auth routes of zibri with tokens or cookies, a second factor and password resets, protects routes by login and permission in a tenant, answers invitations, and has the pages for the login, passwords and invitations |
| [@service-soft/ngx-approval-requests](./projects/ngx-approval-requests/README.md) | Lists the approval requests of an api like zibri's, filtered by status and action, and reviews one: what its action does, who proposed it and why, the values it would change, and approving or rejecting it with a note after confirming, with the outcome or the message of the api |
| [@service-soft/ngx-backup](./projects/ngx-backup/README.md) | The storage a tenant keeps its backups on, at an api like zibri's: a bucket, an SFTP server, or a folder of a WebDAV server or a Nextcloud through the connections of ngx-web-dav, added once the api wrote to it, changed with its write-only secret, and removed after a question that says what happens to the backups on it, with the message of the api when the storage refused the test or backups are still stored on it |
| [@service-soft/ngx-bookkeeping](./projects/ngx-bookkeeping/README.md) | The views of double-entry books kept by an api like zibri's: the journal with reversing an entry, a form that posts only a balanced entry, the ledger, the trial balance, the balance sheet and the income statement with the year before and a pdf each, the fiscal years with their closing, reopening and their export for a tax audit, and preparing, testing and filing the E-Bilanz of a fiscal year, corrections included |
| [@service-soft/ngx-bank](./projects/ngx-bank/README.md) | The views of the bank accounts of an api like zibri's: adding an account with its IBAN checked, uploading a CAMT.053 statement, the statements with their balances, the transactions with what of each is open and reversing a match, and matching a transaction, with the suggestions reviewed as approval requests and a match proposed by hand |
| [@service-soft/ngx-auth](./projects/ngx-auth/README.md) | Logs in at an api with the auth models of zibri-contract, like zibri's, with tokens, cookies or links sent by email, a second factor and password resets, protects routes by login and permission in a tenant, answers invitations, manages service accounts, and has the pages for the login, passwords and invitations |
| [@service-soft/ngx-change-sets](./projects/ngx-change-sets/README.md) | Shows the change sets of an entity as its history, like the ones zibri keeps, and lets the user undo them |
| [@service-soft/ngx-ecommerce](./projects/ngx-ecommerce/README.md) | Lets the user add extras to a booking or order, like breakfast per day or a second bike, and sums up an order with its discounts, taxes and total, in the currency and language of the app |
| [@service-soft/ngx-entity](./projects/ngx-entity/README.md) | Describes the entities of an app with decorators like zibri's and builds their forms from them, on a grid of 12 columns with rows and tabs, reads and writes them at the routes of zibri, and shows them in tables a page at a time, with the filters and orders the server allows, which create, edit and delete them in dialogs or on pages of their own, asking before changes are lost, and offline with ngx-pwa if you like |
| [@service-soft/ngx-error-handling](./projects/ngx-error-handling/README.md) | Hands every error nothing caught to several handlers, and shows it in a dialog, with the message of zibri, the problems of the values it refused and the reference of the request |
| [@service-soft/ngx-navigation](./projects/ngx-navigation/README.md) | Builds the navigation from rows of elements: a navbar whose elements move into a drawer on smaller screens, a footer, breadcrumbs from the routes, links to the sections of a page and a page for unknown urls, with the routes defined in the elements if you like, and the description, canonical url and structured data of every page for search engines |
| [@service-soft/ngx-projects](./projects/ngx-projects/README.md) | The views of the projects of an api like zibri's: the tree of nested projects, a board whose tasks move by pointer, keyboard or menu and follow the changes of others live, the details of a task with its markdown, sub-tasks, comments and history, sharing a project with a customer, recurring tasks and working calendars, each showing only what the role of the user allows |
| [@service-soft/ngx-websocket](./projects/ngx-websocket/README.md) | Connects to a websocket like zibri's with the login and the tenant of the app, connects again and catches up on what it missed, says when that isn't possible, hears its events and sends messages that wait for their answer |
| [@service-soft/ngx-web-dav](./projects/ngx-web-dav/README.md) | The connections of a tenant to folders of WebDAV servers, like its Nextcloud, at an api like zibri's: adding one once the api reached its folder, changing it and its write-only password, and deleting it, with the message of the api when the server refused the login or something still uses the connection, the files the file mirror couldn't write, to overwrite or stop mirroring, and the share link of a Nextcloud folder, to copy and revoke |
| [@service-soft/ngx-persistence-logger](./projects/ngx-persistence-logger/README.md) | Logs to the console and sends the logs to a backend like the logs of zibri, and shows the logs of all applications in a log history with filters and pages |
| [@service-soft/ngx-pwa](./projects/ngx-pwa/README.md) | Keeps the changes the user makes offline and syncs them later in the tenant they were made in, keeps what each user loaded to read it offline, says when the user is offline, turns push notifications on and off, and offers to reload once a new version is ready |
| [@service-soft/ngx-tracking](./projects/ngx-tracking/README.md) | Asks for consent in a GDPR compliant dialog, at the first interaction if you like, so it doesn't slow down the page, and tracks only what the user allowed: Google Analytics, Google Tag Manager, the Meta Pixel or your own backend, and a funnel to show the results |
Expand Down
Loading
Loading