Skip to content

Commit 314b41b

Browse files
authored
TDK housekeeping stabilization (do not merge before #50) (#52)
* feat(test): add new koko tests and eslint housekeeping - add new 070-user-group-search-and-share test and docs from the koko test paper - add new groups api and add those to the tdk client - add several es-lint rules to the default config and apply those * fix(artifacts): rebuild artifacts after rebase * fix(test): fix wrong path * feat(test): add new koko tests and some test housekeeping - add new 080-create-space test and docs based on the koko test paper - add client version guard to protect the test from unsupported client versions - rename the api tdk package to endpoints, to not have a api.api route which is needed for ocis - add eslint rule to have linebreaks between class members - stop using k6 response json method - add client endpoints for application - add client endpoints for drive - add client endpoints for role * - add missing client demos to the kitchen sink test - fix static space creation count * feat(test): add new koko tests and some test housekeeping - add new 090-add-remove-user-share test and docs based on the koko test paper - add new share delete client endpoint * add share.delete to the kitchen sink example * feat(test): add new koko tests and some test housekeeping - add koko 030-search-for-filename test and docs - introduce versionSupported helper and use it instead of plain conditions - add tag search - use og jsonpath instead of jsonpath-plus and adjust related helpers - introduce tag client endpoints - introduce systemtags and systemtags_relations endpoints - introduce libregraph org tags endpoints * fix(cleanup endpoints): cleanup all tdk endpoints * fix(linting): cleanup eslint config and apply airbnb best practices * feat(eslint): split up eslint config * enhancement: cleanup tdk client this enhancement cleans up the tdk/client endpoint structure and introduces a naming schema which applies to all compatible clouds. beside the client refactoring it updates all related tests to use that changed api. * enhancement: cleanup utils tdk package cleanup, rename and structure available and used utils * enhancement: add vitest and utils unit tests integrate vitest, make it possible to run tests on monorepo level via turbo and provide unit tests for the utils package * fix: circular platform import mote Platform const out of the client to prevent circular imports * fix: cleanup tdk auth adapter cleanup auth adapters and rename the oidc adapter to kopano * fix: eslint semi rule remove not needed semicolons * fix: requestFactory params and queryJson empty value handling * fix: long chained rebase cleanup previous pr rebase
1 parent d829745 commit 314b41b

148 files changed

Lines changed: 5576 additions & 4384 deletions

File tree

Some content is hidden

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

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@
1212
"clean": "turbo run clean --no-daemon --parallel && del-cli .pnpm-store node_modules",
1313
"dev": "ROARR_LOG=true turbo run dev --parallel --concurrency 64 --no-daemon | roarr",
1414
"lint": "eslint package.json && syncpack list-mismatches && turbo run lint --no-daemon",
15-
"lint:fix": "eslint package.json --fix && syncpack fix-mismatches && turbo run lint:fix --no-daemon"
15+
"lint:fix": "eslint package.json --fix && syncpack fix-mismatches && turbo run lint:fix --no-daemon",
16+
"test": "turbo run test --no-daemon"
1617
},
1718
"devDependencies": {
1819
"@changesets/cli": "^2.26.1",
1920
"@ownclouders/eslint-config": "workspace:*",
2021
"@roarr/cli": "^5.11.0",
2122
"del-cli": "^5.0.0",
2223
"syncpack": "^9.8.4",
23-
"turbo": "^1.8.8",
24-
"typescript": "^5.0.3"
24+
"turbo": "^1.9.1",
25+
"typescript": "^5.0.4"
2526
},
2627
"packageManager": "pnpm@7.30.5",
2728
"engines": {

packages/esbuild/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
"lint:fix": "pnpm run lint --fix"
2626
},
2727
"dependencies": {
28-
"esbuild": "^0.17.14"
28+
"esbuild": "^0.17.16"
2929
},
3030
"devDependencies": {
3131
"@ownclouders/eslint-config": "workspace:*",
3232
"@ownclouders/tsconfig": "workspace:*",
3333
"@types/node": "^18.15.11",
3434
"concurrently": "^8.0.1",
3535
"del-cli": "^5.0.0",
36-
"typescript": "^5.0.3"
36+
"typescript": "^5.0.4"
3737
}
3838
}

packages/esbuild/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { build as _build, BuildOptions, BuildResult } from 'esbuild';
1+
import { build as _build, BuildOptions, BuildResult } from 'esbuild'
22

33
export const build = async (config?: BuildOptions): Promise<BuildResult> => {
44
return _build({
@@ -8,7 +8,8 @@ export const build = async (config?: BuildOptions): Promise<BuildResult> => {
88
outdir: 'dist',
99
format: 'esm',
1010
minify: true,
11+
sourcemap: false,
1112
platform: 'node',
1213
...config
1314
})
14-
};
15+
}

packages/eslint-config/.eslintrc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
22
"root": true,
3-
"extends": ["."],
4-
"parser": "espree",
5-
"env": {
6-
"node": true
7-
}
3+
"extends": ["."]
84
}

packages/eslint-config/index.js

Lines changed: 26 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,36 @@
1+
const sharedExtends = [
2+
require.resolve('./src/prettier.js'),
3+
require.resolve('./src/eslint.js'),
4+
require.resolve('./src/import.js'),
5+
require.resolve('./src/turbo.js'),
6+
require.resolve('./src/simple-import-sort.js')
7+
]
8+
19
module.exports = {
210
extends: [
3-
'eslint:recommended',
4-
'prettier',
5-
'turbo',
6-
'plugin:@typescript-eslint/eslint-recommended',
7-
'plugin:@typescript-eslint/recommended',
8-
'plugin:import/recommended'
11+
require.resolve('./src/airbnb-base.js'),
12+
...sharedExtends
913
],
10-
processor: 'disable/disable',
11-
parser: '@typescript-eslint/parser',
12-
parserOptions: {
13-
project: './tsconfig.json'
14-
},
15-
plugins: [ '@typescript-eslint', 'eslint-plugin-unicorn', 'disable', 'simple-import-sort', 'json-files', 'no-relative-import-paths', 'relative-imports-when-same-folder'],
16-
rules: {
17-
'simple-import-sort/imports': 'error',
18-
'simple-import-sort/exports': 'error',
19-
'import/prefer-default-export': 'off',
20-
'import/extensions': 'off',
21-
'import/no-unresolved': 'off',
22-
'import/no-extraneous-dependencies': 'off',
23-
'import/first': 'error',
24-
'import/no-duplicates': 'error',
25-
'space-before-blocks': [ 'error', 'always' ],
26-
'import/newline-after-import': [ 'error', { 'count': 1 } ],
27-
'no-multiple-empty-lines': ['error', { 'max': 1, 'maxEOF': 1, 'maxBOF': 0 }],
28-
'import/no-named-as-default': 'error',
29-
'import/no-default-export': 'error',
30-
'import/no-useless-path-segments': 'error',
31-
'import/no-cycle': 'error',
32-
'import/no-self-import': 'error',
33-
'import/no-relative-packages': 'error',
34-
'object-curly-spacing': [ 'error', 'always' ],
35-
'comma-spacing': ['error', { 'before': false, 'after': true }],
36-
'comma-dangle': ['error', 'never'],
37-
'computed-property-spacing': [ 'error', 'always' ],
38-
'no-console': 'off',
39-
'arrow-body-style': ['error', 'always'],
40-
'arrow-parens': ['error', 'always'],
41-
'quotes': ['error', 'single', { 'avoidEscape': true }],
42-
'no-return-assign': 'off',
43-
'function-paren-newline': ['error', 'never'],
44-
'brace-style': 'error',
45-
'class-methods-use-this': 'off',
46-
'@typescript-eslint/no-empty-interface': 'off',
47-
'indent': ['error', 2],
48-
'no-unused-vars': 'off',
49-
'no-underscore-dangle': 'off',
50-
'no-nested-ternary': 'off',
51-
'@typescript-eslint/no-shadow': 'off',
52-
'no-await-in-loop': 'off',
53-
'no-plusplus': 'off',
54-
'@typescript-eslint/no-namespace': 'off',
55-
'@typescript-eslint/lines-between-class-members': 'off',
56-
'default-case': 'off',
57-
'no-restricted-syntax': 'off',
58-
'@typescript-eslint/no-unused-expressions': 'off',
59-
'@typescript-eslint/no-explicit-any': 'off',
60-
'@typescript-eslint/no-loop-func': 'off',
61-
'lines-between-class-members': ['error', 'always'],
62-
'no-continue': 'off',
63-
'no-relative-import-paths/no-relative-import-paths': [
64-
'error',
65-
{ 'allowSameFolder': true, 'rootDir': 'src', 'prefix': '@' }
66-
],
67-
'relative-imports-when-same-folder/no-relative-imports-when-same-folder': 'error'
68-
},
69-
'settings': {
70-
'import/resolver': {
71-
'typescript': {}
72-
}
73-
},
14+
ignorePatterns: ['build.mjs', 'turbowatch.ts', 'vitest.config.ts', '*.test.ts'],
7415
overrides: [
7516
{
76-
files: [ '**/package.json' ],
77-
plugins: [ 'json-files' ],
78-
parser: 'espree',
79-
rules: {
80-
'json-files/sort-package-json': 'error',
81-
'json-files/require-license': 'error',
82-
'json-files/restrict-ranges': 'error',
83-
'json-files/require-unique-dependency-names': 'error',
84-
'relative-imports-when-same-folder/no-relative-imports-when-same-folder': 'off'
17+
files: ['*.ts'],
18+
extends: [
19+
require.resolve('./src/airbnb-base.js'),
20+
require.resolve('./src/airbnb-typescript-base.js'),
21+
require.resolve('./src/no-relative-import-paths.js'),
22+
require.resolve('./src/relative-imports-when-same-folder.js'),
23+
...sharedExtends
24+
],
25+
parserOptions: {
26+
project: './tsconfig.json'
8527
}
8628
},
8729
{
88-
files: [ '**/*.js' ],
89-
parser: 'espree',
90-
rules: {
91-
'relative-imports-when-same-folder/no-relative-imports-when-same-folder': 'off'
92-
}
30+
files: ['*.json'],
31+
extends: [
32+
require.resolve('./src/json-files.js')
33+
]
9334
}
9435
]
95-
};
36+
}

packages/eslint-config/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@
1919
"lint:fix": "pnpm run lint --fix"
2020
},
2121
"dependencies": {
22-
"@typescript-eslint/eslint-plugin": "^5.57.0",
23-
"@typescript-eslint/parser": "^5.57.0",
22+
"@typescript-eslint/eslint-plugin": "^5.58.0",
23+
"@typescript-eslint/parser": "^5.58.0",
24+
"eslint-config-airbnb-base": "^15.0.0",
25+
"eslint-config-airbnb-typescript": "^17.0.0",
2426
"eslint-config-prettier": "^8.8.0",
25-
"eslint-config-turbo": "^1.8.8",
26-
"eslint-import-resolver-typescript": "^3.5.4",
27-
"eslint-plugin-disable": "^2.0.3",
27+
"eslint-config-turbo": "^1.9.1",
28+
"eslint-import-resolver-typescript": "^3.5.5",
2829
"eslint-plugin-import": "^2.27.5",
2930
"eslint-plugin-json-files": "^2.1.0",
3031
"eslint-plugin-no-relative-import-paths": "^1.5.2",
3132
"eslint-plugin-relative-imports-when-same-folder": "^0.0.4",
32-
"eslint-plugin-simple-import-sort": "^10.0.0",
33-
"eslint-plugin-unicorn": "^46.0.0"
33+
"eslint-plugin-simple-import-sort": "^10.0.0"
3434
},
3535
"devDependencies": {
3636
"del-cli": "^5.0.0",
37-
"eslint": "^8.37.0",
38-
"typescript": "^5.0.3"
37+
"eslint": "^8.38.0",
38+
"typescript": "^5.0.4"
3939
}
4040
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['airbnb-base'],
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['airbnb-typescript/base'],
3+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
rules: {
3+
'max-len': ['error', 150],
4+
'arrow-body-style': ['error', 'always'],
5+
'semi': ['error', 'never'],
6+
'arrow-parens': ['error', 'always'],
7+
'brace-style': ['error', '1tbs', { allowSingleLine: false }],
8+
'object-curly-spacing': [ 'error', 'always' ],
9+
'quotes': ['error', 'single', { 'avoidEscape': true }],
10+
'comma-spacing': ['error', { 'before': false, 'after': true }],
11+
'comma-dangle': ['error', 'never'],
12+
'no-console': 'off'
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
extends: ['plugin:import/recommended'],
3+
rules: {
4+
'import/extensions': 'off',
5+
'import/no-unresolved': 'off',
6+
'import/prefer-default-export': 'off',
7+
'import/no-duplicates': 'error',
8+
'import/newline-after-import': ['error', { count: 1 }],
9+
'import/no-default-export': 'error',
10+
'import/no-useless-path-segments': 'error',
11+
'import/no-cycle': 'error',
12+
'import/no-self-import': 'error'
13+
}
14+
}

0 commit comments

Comments
 (0)