mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-18 04:06:19 +00:00
Compare commits
23 Commits
@openstapp
...
@openstapp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3a416d580 | ||
|
e7607360e2
|
|||
|
1f62b5c5b0
|
|||
|
905ebf8c59
|
|||
|
b210e0d9c3
|
|||
| 3a79d57c8d | |||
|
9e6d4fe054
|
|||
|
7b96500a75
|
|||
| e0b7e616b3 | |||
|
38fb7a398d
|
|||
|
a99e08cd68
|
|||
| a5c9d22016 | |||
|
3c49c4cf6d
|
|||
|
f2c4ee308f
|
|||
| bd09b36620 | |||
|
ca146b7761
|
|||
|
|
001f978bf9 | ||
|
|
57a5b6061b | ||
|
|
4fb5941c56 | ||
|
|
314e6a6e86 | ||
|
|
e1cc33bba2 | ||
|
|
9abd397578 | ||
|
|
69fe8c6ac8 |
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/app': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Update to Angular 16.1
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/core-tools': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Removed pack tool
|
|
||||||
|
|
||||||
Use a bundler like `tsup` in conjunction with an
|
|
||||||
`index.ts` that aggregates all exports instead.
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/api-plugin': major
|
|
||||||
'@openstapps/api-cli': major
|
|
||||||
'@openstapps/api': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Split API into API, API-CLI and API-Plugin
|
|
||||||
|
|
||||||
Plugins are now required to use `api-plugin`.
|
|
||||||
Consumers of `api` can benefit from a slimmer package with
|
|
||||||
no NodeJS dependencies.
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/backend': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate config system to cosmiconfig
|
|
||||||
|
|
||||||
Configs are now written using type-checked JavaScript
|
|
||||||
|
|
||||||
```js
|
|
||||||
// @ts-check
|
|
||||||
|
|
||||||
// This file is now type-safe just like TypeScript, but
|
|
||||||
// without the compilation step
|
|
||||||
|
|
||||||
/** @type {import('@openstapps/package').Type} */
|
|
||||||
const foo = {};
|
|
||||||
```
|
|
||||||
|
|
||||||
You can write config files in JavaScript, JSON, or other
|
|
||||||
cosmiconfig-supported formats.
|
|
||||||
|
|
||||||
The config files now are
|
|
||||||
|
|
||||||
- `backendrc.{js,json,...}`
|
|
||||||
- `elasticsearchrc.{js,json,...}`
|
|
||||||
- `prometheusrc.{js,json,...}`
|
|
||||||
|
|
||||||
You can also split them into multiple files,
|
|
||||||
as well as using the `markdown.js` helper in
|
|
||||||
`config/default/tools` to include markdown files
|
|
||||||
as text (see `config/f-u/about-pages`)
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/projectmanagement': major
|
|
||||||
'@openstapps/prettier-config': major
|
|
||||||
'@openstapps/es-mapping-generator': major
|
|
||||||
'@openstapps/backend-config': major
|
|
||||||
'@openstapps/eslint-config': major
|
|
||||||
'@openstapps/minimal-connector': major
|
|
||||||
'@openstapps/collection-utils': major
|
|
||||||
'@openstapps/minimal-plugin': major
|
|
||||||
'@openstapps/tsconfig': major
|
|
||||||
'@openstapps/api-plugin': major
|
|
||||||
'@openstapps/core-tools': major
|
|
||||||
'@openstapps/gitlab-api': major
|
|
||||||
'@openstapps/easy-ast': major
|
|
||||||
'@openstapps/api-cli': major
|
|
||||||
'@openstapps/backend': major
|
|
||||||
'@openstapps/logger': major
|
|
||||||
'@openstapps/proxy': major
|
|
||||||
'@openstapps/core': major
|
|
||||||
'@openstapps/app': major
|
|
||||||
'@openstapps/api': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Move project to a turbo monorepo & pnpm
|
|
||||||
|
|
||||||
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
|
|
||||||
|
|
||||||
- Removed extraneous files from packages
|
|
||||||
- `.npmrc`
|
|
||||||
- `.npmignore`
|
|
||||||
- `.mailmap`
|
|
||||||
- `.gitignore`
|
|
||||||
- `CONTRIBUTING.md`
|
|
||||||
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
|
|
||||||
- `package-lock.json`
|
|
||||||
- `.editorconfig`
|
|
||||||
- `.eslintrc.json` (moved eslint config to `package.json`)
|
|
||||||
- `.eslintignore`
|
|
||||||
- `.gitlab-ci.yml` (Most workflows are workspace-level)
|
|
||||||
- `.gitlab/**` (issue templates etc. are now workspace-level)
|
|
||||||
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
|
|
||||||
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
|
|
||||||
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
|
|
||||||
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
|
|
||||||
- Replaced conventional changelog with changesets
|
|
||||||
- Apps with binaries now use a top level `app.js`
|
|
||||||
|
|
||||||
```js
|
|
||||||
#!/usr/bin/env node
|
|
||||||
import './lib/app.js';
|
|
||||||
```
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/core': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate away from [ts-optchain](https://www.npmjs.com/package/ts-optchain)
|
|
||||||
|
|
||||||
The package has been deprecated with the last releast being 4 years ago.
|
|
||||||
|
|
||||||
TypeScript as well as ECMAScript have native support for optional
|
|
||||||
chaining with the `?.` operator now.
|
|
||||||
|
|
||||||
You will need to update any packages that rely on the translator
|
|
||||||
module.
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/projectmanagement': patch
|
|
||||||
'@openstapps/prettier-config': patch
|
|
||||||
'@openstapps/es-mapping-generator': patch
|
|
||||||
'@openstapps/eslint-config': patch
|
|
||||||
'@openstapps/minimal-connector': patch
|
|
||||||
'@openstapps/minimal-plugin': patch
|
|
||||||
'@openstapps/core-tools': patch
|
|
||||||
'@openstapps/gitlab-api': patch
|
|
||||||
'@openstapps/backend': patch
|
|
||||||
'@openstapps/logger': patch
|
|
||||||
'@openstapps/proxy': patch
|
|
||||||
'@openstapps/core': patch
|
|
||||||
'@openstapps/api': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrated changelogs to changeset format
|
|
||||||
|
|
||||||
```js
|
|
||||||
import fs from 'fs';
|
|
||||||
|
|
||||||
const path = 'packages/logger/CHANGELOG.md';
|
|
||||||
|
|
||||||
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
|
|
||||||
```
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/backend': minor
|
|
||||||
'@openstapps/api-cli': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate integration tests from docker-compose solution to a shell script
|
|
||||||
|
|
||||||
`api-cli` no longer builds as a Docker container as a result.
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/projectmanagement': major
|
|
||||||
'@openstapps/prettier-config': major
|
|
||||||
'@openstapps/es-mapping-generator': major
|
|
||||||
'@openstapps/backend-config': major
|
|
||||||
'@openstapps/eslint-config': major
|
|
||||||
'@openstapps/minimal-connector': major
|
|
||||||
'@openstapps/collection-utils': major
|
|
||||||
'@openstapps/minimal-plugin': major
|
|
||||||
'@openstapps/tsconfig': major
|
|
||||||
'@openstapps/api-plugin': major
|
|
||||||
'@openstapps/core-tools': major
|
|
||||||
'@openstapps/gitlab-api': major
|
|
||||||
'@openstapps/easy-ast': major
|
|
||||||
'@openstapps/api-cli': major
|
|
||||||
'@openstapps/backend': major
|
|
||||||
'@openstapps/logger': major
|
|
||||||
'@openstapps/proxy': major
|
|
||||||
'@openstapps/core': major
|
|
||||||
'@openstapps/app': major
|
|
||||||
'@openstapps/api': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate to ESM
|
|
||||||
|
|
||||||
CommonJS is no longer supported in any capacity. To use the new
|
|
||||||
version, you will need to migrate your package to ESM.
|
|
||||||
We recommend using `tsup` and `Node 18`.
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"type": "module"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/projectmanagement': major
|
|
||||||
'@openstapps/prettier-config': major
|
|
||||||
'@openstapps/es-mapping-generator': major
|
|
||||||
'@openstapps/backend-config': major
|
|
||||||
'@openstapps/eslint-config': major
|
|
||||||
'@openstapps/minimal-connector': major
|
|
||||||
'@openstapps/collection-utils': major
|
|
||||||
'@openstapps/minimal-plugin': major
|
|
||||||
'@openstapps/tsconfig': major
|
|
||||||
'@openstapps/api-plugin': major
|
|
||||||
'@openstapps/core-tools': major
|
|
||||||
'@openstapps/gitlab-api': major
|
|
||||||
'@openstapps/easy-ast': major
|
|
||||||
'@openstapps/api-cli': major
|
|
||||||
'@openstapps/backend': major
|
|
||||||
'@openstapps/logger': major
|
|
||||||
'@openstapps/proxy': major
|
|
||||||
'@openstapps/core': major
|
|
||||||
'@openstapps/app': major
|
|
||||||
'@openstapps/api': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate package to Node 18
|
|
||||||
|
|
||||||
- Consumers of this package will need to migrate to Node 18 or
|
|
||||||
higher.
|
|
||||||
- Packages have been migrated from promisified `readFile` or
|
|
||||||
`readFileSync` towards `fs/promises`
|
|
||||||
- Packages use native `flatMap` now
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/gitlab-api': minor
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate from request-promise-native to got
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/projectmanagement': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Moved project-docs to the [GitLab Wiki](https://gitlab.com/openstapps/openstapps/-/wikis/home) repo.
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/projectmanagement': minor
|
|
||||||
'@openstapps/prettier-config': minor
|
|
||||||
'@openstapps/es-mapping-generator': minor
|
|
||||||
'@openstapps/backend-config': minor
|
|
||||||
'@openstapps/eslint-config': minor
|
|
||||||
'@openstapps/minimal-connector': minor
|
|
||||||
'@openstapps/collection-utils': minor
|
|
||||||
'@openstapps/minimal-plugin': minor
|
|
||||||
'@openstapps/tsconfig': minor
|
|
||||||
'@openstapps/api-plugin': minor
|
|
||||||
'@openstapps/core-tools': minor
|
|
||||||
'@openstapps/gitlab-api': minor
|
|
||||||
'@openstapps/easy-ast': minor
|
|
||||||
'@openstapps/api-cli': minor
|
|
||||||
'@openstapps/backend': minor
|
|
||||||
'@openstapps/logger': minor
|
|
||||||
'@openstapps/proxy': minor
|
|
||||||
'@openstapps/core': minor
|
|
||||||
'@openstapps/app': minor
|
|
||||||
'@openstapps/api': minor
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate tests to C8/Chai/Mocha
|
|
||||||
|
|
||||||
- `@testdeck` OOP testing has been removed.
|
|
||||||
- Tests have been unified
|
|
||||||
- CommonJS module mocking has been replaced through
|
|
||||||
refactoring of tests, as ES Modules cannot be mocked
|
|
||||||
(do yourself a favor and don't try to mock them)
|
|
||||||
- C8 now replaces NYC as a native coverage tool
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/es-mapping-generator': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Remove @openstapps/logger dependency
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
{
|
|
||||||
"mode": "pre",
|
|
||||||
"tag": "next",
|
|
||||||
"initialVersions": {
|
|
||||||
"@openstapps/backend": "2.0.0",
|
|
||||||
"@openstapps/database": "2.0.0",
|
|
||||||
"@openstapps/proxy": "2.0.0",
|
|
||||||
"@openstapps/backend-config": "2.0.0",
|
|
||||||
"@openstapps/eslint-config": "2.0.0",
|
|
||||||
"@openstapps/prettier-config": "2.0.0",
|
|
||||||
"@openstapps/projectmanagement": "2.0.0",
|
|
||||||
"@openstapps/tsconfig": "2.0.0",
|
|
||||||
"@openstapps/minimal-connector": "2.0.0",
|
|
||||||
"@openstapps/minimal-deployment": "2.0.0",
|
|
||||||
"@openstapps/minimal-plugin": "2.0.0",
|
|
||||||
"@openstapps/app": "2.0.0",
|
|
||||||
"@openstapps/app-release-template": "2.0.0",
|
|
||||||
"@openstapps/api": "2.0.0",
|
|
||||||
"@openstapps/api-cli": "2.0.0",
|
|
||||||
"@openstapps/api-plugin": "2.0.0",
|
|
||||||
"@openstapps/collection-utils": "2.0.0",
|
|
||||||
"@openstapps/core": "2.0.0",
|
|
||||||
"@openstapps/core-tools": "2.0.0",
|
|
||||||
"@openstapps/easy-ast": "2.0.0",
|
|
||||||
"@openstapps/es-mapping-generator": "2.0.0",
|
|
||||||
"@openstapps/gitlab-api": "2.0.0",
|
|
||||||
"@openstapps/logger": "2.0.0"
|
|
||||||
},
|
|
||||||
"changesets": [
|
|
||||||
"cool-jars-kiss",
|
|
||||||
"cuddly-bobcats-roll",
|
|
||||||
"dull-news-appear",
|
|
||||||
"five-ears-wash",
|
|
||||||
"fuzzy-walls-greet",
|
|
||||||
"giant-crabs-cheer",
|
|
||||||
"gorgeous-flowers-reflect",
|
|
||||||
"healthy-steaks-shop",
|
|
||||||
"honest-sheep-train",
|
|
||||||
"late-zoos-breathe",
|
|
||||||
"moody-parrots-develop",
|
|
||||||
"neat-hats-trade",
|
|
||||||
"new-pianos-joke",
|
|
||||||
"proud-wolves-end",
|
|
||||||
"quick-houses-count",
|
|
||||||
"rare-squids-bake",
|
|
||||||
"soft-donuts-fail",
|
|
||||||
"sour-coins-visit",
|
|
||||||
"spicy-snails-sort",
|
|
||||||
"stale-garlics-share",
|
|
||||||
"strange-hounds-repair",
|
|
||||||
"tall-ducks-dream",
|
|
||||||
"tame-mayflies-hug",
|
|
||||||
"tame-rings-dream",
|
|
||||||
"thick-weeks-compete",
|
|
||||||
"thin-camels-give",
|
|
||||||
"tidy-buses-reflect",
|
|
||||||
"tough-hairs-provide"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/projectmanagement': major
|
|
||||||
'@openstapps/node-base': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Move images to separate packages
|
|
||||||
|
|
||||||
Removed builder image due to migration to Kaniko
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/eslint-config': minor
|
|
||||||
---
|
|
||||||
|
|
||||||
Update rules
|
|
||||||
|
|
||||||
- `unicorn/no-array-reduce` is now off
|
|
||||||
- `unicorn/no-non-null-assertion` is now off
|
|
||||||
- Removed prettier rules (use prettier formatting instead)
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/es-mapping-generator': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Remove put-es-templates
|
|
||||||
|
|
||||||
The `put-es-templates` functionality has been removed.
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/projectmanagement': patch
|
|
||||||
'@openstapps/prettier-config': patch
|
|
||||||
'@openstapps/es-mapping-generator': patch
|
|
||||||
'@openstapps/backend-config': patch
|
|
||||||
'@openstapps/eslint-config': patch
|
|
||||||
'@openstapps/minimal-connector': patch
|
|
||||||
'@openstapps/collection-utils': patch
|
|
||||||
'@openstapps/minimal-plugin': patch
|
|
||||||
'@openstapps/tsconfig': patch
|
|
||||||
'@openstapps/api-plugin': patch
|
|
||||||
'@openstapps/core-tools': patch
|
|
||||||
'@openstapps/gitlab-api': patch
|
|
||||||
'@openstapps/easy-ast': patch
|
|
||||||
'@openstapps/api-cli': patch
|
|
||||||
'@openstapps/backend': patch
|
|
||||||
'@openstapps/logger': patch
|
|
||||||
'@openstapps/proxy': patch
|
|
||||||
'@openstapps/core': patch
|
|
||||||
'@openstapps/app': patch
|
|
||||||
'@openstapps/api': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate away from @openstapps/configuration
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/projectmanagement': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Update release configs
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/projectmanagement': patch
|
|
||||||
'@openstapps/prettier-config': patch
|
|
||||||
'@openstapps/app-release-template': patch
|
|
||||||
'@openstapps/es-mapping-generator': patch
|
|
||||||
'@openstapps/backend-config': patch
|
|
||||||
'@openstapps/eslint-config': patch
|
|
||||||
'@openstapps/minimal-deployment': patch
|
|
||||||
'@openstapps/minimal-connector': patch
|
|
||||||
'@openstapps/collection-utils': patch
|
|
||||||
'@openstapps/minimal-plugin': patch
|
|
||||||
'@openstapps/tsconfig': patch
|
|
||||||
'@openstapps/node-builder': patch
|
|
||||||
'@openstapps/api-plugin': patch
|
|
||||||
'@openstapps/core-tools': patch
|
|
||||||
'@openstapps/gitlab-api': patch
|
|
||||||
'@openstapps/app-builder-image': patch
|
|
||||||
'@openstapps/easy-ast': patch
|
|
||||||
'@openstapps/database': patch
|
|
||||||
'@openstapps/node-base': patch
|
|
||||||
'@openstapps/api-cli': patch
|
|
||||||
'@openstapps/backend': patch
|
|
||||||
'@openstapps/logger': patch
|
|
||||||
'@openstapps/proxy': patch
|
|
||||||
'@openstapps/core': patch
|
|
||||||
'@openstapps/app': patch
|
|
||||||
'@openstapps/api': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Update to TypeScript 5.1.6
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/app': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate collection helpers to use @openstapps/collection-utils
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/app': minor
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate to Ionic 7
|
|
||||||
|
|
||||||
- Migrate uses of `<ion-label>` with inputs to new syntax
|
|
||||||
- Fix infinite loop in schedule date picker (`datetime.confirm()` to `datetime.cancel()`)
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/api': minor
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate HttpClient to Node 18's native `fetch` API
|
|
||||||
|
|
||||||
HttpClient can now be used both in NodeJS and browsers.
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/es-mapping-generator': major
|
|
||||||
'@openstapps/backend': major
|
|
||||||
'@openstapps/core': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate es mapping types from es-mapping-generator to .d.ts next to generated mappings
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/eslint-config': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Add license header enforcement rule (unfinished)
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/core': minor
|
|
||||||
---
|
|
||||||
|
|
||||||
Include openapi.json in built package
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/projectmanagement': minor
|
|
||||||
'@openstapps/minimal-connector': minor
|
|
||||||
'@openstapps/minimal-plugin': minor
|
|
||||||
'@openstapps/collection-utils': minor
|
|
||||||
'@openstapps/core-tools': minor
|
|
||||||
'@openstapps/gitlab-api': minor
|
|
||||||
'@openstapps/backend': minor
|
|
||||||
'@openstapps/logger': minor
|
|
||||||
'@openstapps/core': minor
|
|
||||||
'@openstapps/api': minor
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate away from `@krlwlfrt/async-pool`
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import {mapAsyncLimit} from '@openstapps/collection-utils';
|
|
||||||
|
|
||||||
await mapAsyncLimit(
|
|
||||||
[1, 2, 3],
|
|
||||||
async it => {
|
|
||||||
await someNetworkRequest(it);
|
|
||||||
},
|
|
||||||
5,
|
|
||||||
);
|
|
||||||
```
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/app': minor
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate away from JIT compilation
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/logger': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Fix an issue with chalk terminal colors in tests
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/core-tools': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate openapi generation to output single file
|
|
||||||
|
|
||||||
The OpenAPI generator now outputs a single file instead
|
|
||||||
of a directory with the `openapi.json` and copied schema
|
|
||||||
files.
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/app': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate unit tests to karma-coverage and junit reports.
|
|
||||||
Fixes an issue where coverage reports would not be generated.
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/projectmanagement': minor
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate moment.js to date-fns
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/projectmanagement': major
|
|
||||||
'@openstapps/es-mapping-generator': major
|
|
||||||
'@openstapps/minimal-connector': major
|
|
||||||
'@openstapps/collection-utils': major
|
|
||||||
'@openstapps/minimal-plugin': major
|
|
||||||
'@openstapps/api-plugin': major
|
|
||||||
'@openstapps/core-tools': major
|
|
||||||
'@openstapps/gitlab-api': major
|
|
||||||
'@openstapps/easy-ast': major
|
|
||||||
'@openstapps/api-cli': major
|
|
||||||
'@openstapps/backend': major
|
|
||||||
'@openstapps/logger': major
|
|
||||||
'@openstapps/proxy': major
|
|
||||||
'@openstapps/core': major
|
|
||||||
'@openstapps/api': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate build system to `tsup`
|
|
||||||
|
|
||||||
All packages now use an `index.ts` file to expose contents.
|
|
||||||
|
|
||||||
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/core-tools': major
|
|
||||||
'@openstapps/easy-ast': major
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate easy-ast to separate package
|
|
||||||
|
|
||||||
The `easy-ast` part of `core-tools` has been moved to its own package.
|
|
||||||
For migration, simply use the new package.
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
'@openstapps/core-tools': patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Migrate from away from lodash
|
|
||||||
@@ -7,14 +7,18 @@
|
|||||||
# ```
|
# ```
|
||||||
# To your pipeline.
|
# To your pipeline.
|
||||||
# https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html#use-rules-to-add-jobs
|
# https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html#use-rules-to-add-jobs
|
||||||
|
|
||||||
|
.limit_pipelines:
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'main' || $CI_COMMIT_BRANCH == 'develop'
|
||||||
|
when: on_success
|
||||||
|
- when: never
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- local: /backend/backend/.gitlab-ci.yml
|
- local: /backend/backend/.gitlab-ci.yml
|
||||||
- local: /frontend/app/.gitlab-ci.yml
|
- local: /frontend/app/.gitlab-ci.yml
|
||||||
- local: /.gitlab/schedules.gitlab-ci.yml
|
- local: /.gitlab/schedules.gitlab-ci.yml
|
||||||
- local: /.gitlab/publishing.gitlab-ci.yml
|
- local: /.gitlab/publishing.gitlab-ci.yml
|
||||||
rules:
|
|
||||||
- if: '$CI_COMMIT_MESSAGE =~ /ci: publish release$/'
|
|
||||||
when: always
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
TURBO_CACHE_BYPASS:
|
TURBO_CACHE_BYPASS:
|
||||||
@@ -28,7 +32,7 @@ variables:
|
|||||||
default:
|
default:
|
||||||
image: registry.gitlab.com/openstapps/openstapps/node-builder
|
image: registry.gitlab.com/openstapps/openstapps/node-builder
|
||||||
tags:
|
tags:
|
||||||
- performance
|
- saas-linux-xlarge-amd64
|
||||||
interruptible: true
|
interruptible: true
|
||||||
before_script:
|
before_script:
|
||||||
- corepack enable
|
- corepack enable
|
||||||
@@ -76,13 +80,14 @@ build:
|
|||||||
rules: &deploy-rules
|
rules: &deploy-rules
|
||||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||||
variables:
|
variables:
|
||||||
DEPLOY_ID: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
|
DEPLOY_ID: $CI_MERGE_REQUEST_IID
|
||||||
- if: $CI_COMMIT_BRANCH == 'main'
|
- if: $CI_COMMIT_BRANCH == 'main'
|
||||||
variables:
|
variables:
|
||||||
DEPLOY_ID: production
|
DEPLOY_ID: production
|
||||||
- if: $CI_COMMIT_BRANCH == 'develop'
|
- if: $CI_COMMIT_BRANCH == 'develop'
|
||||||
variables:
|
variables:
|
||||||
DEPLOY_ID: staging
|
DEPLOY_ID: staging
|
||||||
|
- !reference [.limit_pipelines, rules]
|
||||||
|
|
||||||
stop review:
|
stop review:
|
||||||
stage: build
|
stage: build
|
||||||
@@ -121,15 +126,15 @@ unit:
|
|||||||
coverage_format: cobertura
|
coverage_format: cobertura
|
||||||
path: coverage.xml
|
path: coverage.xml
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'main' || $CI_COMMIT_BRANCH == 'develop'
|
- !reference [.limit_pipelines, rules]
|
||||||
|
|
||||||
audit:
|
audit:
|
||||||
stage: audit
|
stage: audit
|
||||||
|
allow_failure: true
|
||||||
needs: []
|
needs: []
|
||||||
script:
|
script:
|
||||||
- pnpm audit --prod
|
- pnpm audit --prod
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'develop'
|
|
||||||
allow_failure: true
|
|
||||||
- if: $CI_COMMIT_BRANCH == 'main'
|
- if: $CI_COMMIT_BRANCH == 'main'
|
||||||
allow_failure: false
|
allow_failure: false
|
||||||
|
- !reference [.limit_pipelines, rules]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.limit_publishing:
|
.limit_publish_pipelines:
|
||||||
- if: $CI_PIPELINE_SOURCE != "schedule"
|
rules:
|
||||||
when: on_success
|
- if: '($CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "develop") && $CI_COMMIT_MESSAGE =~ /ci: publish release/ && $CI_PIPELINE_SOURCE != "schedule"'
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
stage: publish
|
stage: publish
|
||||||
@@ -12,7 +12,8 @@ deploy:
|
|||||||
paths:
|
paths:
|
||||||
- ./.deploy
|
- ./.deploy
|
||||||
- ./frontend/app/www
|
- ./frontend/app/www
|
||||||
rules: !reference [.limit_publishing]
|
rules:
|
||||||
|
- !reference [.limit_publish_pipelines, rules]
|
||||||
|
|
||||||
publish image:
|
publish image:
|
||||||
stage: publish
|
stage: publish
|
||||||
@@ -23,14 +24,15 @@ publish image:
|
|||||||
image:
|
image:
|
||||||
name: gcr.io/kaniko-project/executor:v1.12.1-debug
|
name: gcr.io/kaniko-project/executor:v1.12.1-debug
|
||||||
entrypoint: [""]
|
entrypoint: [""]
|
||||||
|
variables:
|
||||||
|
PUBLISH_TAG: next
|
||||||
script:
|
script:
|
||||||
- >
|
- >
|
||||||
/kaniko/executor
|
/kaniko/executor
|
||||||
--context "${CI_PROJECT_DIR}/${DEPLOY_DIR}"
|
--context "${CI_PROJECT_DIR}/${DEPLOY_DIR}"
|
||||||
--dockerfile "${CI_PROJECT_DIR}/${DEPLOY_DIR}/Dockerfile"
|
--dockerfile "${CI_PROJECT_DIR}/${DEPLOY_DIR}/Dockerfile"
|
||||||
--destination "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:$(grep -o '"version": "[^"]*' "${DEPLOY_DIR}/package.json" | cut -d'"' -f4)"
|
--destination "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:$(grep -o '"version": "[^"]*' "${DEPLOY_DIR}/package.json" | cut -d'"' -f4)"
|
||||||
--destination "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:latest"
|
--destination "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${PUBLISH_TAG}"
|
||||||
rules: !reference [.limit_publishing]
|
|
||||||
parallel:
|
parallel:
|
||||||
matrix:
|
matrix:
|
||||||
- IMAGE_NAME: database
|
- IMAGE_NAME: database
|
||||||
@@ -47,6 +49,11 @@ publish image:
|
|||||||
DEPLOY_DIR: .deploy/minimal-plugin
|
DEPLOY_DIR: .deploy/minimal-plugin
|
||||||
- IMAGE_NAME: app
|
- IMAGE_NAME: app
|
||||||
DEPLOY_DIR: frontend/app
|
DEPLOY_DIR: frontend/app
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH == 'main'
|
||||||
|
variables:
|
||||||
|
PUBLISH_TAG: latest
|
||||||
|
- !reference [.limit_publish_pipelines, rules]
|
||||||
|
|
||||||
publish packages:
|
publish packages:
|
||||||
stage: publish
|
stage: publish
|
||||||
@@ -54,18 +61,17 @@ publish packages:
|
|||||||
variables:
|
variables:
|
||||||
GIT_STRATEGY: clone
|
GIT_STRATEGY: clone
|
||||||
GIT_DEPTH: 0
|
GIT_DEPTH: 0
|
||||||
|
PUBLISH_TAG: next
|
||||||
script:
|
script:
|
||||||
- pnpm install
|
- pnpm install
|
||||||
- pnpm build
|
- pnpm build
|
||||||
- pnpm publish -r --publish-branch ${PUBLISH_BRANCH} --tag ${PUBLISH_TAG} --no-git-checks # TODO: Git checks...
|
- pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_AUTH_TOKEN}"
|
||||||
|
- pnpm publish -r --publish-branch ${CI_COMMIT_BRANCH} --tag ${PUBLISH_TAG} --no-git-checks # TODO: Git checks...
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH == 'main'
|
- if: $CI_COMMIT_BRANCH == 'main'
|
||||||
variables:
|
variables:
|
||||||
PUBLISH_BRANCH: main
|
|
||||||
PUBLISH_TAG: latest
|
PUBLISH_TAG: latest
|
||||||
- variables:
|
- !reference [.limit_publish_pipelines, rules]
|
||||||
PUBLISH_BRANCH: $CI_COMMIT_BRANCH
|
|
||||||
PUBLISH_TAG: next
|
|
||||||
|
|
||||||
publish docs:
|
publish docs:
|
||||||
stage: publish
|
stage: publish
|
||||||
@@ -77,3 +83,6 @@ publish docs:
|
|||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH == 'main'
|
||||||
|
- !reference [.limit_publish_pipelines, rules]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.limit_base_image_publishing:
|
.limit_scheduled_pipelines:
|
||||||
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == 'main'
|
rules:
|
||||||
when: always
|
- if: $CI_COMMIT_BRANCH == 'main' && $CI_PIPELINE_SOURCE == "schedule"
|
||||||
|
|
||||||
base image:
|
base image:
|
||||||
image: docker
|
image: docker
|
||||||
@@ -18,10 +18,9 @@ base image:
|
|||||||
docker build
|
docker build
|
||||||
-t "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:$(grep -o '"version": "[^"]*' "${DEPLOY_DIR}/package.json" | cut -d'"' -f4)"
|
-t "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:$(grep -o '"version": "[^"]*' "${DEPLOY_DIR}/package.json" | cut -d'"' -f4)"
|
||||||
-t "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:latest" "${CI_PROJECT_DIR}/${DEPLOY_DIR}" &&
|
-t "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:latest" "${CI_PROJECT_DIR}/${DEPLOY_DIR}" &&
|
||||||
docker push "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}"
|
docker push "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}" --all-tags
|
||||||
cache: {} # disable irrelevant cache for this job
|
cache: {} # disable irrelevant cache for this job
|
||||||
before_script: [] # do not run irrelevant before script for this job
|
before_script: [] # do not run irrelevant before script for this job
|
||||||
rules: !reference [.limit_base_image_publishing]
|
|
||||||
parallel:
|
parallel:
|
||||||
matrix:
|
matrix:
|
||||||
- IMAGE_NAME: node-base
|
- IMAGE_NAME: node-base
|
||||||
@@ -30,4 +29,7 @@ base image:
|
|||||||
DEPLOY_DIR: images/node-builder
|
DEPLOY_DIR: images/node-builder
|
||||||
- IMAGE_NAME: app-builder
|
- IMAGE_NAME: app-builder
|
||||||
DEPLOY_DIR: images/app-builder
|
DEPLOY_DIR: images/app-builder
|
||||||
|
- IMAGE_NAME: app-cypress
|
||||||
|
DEPLOY_DIR: images/app-cypress
|
||||||
|
rules:
|
||||||
|
- !reference [.limit_scheduled_pipelines, rules]
|
||||||
@@ -19,4 +19,4 @@ integration:
|
|||||||
junit:
|
junit:
|
||||||
- backend/backend/coverage/integration-report-junit.xml
|
- backend/backend/coverage/integration-report-junit.xml
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'main' || $CI_COMMIT_BRANCH == 'develop'
|
- !reference [.limit_pipelines, rules]
|
||||||
|
|||||||
@@ -1,5 +1,168 @@
|
|||||||
# @openstapps/backend
|
# @openstapps/backend
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrate config system to cosmiconfig
|
||||||
|
|
||||||
|
Configs are now written using type-checked JavaScript
|
||||||
|
|
||||||
|
```js
|
||||||
|
// @ts-check
|
||||||
|
|
||||||
|
// This file is now type-safe just like TypeScript, but
|
||||||
|
// without the compilation step
|
||||||
|
|
||||||
|
/** @type {import('@openstapps/package').Type} */
|
||||||
|
const foo = {};
|
||||||
|
```
|
||||||
|
|
||||||
|
You can write config files in JavaScript, JSON, or other
|
||||||
|
cosmiconfig-supported formats.
|
||||||
|
|
||||||
|
The config files now are
|
||||||
|
|
||||||
|
- `backendrc.{js,json,...}`
|
||||||
|
- `elasticsearchrc.{js,json,...}`
|
||||||
|
- `prometheusrc.{js,json,...}`
|
||||||
|
|
||||||
|
You can also split them into multiple files,
|
||||||
|
as well as using the `markdown.js` helper in
|
||||||
|
`config/default/tools` to include markdown files
|
||||||
|
as text (see `config/f-u/about-pages`)
|
||||||
|
|
||||||
|
- 64caebaf: Move project to a turbo monorepo & pnpm
|
||||||
|
|
||||||
|
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
|
||||||
|
|
||||||
|
- Removed extraneous files from packages
|
||||||
|
- `.npmrc`
|
||||||
|
- `.npmignore`
|
||||||
|
- `.mailmap`
|
||||||
|
- `.gitignore`
|
||||||
|
- `CONTRIBUTING.md`
|
||||||
|
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
|
||||||
|
- `package-lock.json`
|
||||||
|
- `.editorconfig`
|
||||||
|
- `.eslintrc.json` (moved eslint config to `package.json`)
|
||||||
|
- `.eslintignore`
|
||||||
|
- `.gitlab-ci.yml` (Most workflows are workspace-level)
|
||||||
|
- `.gitlab/**` (issue templates etc. are now workspace-level)
|
||||||
|
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
|
||||||
|
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
|
||||||
|
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
|
||||||
|
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
|
||||||
|
- Replaced conventional changelog with changesets
|
||||||
|
- Apps with binaries now use a top level `app.js`
|
||||||
|
|
||||||
|
```js
|
||||||
|
#!/usr/bin/env node
|
||||||
|
import './lib/app.js';
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate to ESM
|
||||||
|
|
||||||
|
CommonJS is no longer supported in any capacity. To use the new
|
||||||
|
version, you will need to migrate your package to ESM.
|
||||||
|
We recommend using `tsup` and `Node 18`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate package to Node 18
|
||||||
|
|
||||||
|
- Consumers of this package will need to migrate to Node 18 or
|
||||||
|
higher.
|
||||||
|
- Packages have been migrated from promisified `readFile` or
|
||||||
|
`readFileSync` towards `fs/promises`
|
||||||
|
- Packages use native `flatMap` now
|
||||||
|
|
||||||
|
- 0a7e6af1: Migrate es mapping types from es-mapping-generator to .d.ts next to generated mappings
|
||||||
|
- 64caebaf: Migrate build system to `tsup`
|
||||||
|
|
||||||
|
All packages now use an `index.ts` file to expose contents.
|
||||||
|
|
||||||
|
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrate integration tests from docker-compose solution to a shell script
|
||||||
|
|
||||||
|
`api-cli` no longer builds as a Docker container as a result.
|
||||||
|
|
||||||
|
- 64caebaf: Migrate tests to C8/Chai/Mocha
|
||||||
|
|
||||||
|
- `@testdeck` OOP testing has been removed.
|
||||||
|
- Tests have been unified
|
||||||
|
- CommonJS module mocking has been replaced through
|
||||||
|
refactoring of tests, as ES Modules cannot be mocked
|
||||||
|
(do yourself a favor and don't try to mock them)
|
||||||
|
- C8 now replaces NYC as a native coverage tool
|
||||||
|
|
||||||
|
- 64caebaf: Migrate away from `@krlwlfrt/async-pool`
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import {mapAsyncLimit} from '@openstapps/collection-utils';
|
||||||
|
|
||||||
|
await mapAsyncLimit(
|
||||||
|
[1, 2, 3],
|
||||||
|
async it => {
|
||||||
|
await someNetworkRequest(it);
|
||||||
|
},
|
||||||
|
5,
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrated changelogs to changeset format
|
||||||
|
|
||||||
|
```js
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
|
const path = 'packages/logger/CHANGELOG.md';
|
||||||
|
|
||||||
|
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
|
||||||
|
```
|
||||||
|
|
||||||
|
- 98546a97: Migrate away from @openstapps/configuration
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [1f62b5c5]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [23481d0d]
|
||||||
|
- Updated dependencies [0a7e6af1]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- @openstapps/core-tools@3.0.0
|
||||||
|
- @openstapps/logger@3.0.0
|
||||||
|
- @openstapps/core@3.0.0
|
||||||
|
|
||||||
|
## 3.0.0-next.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
- Updated dependencies [23481d0d]
|
||||||
|
- @openstapps/core-tools@3.0.0-next.4
|
||||||
|
- @openstapps/logger@3.0.0-next.4
|
||||||
|
- @openstapps/core@3.0.0-next.4
|
||||||
|
|
||||||
## 3.0.0-next.0
|
## 3.0.0-next.0
|
||||||
|
|
||||||
### Major Changes
|
### Major Changes
|
||||||
|
|||||||
@@ -70,6 +70,10 @@ const config = {
|
|||||||
authProvider: 'paia',
|
authProvider: 'paia',
|
||||||
url: 'https://hds.hebis.de/paia/core',
|
url: 'https://hds.hebis.de/paia/core',
|
||||||
},
|
},
|
||||||
|
/** TODO: idCards: {
|
||||||
|
authProvider: 'default',
|
||||||
|
url: 'TODO',
|
||||||
|
} */
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
aboutPages,
|
aboutPages,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/backend",
|
"name": "@openstapps/backend",
|
||||||
"description": "A reference implementation for a StApps backend",
|
"description": "A reference implementation for a StApps backend",
|
||||||
"version": "3.0.0-next.0",
|
"version": "3.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export const query: QueryDslQueryContainer = {
|
|||||||
should: [],
|
should: [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
weight: 1.1,
|
weight: 1.05,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filter: {
|
filter: {
|
||||||
@@ -42,14 +42,14 @@ export const query: QueryDslQueryContainer = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
term: {
|
term: {
|
||||||
'academicTerms.acronym.raw': 'WS 2022/23',
|
'academicTerms.acronym.raw': 'WS 2023/24',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
should: [],
|
should: [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
weight: 1.05,
|
weight: 1.1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filter: {
|
filter: {
|
||||||
@@ -69,7 +69,7 @@ export const query: QueryDslQueryContainer = {
|
|||||||
should: [],
|
should: [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
weight: 1.1,
|
weight: 1.05,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filter: {
|
filter: {
|
||||||
@@ -82,14 +82,14 @@ export const query: QueryDslQueryContainer = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
term: {
|
term: {
|
||||||
'academicTerms.acronym.raw': 'WiSe 2022/23',
|
'academicTerms.acronym.raw': 'WiSe 2023/24',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
should: [],
|
should: [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
weight: 1.05,
|
weight: 1.1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
filter: {
|
filter: {
|
||||||
|
|||||||
13
backend/database/CHANGELOG.md
Normal file
13
backend/database/CHANGELOG.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# @openstapps/database
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
|
||||||
|
## 3.0.0-next.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/database",
|
"name": "@openstapps/database",
|
||||||
"version": "2.0.0",
|
"version": "3.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"files": [
|
"files": [
|
||||||
"config",
|
"config",
|
||||||
|
|||||||
@@ -1,5 +1,109 @@
|
|||||||
# @openstapps/proxy
|
# @openstapps/proxy
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- 64caebaf: Move project to a turbo monorepo & pnpm
|
||||||
|
|
||||||
|
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
|
||||||
|
|
||||||
|
- Removed extraneous files from packages
|
||||||
|
- `.npmrc`
|
||||||
|
- `.npmignore`
|
||||||
|
- `.mailmap`
|
||||||
|
- `.gitignore`
|
||||||
|
- `CONTRIBUTING.md`
|
||||||
|
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
|
||||||
|
- `package-lock.json`
|
||||||
|
- `.editorconfig`
|
||||||
|
- `.eslintrc.json` (moved eslint config to `package.json`)
|
||||||
|
- `.eslintignore`
|
||||||
|
- `.gitlab-ci.yml` (Most workflows are workspace-level)
|
||||||
|
- `.gitlab/**` (issue templates etc. are now workspace-level)
|
||||||
|
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
|
||||||
|
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
|
||||||
|
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
|
||||||
|
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
|
||||||
|
- Replaced conventional changelog with changesets
|
||||||
|
- Apps with binaries now use a top level `app.js`
|
||||||
|
|
||||||
|
```js
|
||||||
|
#!/usr/bin/env node
|
||||||
|
import './lib/app.js';
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate to ESM
|
||||||
|
|
||||||
|
CommonJS is no longer supported in any capacity. To use the new
|
||||||
|
version, you will need to migrate your package to ESM.
|
||||||
|
We recommend using `tsup` and `Node 18`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate package to Node 18
|
||||||
|
|
||||||
|
- Consumers of this package will need to migrate to Node 18 or
|
||||||
|
higher.
|
||||||
|
- Packages have been migrated from promisified `readFile` or
|
||||||
|
`readFileSync` towards `fs/promises`
|
||||||
|
- Packages use native `flatMap` now
|
||||||
|
|
||||||
|
- 64caebaf: Migrate build system to `tsup`
|
||||||
|
|
||||||
|
All packages now use an `index.ts` file to expose contents.
|
||||||
|
|
||||||
|
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrate tests to C8/Chai/Mocha
|
||||||
|
|
||||||
|
- `@testdeck` OOP testing has been removed.
|
||||||
|
- Tests have been unified
|
||||||
|
- CommonJS module mocking has been replaced through
|
||||||
|
refactoring of tests, as ES Modules cannot be mocked
|
||||||
|
(do yourself a favor and don't try to mock them)
|
||||||
|
- C8 now replaces NYC as a native coverage tool
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrated changelogs to changeset format
|
||||||
|
|
||||||
|
```js
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
|
const path = 'packages/logger/CHANGELOG.md';
|
||||||
|
|
||||||
|
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
|
||||||
|
```
|
||||||
|
|
||||||
|
- 98546a97: Migrate away from @openstapps/configuration
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [23481d0d]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- @openstapps/logger@3.0.0
|
||||||
|
|
||||||
|
## 3.0.0-next.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
- Updated dependencies [23481d0d]
|
||||||
|
- @openstapps/logger@3.0.0-next.4
|
||||||
|
|
||||||
## 3.0.0-next.0
|
## 3.0.0-next.0
|
||||||
|
|
||||||
### Major Changes
|
### Major Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/proxy",
|
"name": "@openstapps/proxy",
|
||||||
"description": "NGINX proxy that is dynamically configured by a Node.js script",
|
"description": "NGINX proxy that is dynamically configured by a Node.js script",
|
||||||
"version": "3.0.0-next.0",
|
"version": "3.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
|
|||||||
@@ -1,5 +1,80 @@
|
|||||||
# @openstapps/backend-config
|
# @openstapps/backend-config
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- 64caebaf: Move project to a turbo monorepo & pnpm
|
||||||
|
|
||||||
|
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
|
||||||
|
|
||||||
|
- Removed extraneous files from packages
|
||||||
|
- `.npmrc`
|
||||||
|
- `.npmignore`
|
||||||
|
- `.mailmap`
|
||||||
|
- `.gitignore`
|
||||||
|
- `CONTRIBUTING.md`
|
||||||
|
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
|
||||||
|
- `package-lock.json`
|
||||||
|
- `.editorconfig`
|
||||||
|
- `.eslintrc.json` (moved eslint config to `package.json`)
|
||||||
|
- `.eslintignore`
|
||||||
|
- `.gitlab-ci.yml` (Most workflows are workspace-level)
|
||||||
|
- `.gitlab/**` (issue templates etc. are now workspace-level)
|
||||||
|
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
|
||||||
|
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
|
||||||
|
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
|
||||||
|
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
|
||||||
|
- Replaced conventional changelog with changesets
|
||||||
|
- Apps with binaries now use a top level `app.js`
|
||||||
|
|
||||||
|
```js
|
||||||
|
#!/usr/bin/env node
|
||||||
|
import './lib/app.js';
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate to ESM
|
||||||
|
|
||||||
|
CommonJS is no longer supported in any capacity. To use the new
|
||||||
|
version, you will need to migrate your package to ESM.
|
||||||
|
We recommend using `tsup` and `Node 18`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate package to Node 18
|
||||||
|
|
||||||
|
- Consumers of this package will need to migrate to Node 18 or
|
||||||
|
higher.
|
||||||
|
- Packages have been migrated from promisified `readFile` or
|
||||||
|
`readFileSync` towards `fs/promises`
|
||||||
|
- Packages use native `flatMap` now
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrate tests to C8/Chai/Mocha
|
||||||
|
|
||||||
|
- `@testdeck` OOP testing has been removed.
|
||||||
|
- Tests have been unified
|
||||||
|
- CommonJS module mocking has been replaced through
|
||||||
|
refactoring of tests, as ES Modules cannot be mocked
|
||||||
|
(do yourself a favor and don't try to mock them)
|
||||||
|
- C8 now replaces NYC as a native coverage tool
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 98546a97: Migrate away from @openstapps/configuration
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
|
||||||
|
## 3.0.0-next.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
|
||||||
## 3.0.0-next.0
|
## 3.0.0-next.0
|
||||||
|
|
||||||
### Major Changes
|
### Major Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/backend-config",
|
"name": "@openstapps/backend-config",
|
||||||
"description": "Backend Configuration for OpenStApps",
|
"description": "Backend Configuration for OpenStApps",
|
||||||
"version": "3.0.0-next.0",
|
"version": "3.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
|
|||||||
@@ -1,5 +1,97 @@
|
|||||||
# @openstapps/eslint-config
|
# @openstapps/eslint-config
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- 64caebaf: Move project to a turbo monorepo & pnpm
|
||||||
|
|
||||||
|
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
|
||||||
|
|
||||||
|
- Removed extraneous files from packages
|
||||||
|
- `.npmrc`
|
||||||
|
- `.npmignore`
|
||||||
|
- `.mailmap`
|
||||||
|
- `.gitignore`
|
||||||
|
- `CONTRIBUTING.md`
|
||||||
|
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
|
||||||
|
- `package-lock.json`
|
||||||
|
- `.editorconfig`
|
||||||
|
- `.eslintrc.json` (moved eslint config to `package.json`)
|
||||||
|
- `.eslintignore`
|
||||||
|
- `.gitlab-ci.yml` (Most workflows are workspace-level)
|
||||||
|
- `.gitlab/**` (issue templates etc. are now workspace-level)
|
||||||
|
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
|
||||||
|
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
|
||||||
|
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
|
||||||
|
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
|
||||||
|
- Replaced conventional changelog with changesets
|
||||||
|
- Apps with binaries now use a top level `app.js`
|
||||||
|
|
||||||
|
```js
|
||||||
|
#!/usr/bin/env node
|
||||||
|
import './lib/app.js';
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate to ESM
|
||||||
|
|
||||||
|
CommonJS is no longer supported in any capacity. To use the new
|
||||||
|
version, you will need to migrate your package to ESM.
|
||||||
|
We recommend using `tsup` and `Node 18`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate package to Node 18
|
||||||
|
|
||||||
|
- Consumers of this package will need to migrate to Node 18 or
|
||||||
|
higher.
|
||||||
|
- Packages have been migrated from promisified `readFile` or
|
||||||
|
`readFileSync` towards `fs/promises`
|
||||||
|
- Packages use native `flatMap` now
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrate tests to C8/Chai/Mocha
|
||||||
|
|
||||||
|
- `@testdeck` OOP testing has been removed.
|
||||||
|
- Tests have been unified
|
||||||
|
- CommonJS module mocking has been replaced through
|
||||||
|
refactoring of tests, as ES Modules cannot be mocked
|
||||||
|
(do yourself a favor and don't try to mock them)
|
||||||
|
- C8 now replaces NYC as a native coverage tool
|
||||||
|
|
||||||
|
- 64caebaf: Update rules
|
||||||
|
|
||||||
|
- `unicorn/no-array-reduce` is now off
|
||||||
|
- `unicorn/no-non-null-assertion` is now off
|
||||||
|
- Removed prettier rules (use prettier formatting instead)
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrated changelogs to changeset format
|
||||||
|
|
||||||
|
```js
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
|
const path = 'packages/logger/CHANGELOG.md';
|
||||||
|
|
||||||
|
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
|
||||||
|
```
|
||||||
|
|
||||||
|
- 98546a97: Migrate away from @openstapps/configuration
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
- 64caebaf: Add license header enforcement rule (unfinished)
|
||||||
|
|
||||||
|
## 3.0.0-next.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
|
||||||
## 3.0.0-next.0
|
## 3.0.0-next.0
|
||||||
|
|
||||||
### Major Changes
|
### Major Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/eslint-config",
|
"name": "@openstapps/eslint-config",
|
||||||
"description": "A collection of configuration base files for StApps projects. Just an (unused) experiment for now.",
|
"description": "A collection of configuration base files for StApps projects. Just an (unused) experiment for now.",
|
||||||
"version": "3.0.0-next.0",
|
"version": "3.0.0",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"repository": "git@gitlab.com:openstapps/eslint-config.git",
|
"repository": "git@gitlab.com:openstapps/eslint-config.git",
|
||||||
|
|||||||
@@ -1,5 +1,90 @@
|
|||||||
# @openstapps/prettier-config
|
# @openstapps/prettier-config
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- 64caebaf: Move project to a turbo monorepo & pnpm
|
||||||
|
|
||||||
|
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
|
||||||
|
|
||||||
|
- Removed extraneous files from packages
|
||||||
|
- `.npmrc`
|
||||||
|
- `.npmignore`
|
||||||
|
- `.mailmap`
|
||||||
|
- `.gitignore`
|
||||||
|
- `CONTRIBUTING.md`
|
||||||
|
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
|
||||||
|
- `package-lock.json`
|
||||||
|
- `.editorconfig`
|
||||||
|
- `.eslintrc.json` (moved eslint config to `package.json`)
|
||||||
|
- `.eslintignore`
|
||||||
|
- `.gitlab-ci.yml` (Most workflows are workspace-level)
|
||||||
|
- `.gitlab/**` (issue templates etc. are now workspace-level)
|
||||||
|
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
|
||||||
|
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
|
||||||
|
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
|
||||||
|
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
|
||||||
|
- Replaced conventional changelog with changesets
|
||||||
|
- Apps with binaries now use a top level `app.js`
|
||||||
|
|
||||||
|
```js
|
||||||
|
#!/usr/bin/env node
|
||||||
|
import './lib/app.js';
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate to ESM
|
||||||
|
|
||||||
|
CommonJS is no longer supported in any capacity. To use the new
|
||||||
|
version, you will need to migrate your package to ESM.
|
||||||
|
We recommend using `tsup` and `Node 18`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate package to Node 18
|
||||||
|
|
||||||
|
- Consumers of this package will need to migrate to Node 18 or
|
||||||
|
higher.
|
||||||
|
- Packages have been migrated from promisified `readFile` or
|
||||||
|
`readFileSync` towards `fs/promises`
|
||||||
|
- Packages use native `flatMap` now
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrate tests to C8/Chai/Mocha
|
||||||
|
|
||||||
|
- `@testdeck` OOP testing has been removed.
|
||||||
|
- Tests have been unified
|
||||||
|
- CommonJS module mocking has been replaced through
|
||||||
|
refactoring of tests, as ES Modules cannot be mocked
|
||||||
|
(do yourself a favor and don't try to mock them)
|
||||||
|
- C8 now replaces NYC as a native coverage tool
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrated changelogs to changeset format
|
||||||
|
|
||||||
|
```js
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
|
const path = 'packages/logger/CHANGELOG.md';
|
||||||
|
|
||||||
|
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
|
||||||
|
```
|
||||||
|
|
||||||
|
- 98546a97: Migrate away from @openstapps/configuration
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
|
||||||
|
## 3.0.0-next.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
|
||||||
## 3.0.0-next.0
|
## 3.0.0-next.0
|
||||||
|
|
||||||
### Major Changes
|
### Major Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/prettier-config",
|
"name": "@openstapps/prettier-config",
|
||||||
"description": "StApps Prettier Config",
|
"description": "StApps Prettier Config",
|
||||||
"version": "3.0.0-next.0",
|
"version": "3.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"repository": "git@gitlab.com:openstapps/prettier-config.git",
|
"repository": "git@gitlab.com:openstapps/prettier-config.git",
|
||||||
|
|||||||
@@ -1,5 +1,143 @@
|
|||||||
# @openstapps/projectmanagement
|
# @openstapps/projectmanagement
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- 64caebaf: Move project to a turbo monorepo & pnpm
|
||||||
|
|
||||||
|
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
|
||||||
|
|
||||||
|
- Removed extraneous files from packages
|
||||||
|
- `.npmrc`
|
||||||
|
- `.npmignore`
|
||||||
|
- `.mailmap`
|
||||||
|
- `.gitignore`
|
||||||
|
- `CONTRIBUTING.md`
|
||||||
|
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
|
||||||
|
- `package-lock.json`
|
||||||
|
- `.editorconfig`
|
||||||
|
- `.eslintrc.json` (moved eslint config to `package.json`)
|
||||||
|
- `.eslintignore`
|
||||||
|
- `.gitlab-ci.yml` (Most workflows are workspace-level)
|
||||||
|
- `.gitlab/**` (issue templates etc. are now workspace-level)
|
||||||
|
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
|
||||||
|
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
|
||||||
|
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
|
||||||
|
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
|
||||||
|
- Replaced conventional changelog with changesets
|
||||||
|
- Apps with binaries now use a top level `app.js`
|
||||||
|
|
||||||
|
```js
|
||||||
|
#!/usr/bin/env node
|
||||||
|
import './lib/app.js';
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate to ESM
|
||||||
|
|
||||||
|
CommonJS is no longer supported in any capacity. To use the new
|
||||||
|
version, you will need to migrate your package to ESM.
|
||||||
|
We recommend using `tsup` and `Node 18`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate package to Node 18
|
||||||
|
|
||||||
|
- Consumers of this package will need to migrate to Node 18 or
|
||||||
|
higher.
|
||||||
|
- Packages have been migrated from promisified `readFile` or
|
||||||
|
`readFileSync` towards `fs/promises`
|
||||||
|
- Packages use native `flatMap` now
|
||||||
|
|
||||||
|
- 11c9d742: Move images to separate packages
|
||||||
|
|
||||||
|
Removed builder image due to migration to Kaniko
|
||||||
|
|
||||||
|
- 64caebaf: Migrate build system to `tsup`
|
||||||
|
|
||||||
|
All packages now use an `index.ts` file to expose contents.
|
||||||
|
|
||||||
|
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrate tests to C8/Chai/Mocha
|
||||||
|
|
||||||
|
- `@testdeck` OOP testing has been removed.
|
||||||
|
- Tests have been unified
|
||||||
|
- CommonJS module mocking has been replaced through
|
||||||
|
refactoring of tests, as ES Modules cannot be mocked
|
||||||
|
(do yourself a favor and don't try to mock them)
|
||||||
|
- C8 now replaces NYC as a native coverage tool
|
||||||
|
|
||||||
|
- 64caebaf: Migrate away from `@krlwlfrt/async-pool`
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import {mapAsyncLimit} from '@openstapps/collection-utils';
|
||||||
|
|
||||||
|
await mapAsyncLimit(
|
||||||
|
[1, 2, 3],
|
||||||
|
async it => {
|
||||||
|
await someNetworkRequest(it);
|
||||||
|
},
|
||||||
|
5,
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate moment.js to date-fns
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrated changelogs to changeset format
|
||||||
|
|
||||||
|
```js
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
|
const path = 'packages/logger/CHANGELOG.md';
|
||||||
|
|
||||||
|
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Moved project-docs to the [GitLab Wiki](https://gitlab.com/openstapps/openstapps/-/wikis/home) repo.
|
||||||
|
- 98546a97: Migrate away from @openstapps/configuration
|
||||||
|
- 4e4c7b5c: Update release configs
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [23481d0d]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- @openstapps/collection-utils@3.0.0
|
||||||
|
- @openstapps/gitlab-api@3.0.0
|
||||||
|
- @openstapps/logger@3.0.0
|
||||||
|
|
||||||
|
## 3.0.0-next.4
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- 11c9d742: Move images to separate packages
|
||||||
|
|
||||||
|
Removed builder image due to migration to Kaniko
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4e4c7b5c: Update release configs
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
- Updated dependencies [23481d0d]
|
||||||
|
- @openstapps/collection-utils@3.0.0-next.4
|
||||||
|
- @openstapps/gitlab-api@3.0.0-next.4
|
||||||
|
- @openstapps/logger@3.0.0-next.4
|
||||||
|
|
||||||
## 3.0.0-next.3
|
## 3.0.0-next.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/projectmanagement",
|
"name": "@openstapps/projectmanagement",
|
||||||
"description": "Main documentation and scripts for maintenance.",
|
"description": "Main documentation and scripts for maintenance.",
|
||||||
"version": "3.0.0-next.3",
|
"version": "3.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
|
|||||||
@@ -1,5 +1,80 @@
|
|||||||
# @openstapps/tsconfig
|
# @openstapps/tsconfig
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- 64caebaf: Move project to a turbo monorepo & pnpm
|
||||||
|
|
||||||
|
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
|
||||||
|
|
||||||
|
- Removed extraneous files from packages
|
||||||
|
- `.npmrc`
|
||||||
|
- `.npmignore`
|
||||||
|
- `.mailmap`
|
||||||
|
- `.gitignore`
|
||||||
|
- `CONTRIBUTING.md`
|
||||||
|
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
|
||||||
|
- `package-lock.json`
|
||||||
|
- `.editorconfig`
|
||||||
|
- `.eslintrc.json` (moved eslint config to `package.json`)
|
||||||
|
- `.eslintignore`
|
||||||
|
- `.gitlab-ci.yml` (Most workflows are workspace-level)
|
||||||
|
- `.gitlab/**` (issue templates etc. are now workspace-level)
|
||||||
|
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
|
||||||
|
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
|
||||||
|
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
|
||||||
|
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
|
||||||
|
- Replaced conventional changelog with changesets
|
||||||
|
- Apps with binaries now use a top level `app.js`
|
||||||
|
|
||||||
|
```js
|
||||||
|
#!/usr/bin/env node
|
||||||
|
import './lib/app.js';
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate to ESM
|
||||||
|
|
||||||
|
CommonJS is no longer supported in any capacity. To use the new
|
||||||
|
version, you will need to migrate your package to ESM.
|
||||||
|
We recommend using `tsup` and `Node 18`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate package to Node 18
|
||||||
|
|
||||||
|
- Consumers of this package will need to migrate to Node 18 or
|
||||||
|
higher.
|
||||||
|
- Packages have been migrated from promisified `readFile` or
|
||||||
|
`readFileSync` towards `fs/promises`
|
||||||
|
- Packages use native `flatMap` now
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrate tests to C8/Chai/Mocha
|
||||||
|
|
||||||
|
- `@testdeck` OOP testing has been removed.
|
||||||
|
- Tests have been unified
|
||||||
|
- CommonJS module mocking has been replaced through
|
||||||
|
refactoring of tests, as ES Modules cannot be mocked
|
||||||
|
(do yourself a favor and don't try to mock them)
|
||||||
|
- C8 now replaces NYC as a native coverage tool
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 98546a97: Migrate away from @openstapps/configuration
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
|
||||||
|
## 3.0.0-next.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
|
||||||
## 3.0.0-next.0
|
## 3.0.0-next.0
|
||||||
|
|
||||||
### Major Changes
|
### Major Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/tsconfig",
|
"name": "@openstapps/tsconfig",
|
||||||
"description": "The tsconfig for the openstapps project",
|
"description": "The tsconfig for the openstapps project",
|
||||||
"version": "3.0.0-next.0",
|
"version": "3.0.0",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"repository": "git@gitlab.com:openstapps/eslint-config.git",
|
"repository": "git@gitlab.com:openstapps/eslint-config.git",
|
||||||
|
|||||||
@@ -1,5 +1,133 @@
|
|||||||
# @openstapps/minimal-connector
|
# @openstapps/minimal-connector
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- 64caebaf: Move project to a turbo monorepo & pnpm
|
||||||
|
|
||||||
|
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
|
||||||
|
|
||||||
|
- Removed extraneous files from packages
|
||||||
|
- `.npmrc`
|
||||||
|
- `.npmignore`
|
||||||
|
- `.mailmap`
|
||||||
|
- `.gitignore`
|
||||||
|
- `CONTRIBUTING.md`
|
||||||
|
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
|
||||||
|
- `package-lock.json`
|
||||||
|
- `.editorconfig`
|
||||||
|
- `.eslintrc.json` (moved eslint config to `package.json`)
|
||||||
|
- `.eslintignore`
|
||||||
|
- `.gitlab-ci.yml` (Most workflows are workspace-level)
|
||||||
|
- `.gitlab/**` (issue templates etc. are now workspace-level)
|
||||||
|
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
|
||||||
|
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
|
||||||
|
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
|
||||||
|
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
|
||||||
|
- Replaced conventional changelog with changesets
|
||||||
|
- Apps with binaries now use a top level `app.js`
|
||||||
|
|
||||||
|
```js
|
||||||
|
#!/usr/bin/env node
|
||||||
|
import './lib/app.js';
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate to ESM
|
||||||
|
|
||||||
|
CommonJS is no longer supported in any capacity. To use the new
|
||||||
|
version, you will need to migrate your package to ESM.
|
||||||
|
We recommend using `tsup` and `Node 18`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate package to Node 18
|
||||||
|
|
||||||
|
- Consumers of this package will need to migrate to Node 18 or
|
||||||
|
higher.
|
||||||
|
- Packages have been migrated from promisified `readFile` or
|
||||||
|
`readFileSync` towards `fs/promises`
|
||||||
|
- Packages use native `flatMap` now
|
||||||
|
|
||||||
|
- 64caebaf: Migrate build system to `tsup`
|
||||||
|
|
||||||
|
All packages now use an `index.ts` file to expose contents.
|
||||||
|
|
||||||
|
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrate tests to C8/Chai/Mocha
|
||||||
|
|
||||||
|
- `@testdeck` OOP testing has been removed.
|
||||||
|
- Tests have been unified
|
||||||
|
- CommonJS module mocking has been replaced through
|
||||||
|
refactoring of tests, as ES Modules cannot be mocked
|
||||||
|
(do yourself a favor and don't try to mock them)
|
||||||
|
- C8 now replaces NYC as a native coverage tool
|
||||||
|
|
||||||
|
- 64caebaf: Migrate away from `@krlwlfrt/async-pool`
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import {mapAsyncLimit} from '@openstapps/collection-utils';
|
||||||
|
|
||||||
|
await mapAsyncLimit(
|
||||||
|
[1, 2, 3],
|
||||||
|
async it => {
|
||||||
|
await someNetworkRequest(it);
|
||||||
|
},
|
||||||
|
5,
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrated changelogs to changeset format
|
||||||
|
|
||||||
|
```js
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
|
const path = 'packages/logger/CHANGELOG.md';
|
||||||
|
|
||||||
|
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
|
||||||
|
```
|
||||||
|
|
||||||
|
- 98546a97: Migrate away from @openstapps/configuration
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [1f62b5c5]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [23481d0d]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [0a7e6af1]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- @openstapps/api@3.0.0
|
||||||
|
- @openstapps/logger@3.0.0
|
||||||
|
- @openstapps/core@3.0.0
|
||||||
|
|
||||||
|
## 3.0.0-next.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
- Updated dependencies [23481d0d]
|
||||||
|
- @openstapps/logger@3.0.0-next.4
|
||||||
|
- @openstapps/core@3.0.0-next.4
|
||||||
|
- @openstapps/api@3.0.0-next.4
|
||||||
|
|
||||||
## 3.0.0-next.0
|
## 3.0.0-next.0
|
||||||
|
|
||||||
### Major Changes
|
### Major Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/minimal-connector",
|
"name": "@openstapps/minimal-connector",
|
||||||
"description": "This is a minimal connector which serves as an example",
|
"description": "This is a minimal connector which serves as an example",
|
||||||
"version": "3.0.0-next.0",
|
"version": "3.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
|
|||||||
13
examples/minimal-deployment/CHANGELOG.md
Normal file
13
examples/minimal-deployment/CHANGELOG.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# @openstapps/minimal-deployment
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
|
||||||
|
## 3.0.0-next.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/minimal-deployment",
|
"name": "@openstapps/minimal-deployment",
|
||||||
"version": "2.0.0",
|
"version": "3.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"files": [
|
"files": [
|
||||||
"database",
|
"database",
|
||||||
|
|||||||
@@ -1,5 +1,141 @@
|
|||||||
# @openstapps/minimal-plugin
|
# @openstapps/minimal-plugin
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- 64caebaf: Move project to a turbo monorepo & pnpm
|
||||||
|
|
||||||
|
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
|
||||||
|
|
||||||
|
- Removed extraneous files from packages
|
||||||
|
- `.npmrc`
|
||||||
|
- `.npmignore`
|
||||||
|
- `.mailmap`
|
||||||
|
- `.gitignore`
|
||||||
|
- `CONTRIBUTING.md`
|
||||||
|
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
|
||||||
|
- `package-lock.json`
|
||||||
|
- `.editorconfig`
|
||||||
|
- `.eslintrc.json` (moved eslint config to `package.json`)
|
||||||
|
- `.eslintignore`
|
||||||
|
- `.gitlab-ci.yml` (Most workflows are workspace-level)
|
||||||
|
- `.gitlab/**` (issue templates etc. are now workspace-level)
|
||||||
|
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
|
||||||
|
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
|
||||||
|
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
|
||||||
|
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
|
||||||
|
- Replaced conventional changelog with changesets
|
||||||
|
- Apps with binaries now use a top level `app.js`
|
||||||
|
|
||||||
|
```js
|
||||||
|
#!/usr/bin/env node
|
||||||
|
import './lib/app.js';
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate to ESM
|
||||||
|
|
||||||
|
CommonJS is no longer supported in any capacity. To use the new
|
||||||
|
version, you will need to migrate your package to ESM.
|
||||||
|
We recommend using `tsup` and `Node 18`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate package to Node 18
|
||||||
|
|
||||||
|
- Consumers of this package will need to migrate to Node 18 or
|
||||||
|
higher.
|
||||||
|
- Packages have been migrated from promisified `readFile` or
|
||||||
|
`readFileSync` towards `fs/promises`
|
||||||
|
- Packages use native `flatMap` now
|
||||||
|
|
||||||
|
- 64caebaf: Migrate build system to `tsup`
|
||||||
|
|
||||||
|
All packages now use an `index.ts` file to expose contents.
|
||||||
|
|
||||||
|
You will need to migrate paths from `import foo from '@scope/package/lib/foo` to `import foo from '@scope/package'`
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrate tests to C8/Chai/Mocha
|
||||||
|
|
||||||
|
- `@testdeck` OOP testing has been removed.
|
||||||
|
- Tests have been unified
|
||||||
|
- CommonJS module mocking has been replaced through
|
||||||
|
refactoring of tests, as ES Modules cannot be mocked
|
||||||
|
(do yourself a favor and don't try to mock them)
|
||||||
|
- C8 now replaces NYC as a native coverage tool
|
||||||
|
|
||||||
|
- 64caebaf: Migrate away from `@krlwlfrt/async-pool`
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import {mapAsyncLimit} from '@openstapps/collection-utils';
|
||||||
|
|
||||||
|
await mapAsyncLimit(
|
||||||
|
[1, 2, 3],
|
||||||
|
async it => {
|
||||||
|
await someNetworkRequest(it);
|
||||||
|
},
|
||||||
|
5,
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 64caebaf: Migrated changelogs to changeset format
|
||||||
|
|
||||||
|
```js
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
|
const path = 'packages/logger/CHANGELOG.md';
|
||||||
|
|
||||||
|
fs.writeFileSync(path, fs.readFileSync(path, 'utf8').replace(/^#+\s+\[/gm, '## ['));
|
||||||
|
```
|
||||||
|
|
||||||
|
- 98546a97: Migrate away from @openstapps/configuration
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [1f62b5c5]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [23481d0d]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [0a7e6af1]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- @openstapps/core-tools@3.0.0
|
||||||
|
- @openstapps/api-plugin@3.0.0
|
||||||
|
- @openstapps/api@3.0.0
|
||||||
|
- @openstapps/logger@3.0.0
|
||||||
|
- @openstapps/core@3.0.0
|
||||||
|
|
||||||
|
## 3.0.0-next.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
- Updated dependencies [23481d0d]
|
||||||
|
- @openstapps/api-plugin@3.0.0-next.4
|
||||||
|
- @openstapps/core-tools@3.0.0-next.4
|
||||||
|
- @openstapps/logger@3.0.0-next.4
|
||||||
|
- @openstapps/core@3.0.0-next.4
|
||||||
|
- @openstapps/api@3.0.0-next.4
|
||||||
|
|
||||||
## 3.0.0-next.0
|
## 3.0.0-next.0
|
||||||
|
|
||||||
### Major Changes
|
### Major Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/minimal-plugin",
|
"name": "@openstapps/minimal-plugin",
|
||||||
"description": "Minimal Plugin",
|
"description": "Minimal Plugin",
|
||||||
"version": "3.0.0-next.0",
|
"version": "3.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
|
|||||||
@@ -15,8 +15,12 @@
|
|||||||
buildToolsVersions = [ "${buildToolsVersion}" ];
|
buildToolsVersions = [ "${buildToolsVersion}" ];
|
||||||
platformVersions = [ "32" ];
|
platformVersions = [ "32" ];
|
||||||
};
|
};
|
||||||
cypress = prev.cypress.overrideAttrs(prev: {
|
cypress = prev.cypress.overrideAttrs(cyPrev: rec {
|
||||||
version = "12.17.1";
|
version = "13.2.0";
|
||||||
|
src = prev.fetchzip {
|
||||||
|
url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip";
|
||||||
|
hash = "sha256-9o0nprGcJhudS1LNm+T7Vf0Dwd1RBauYKI+w1FBQ3ZM=";
|
||||||
|
};
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 2020,
|
"ecmaVersion": 2020,
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
"project": ["tsconfig.json", "tsconfig.spec.json", "e2e/tsconfig.e2e.json"],
|
"project": ["tsconfig.json", "tsconfig.spec.json", "cypress/tsconfig.json"],
|
||||||
"createDefaultProgram": true
|
"createDefaultProgram": true
|
||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
|
|||||||
2
frontend/app/.gitignore
vendored
2
frontend/app/.gitignore
vendored
@@ -44,3 +44,5 @@ UserInterfaceState.xcuserstate
|
|||||||
|
|
||||||
docs
|
docs
|
||||||
bundle-info.html
|
bundle-info.html
|
||||||
|
|
||||||
|
.browser-data/
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
e2e:
|
e2e:
|
||||||
image: cypress/browsers:latest # https://hub.docker.com/r/cypress/browsers/tags/
|
image: registry.gitlab.com/openstapps/openstapps/app-cypress:node-18
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- pnpm --filter=@openstapps/app install
|
- pnpm --filter=@openstapps/app install
|
||||||
- pnpm --filter=@openstapps/app exec cypress install
|
- pnpm --filter=@openstapps/app exec cypress install
|
||||||
|
- cd node_modules/.pnpm/re2*/node_modules/re2
|
||||||
|
- npm run install
|
||||||
|
- cd $CI_PROJECT_DIR
|
||||||
- pnpm test:integration:app
|
- pnpm test:integration:app
|
||||||
artifacts:
|
artifacts:
|
||||||
when: on_failure
|
when: on_failure
|
||||||
@@ -19,4 +22,4 @@ e2e:
|
|||||||
- BROWSER: chrome
|
- BROWSER: chrome
|
||||||
- BROWSER: firefox
|
- BROWSER: firefox
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'main' || $CI_COMMIT_BRANCH == 'develop'
|
- !reference [.limit_pipelines, rules]
|
||||||
|
|||||||
@@ -1,5 +1,169 @@
|
|||||||
# @openstapps/app
|
# @openstapps/app
|
||||||
|
|
||||||
|
## 3.0.0
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to Angular 16.1
|
||||||
|
- 64caebaf: Move project to a turbo monorepo & pnpm
|
||||||
|
|
||||||
|
Internal dependencies are now defined using `"@openstapps/package": "workspace:*"`
|
||||||
|
|
||||||
|
- Removed extraneous files from packages
|
||||||
|
- `.npmrc`
|
||||||
|
- `.npmignore`
|
||||||
|
- `.mailmap`
|
||||||
|
- `.gitignore`
|
||||||
|
- `CONTRIBUTING.md`
|
||||||
|
- `LICENSE` (Project license file is added upon publishing, see [pnpm.io](https://pnpm.io/cli/publish))
|
||||||
|
- `package-lock.json`
|
||||||
|
- `.editorconfig`
|
||||||
|
- `.eslintrc.json` (moved eslint config to `package.json`)
|
||||||
|
- `.eslintignore`
|
||||||
|
- `.gitlab-ci.yml` (Most workflows are workspace-level)
|
||||||
|
- `.gitlab/**` (issue templates etc. are now workspace-level)
|
||||||
|
- `.dockerignore` (Docker files are determined by which files are deployed with `pnpm deploy`, as per `package.json/files`)
|
||||||
|
- TSConfig has been moved to its own package (You can now use `"extends": "@openstapps/tsconfig"`)
|
||||||
|
- Removed ESLint and Prettier peer dependency hell by injecting them through the `.pnpmfile.cjs`
|
||||||
|
- Added syncpack for keeping dependency versions in sync (and consistent key ordering in `package.json`)
|
||||||
|
- Replaced conventional changelog with changesets
|
||||||
|
- Apps with binaries now use a top level `app.js`
|
||||||
|
|
||||||
|
```js
|
||||||
|
#!/usr/bin/env node
|
||||||
|
import './lib/app.js';
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate to ESM
|
||||||
|
|
||||||
|
CommonJS is no longer supported in any capacity. To use the new
|
||||||
|
version, you will need to migrate your package to ESM.
|
||||||
|
We recommend using `tsup` and `Node 18`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 64caebaf: Migrate package to Node 18
|
||||||
|
|
||||||
|
- Consumers of this package will need to migrate to Node 18 or
|
||||||
|
higher.
|
||||||
|
- Packages have been migrated from promisified `readFile` or
|
||||||
|
`readFileSync` towards `fs/promises`
|
||||||
|
- Packages use native `flatMap` now
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- f2c4ee30: Detail views now won't load data again if it is being navigated to from a list item
|
||||||
|
- e1cc33bb: Added the ability to remove and add date series from their detail page
|
||||||
|
- 64caebaf: Migrate tests to C8/Chai/Mocha
|
||||||
|
|
||||||
|
- `@testdeck` OOP testing has been removed.
|
||||||
|
- Tests have been unified
|
||||||
|
- CommonJS module mocking has been replaced through
|
||||||
|
refactoring of tests, as ES Modules cannot be mocked
|
||||||
|
(do yourself a favor and don't try to mock them)
|
||||||
|
- C8 now replaces NYC as a native coverage tool
|
||||||
|
|
||||||
|
- 1f62b5c5: Add support for web-service-provided id cards on the profile page
|
||||||
|
- a5c9d220: Add directions to inPlace and place list items
|
||||||
|
- e1cc33bb: Improved calendar descriptions
|
||||||
|
|
||||||
|
- The dashboard quick link now has a more intuitive icon
|
||||||
|
- "Recurring" has been renamed to "Week Overview"
|
||||||
|
- Long words in calendar tabs will now break instead of overflowing
|
||||||
|
|
||||||
|
- 001f978b: Revamp "My Courses" section on profile page
|
||||||
|
|
||||||
|
The "My Courses" section on the profile page has been improved
|
||||||
|
|
||||||
|
- It will now show the upcoming courses for the next five days
|
||||||
|
- The section header is now consistent with the other sections
|
||||||
|
- The section now uses standard list items instead of the custom solution
|
||||||
|
|
||||||
|
Additionally, the profile page component has been cleaned up.
|
||||||
|
|
||||||
|
- a5c9d220: Adjust map button and item behavior on different screen sizes
|
||||||
|
|
||||||
|
- Small screens will show the item without margins below the map actions
|
||||||
|
- Large screens will show the list item on the left side
|
||||||
|
|
||||||
|
- 23481d0d: Migrate to Ionic 7
|
||||||
|
|
||||||
|
- Migrate uses of `<ion-label>` with inputs to new syntax
|
||||||
|
- Fix infinite loop in schedule date picker (`datetime.confirm()` to `datetime.cancel()`)
|
||||||
|
|
||||||
|
- 64caebaf: Migrate away from JIT compilation
|
||||||
|
- a5c9d220: Map items are now native list items
|
||||||
|
- e1cc33bb: Replaced simple links with list items in date-series detail
|
||||||
|
- 001f978b: Use event title for date series instead of the generic date series title
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- a99e08cd: Refactored Opening Hours
|
||||||
|
|
||||||
|
- Migrated Opening Hours to use OnPush change detection
|
||||||
|
- Fixed a bug where opening hours would not update correctly
|
||||||
|
- Lazy-load opening hours module to keep it out of the main bundle
|
||||||
|
- Added e2e tests to verify functionality
|
||||||
|
- Changed live update status to show exact minutes starting one hour before the next change
|
||||||
|
|
||||||
|
- bd09b366: Use observable chains instead of change detection in the rating component
|
||||||
|
- 001f978b: Add a way to hide action chips on list items
|
||||||
|
- e0b7e616: Fixed distance not updating in list items
|
||||||
|
- b210e0d9: Change leaflet tiles to be inverted as a whole
|
||||||
|
- 98546a97: Migrate away from @openstapps/configuration
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
- bebee6b4: Migrate collection helpers to use @openstapps/collection-utils
|
||||||
|
- 3c49c4cf: Fixed an issue that caused double and triple loading of data detail items through the route stack service
|
||||||
|
- 107a7c5e: Migrate unit tests to karma-coverage and junit reports.
|
||||||
|
Fixes an issue where coverage reports would not be generated.
|
||||||
|
- 1f62b5c5: Make section swiper buttons reactive
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [1f62b5c5]
|
||||||
|
- Updated dependencies [98546a97]
|
||||||
|
- Updated dependencies [23481d0d]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [0a7e6af1]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- Updated dependencies [64caebaf]
|
||||||
|
- @openstapps/api@3.0.0
|
||||||
|
- @openstapps/collection-utils@3.0.0
|
||||||
|
- @openstapps/core@3.0.0
|
||||||
|
|
||||||
|
## 3.0.0-next.4
|
||||||
|
|
||||||
|
### Major Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to Angular 16.1
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 23481d0d: Migrate to Ionic 7
|
||||||
|
|
||||||
|
- Migrate uses of `<ion-label>` with inputs to new syntax
|
||||||
|
- Fix infinite loop in schedule date picker (`datetime.confirm()` to `datetime.cancel()`)
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 23481d0d: Update to TypeScript 5.1.6
|
||||||
|
- bebee6b4: Migrate collection helpers to use @openstapps/collection-utils
|
||||||
|
- 107a7c5e: Migrate unit tests to karma-coverage and junit reports.
|
||||||
|
Fixes an issue where coverage reports would not be generated.
|
||||||
|
- Updated dependencies [23481d0d]
|
||||||
|
- @openstapps/collection-utils@3.0.0-next.4
|
||||||
|
- @openstapps/core@3.0.0-next.4
|
||||||
|
- @openstapps/api@3.0.0-next.4
|
||||||
|
|
||||||
## 3.0.0-next.0
|
## 3.0.0-next.0
|
||||||
|
|
||||||
### Major Changes
|
### Major Changes
|
||||||
|
|||||||
@@ -42,3 +42,23 @@ The command `ionic cordova run ios` runs into the error `/platforms/ios/build/em
|
|||||||
|
|
||||||
- Either use the command: `ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"`
|
- Either use the command: `ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"`
|
||||||
- Or open the iOS project in Xcode and change build system in workspace settings to `Lagacy Build System`. Then the normal run command works also.
|
- Or open the iOS project in Xcode and change build system in workspace settings to `Lagacy Build System`. Then the normal run command works also.
|
||||||
|
|
||||||
|
## Cypress
|
||||||
|
|
||||||
|
#### Problem
|
||||||
|
|
||||||
|
The browser doesn't open or the tests don't connect to a browser
|
||||||
|
|
||||||
|
#### Cause
|
||||||
|
|
||||||
|
Cypress was installed to a read-only location, see
|
||||||
|
[this issue](https://github.com/cypress-io/cypress/issues/18893).
|
||||||
|
This can be the case if you use NixOS.
|
||||||
|
|
||||||
|
#### Solution
|
||||||
|
|
||||||
|
Make sure the cypress folder is writable before each launch
|
||||||
|
|
||||||
|
```shell
|
||||||
|
chmod -R +rw ~/.config/Cypress
|
||||||
|
```
|
||||||
|
|||||||
@@ -52,6 +52,44 @@ All the npm scripts are defined in `package.json` [file](package.json). It is re
|
|||||||
|
|
||||||
## Most useful commands
|
## Most useful commands
|
||||||
|
|
||||||
|
## Editing the Ionic Database from the browser
|
||||||
|
|
||||||
|
Add the following function using the browser console
|
||||||
|
|
||||||
|
```js
|
||||||
|
function addToIonicDB(key, value) {
|
||||||
|
indexedDB.open('_ionicstorage').onsuccess = event => {
|
||||||
|
const db = event.target.result;
|
||||||
|
db.transaction('_ionickv', 'readwrite').objectStore('_ionickv').put(value, key);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
You can then call the function in the browser to add values to the
|
||||||
|
ionic database in the IndexedDB.
|
||||||
|
|
||||||
|
For example, you can add a stored authorization like this:
|
||||||
|
|
||||||
|
```js
|
||||||
|
addToIonicDB(
|
||||||
|
'token_response',
|
||||||
|
JSON.stringify({
|
||||||
|
access_token: 'AT-123-abcdefghi',
|
||||||
|
refresh_token: 'RT-123-jklmnopqrs',
|
||||||
|
scope: '',
|
||||||
|
token_type: 'bearer',
|
||||||
|
issued_at: 1696852785,
|
||||||
|
expires_in: '28800',
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
You'll need to run _Chromium_ using
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pnpm chromium:no-cors
|
||||||
|
```
|
||||||
|
|
||||||
### Running the app
|
### Running the app
|
||||||
|
|
||||||
Install the npm packages needed for running the app (as for any other node project which uses npm):
|
Install the npm packages needed for running the app (as for any other node project which uses npm):
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':capacitor-app')
|
implementation project(':capacitor-app')
|
||||||
implementation project(':capacitor-browser')
|
implementation project(':capacitor-browser')
|
||||||
|
implementation project(':capacitor-clipboard')
|
||||||
implementation project(':capacitor-device')
|
implementation project(':capacitor-device')
|
||||||
implementation project(':capacitor-dialog')
|
implementation project(':capacitor-dialog')
|
||||||
implementation project(':capacitor-filesystem')
|
implementation project(':capacitor-filesystem')
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
"pkg": "@capacitor/browser",
|
"pkg": "@capacitor/browser",
|
||||||
"classpath": "com.capacitorjs.plugins.browser.BrowserPlugin"
|
"classpath": "com.capacitorjs.plugins.browser.BrowserPlugin"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"pkg": "@capacitor/clipboard",
|
||||||
|
"classpath": "com.capacitorjs.plugins.clipboard.ClipboardPlugin"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/device",
|
"pkg": "@capacitor/device",
|
||||||
"classpath": "com.capacitorjs.plugins.device.DevicePlugin"
|
"classpath": "com.capacitorjs.plugins.device.DevicePlugin"
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ project(':capacitor-app').projectDir = new File('../../../node_modules/.pnpm/@ca
|
|||||||
include ':capacitor-browser'
|
include ':capacitor-browser'
|
||||||
project(':capacitor-browser').projectDir = new File('../../../node_modules/.pnpm/@capacitor+browser@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/browser/android')
|
project(':capacitor-browser').projectDir = new File('../../../node_modules/.pnpm/@capacitor+browser@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/browser/android')
|
||||||
|
|
||||||
|
include ':capacitor-clipboard'
|
||||||
|
project(':capacitor-clipboard').projectDir = new File('../../../node_modules/.pnpm/@capacitor+clipboard@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/clipboard/android')
|
||||||
|
|
||||||
include ':capacitor-device'
|
include ':capacitor-device'
|
||||||
project(':capacitor-device').projectDir = new File('../../../node_modules/.pnpm/@capacitor+device@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/device/android')
|
project(':capacitor-device').projectDir = new File('../../../node_modules/.pnpm/@capacitor+device@4.1.0_@capacitor+core@4.6.1/node_modules/@capacitor/device/android')
|
||||||
|
|
||||||
|
|||||||
@@ -182,6 +182,7 @@
|
|||||||
"builder": "@cypress/schematic:cypress",
|
"builder": "@cypress/schematic:cypress",
|
||||||
"options": {
|
"options": {
|
||||||
"devServerTarget": "app:serve",
|
"devServerTarget": "app:serve",
|
||||||
|
"liveReload": false,
|
||||||
"watch": true,
|
"watch": true,
|
||||||
"headless": false
|
"headless": false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -18,14 +18,18 @@
|
|||||||
|
|
||||||
describe('dashboard', async function () {
|
describe('dashboard', async function () {
|
||||||
describe('schedule section', function () {
|
describe('schedule section', function () {
|
||||||
it('should lead to the schedule', function () {
|
it('should lead to the week overview', function () {
|
||||||
cy.visit('/overview');
|
cy.visit('/overview');
|
||||||
cy.get('.schedule').contains('a', 'Stundenplan').click();
|
cy.get('.schedule')
|
||||||
cy.url().should('include', '/schedule/recurring');
|
.contains('a', /Wochen.*übersicht/)
|
||||||
|
.click();
|
||||||
|
cy.url().should('include', '/schedule/week-overview');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should lead to the calendar', function () {
|
||||||
cy.visit('/overview');
|
cy.visit('/overview');
|
||||||
cy.get('.schedule').contains('a', 'Kein Eintrag gefunden').click();
|
cy.get('.schedule').contains('a', 'Kein Eintrag gefunden').click();
|
||||||
cy.url().should('include', '/schedule/recurring');
|
cy.url().should('include', '/schedule/calendar');
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Reenable and stabilize tests
|
// TODO: Reenable and stabilize tests
|
||||||
|
|||||||
141
frontend/app/cypress/integration/opening-hours.spec.ts
Normal file
141
frontend/app/cypress/integration/opening-hours.spec.ts
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
describe('opening hours', () => {
|
||||||
|
beforeEach(function () {
|
||||||
|
cy.intercept('POST', 'https://mobile.server.uni-frankfurt.de/search', {
|
||||||
|
fixture: 'search/types/canteen/canteen-search-result.json',
|
||||||
|
}).as('search');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should specify relative closing time', () => {
|
||||||
|
cy.clock(new Date(2023, 9, 16, 15, 29), ['Date']);
|
||||||
|
cy.visit('/canteen');
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geöffnet')
|
||||||
|
.should('contain', 'Schließt heute um 22:00');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should specify relative opening time', () => {
|
||||||
|
cy.clock(new Date(2023, 9, 16, 6, 29), ['Date']);
|
||||||
|
cy.visit('/canteen');
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geschlossen')
|
||||||
|
.should('contain', 'Öffnet heute um 08:30');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should specify soon opening time', () => {
|
||||||
|
cy.clock(new Date(2023, 9, 16, 8, 0), ['Date']);
|
||||||
|
cy.visit('/canteen');
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geschlossen')
|
||||||
|
.should('contain', 'Öffnet in 30 Minuten');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should specify soon closing time', () => {
|
||||||
|
cy.clock(new Date(2023, 9, 16, 21, 30), ['Date']);
|
||||||
|
cy.visit('/canteen');
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geöffnet')
|
||||||
|
.should('contain', 'Schließt in 30 Minuten');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should update the soon closing time every minute', () => {
|
||||||
|
cy.clock(new Date(2023, 9, 16, 21, 30));
|
||||||
|
cy.visit('/canteen');
|
||||||
|
cy.tick(500);
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geöffnet')
|
||||||
|
.should('contain', 'Schließt in 30 Minuten');
|
||||||
|
|
||||||
|
cy.tick(60_000);
|
||||||
|
cy.tick(50);
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geöffnet')
|
||||||
|
.should('contain', 'Schließt in 29 Minuten');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should update the status when it changes', () => {
|
||||||
|
cy.clock(new Date(2023, 9, 16, 21, 59));
|
||||||
|
cy.visit('/canteen');
|
||||||
|
cy.tick(500);
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geöffnet')
|
||||||
|
.should('contain', 'Schließt in 1 Minute');
|
||||||
|
|
||||||
|
cy.tick(60_000);
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geschlossen')
|
||||||
|
.should('contain', 'Öffnet morgen um 08:30');
|
||||||
|
});
|
||||||
|
|
||||||
|
// This one takes long to execute!
|
||||||
|
it('should update as expected', () => {
|
||||||
|
cy.clock(new Date(2023, 9, 16, 20, 59));
|
||||||
|
cy.visit('/canteen');
|
||||||
|
cy.tick(500);
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geöffnet')
|
||||||
|
.should('contain', 'Schließt heute um 22:00');
|
||||||
|
|
||||||
|
cy.tick(60_000);
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geöffnet')
|
||||||
|
.should('contain', 'Schließt in 60 Minuten');
|
||||||
|
|
||||||
|
cy.tick(30 * 60_000);
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geöffnet')
|
||||||
|
.should('contain', 'Schließt in 30 Minuten');
|
||||||
|
|
||||||
|
cy.tick(30 * 60_000);
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geschlossen')
|
||||||
|
.should('contain', 'Öffnet morgen um 08:30');
|
||||||
|
|
||||||
|
cy.tick(9.5 * 60 * 60_000);
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geschlossen')
|
||||||
|
.should('contain', 'Öffnet in 60 Minuten');
|
||||||
|
|
||||||
|
cy.tick(30 * 60_000);
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geschlossen')
|
||||||
|
.should('contain', 'Öffnet in 30 Minuten');
|
||||||
|
|
||||||
|
cy.tick(30 * 60_000);
|
||||||
|
|
||||||
|
cy.get('stapps-opening-hours')
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Geöffnet')
|
||||||
|
.should('contain', 'Schließt heute um 22:00');
|
||||||
|
|
||||||
|
// Long tick warps will cause network requests to time out
|
||||||
|
cy.get('@consoleError').invoke('resetHistory');
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -31,36 +31,24 @@
|
|||||||
// When a command from ./commands is ready to use, import with `import './commands'` syntax
|
// When a command from ./commands is ready to use, import with `import './commands'` syntax
|
||||||
// import './commands';
|
// import './commands';
|
||||||
|
|
||||||
beforeEach(async function () {
|
beforeEach(function () {
|
||||||
let databases: string[];
|
cy.wrap(
|
||||||
if (window.indexedDB.databases) {
|
new Promise(resolve => {
|
||||||
databases = (await window.indexedDB.databases()).map(it => it.name);
|
window.indexedDB.deleteDatabase('_ionicstorage').onsuccess = resolve;
|
||||||
console.log('Trying to clear all databases');
|
}),
|
||||||
} else {
|
);
|
||||||
console.log("Browser doesn't support database enumeration, deleting just ionic storage");
|
|
||||||
databases = ['_ionicstorage'];
|
|
||||||
}
|
|
||||||
for (const database of databases) {
|
|
||||||
if (database) {
|
|
||||||
console.log(`Deleting database ${database}`);
|
|
||||||
await new Promise(resolve => (window.indexedDB.deleteDatabase(database).onsuccess = resolve));
|
|
||||||
console.log(`Deleted database ${database}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.on('window:before:load', window => {
|
Cypress.on('window:before:load', window => {
|
||||||
// Fake that user is using its browser in german language
|
// Fake that user is using its browser in German
|
||||||
Object.defineProperty(window.navigator, 'language', {value: 'de-DE'});
|
Object.defineProperty(window.navigator, 'language', {value: 'de-DE'});
|
||||||
Object.defineProperty(window.navigator, 'languages', [{value: 'de-DE'}]);
|
Object.defineProperty(window.navigator, 'languages', [{value: 'de-DE'}]);
|
||||||
|
|
||||||
// Fail tests on console error
|
cy.spy(window.console, 'error').as('consoleError');
|
||||||
cy.stub(window.console, 'error').callsFake(message => {
|
});
|
||||||
// log out to the terminal
|
|
||||||
cy.now('task', 'error', message);
|
afterEach(function () {
|
||||||
// log to Command Log and fail the test
|
cy.get('@consoleError').should('not.have.been.called');
|
||||||
throw new Error(message);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.on('uncaught:exception', error => {
|
Cypress.on('uncaught:exception', error => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@openstapps/app",
|
"name": "@openstapps/app",
|
||||||
"description": "The generic app tailored to fulfill needs of German universities, written using Ionic Framework.",
|
"description": "The generic app tailored to fulfill needs of German universities, written using Ionic Framework.",
|
||||||
"version": "3.0.0-next.0",
|
"version": "3.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
|
"author": "Karl-Philipp Wulfert <krlwlfrt@gmail.com>",
|
||||||
@@ -22,6 +22,7 @@
|
|||||||
"build:stats": "ng build --configuration=production --stats-json",
|
"build:stats": "ng build --configuration=production --stats-json",
|
||||||
"changelog": "conventional-changelog -p angular -i src/assets/about/CHANGELOG.md -s -r 0",
|
"changelog": "conventional-changelog -p angular -i src/assets/about/CHANGELOG.md -s -r 0",
|
||||||
"check-icons": "ts-node-esm scripts/check-icon-correctness.ts",
|
"check-icons": "ts-node-esm scripts/check-icon-correctness.ts",
|
||||||
|
"chromium:no-cors": "chromium --disable-web-security --user-data-dir=\".browser-data/chromium\"",
|
||||||
"cypress:open": "cypress open",
|
"cypress:open": "cypress open",
|
||||||
"cypress:run": "cypress run",
|
"cypress:run": "cypress run",
|
||||||
"docker:build": "sudo docker run -p 8100:8100 -p 35729:35729 -p 53703:53703 -v $PWD:/app -it registry.gitlab.com/openstapps/app bash -c \"npm install && npm run build\"",
|
"docker:build": "sudo docker run -p 8100:8100 -p 35729:35729 -p 53703:53703 -v $PWD:/app -it registry.gitlab.com/openstapps/app bash -c \"npm install && npm run build\"",
|
||||||
@@ -63,6 +64,7 @@
|
|||||||
"@awesome-cordova-plugins/core": "5.45.0",
|
"@awesome-cordova-plugins/core": "5.45.0",
|
||||||
"@capacitor/app": "4.1.1",
|
"@capacitor/app": "4.1.1",
|
||||||
"@capacitor/browser": "4.1.0",
|
"@capacitor/browser": "4.1.0",
|
||||||
|
"@capacitor/clipboard": "4.1.0",
|
||||||
"@capacitor/core": "4.6.1",
|
"@capacitor/core": "4.6.1",
|
||||||
"@capacitor/device": "4.1.0",
|
"@capacitor/device": "4.1.0",
|
||||||
"@capacitor/dialog": "4.1.0",
|
"@capacitor/dialog": "4.1.0",
|
||||||
@@ -84,11 +86,13 @@
|
|||||||
"@ngx-translate/http-loader": "8.0.0",
|
"@ngx-translate/http-loader": "8.0.0",
|
||||||
"@openid/appauth": "1.3.1",
|
"@openid/appauth": "1.3.1",
|
||||||
"@openstapps/api": "workspace:*",
|
"@openstapps/api": "workspace:*",
|
||||||
"@openstapps/core": "workspace:*",
|
|
||||||
"@openstapps/collection-utils": "workspace:*",
|
"@openstapps/collection-utils": "workspace:*",
|
||||||
|
"@openstapps/core": "workspace:*",
|
||||||
"@transistorsoft/capacitor-background-fetch": "1.0.2",
|
"@transistorsoft/capacitor-background-fetch": "1.0.2",
|
||||||
|
"@types/dom-view-transitions": "1.0.1",
|
||||||
"capacitor-secure-storage-plugin": "0.8.1",
|
"capacitor-secure-storage-plugin": "0.8.1",
|
||||||
"cordova-plugin-calendar": "5.1.6",
|
"cordova-plugin-calendar": "5.1.6",
|
||||||
|
"date-fns": "2.30.0",
|
||||||
"deepmerge": "4.3.1",
|
"deepmerge": "4.3.1",
|
||||||
"form-data": "4.0.0",
|
"form-data": "4.0.0",
|
||||||
"geojson": "0.5.0",
|
"geojson": "0.5.0",
|
||||||
@@ -98,6 +102,7 @@
|
|||||||
"leaflet.markercluster": "1.5.3",
|
"leaflet.markercluster": "1.5.3",
|
||||||
"material-symbols": "0.10.0",
|
"material-symbols": "0.10.0",
|
||||||
"moment": "2.29.4",
|
"moment": "2.29.4",
|
||||||
|
"ngx-date-fns": "10.0.1",
|
||||||
"ngx-logger": "5.0.12",
|
"ngx-logger": "5.0.12",
|
||||||
"ngx-markdown": "16.0.0",
|
"ngx-markdown": "16.0.0",
|
||||||
"ngx-moment": "6.0.2",
|
"ngx-moment": "6.0.2",
|
||||||
@@ -146,7 +151,7 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "5.60.1",
|
"@typescript-eslint/eslint-plugin": "5.60.1",
|
||||||
"@typescript-eslint/parser": "5.60.1",
|
"@typescript-eslint/parser": "5.60.1",
|
||||||
"cordova-res": "0.15.4",
|
"cordova-res": "0.15.4",
|
||||||
"cypress": "12.17.1",
|
"cypress": "13.2.0",
|
||||||
"eslint": "8.43.0",
|
"eslint": "8.43.0",
|
||||||
"eslint-plugin-jsdoc": "46.4.2",
|
"eslint-plugin-jsdoc": "46.4.2",
|
||||||
"eslint-plugin-prettier": "4.2.1",
|
"eslint-plugin-prettier": "4.2.1",
|
||||||
|
|||||||
@@ -58,12 +58,15 @@ import {StorageProvider} from './modules/storage/storage.provider';
|
|||||||
import {AssessmentsModule} from './modules/assessments/assessments.module';
|
import {AssessmentsModule} from './modules/assessments/assessments.module';
|
||||||
import {ServiceHandlerInterceptor} from './_helpers/service-handler.interceptor';
|
import {ServiceHandlerInterceptor} from './_helpers/service-handler.interceptor';
|
||||||
import {RoutingStackService} from './util/routing-stack.service';
|
import {RoutingStackService} from './util/routing-stack.service';
|
||||||
import {SCSettingValue} from '@openstapps/core';
|
import {SCLanguageCode, SCSettingValue} from '@openstapps/core';
|
||||||
import {DefaultAuthService} from './modules/auth/default-auth.service';
|
import {DefaultAuthService} from './modules/auth/default-auth.service';
|
||||||
import {PAIAAuthService} from './modules/auth/paia/paia-auth.service';
|
import {PAIAAuthService} from './modules/auth/paia/paia-auth.service';
|
||||||
import {IonIconModule} from './util/ion-icon/ion-icon.module';
|
import {IonIconModule} from './util/ion-icon/ion-icon.module';
|
||||||
import {NavigationModule} from './modules/menu/navigation/navigation.module';
|
import {NavigationModule} from './modules/menu/navigation/navigation.module';
|
||||||
import {browserFactory, SimpleBrowser} from './util/browser.factory';
|
import {browserFactory, SimpleBrowser} from './util/browser.factory';
|
||||||
|
import {getDateFnsLocale} from './translation/dfns-locale';
|
||||||
|
import {setDefaultOptions} from 'date-fns';
|
||||||
|
import {DateFnsConfigurationService} from 'ngx-date-fns';
|
||||||
|
|
||||||
registerLocaleData(localeDe);
|
registerLocaleData(localeDe);
|
||||||
|
|
||||||
@@ -71,12 +74,6 @@ SwiperCore.use([FreeMode, Navigation]);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes data needed on startup
|
* Initializes data needed on startup
|
||||||
* @param storageProvider provider of the saved data (using framework's storage)
|
|
||||||
* @param logger TODO
|
|
||||||
* @param settingsProvider provider of settings (e.g. language that has been set)
|
|
||||||
* @param configProvider TODO
|
|
||||||
* @param translateService TODO
|
|
||||||
* @param _routingStackService Just for init and to track the stack from the get go
|
|
||||||
*/
|
*/
|
||||||
export function initializerFactory(
|
export function initializerFactory(
|
||||||
storageProvider: StorageProvider,
|
storageProvider: StorageProvider,
|
||||||
@@ -87,6 +84,7 @@ export function initializerFactory(
|
|||||||
_routingStackService: RoutingStackService,
|
_routingStackService: RoutingStackService,
|
||||||
defaultAuthService: DefaultAuthService,
|
defaultAuthService: DefaultAuthService,
|
||||||
paiaAuthService: PAIAAuthService,
|
paiaAuthService: PAIAAuthService,
|
||||||
|
dateFnsConfigurationService: DateFnsConfigurationService,
|
||||||
) {
|
) {
|
||||||
return async () => {
|
return async () => {
|
||||||
initLogger(logger);
|
initLogger(logger);
|
||||||
@@ -107,6 +105,10 @@ export function initializerFactory(
|
|||||||
translateService.setDefaultLang('en');
|
translateService.setDefaultLang('en');
|
||||||
translateService.use(languageCode);
|
translateService.use(languageCode);
|
||||||
moment.locale(languageCode);
|
moment.locale(languageCode);
|
||||||
|
const dateFnsLocale = await getDateFnsLocale(languageCode as SCLanguageCode);
|
||||||
|
setDefaultOptions({locale: dateFnsLocale});
|
||||||
|
dateFnsConfigurationService.setLocale(dateFnsLocale);
|
||||||
|
|
||||||
await defaultAuthService.init();
|
await defaultAuthService.init();
|
||||||
await paiaAuthService.init();
|
await paiaAuthService.init();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -198,6 +200,7 @@ export function createTranslateLoader(http: HttpClient) {
|
|||||||
RoutingStackService,
|
RoutingStackService,
|
||||||
DefaultAuthService,
|
DefaultAuthService,
|
||||||
PAIAAuthService,
|
PAIAAuthService,
|
||||||
|
DateFnsConfigurationService,
|
||||||
],
|
],
|
||||||
useFactory: initializerFactory,
|
useFactory: initializerFactory,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {Component, DestroyRef, inject, Input, OnInit, ViewChild} from '@angular/
|
|||||||
import {ActivatedRoute} from '@angular/router';
|
import {ActivatedRoute} from '@angular/router';
|
||||||
import {AssessmentsProvider} from '../assessments.provider';
|
import {AssessmentsProvider} from '../assessments.provider';
|
||||||
import {DataDetailComponent, ExternalDataLoadEvent} from '../../data/detail/data-detail.component';
|
import {DataDetailComponent, ExternalDataLoadEvent} from '../../data/detail/data-detail.component';
|
||||||
import {NavController, ViewWillEnter} from '@ionic/angular';
|
import {NavController} from '@ionic/angular';
|
||||||
import {DataRoutingService} from '../../data/data-routing.service';
|
import {DataRoutingService} from '../../data/data-routing.service';
|
||||||
import {SCAssessment} from '@openstapps/core';
|
import {SCAssessment} from '@openstapps/core';
|
||||||
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
||||||
@@ -27,7 +27,7 @@ import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
|||||||
templateUrl: 'assessments-detail.html',
|
templateUrl: 'assessments-detail.html',
|
||||||
styleUrls: ['assessments-detail.scss'],
|
styleUrls: ['assessments-detail.scss'],
|
||||||
})
|
})
|
||||||
export class AssessmentsDetailComponent implements ViewWillEnter, OnInit {
|
export class AssessmentsDetailComponent implements OnInit {
|
||||||
destroy$ = inject(DestroyRef);
|
destroy$ = inject(DestroyRef);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -67,8 +67,4 @@ export class AssessmentsDetailComponent implements ViewWillEnter, OnInit {
|
|||||||
event.resolve(this.item);
|
event.resolve(this.item);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async ionViewWillEnter() {
|
|
||||||
await this.detailComponent.ionViewWillEnter();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ export class AssessmentsSimpleDataListComponent implements OnInit {
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
token: this.activatedRoute.snapshot.queryParamMap.get('token'),
|
token: this.activatedRoute.snapshot.queryParamMap.get('token'),
|
||||||
},
|
},
|
||||||
|
state: {item: thing},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ export class AssessmentsPageComponent implements OnInit, AfterViewInit {
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
token: this.activatedRoute.snapshot.queryParamMap.get('token'),
|
token: this.activatedRoute.snapshot.queryParamMap.get('token'),
|
||||||
},
|
},
|
||||||
|
state: {item: thing},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export class CatalogComponent implements OnInit {
|
|||||||
.itemSelectListener()
|
.itemSelectListener()
|
||||||
.pipe(takeUntilDestroyed())
|
.pipe(takeUntilDestroyed())
|
||||||
.subscribe(item => {
|
.subscribe(item => {
|
||||||
void this.router.navigate(['data-detail', item.uid]);
|
void this.router.navigate(['data-detail', item.uid], {state: {item}});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,19 +19,20 @@
|
|||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
<div #schedule class="schedule">
|
<div #schedule class="schedule">
|
||||||
<a [routerLink]="['/schedule/recurring']">
|
<a [routerLink]="['/schedule/week-overview']">
|
||||||
<ion-icon size="40" weight="300" name="grid_view"></ion-icon>
|
<ion-icon size="36" weight="300" name="calendar_month"></ion-icon>
|
||||||
<ion-label>{{ 'schedule.recurring' | translate }}</ion-label>
|
<ion-label [innerHTML]="'schedule.recurring' | translate"></ion-label>
|
||||||
</a>
|
</a>
|
||||||
<!-- Avoid structural directives here, they might interfere with the collapse animation -->
|
<!-- Avoid structural directives here, they might interfere with the collapse animation -->
|
||||||
<a
|
<a
|
||||||
[routerLink]="nextEvent?.event ? ['/data-detail', nextEvent!.event.uid] : ['/schedule/recurring']"
|
[routerLink]="nextEvent ? ['/data-detail', nextEvent!.uid] : ['/schedule/calendar']"
|
||||||
|
[state]="{item: nextEvent}"
|
||||||
class="schedule-item-button"
|
class="schedule-item-button"
|
||||||
>
|
>
|
||||||
<ion-label>{{ 'dashboard.schedule.title' | translate }}</ion-label>
|
<ion-label>{{ 'dashboard.schedule.title' | translate }}</ion-label>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
{{
|
{{
|
||||||
nextEvent?.event
|
nextEvent
|
||||||
? (nextEvent!.dates | nextDateInList | amDateFormat : 'll, HH:mm')
|
? (nextEvent!.dates | nextDateInList | amDateFormat : 'll, HH:mm')
|
||||||
: ('dashboard.schedule.noEvent' | translate)
|
: ('dashboard.schedule.noEvent' | translate)
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -87,7 +87,8 @@ ion-content {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
height: auto;
|
height: auto;
|
||||||
padding: var(--spacing-lg);
|
min-height: 80px;
|
||||||
|
padding: var(--spacing-sm);
|
||||||
|
|
||||||
color: var(--ion-color-primary-contrast);
|
color: var(--ion-color-primary-contrast);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -104,11 +105,9 @@ ion-content {
|
|||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
gap: var(--spacing-sm);
|
gap: var(--spacing-sm);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-around;
|
justify-content: center;
|
||||||
|
|
||||||
box-sizing: content-box;
|
height: 100%;
|
||||||
aspect-ratio: 1;
|
|
||||||
max-height: 60px;
|
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
@@ -117,6 +116,7 @@ ion-content {
|
|||||||
ion-label {
|
ion-label {
|
||||||
font-size: var(--font-size-xxs);
|
font-size: var(--font-size-xxs);
|
||||||
font-weight: var(--font-weight-semi-bold);
|
font-weight: var(--font-weight-semi-bold);
|
||||||
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover ::ng-deep stapps-icon {
|
&:hover ::ng-deep stapps-icon {
|
||||||
@@ -134,8 +134,12 @@ ion-content {
|
|||||||
}
|
}
|
||||||
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
|
||||||
flex: 1 1 65%;
|
flex: 1 1 65%;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
|
padding-inline: var(--spacing-lg);
|
||||||
|
|
||||||
background: var(--linear-gradient);
|
background: var(--linear-gradient);
|
||||||
|
|
||||||
ion-label {
|
ion-label {
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
|
|||||||
.itemSelectListener()
|
.itemSelectListener()
|
||||||
.pipe(takeUntilDestroyed())
|
.pipe(takeUntilDestroyed())
|
||||||
.subscribe(item => {
|
.subscribe(item => {
|
||||||
void this.router.navigate(['data-detail', item.uid]);
|
void this.router.navigate(['data-detail', item.uid], {state: {item}});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
<stapps-data-list-item
|
<stapps-data-list-item
|
||||||
*ngFor="let dish of dishes"
|
*ngFor="let dish of dishes"
|
||||||
[hideThumbnail]="true"
|
[hideThumbnail]="true"
|
||||||
[favoriteButton]="false"
|
|
||||||
[item]="dish"
|
[item]="dish"
|
||||||
appearance="square"
|
appearance="square"
|
||||||
></stapps-data-list-item>
|
></stapps-data-list-item>
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ export class ActionChipListComponent {
|
|||||||
event:
|
event:
|
||||||
item.type === SCThingType.AcademicEvent ||
|
item.type === SCThingType.AcademicEvent ||
|
||||||
(item.type === SCThingType.DateSeries && (item as SCDateSeries).dates.length > 0),
|
(item.type === SCThingType.DateSeries && (item as SCDateSeries).dates.length > 0),
|
||||||
|
navigate: ('inPlace' in item && item.inPlace && 'geo' in item.inPlace) || 'geo' in item,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,5 +14,6 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<stapps-locate-action-chip *ngIf="applicable.locate" [item]="item"></stapps-locate-action-chip>
|
<stapps-locate-action-chip *ngIf="applicable.locate" [item]="item"></stapps-locate-action-chip>
|
||||||
|
<stapps-navigate-action-chip *ngIf="applicable.navigate" [item]="$any(item)"></stapps-navigate-action-chip>
|
||||||
<!-- Add Event Chip needs to load data and should be the last -->
|
<!-- Add Event Chip needs to load data and should be the last -->
|
||||||
<stapps-add-event-action-chip *ngIf="applicable.event" [item]="item"></stapps-add-event-action-chip>
|
<stapps-add-event-action-chip *ngIf="applicable.event" [item]="item"></stapps-add-event-action-chip>
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2023 StApps
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
|
* Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with
|
||||||
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
import {Component, Input} from '@angular/core';
|
||||||
|
import {SCPlaceWithoutReferences, SCThings} from '@openstapps/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'stapps-navigate-action-chip',
|
||||||
|
templateUrl: 'navigate-action-chip.html',
|
||||||
|
styleUrls: ['navigate-action-chip.scss'],
|
||||||
|
})
|
||||||
|
export class NavigateActionChipComponent {
|
||||||
|
place: SCPlaceWithoutReferences;
|
||||||
|
|
||||||
|
@Input({required: true}) set item(value: SCThings) {
|
||||||
|
if ('geo' in value) {
|
||||||
|
this.place = value;
|
||||||
|
} else if ('inPlace' in value && value.inPlace && 'geo' in value.inPlace) {
|
||||||
|
this.place = value.inPlace;
|
||||||
|
} else {
|
||||||
|
console.error('Invalid place', value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
~ Copyright (C) 2022 StApps
|
~ Copyright (C) 2023 StApps
|
||||||
~ This program is free software: you can redistribute it and/or modify it
|
~ This program is free software: you can redistribute it and/or modify it
|
||||||
~ under the terms of the GNU General Public License as published by the Free
|
~ under the terms of the GNU General Public License as published by the Free
|
||||||
~ Software Foundation, version 3.
|
~ Software Foundation, version 3.
|
||||||
@@ -12,15 +12,7 @@
|
|||||||
~ You should have received a copy of the GNU General Public License along with
|
~ You should have received a copy of the GNU General Public License along with
|
||||||
~ this program. If not, see <https://www.gnu.org/licenses/>.
|
~ this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
|
<ion-chip [color]="'primary'" [outline]="true" [geoNavigation]="place">
|
||||||
<ion-header translucent>
|
<ion-icon name="directions"></ion-icon>
|
||||||
<ion-toolbar color="primary" mode="ios">
|
<ion-label>{{'map.directions.TITLE' | translate}}</ion-label>
|
||||||
<ion-title>{{ 'map.modals.single.TITLE' | translate }}</ion-title>
|
</ion-chip>
|
||||||
<ion-buttons slot="end">
|
|
||||||
<ion-button (click)="modalController.dismiss()">{{ 'app.ui.CLOSE' | translate }}</ion-button>
|
|
||||||
</ion-buttons>
|
|
||||||
</ion-toolbar>
|
|
||||||
</ion-header>
|
|
||||||
<ion-content>
|
|
||||||
<stapps-data-detail-content [item]="$any(item)" [openAsModal]="true"></stapps-data-detail-content>
|
|
||||||
</ion-content>
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*!
|
||||||
* Copyright (C) 2021 StApps
|
* Copyright (C) 2023 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the Free
|
* under the terms of the GNU General Public License as published by the Free
|
||||||
* Software Foundation, version 3.
|
* Software Foundation, version 3.
|
||||||
@@ -12,20 +12,3 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {Component, Input} from '@angular/core';
|
|
||||||
import {SCPlace} from '@openstapps/core';
|
|
||||||
import {ModalController} from '@ionic/angular';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-map-single-modal',
|
|
||||||
templateUrl: './map-single.html',
|
|
||||||
styleUrls: ['./map-single.scss'],
|
|
||||||
})
|
|
||||||
export class MapSingleModalComponent {
|
|
||||||
/**
|
|
||||||
* The item to be shown
|
|
||||||
*/
|
|
||||||
@Input() item: SCPlace;
|
|
||||||
|
|
||||||
constructor(readonly modalController: ModalController) {}
|
|
||||||
}
|
|
||||||
@@ -29,6 +29,7 @@ export const DataIcons: Record<SCThingType, string> = {
|
|||||||
'dish': SCIcon`lunch_dining`,
|
'dish': SCIcon`lunch_dining`,
|
||||||
'favorite': SCIcon`favorite`,
|
'favorite': SCIcon`favorite`,
|
||||||
'floor': SCIcon`foundation`,
|
'floor': SCIcon`foundation`,
|
||||||
|
'id card': SCIcon`badge`,
|
||||||
'message': SCIcon`newspaper`,
|
'message': SCIcon`newspaper`,
|
||||||
'organization': SCIcon`business_center`,
|
'organization': SCIcon`business_center`,
|
||||||
'periodical': SCIcon`feed`,
|
'periodical': SCIcon`feed`,
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ import {StappsRatingComponent} from './elements/rating.component';
|
|||||||
import {DishCharacteristicsComponent} from './types/dish/dish-characteristics.component';
|
import {DishCharacteristicsComponent} from './types/dish/dish-characteristics.component';
|
||||||
import {SkeletonListComponent} from './list/skeleton-list.component';
|
import {SkeletonListComponent} from './list/skeleton-list.component';
|
||||||
import {CertificationsInDetailComponent} from './elements/certifications-in-detail.component';
|
import {CertificationsInDetailComponent} from './elements/certifications-in-detail.component';
|
||||||
|
import {GeoNavigationDirective} from '../map/geo-navigation.directive';
|
||||||
|
import {NavigateActionChipComponent} from './chips/data/navigate-action-chip.component';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Module for handling data
|
* Module for handling data
|
||||||
@@ -110,6 +112,7 @@ import {CertificationsInDetailComponent} from './elements/certifications-in-deta
|
|||||||
declarations: [
|
declarations: [
|
||||||
ActionChipListComponent,
|
ActionChipListComponent,
|
||||||
AddEventActionChipComponent,
|
AddEventActionChipComponent,
|
||||||
|
NavigateActionChipComponent,
|
||||||
EditEventSelectionComponent,
|
EditEventSelectionComponent,
|
||||||
AddressDetailComponent,
|
AddressDetailComponent,
|
||||||
CatalogDetailContentComponent,
|
CatalogDetailContentComponent,
|
||||||
@@ -194,6 +197,7 @@ import {CertificationsInDetailComponent} from './elements/certifications-in-deta
|
|||||||
TranslateModule.forChild(),
|
TranslateModule.forChild(),
|
||||||
ThingTranslateModule.forChild(),
|
ThingTranslateModule.forChild(),
|
||||||
UtilModule,
|
UtilModule,
|
||||||
|
GeoNavigationDirective,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
CoordinatedSearchProvider,
|
CoordinatedSearchProvider,
|
||||||
|
|||||||
@@ -111,8 +111,8 @@ describe('DataDetailComponent', () => {
|
|||||||
expect(DataDetailComponent.prototype.getItem).toHaveBeenCalledWith(sampleThing.uid, false);
|
expect(DataDetailComponent.prototype.getItem).toHaveBeenCalledWith(sampleThing.uid, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should get a data item when the view is entered', () => {
|
it('should get a data item when initialized', () => {
|
||||||
comp.ionViewWillEnter();
|
comp.ngOnInit();
|
||||||
expect(DataDetailComponent.prototype.getItem).toHaveBeenCalledWith(sampleThing.uid, false);
|
expect(DataDetailComponent.prototype.getItem).toHaveBeenCalledWith(sampleThing.uid, false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {Component, ContentChild, EventEmitter, Input, Output, TemplateRef} from '@angular/core';
|
import {Component, ContentChild, EventEmitter, Input, OnInit, Output, TemplateRef} from '@angular/core';
|
||||||
import {ActivatedRoute} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {ModalController, ViewWillEnter} from '@ionic/angular';
|
import {ModalController} from '@ionic/angular';
|
||||||
import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
|
import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
|
||||||
import {SCLanguageCode, SCSaveableThing, SCThings, SCUuid} from '@openstapps/core';
|
import {SCLanguageCode, SCSaveableThing, SCThings, SCUuid} from '@openstapps/core';
|
||||||
import {DataProvider, DataScope} from '../data.provider';
|
import {DataProvider, DataScope} from '../data.provider';
|
||||||
@@ -37,7 +37,7 @@ export interface ExternalDataLoadEvent {
|
|||||||
styleUrls: ['data-detail.scss'],
|
styleUrls: ['data-detail.scss'],
|
||||||
templateUrl: 'data-detail.html',
|
templateUrl: 'data-detail.html',
|
||||||
})
|
})
|
||||||
export class DataDetailComponent implements ViewWillEnter {
|
export class DataDetailComponent implements OnInit {
|
||||||
/**
|
/**
|
||||||
* The associated item
|
* The associated item
|
||||||
*
|
*
|
||||||
@@ -84,21 +84,20 @@ export class DataDetailComponent implements ViewWillEnter {
|
|||||||
return (thing as SCSaveableThing).data !== undefined;
|
return (thing as SCSaveableThing).data !== undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param route the route the page was accessed from
|
|
||||||
* @param dataProvider the data provider
|
|
||||||
* @param favoritesService the favorites provider
|
|
||||||
* @param modalController the modal controller
|
|
||||||
* @param translateService he translate provider
|
|
||||||
*/
|
|
||||||
constructor(
|
constructor(
|
||||||
protected readonly route: ActivatedRoute,
|
protected readonly route: ActivatedRoute,
|
||||||
|
router: Router,
|
||||||
private readonly dataProvider: DataProvider,
|
private readonly dataProvider: DataProvider,
|
||||||
private readonly favoritesService: FavoritesService,
|
private readonly favoritesService: FavoritesService,
|
||||||
readonly modalController: ModalController,
|
readonly modalController: ModalController,
|
||||||
translateService: TranslateService,
|
translateService: TranslateService,
|
||||||
) {
|
) {
|
||||||
|
this.inputItem = router.getCurrentNavigation()?.extras.state?.item;
|
||||||
|
if (!this.inputItem?.origin) {
|
||||||
|
// We received a ThingWithoutReferences.
|
||||||
|
// This can happen, for example, when detail views use `inPlace` list items
|
||||||
|
delete this.inputItem;
|
||||||
|
}
|
||||||
this.language = translateService.currentLang as SCLanguageCode;
|
this.language = translateService.currentLang as SCLanguageCode;
|
||||||
translateService.onLangChange.subscribe((event: LangChangeEvent) => {
|
translateService.onLangChange.subscribe((event: LangChangeEvent) => {
|
||||||
this.language = event.lang as SCLanguageCode;
|
this.language = event.lang as SCLanguageCode;
|
||||||
@@ -138,10 +137,7 @@ export class DataDetailComponent implements ViewWillEnter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
async ngOnInit() {
|
||||||
* Initialize
|
|
||||||
*/
|
|
||||||
async ionViewWillEnter() {
|
|
||||||
const uid = this.route.snapshot.paramMap.get('uid') || '';
|
const uid = this.route.snapshot.paramMap.get('uid') || '';
|
||||||
await this.getItem(uid ?? '', false);
|
await this.getItem(uid ?? '', false);
|
||||||
// fallback to the saved item (from favorites)
|
// fallback to the saved item (from favorites)
|
||||||
|
|||||||
@@ -37,32 +37,22 @@ export class DataPathComponent implements OnInit {
|
|||||||
@Input() maxItems = 2;
|
@Input() maxItems = 2;
|
||||||
|
|
||||||
@Input() set item(item: SCThings) {
|
@Input() set item(item: SCThings) {
|
||||||
// eslint-disable-next-line unicorn/prefer-ternary
|
|
||||||
if (item.type === SCThingType.Catalog && item.superCatalogs) {
|
if (item.type === SCThingType.Catalog && item.superCatalogs) {
|
||||||
this.path = new Promise(resolve =>
|
this.path = Promise.resolve([...item.superCatalogs!, item]);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
||||||
resolve([...item.superCatalogs!, item]),
|
|
||||||
);
|
|
||||||
} else if (item.type === SCThingType.Assessment && item.superAssessments) {
|
} else if (item.type === SCThingType.Assessment && item.superAssessments) {
|
||||||
this.path = new Promise(resolve =>
|
this.path = Promise.resolve([...item.superAssessments!, item]);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
||||||
resolve([...item.superAssessments!, item]),
|
|
||||||
);
|
|
||||||
} else if (
|
} else if (
|
||||||
item.type === SCThingType.AcademicEvent &&
|
item.type === SCThingType.AcademicEvent &&
|
||||||
item.catalogs &&
|
item.catalogs &&
|
||||||
(item.catalogs.length === 1 || this.routeStack.lastDataDetail)
|
(item.catalogs.length === 1 || this.routeStack.lastDataDetail)
|
||||||
) {
|
) {
|
||||||
const catalogWithoutReferences = item.catalogs[0];
|
|
||||||
const catalogPromise = (
|
|
||||||
item.catalogs.length === 1
|
|
||||||
? this.dataProvider.get(catalogWithoutReferences.uid, DataScope.Remote)
|
|
||||||
: this.routeStack.lastDataDetail
|
|
||||||
) as Promise<SCCatalog>;
|
|
||||||
|
|
||||||
this.path = new Promise(async resolve => {
|
this.path = new Promise(async resolve => {
|
||||||
const catalog = await catalogPromise;
|
const catalogWithoutReferences = item.catalogs![0];
|
||||||
const superCatalogs = catalog.superCatalogs;
|
const catalog =
|
||||||
|
item.catalogs!.length === 1
|
||||||
|
? await this.dataProvider.get(catalogWithoutReferences.uid, DataScope.Remote)
|
||||||
|
: this.routeStack.lastDataDetail;
|
||||||
|
const superCatalogs = (catalog as SCCatalog).superCatalogs;
|
||||||
|
|
||||||
resolve(
|
resolve(
|
||||||
superCatalogs
|
superCatalogs
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable unicorn/no-useless-undefined */
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2023 StApps
|
* Copyright (C) 2023 StApps
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
@@ -12,60 +13,51 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {Component, ElementRef, HostListener, Input} from '@angular/core';
|
import {ChangeDetectionStrategy, Component, ElementRef, HostListener, Input} from '@angular/core';
|
||||||
import {SCDish, SCRatingRequest, SCUuid} from '@openstapps/core';
|
import {SCDish, SCRatingRequest} from '@openstapps/core';
|
||||||
import {RatingProvider} from '../rating.provider';
|
import {RatingProvider} from '../rating.provider';
|
||||||
import {ratingAnimation} from './rating.animation';
|
import {ratingAnimation} from './rating.animation';
|
||||||
|
import {BehaviorSubject, filter, merge, mergeMap, of, ReplaySubject, withLatestFrom} from 'rxjs';
|
||||||
|
import {catchError, map} from 'rxjs/operators';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'stapps-rating',
|
selector: 'stapps-rating',
|
||||||
templateUrl: 'rating.html',
|
templateUrl: 'rating.html',
|
||||||
styleUrls: ['rating.scss'],
|
styleUrls: ['rating.scss'],
|
||||||
animations: [ratingAnimation],
|
animations: [ratingAnimation],
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class StappsRatingComponent {
|
export class StappsRatingComponent {
|
||||||
rate = false;
|
performRating = new BehaviorSubject(false);
|
||||||
|
|
||||||
rated = false;
|
userRating = new BehaviorSubject<number | undefined>(undefined);
|
||||||
|
|
||||||
canBeRated = false;
|
dish = new ReplaySubject<SCDish>(1);
|
||||||
|
|
||||||
uid: SCUuid;
|
wasAlreadyRated = merge(
|
||||||
|
this.dish.pipe(mergeMap(({uid}) => this.ratingProvider.hasRated(uid))),
|
||||||
|
this.userRating.pipe(
|
||||||
|
filter(it => it !== undefined),
|
||||||
|
withLatestFrom(this.dish),
|
||||||
|
mergeMap(([rating, {uid}]) => this.ratingProvider.rate(uid, rating as SCRatingRequest['rating'])),
|
||||||
|
map(() => true),
|
||||||
|
catchError(() => of(false)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
rating?: number;
|
canBeRated = this.dish.pipe(mergeMap(dish => this.ratingProvider.canRate(dish)));
|
||||||
|
|
||||||
@Input() set item(value: SCDish) {
|
@Input({required: true}) set item(value: SCDish) {
|
||||||
this.uid = value.uid;
|
this.dish.next(value);
|
||||||
|
|
||||||
Promise.all([this.ratingProvider.canRate(value), this.ratingProvider.hasRated(this.uid)] as const).then(
|
|
||||||
([canRate, hasRated]) => {
|
|
||||||
this.canBeRated = canRate;
|
|
||||||
this.rated = hasRated;
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(readonly elementRef: ElementRef, readonly ratingProvider: RatingProvider) {}
|
constructor(readonly elementRef: ElementRef, readonly ratingProvider: RatingProvider) {}
|
||||||
|
|
||||||
async submitRating(rating: number) {
|
|
||||||
this.rating = rating;
|
|
||||||
try {
|
|
||||||
await this.ratingProvider.rate(this.uid, rating as SCRatingRequest['rating']);
|
|
||||||
this.rated = true;
|
|
||||||
} catch {
|
|
||||||
this.rating = undefined;
|
|
||||||
// allow change detection to catch up first
|
|
||||||
setTimeout(() => {
|
|
||||||
this.rate = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@HostListener('document:mousedown', ['$event'])
|
@HostListener('document:mousedown', ['$event'])
|
||||||
clickOutside(event: MouseEvent) {
|
clickOutside(event: MouseEvent) {
|
||||||
if (this.rating) return;
|
if (this.userRating.value) return;
|
||||||
if (!this.elementRef.nativeElement.contains(event.target)) {
|
if (!this.elementRef.nativeElement.contains(event.target)) {
|
||||||
this.rate = false;
|
this.performRating.next(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,19 +14,23 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<ion-button
|
<ion-button
|
||||||
*ngIf="canBeRated"
|
*ngIf="canBeRated | async"
|
||||||
fill="clear"
|
fill="clear"
|
||||||
(click)="$event.stopPropagation(); rate = true"
|
(click)="$event.stopPropagation(); performRating.next(true)"
|
||||||
[disabled]="rated"
|
[disabled]="wasAlreadyRated | async"
|
||||||
>
|
>
|
||||||
<ion-icon slot="icon-only" color="medium" name="thumbs_up_down"></ion-icon>
|
<ion-icon slot="icon-only" color="medium" name="thumbs_up_down"></ion-icon>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
|
|
||||||
<div class="rating-stars" *ngIf="rate && !rated" [@rating]="rating ? 'rated' : 'abandoned'">
|
<div
|
||||||
|
class="rating-stars"
|
||||||
|
*ngIf="(performRating | async) && (wasAlreadyRated | async) !== true"
|
||||||
|
[@rating]="(userRating | async) === undefined ? 'abandoned' : 'rated'"
|
||||||
|
>
|
||||||
<ion-icon
|
<ion-icon
|
||||||
[class.rated-value]="rating === i"
|
[class.rated-value]="(userRating | async) === i"
|
||||||
*ngFor="let i of [5, 4, 3, 2, 1]"
|
*ngFor="let i of [5, 4, 3, 2, 1]"
|
||||||
(click)="$event.stopPropagation(); submitRating(i)"
|
(click)="$event.stopPropagation(); userRating.next(i)"
|
||||||
slot="icon-only"
|
slot="icon-only"
|
||||||
size="32"
|
size="32"
|
||||||
color="medium"
|
color="medium"
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user