Skip to content

Commit f0b672e

Browse files
committed
Merge branch 'main' into dam-download-folders
2 parents 017d90d + 5b13904 commit f0b672e

File tree

696 files changed

+25507
-7652
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

696 files changed

+25507
-7652
lines changed

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"access": "restricted",
88
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
10-
"ignore": ["comet-admin-stories", "comet-demo-api", "comet-demo-admin", "comet-demo-site"],
10+
"ignore": ["comet-admin-stories", "comet-demo-api", "comet-demo-admin", "comet-demo-site", "comet-docs"],
1111
"snapshot": {
1212
"useCalculatedVersion": true
1313
}

.changeset/fair-clouds-poke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@comet/cms-api": patch
3+
---
4+
5+
API Generator: Use correct type for `where` when `getFindCondition` service method is not used

.changeset/olive-comics-knock.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
"@comet/cms-api": minor
3+
---
4+
5+
Add access logging to log information about the request to standard output. The log contains information about the requester and the request itself. This can be useful for fulfilling legal requirements regarding data integrity or for forensics.
6+
7+
There are two ways to integrate logging into an application:
8+
9+
**First option: Use the default implementation**
10+
11+
```ts
12+
imports: [
13+
...
14+
AccessLogModule,
15+
...
16+
]
17+
```
18+
19+
**Second option: Configure logging**
20+
21+
Use the `shouldLogRequest` to prevent logging for specific requests. For instance, one may filter requests for system users.
22+
23+
```ts
24+
imports: [
25+
...
26+
AccessLogModule.forRoot({
27+
shouldLogRequest: ({user, req}) => {
28+
// do something
29+
return true; //or false
30+
},
31+
}),
32+
...
33+
]
34+
```
35+
36+
More information can be found in the documentation under 'Authentication > Access Logging'.

.changeset/polite-bats-poke.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
3+
4+
5+
6+
- [ ] Add changeset (if necessary)

.github/workflows/lint.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ on:
77
- synchronize
88
- reopened
99
- closed
10-
branches:
11-
- main
12-
- next
1310
push:
1411
branches:
1512
- main

SECURITY.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Security policy
2+
3+
## Supported versions
4+
5+
The versions of the project that are currently supported with security updates.
6+
7+
| Version | Supported |
8+
| ------: | :---------------------------------- |
9+
| 5.x | :white_check_mark: |
10+
| 4.x | :white_check_mark: |
11+
| 3.x | :white_check_mark: (until March 24) |
12+
| < 3.0 | :x: |
13+
14+
## Reporting a vulnerability
15+
16+
You can report a vulnerability by contacting us via email at [[email protected]](mailto:[email protected]).

demo/admin/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "@comet/eslint-config/react",
3-
"ignorePatterns": ["schema.json", "src/fragmentTypes.json", "src/*.generated.ts", "dist/**"],
3+
"ignorePatterns": ["schema.json", "src/fragmentTypes.json", "dist/**", "src/**/*.generated.ts"],
44
"rules": {
55
"@calm/react-intl/missing-formatted-message": "off"
66
}

demo/admin/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
/build
44
.npm
55
.config
6-
generated
76
/schema.*
87
fragmentTypes.json
98
lang
@@ -13,4 +12,5 @@ lang-compiled
1312
graphql.generated.ts
1413
block-meta.json
1514
src/blocks.generated.ts
16-
comet-config.json
15+
comet-config.json
16+
src/**/*.generated.ts

demo/admin/codegen.ts

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const rootBlocks = Object.keys(schema.getTypeMap()).filter((type) => type.endsWi
88

99
const config: CodegenConfig = {
1010
schema: "schema.gql",
11-
documents: ["src/**/*.{ts,tsx}"],
1211
generates: {
1312
"./schema.json": {
1413
plugins: ["introspection"],
@@ -20,12 +19,7 @@ const config: CodegenConfig = {
2019
plugins: ["fragment-matcher"],
2120
},
2221
"./src/graphql.generated.ts": {
23-
plugins: [
24-
{ add: { content: `import { ${rootBlocks.sort().join(", ")} } from "./blocks.generated";` } },
25-
"named-operations-object",
26-
"typescript",
27-
"typescript-operations",
28-
],
22+
plugins: [{ add: { content: `import { ${rootBlocks.sort().join(", ")} } from "@src/blocks.generated";` } }, "typescript"],
2923
config: {
3024
avoidOptionals: {
3125
field: true,
@@ -36,6 +30,29 @@ const config: CodegenConfig = {
3630
typesPrefix: "GQL",
3731
},
3832
},
33+
34+
"./src/": {
35+
documents: ["./src/**/!(*.generated).{tsx,ts}"],
36+
preset: "near-operation-file",
37+
presetConfig: {
38+
extension: ".generated.ts",
39+
baseTypesPath: "graphql.generated.ts",
40+
},
41+
config: {
42+
avoidOptionals: {
43+
field: true,
44+
},
45+
enumsAsTypes: true,
46+
namingConvention: "keep",
47+
scalars: rootBlocks.reduce((scalars, rootBlock) => ({ ...scalars, [rootBlock]: rootBlock }), {}),
48+
typesPrefix: "GQL",
49+
},
50+
plugins: [
51+
{ add: { content: `import { ${rootBlocks.sort().join(", ")} } from "@src/blocks.generated";` } },
52+
"named-operations-object",
53+
"typescript-operations",
54+
],
55+
},
3956
},
4057
};
4158

demo/admin/crud-generator-config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { CrudGeneratorConfig } from "@comet/cms-admin";
2+
export default [
3+
{
4+
target: "src/products/generated",
5+
entityName: "Product",
6+
},
7+
{
8+
target: "src/news/generated",
9+
entityName: "News",
10+
},
11+
] satisfies CrudGeneratorConfig[];

demo/admin/intl-update.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env sh
2+
3+
cd "$(dirname "$0")" || exit
4+
5+
rm -rf ./lang/
6+
mkdir -p ./lang
7+
8+
git clone https://github.com/vivid-planet/comet-demo-lang lang/comet-demo-lang
9+
git clone https://github.com/vivid-planet/comet-lang.git lang/comet-lang

demo/admin/package.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"version": "1.0.0",
44
"private": true,
55
"scripts": {
6-
"build": "run-s intl:update intl:compile && run-p gql:types generate-block-types && cross-env BABEL_ENV=production webpack --config ./webpack.config.ts --env production --mode production --progress",
6+
"admin-generator": "rimraf 'src/*/generated' && comet-admin-generator generate crud-generator-config.ts",
7+
"build": "run-s intl:compile && run-p gql:types generate-block-types && cross-env BABEL_ENV=production webpack --config ./webpack.config.ts --env production --mode production --progress",
78
"generate-block-types": "comet generate-block-types --inputs",
89
"generate-block-types:watch": "chokidar -s \"**/block-meta.json\" -c \"npm run generate-block-types\"",
910
"gql:types": "graphql-codegen",
@@ -13,22 +14,23 @@
1314
"intl:compile:comet": "formatjs compile-folder --format simple --ast lang/comet-lang lang-compiled/comet-lang",
1415
"intl:compile:comet-demo": "formatjs compile-folder --format simple --ast lang/comet-demo-lang lang-compiled/comet-demo-lang",
1516
"intl:extract": "formatjs extract \"src/**/*.ts*\" --ignore ./**.d.ts --out-file lang-extracted/en.json --format simple",
16-
"intl:update": "cd ./lang/comet-lang && git pull && cd ../comet-demo-lang && git pull",
17-
"lint": "run-s intl:update intl:compile && run-p gql:types generate-block-types && run-p lint:eslint lint:tsc",
17+
"lint": "run-s intl:compile && run-p gql:types generate-block-types && run-p lint:eslint lint:tsc && $npm_execpath lint:generated-files-not-modified",
1818
"lint:eslint": "eslint --max-warnings 0 --config ./.eslintrc.cli.js --ext .ts,.tsx,.js,.jsx,.json,.md src/ package.json",
1919
"lint:tsc": "tsc --project .",
20-
"start": "run-s intl:update intl:compile && run-p gql:types generate-block-types && dotenv -- cross-env BABEL_ENV=development webpack serve --config ./webpack.config.ts --mode development"
20+
"lint:generated-files-not-modified": "$npm_execpath admin-generator && git diff --exit-code HEAD --",
21+
"start": "run-s intl:compile && run-p gql:types generate-block-types && dotenv -- cross-env BABEL_ENV=development webpack serve --config ./webpack.config.ts --mode development"
2122
},
2223
"dependencies": {
2324
"@apollo/client": "^3.7.0",
2425
"@babel/core": "^7.0.0",
25-
"@comet/admin": "workspace:^4.5.0",
26-
"@comet/admin-icons": "workspace:^4.5.0",
27-
"@comet/admin-react-select": "workspace:^4.5.0",
28-
"@comet/admin-rte": "workspace:^4.5.0",
29-
"@comet/admin-theme": "workspace:^4.5.0",
30-
"@comet/blocks-admin": "workspace:^4.5.0",
31-
"@comet/cms-admin": "workspace:^4.5.0",
26+
"@comet/admin": "workspace:*",
27+
"@comet/admin-date-time": "workspace:*",
28+
"@comet/admin-icons": "workspace:*",
29+
"@comet/admin-react-select": "workspace:*",
30+
"@comet/admin-rte": "workspace:*",
31+
"@comet/admin-theme": "workspace:*",
32+
"@comet/blocks-admin": "workspace:*",
33+
"@comet/cms-admin": "workspace:*",
3234
"@emotion/react": "^11.9.3",
3335
"@emotion/styled": "^11.9.3",
3436
"@fontsource/roboto": "^4.5.5",
@@ -86,8 +88,8 @@
8688
"zen-observable": "^0.8.0"
8789
},
8890
"devDependencies": {
89-
"@comet/cli": "workspace:^4.5.0",
90-
"@comet/eslint-config": "workspace:^4.5.0",
91+
"@comet/cli": "workspace:*",
92+
"@comet/eslint-config": "workspace:*",
9193
"@emotion/babel-plugin": "^11.0.0",
9294
"@formatjs/cli": "^2.0.0",
9395
"@gitbeaker/node": "^25.0.0",
@@ -96,6 +98,7 @@
9698
"@graphql-codegen/fragment-matcher": "^2.0.0",
9799
"@graphql-codegen/introspection": "^2.0.0",
98100
"@graphql-codegen/named-operations-object": "^2.0.0",
101+
"@graphql-codegen/near-operation-file-preset": "^2.5.0",
99102
"@graphql-codegen/typescript": "^2.0.0",
100103
"@graphql-codegen/typescript-operations": "^2.0.0",
101104
"@ory/hydra-client": "^1.0.0",

0 commit comments

Comments
 (0)