aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-14 13:48:13 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-12-16 10:08:43 +0100
commit9b3294a8496c89c7880054de1f1f09c9990f1b46 (patch)
tree4c3271417505ee81c36b1ac23fc2829e5aad432a
parent75278e289067977291baa7e2ac217e85fc7d6088 (diff)
downloadPeerTube-9b3294a8496c89c7880054de1f1f09c9990f1b46.tar.gz
PeerTube-9b3294a8496c89c7880054de1f1f09c9990f1b46.tar.zst
PeerTube-9b3294a8496c89c7880054de1f1f09c9990f1b46.zip
Fix some build scripts and lint
-rw-r--r--package.json1
-rwxr-xr-xscripts/ci.sh2
-rwxr-xr-xscripts/dev/server.sh4
-rw-r--r--support/doc/development/lib.md16
-rw-r--r--types/generate-package.ts1
-rw-r--r--types/tsconfig.dist.json2
6 files changed, 15 insertions, 11 deletions
diff --git a/package.json b/package.json
index 88d8329e6..c9717b5e9 100644
--- a/package.json
+++ b/package.json
@@ -29,7 +29,6 @@
29 "build:embed": "bash ./scripts/build/embed.sh", 29 "build:embed": "bash ./scripts/build/embed.sh",
30 "build:server": "bash ./scripts/build/server.sh", 30 "build:server": "bash ./scripts/build/server.sh",
31 "build:client": "bash ./scripts/build/client.sh", 31 "build:client": "bash ./scripts/build/client.sh",
32 "build:types": "tsc -b --verbose types",
33 "clean:client": "bash ./scripts/clean/client/index.sh", 32 "clean:client": "bash ./scripts/clean/client/index.sh",
34 "clean:server:test": "bash ./scripts/clean/server/test.sh", 33 "clean:server:test": "bash ./scripts/clean/server/test.sh",
35 "i18n:update": "bash ./scripts/i18n/update.sh", 34 "i18n:update": "bash ./scripts/i18n/update.sh",
diff --git a/scripts/ci.sh b/scripts/ci.sh
index a628cbced..7ad6f38e9 100755
--- a/scripts/ci.sh
+++ b/scripts/ci.sh
@@ -98,6 +98,8 @@ elif [ "$1" = "external-plugins" ]; then
98 98
99 runTest "$1" 1 $externalPluginsFiles 99 runTest "$1" 1 $externalPluginsFiles
100elif [ "$1" = "lint" ]; then 100elif [ "$1" = "lint" ]; then
101 npm run build:server
102
101 npm run eslint -- --ext .ts "./server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts" 103 npm run eslint -- --ext .ts "./server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts"
102 npm run swagger-cli -- validate support/doc/api/openapi.yaml 104 npm run swagger-cli -- validate support/doc/api/openapi.yaml
103 105
diff --git a/scripts/dev/server.sh b/scripts/dev/server.sh
index 5aac470eb..07d88eb2f 100755
--- a/scripts/dev/server.sh
+++ b/scripts/dev/server.sh
@@ -19,10 +19,10 @@ rm -rf "./dist"
19mkdir "./dist" 19mkdir "./dist"
20cp "./tsconfig.json" "./dist" 20cp "./tsconfig.json" "./dist"
21 21
22npm run tsc -- --incremental --sourceMap 22npm run tsc -- -b -v --incremental
23cp -r ./server/static ./server/assets ./dist/server 23cp -r ./server/static ./server/assets ./dist/server
24cp -r "./server/lib/emails" "./dist/server/lib" 24cp -r "./server/lib/emails" "./dist/server/lib"
25 25
26NODE_ENV=test node node_modules/.bin/concurrently -k \ 26NODE_ENV=test node node_modules/.bin/concurrently -k \
27 "node_modules/.bin/nodemon --delay 1 --watch ./dist dist/server" \ 27 "node_modules/.bin/nodemon --delay 1 --watch ./dist dist/server" \
28 "node_modules/.bin/tsc --incremental --sourceMap --preserveWatchOutput -w" 28 "node_modules/.bin/tsc -b -w --preserveWatchOutput"
diff --git a/support/doc/development/lib.md b/support/doc/development/lib.md
index 9c67a39dd..097afa4fb 100644
--- a/support/doc/development/lib.md
+++ b/support/doc/development/lib.md
@@ -2,22 +2,24 @@
2 2
3## @peertube/embed-api 3## @peertube/embed-api
4 4
5### Build 5### Build & Publish
6 6
7``` 7```
8$ cd client/src/standalone/player/ 8$ cd client/src/standalone/player/
9$ npm run build 9$ npm run build
10$ npm publish --access=public
10``` 11```
11 12
12## @peertube/peertube-types 13## @peertube/peertube-types
13 14
14Typescript definition files generation is controlled by the various `tsconfig.types.json` files, see: 15Typescript definition files generation is controlled by the various `tsconfig.types.json` files.
15``` 16
16yarn tsc -b --verbose tsconfig.types.json 17The complete types package is generated via:
17```
18 18
19But the complete types package is generated via:
20``` 19```
21yarn generate-types-package 20$ npm run generate-types-package
21$ cd dist
22$ npm publish --access=public
22``` 23```
24
23> See [scripts/generate-types-package.ts](scripts/generate-types-package.ts) for details. 25> See [scripts/generate-types-package.ts](scripts/generate-types-package.ts) for details.
diff --git a/types/generate-package.ts b/types/generate-package.ts
index e0bdd721a..ae7937430 100644
--- a/types/generate-package.ts
+++ b/types/generate-package.ts
@@ -13,6 +13,7 @@ run()
13 13
14async function run () { 14async function run () {
15 execSync('npm run build:types', { stdio: 'inherit' }) 15 execSync('npm run build:types', { stdio: 'inherit' })
16
16 const typesPath = resolve(cwd(), './types/') 17 const typesPath = resolve(cwd(), './types/')
17 const typesDistPath = resolve(cwd(), typesPath, './dist/') 18 const typesDistPath = resolve(cwd(), typesPath, './dist/')
18 const typesDistPackageJsonPath = resolve(typesDistPath, './package.json') 19 const typesDistPackageJsonPath = resolve(typesDistPath, './package.json')
diff --git a/types/tsconfig.dist.json b/types/tsconfig.dist.json
index d9c3fdfc3..fc2dbe45b 100644
--- a/types/tsconfig.dist.json
+++ b/types/tsconfig.dist.json
@@ -1,5 +1,5 @@
1{ 1{
2 "extends": "./tsconfig.base.json", 2 "extends": "./tsconfig.json",
3 "compilerOptions": { 3 "compilerOptions": {
4 "typeRoots": [ 4 "typeRoots": [
5 "node_modules/@types", 5 "node_modules/@types",