]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Move types package in packages/
authorChocobozzz <me@florianbigard.com>
Tue, 28 Dec 2021 09:18:15 +0000 (10:18 +0100)
committerChocobozzz <me@florianbigard.com>
Tue, 28 Dec 2021 09:18:15 +0000 (10:18 +0100)
15 files changed:
.github/workflows/test.yml
.gitignore
client/tsconfig.types.json
package.json
packages/types/README.md [moved from types/README.md with 100% similarity]
packages/types/generate-package.ts [moved from types/generate-package.ts with 94% similarity]
packages/types/src/client/index.ts [moved from types/src/client/index.ts with 100% similarity]
packages/types/src/client/tsconfig.json [moved from types/src/client/tsconfig.json with 73% similarity]
packages/types/src/index.ts [moved from types/src/index.ts with 100% similarity]
packages/types/tests/test.ts [moved from types/tests/test.ts with 100% similarity]
packages/types/tsconfig.dist.json [moved from types/tsconfig.dist.json with 100% similarity]
packages/types/tsconfig.json [moved from types/tsconfig.json with 57% similarity]
scripts/ci.sh
server/tsconfig.types.json
shared/tsconfig.types.json

index 1a59d13d7bcf939eacc1be80814aabf74831023d..8ba2c549d37641f358dc54f2a1eb4ee03224b626 100644 (file)
@@ -39,7 +39,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        test_suite: [ types, client, api-1, api-2, api-3, api-4, cli-plugin, lint, external-plugins ]
+        test_suite: [ types-package, client, api-1, api-2, api-3, api-4, cli-plugin, lint, external-plugins ]
 
     env:
       PGUSER: peertube
index 0ec17217d2b8f584b8c9f72069351f20157d2859..5e06248f11d9048ab59f8cbb1e1c90cb70adac28 100644 (file)
@@ -53,4 +53,6 @@ yarn-error.log
 
 # TypeScript
 *.tsbuildinfo
-/types/dist/
+
+# Packages
+/packages/types/dist/
index c6ed641005f20d83cbd209c2c5a4a5177d15b4d8..99d96d41386dce105bfd61139a595d4f4b726a19 100644 (file)
@@ -4,11 +4,11 @@
     "stripInternal": true,
     "removeComments": false,
     "declaration": true,
-    "outDir": "../types/dist/client/",
+    "outDir": "../packages/types/dist/client/",
     "emitDeclarationOnly": true,
     "composite": true,
     "rootDir": "src/",
-    "tsBuildInfoFile": "../types/dist/tsconfig.client.tsbuildinfo"
+    "tsBuildInfoFile": "../packages/types/dist/tsconfig.client.tsbuildinfo"
   },
   "references": [
     { "path": "../shared/tsconfig.types.json" }
index c7d00ec151b37e883913c0890f27017f3f92c82c..b414223431ab8bda41db323036de25f295a985eb 100644 (file)
@@ -52,7 +52,7 @@
     "test": "bash ./scripts/test.sh",
     "help": "bash ./scripts/help.sh",
     "generate-cli-doc": "bash ./scripts/generate-cli-doc.sh",
-    "generate-types-package": "ts-node ./types/generate-package.ts",
+    "generate-types-package": "ts-node ./packages/types/generate-package.ts",
     "parse-log": "node ./dist/scripts/parse-log.js",
     "prune-storage": "node ./dist/scripts/prune-storage.js",
     "postinstall": "test -n \"$NOCLIENT\" || (cd client && yarn install --pure-lockfile)",
similarity index 100%
rename from types/README.md
rename to packages/types/README.md
similarity index 94%
rename from types/generate-package.ts
rename to packages/types/generate-package.ts
index ae061f9b0f930536596927113d0ddaebc3aa8ad9..0c14514e7fb3b76dabf303be21030657231f663c 100644 (file)
@@ -12,7 +12,7 @@ run()
   })
 
 async function run () {
-  const typesPath = resolve(cwd(), './types/')
+  const typesPath = resolve(cwd(), './packages/types/')
   const typesDistPath = resolve(cwd(), typesPath, './dist/')
   const typesDistPackageJsonPath = resolve(typesDistPath, './package.json')
   const typesDistGitIgnorePath = resolve(typesDistPath, './.gitignore')
@@ -22,7 +22,7 @@ async function run () {
   const clientPackageJson = await readJson(resolve(cwd(), './client/package.json'))
 
   await remove(typesDistPath)
-  execSync('npm run tsc -- -b --verbose types', { stdio: 'inherit' })
+  execSync('npm run tsc -- -b --verbose packages/types', { stdio: 'inherit' })
   execSync(`npm run resolve-tspaths -- --project ${distTsConfigPath} --src ${typesDistPath} --out ${typesDistPath}`, { stdio: 'inherit' })
 
   const allDependencies = Object.assign(
@@ -42,7 +42,7 @@ async function run () {
     package: { dependencies: allDependencies }
   }
 
-  const { dependencies: unusedDependencies } = await depcheck(resolve(cwd(), './types/'), depcheckOptions)
+  const { dependencies: unusedDependencies } = await depcheck(resolve(typesPath), depcheckOptions)
   console.log(`Removing ${Object.keys(unusedDependencies).length} unused dependencies.`)
   const dependencies = Object
     .keys(allDependencies)
similarity index 73%
rename from types/src/client/tsconfig.json
rename to packages/types/src/client/tsconfig.json
index dea4c131c4081ed004ae304876be3b90e30ecbac..bb76fbe2130ee97a2e98b9b0536a956c3e6a131a 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "extends": "../../../tsconfig.base.json",
+  "extends": "../../../../tsconfig.base.json",
   "compilerOptions": {
     "stripInternal": true,
     "removeComments": false,
@@ -9,7 +9,7 @@
     "tsBuildInfoFile": "../../dist/tsconfig.client.types.tsbuildinfo"
   },
   "references": [
-    { "path": "../../../client/tsconfig.types.json" }
+    { "path": "../../../../client/tsconfig.types.json" }
   ],
   "files": ["index.ts"]
 }
similarity index 57%
rename from types/tsconfig.json
rename to packages/types/tsconfig.json
index 51468388676d38114e055c8931126bf6054c4c98..f8e16f6b4fbbed2dca6c5633a4896f6d014cc82f 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "extends": "../tsconfig.base.json",
+  "extends": "../../tsconfig.base.json",
   "compilerOptions": {
     "stripInternal": true,
     "removeComments": false,
@@ -9,14 +9,14 @@
     "rootDir": "./src/",
     "tsBuildInfoFile": "./dist/tsconfig.server.types.tsbuildinfo",
     "paths": {
-      "@server/*": [ "../../server/*" ],
-      "@shared/*": [ "../../shared/*" ],
-      "@client/*": [ "../../client/src/*" ]
+      "@server/*": [ "../../../server/*" ],
+      "@shared/*": [ "../../../shared/*" ],
+      "@client/*": [ "../../../client/src/*" ]
     }
   },
   "references": [
-    { "path": "../shared/tsconfig.types.json" },
-    { "path": "../server/tsconfig.types.json" },
+    { "path": "../../shared/tsconfig.types.json" },
+    { "path": "../../server/tsconfig.types.json" },
     { "path": "./src/client/tsconfig.json" }
   ],
   "files": ["./src/index.ts"]
index 070a104ccffd8bb8c873638f9d8792f077426f8f..5b757d94b370a4142c09671480166cb149afc4a0 100755 (executable)
@@ -40,9 +40,9 @@ findTestFiles () {
     find $1 -type f -name "*.js" $exception | xargs echo
 }
 
-if [ "$1" = "types" ]; then
+if [ "$1" = "types-package" ]; then
     npm run generate-types-package
-    npm run tsc -- --noEmit --esModuleInterop types/tests/test.ts
+    npm run tsc -- --noEmit --esModuleInterop packages/types/tests/test.ts
 elif [ "$1" = "client" ]; then
     npm run build
 
index 824834066ec6b2e8f4344985d388d572c594b40b..da6b572eac24ef482ce789f47ca466cbf91dd3e6 100644 (file)
@@ -1,7 +1,7 @@
 {
   "extends": "./tsconfig.json",
   "compilerOptions": {
-    "outDir": "../types/dist/server",
+    "outDir": "../packages/types/dist/server",
     "stripInternal": true,
     "removeComments": false,
     "emitDeclarationOnly": true
index 73c1cae6cee06d84e045fe18cbb2b8affad4525f..6acfc05e1572d16805ba8413a2783e3ff49c4839 100644 (file)
@@ -1,7 +1,7 @@
 {
   "extends": "./tsconfig.json",
   "compilerOptions": {
-    "outDir": "../types/dist/shared",
+    "outDir": "../packages/types/dist/shared",
     "stripInternal": true,
     "removeComments": false,
     "emitDeclarationOnly": true