diff options
-rw-r--r-- | .github/workflows/test.yml | 2 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | client/tsconfig.types.json | 4 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | packages/types/README.md (renamed from types/README.md) | 0 | ||||
-rw-r--r-- | packages/types/generate-package.ts (renamed from types/generate-package.ts) | 6 | ||||
-rw-r--r-- | packages/types/src/client/index.ts (renamed from types/src/client/index.ts) | 0 | ||||
-rw-r--r-- | packages/types/src/client/tsconfig.json (renamed from types/src/client/tsconfig.json) | 4 | ||||
-rw-r--r-- | packages/types/src/index.ts (renamed from types/src/index.ts) | 0 | ||||
-rw-r--r-- | packages/types/tests/test.ts (renamed from types/tests/test.ts) | 0 | ||||
-rw-r--r-- | packages/types/tsconfig.dist.json (renamed from types/tsconfig.dist.json) | 0 | ||||
-rw-r--r-- | packages/types/tsconfig.json (renamed from types/tsconfig.json) | 12 | ||||
-rwxr-xr-x | scripts/ci.sh | 4 | ||||
-rw-r--r-- | server/tsconfig.types.json | 2 | ||||
-rw-r--r-- | shared/tsconfig.types.json | 2 |
15 files changed, 22 insertions, 20 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a59d13d7..8ba2c549d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml | |||
@@ -39,7 +39,7 @@ jobs: | |||
39 | strategy: | 39 | strategy: |
40 | fail-fast: false | 40 | fail-fast: false |
41 | matrix: | 41 | matrix: |
42 | test_suite: [ types, client, api-1, api-2, api-3, api-4, cli-plugin, lint, external-plugins ] | 42 | test_suite: [ types-package, client, api-1, api-2, api-3, api-4, cli-plugin, lint, external-plugins ] |
43 | 43 | ||
44 | env: | 44 | env: |
45 | PGUSER: peertube | 45 | PGUSER: peertube |
diff --git a/.gitignore b/.gitignore index 0ec17217d..5e06248f1 100644 --- a/.gitignore +++ b/.gitignore | |||
@@ -53,4 +53,6 @@ yarn-error.log | |||
53 | 53 | ||
54 | # TypeScript | 54 | # TypeScript |
55 | *.tsbuildinfo | 55 | *.tsbuildinfo |
56 | /types/dist/ | 56 | |
57 | # Packages | ||
58 | /packages/types/dist/ | ||
diff --git a/client/tsconfig.types.json b/client/tsconfig.types.json index c6ed64100..99d96d413 100644 --- a/client/tsconfig.types.json +++ b/client/tsconfig.types.json | |||
@@ -4,11 +4,11 @@ | |||
4 | "stripInternal": true, | 4 | "stripInternal": true, |
5 | "removeComments": false, | 5 | "removeComments": false, |
6 | "declaration": true, | 6 | "declaration": true, |
7 | "outDir": "../types/dist/client/", | 7 | "outDir": "../packages/types/dist/client/", |
8 | "emitDeclarationOnly": true, | 8 | "emitDeclarationOnly": true, |
9 | "composite": true, | 9 | "composite": true, |
10 | "rootDir": "src/", | 10 | "rootDir": "src/", |
11 | "tsBuildInfoFile": "../types/dist/tsconfig.client.tsbuildinfo" | 11 | "tsBuildInfoFile": "../packages/types/dist/tsconfig.client.tsbuildinfo" |
12 | }, | 12 | }, |
13 | "references": [ | 13 | "references": [ |
14 | { "path": "../shared/tsconfig.types.json" } | 14 | { "path": "../shared/tsconfig.types.json" } |
diff --git a/package.json b/package.json index c7d00ec15..b41422343 100644 --- a/package.json +++ b/package.json | |||
@@ -52,7 +52,7 @@ | |||
52 | "test": "bash ./scripts/test.sh", | 52 | "test": "bash ./scripts/test.sh", |
53 | "help": "bash ./scripts/help.sh", | 53 | "help": "bash ./scripts/help.sh", |
54 | "generate-cli-doc": "bash ./scripts/generate-cli-doc.sh", | 54 | "generate-cli-doc": "bash ./scripts/generate-cli-doc.sh", |
55 | "generate-types-package": "ts-node ./types/generate-package.ts", | 55 | "generate-types-package": "ts-node ./packages/types/generate-package.ts", |
56 | "parse-log": "node ./dist/scripts/parse-log.js", | 56 | "parse-log": "node ./dist/scripts/parse-log.js", |
57 | "prune-storage": "node ./dist/scripts/prune-storage.js", | 57 | "prune-storage": "node ./dist/scripts/prune-storage.js", |
58 | "postinstall": "test -n \"$NOCLIENT\" || (cd client && yarn install --pure-lockfile)", | 58 | "postinstall": "test -n \"$NOCLIENT\" || (cd client && yarn install --pure-lockfile)", |
diff --git a/types/README.md b/packages/types/README.md index adeca48e5..adeca48e5 100644 --- a/types/README.md +++ b/packages/types/README.md | |||
diff --git a/types/generate-package.ts b/packages/types/generate-package.ts index ae061f9b0..0c14514e7 100644 --- a/types/generate-package.ts +++ b/packages/types/generate-package.ts | |||
@@ -12,7 +12,7 @@ run() | |||
12 | }) | 12 | }) |
13 | 13 | ||
14 | async function run () { | 14 | async function run () { |
15 | const typesPath = resolve(cwd(), './types/') | 15 | const typesPath = resolve(cwd(), './packages/types/') |
16 | const typesDistPath = resolve(cwd(), typesPath, './dist/') | 16 | const typesDistPath = resolve(cwd(), typesPath, './dist/') |
17 | const typesDistPackageJsonPath = resolve(typesDistPath, './package.json') | 17 | const typesDistPackageJsonPath = resolve(typesDistPath, './package.json') |
18 | const typesDistGitIgnorePath = resolve(typesDistPath, './.gitignore') | 18 | const typesDistGitIgnorePath = resolve(typesDistPath, './.gitignore') |
@@ -22,7 +22,7 @@ async function run () { | |||
22 | const clientPackageJson = await readJson(resolve(cwd(), './client/package.json')) | 22 | const clientPackageJson = await readJson(resolve(cwd(), './client/package.json')) |
23 | 23 | ||
24 | await remove(typesDistPath) | 24 | await remove(typesDistPath) |
25 | execSync('npm run tsc -- -b --verbose types', { stdio: 'inherit' }) | 25 | execSync('npm run tsc -- -b --verbose packages/types', { stdio: 'inherit' }) |
26 | execSync(`npm run resolve-tspaths -- --project ${distTsConfigPath} --src ${typesDistPath} --out ${typesDistPath}`, { stdio: 'inherit' }) | 26 | execSync(`npm run resolve-tspaths -- --project ${distTsConfigPath} --src ${typesDistPath} --out ${typesDistPath}`, { stdio: 'inherit' }) |
27 | 27 | ||
28 | const allDependencies = Object.assign( | 28 | const allDependencies = Object.assign( |
@@ -42,7 +42,7 @@ async function run () { | |||
42 | package: { dependencies: allDependencies } | 42 | package: { dependencies: allDependencies } |
43 | } | 43 | } |
44 | 44 | ||
45 | const { dependencies: unusedDependencies } = await depcheck(resolve(cwd(), './types/'), depcheckOptions) | 45 | const { dependencies: unusedDependencies } = await depcheck(resolve(typesPath), depcheckOptions) |
46 | console.log(`Removing ${Object.keys(unusedDependencies).length} unused dependencies.`) | 46 | console.log(`Removing ${Object.keys(unusedDependencies).length} unused dependencies.`) |
47 | const dependencies = Object | 47 | const dependencies = Object |
48 | .keys(allDependencies) | 48 | .keys(allDependencies) |
diff --git a/types/src/client/index.ts b/packages/types/src/client/index.ts index 5ee10ecb8..5ee10ecb8 100644 --- a/types/src/client/index.ts +++ b/packages/types/src/client/index.ts | |||
diff --git a/types/src/client/tsconfig.json b/packages/types/src/client/tsconfig.json index dea4c131c..bb76fbe21 100644 --- a/types/src/client/tsconfig.json +++ b/packages/types/src/client/tsconfig.json | |||
@@ -1,5 +1,5 @@ | |||
1 | { | 1 | { |
2 | "extends": "../../../tsconfig.base.json", | 2 | "extends": "../../../../tsconfig.base.json", |
3 | "compilerOptions": { | 3 | "compilerOptions": { |
4 | "stripInternal": true, | 4 | "stripInternal": true, |
5 | "removeComments": false, | 5 | "removeComments": false, |
@@ -9,7 +9,7 @@ | |||
9 | "tsBuildInfoFile": "../../dist/tsconfig.client.types.tsbuildinfo" | 9 | "tsBuildInfoFile": "../../dist/tsconfig.client.types.tsbuildinfo" |
10 | }, | 10 | }, |
11 | "references": [ | 11 | "references": [ |
12 | { "path": "../../../client/tsconfig.types.json" } | 12 | { "path": "../../../../client/tsconfig.types.json" } |
13 | ], | 13 | ], |
14 | "files": ["index.ts"] | 14 | "files": ["index.ts"] |
15 | } | 15 | } |
diff --git a/types/src/index.ts b/packages/types/src/index.ts index a8adca287..a8adca287 100644 --- a/types/src/index.ts +++ b/packages/types/src/index.ts | |||
diff --git a/types/tests/test.ts b/packages/types/tests/test.ts index 8c53320a1..8c53320a1 100644 --- a/types/tests/test.ts +++ b/packages/types/tests/test.ts | |||
diff --git a/types/tsconfig.dist.json b/packages/types/tsconfig.dist.json index fbc92712b..fbc92712b 100644 --- a/types/tsconfig.dist.json +++ b/packages/types/tsconfig.dist.json | |||
diff --git a/types/tsconfig.json b/packages/types/tsconfig.json index 514683886..f8e16f6b4 100644 --- a/types/tsconfig.json +++ b/packages/types/tsconfig.json | |||
@@ -1,5 +1,5 @@ | |||
1 | { | 1 | { |
2 | "extends": "../tsconfig.base.json", | 2 | "extends": "../../tsconfig.base.json", |
3 | "compilerOptions": { | 3 | "compilerOptions": { |
4 | "stripInternal": true, | 4 | "stripInternal": true, |
5 | "removeComments": false, | 5 | "removeComments": false, |
@@ -9,14 +9,14 @@ | |||
9 | "rootDir": "./src/", | 9 | "rootDir": "./src/", |
10 | "tsBuildInfoFile": "./dist/tsconfig.server.types.tsbuildinfo", | 10 | "tsBuildInfoFile": "./dist/tsconfig.server.types.tsbuildinfo", |
11 | "paths": { | 11 | "paths": { |
12 | "@server/*": [ "../../server/*" ], | 12 | "@server/*": [ "../../../server/*" ], |
13 | "@shared/*": [ "../../shared/*" ], | 13 | "@shared/*": [ "../../../shared/*" ], |
14 | "@client/*": [ "../../client/src/*" ] | 14 | "@client/*": [ "../../../client/src/*" ] |
15 | } | 15 | } |
16 | }, | 16 | }, |
17 | "references": [ | 17 | "references": [ |
18 | { "path": "../shared/tsconfig.types.json" }, | 18 | { "path": "../../shared/tsconfig.types.json" }, |
19 | { "path": "../server/tsconfig.types.json" }, | 19 | { "path": "../../server/tsconfig.types.json" }, |
20 | { "path": "./src/client/tsconfig.json" } | 20 | { "path": "./src/client/tsconfig.json" } |
21 | ], | 21 | ], |
22 | "files": ["./src/index.ts"] | 22 | "files": ["./src/index.ts"] |
diff --git a/scripts/ci.sh b/scripts/ci.sh index 070a104cc..5b757d94b 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh | |||
@@ -40,9 +40,9 @@ findTestFiles () { | |||
40 | find $1 -type f -name "*.js" $exception | xargs echo | 40 | find $1 -type f -name "*.js" $exception | xargs echo |
41 | } | 41 | } |
42 | 42 | ||
43 | if [ "$1" = "types" ]; then | 43 | if [ "$1" = "types-package" ]; then |
44 | npm run generate-types-package | 44 | npm run generate-types-package |
45 | npm run tsc -- --noEmit --esModuleInterop types/tests/test.ts | 45 | npm run tsc -- --noEmit --esModuleInterop packages/types/tests/test.ts |
46 | elif [ "$1" = "client" ]; then | 46 | elif [ "$1" = "client" ]; then |
47 | npm run build | 47 | npm run build |
48 | 48 | ||
diff --git a/server/tsconfig.types.json b/server/tsconfig.types.json index 824834066..da6b572ea 100644 --- a/server/tsconfig.types.json +++ b/server/tsconfig.types.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "extends": "./tsconfig.json", | 2 | "extends": "./tsconfig.json", |
3 | "compilerOptions": { | 3 | "compilerOptions": { |
4 | "outDir": "../types/dist/server", | 4 | "outDir": "../packages/types/dist/server", |
5 | "stripInternal": true, | 5 | "stripInternal": true, |
6 | "removeComments": false, | 6 | "removeComments": false, |
7 | "emitDeclarationOnly": true | 7 | "emitDeclarationOnly": true |
diff --git a/shared/tsconfig.types.json b/shared/tsconfig.types.json index 73c1cae6c..6acfc05e1 100644 --- a/shared/tsconfig.types.json +++ b/shared/tsconfig.types.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "extends": "./tsconfig.json", | 2 | "extends": "./tsconfig.json", |
3 | "compilerOptions": { | 3 | "compilerOptions": { |
4 | "outDir": "../types/dist/shared", | 4 | "outDir": "../packages/types/dist/shared", |
5 | "stripInternal": true, | 5 | "stripInternal": true, |
6 | "removeComments": false, | 6 | "removeComments": false, |
7 | "emitDeclarationOnly": true | 7 | "emitDeclarationOnly": true |