Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix some build scripts and lint

Chocobozzz9b3294a8496c
diff --git a/package.json b/package.json
index 88d8329e62..c9717b5e96 100644
--- a/package.json
+++ b/package.json
@@ -29,7 +29,6 @@
"build:embed": "bash ./scripts/build/embed.sh",
"build:server": "bash ./scripts/build/server.sh",
"build:client": "bash ./scripts/build/client.sh",
- "build:types": "tsc -b --verbose types",
"clean:client": "bash ./scripts/clean/client/index.sh",
"clean:server:test": "bash ./scripts/clean/server/test.sh",
"i18n:update": "bash ./scripts/i18n/update.sh",
diff --git a/scripts/ci.sh b/scripts/ci.sh
index a628cbcedb..7ad6f38e95 100755
--- a/scripts/ci.sh
+++ b/scripts/ci.sh
@@ -98,6 +98,8 @@ elif [ "$1" = "external-plugins" ]; then
runTest "$1" 1 $externalPluginsFiles
elif [ "$1" = "lint" ]; then
+ npm run build:server
+
npm run eslint -- --ext .ts "./server/**/*.ts" "shared/**/*.ts" "scripts/**/*.ts"
npm run swagger-cli -- validate support/doc/api/openapi.yaml
diff --git a/scripts/dev/server.sh b/scripts/dev/server.sh
index 5aac470eba..07d88eb2f7 100755
--- a/scripts/dev/server.sh
+++ b/scripts/dev/server.sh
@@ -19,10 +19,10 @@ rm -rf "./dist"
mkdir "./dist"
cp "./tsconfig.json" "./dist"
-npm run tsc -- --incremental --sourceMap
+npm run tsc -- -b -v --incremental
cp -r ./server/static ./server/assets ./dist/server
cp -r "./server/lib/emails" "./dist/server/lib"
NODE_ENV=test node node_modules/.bin/concurrently -k \
"node_modules/.bin/nodemon --delay 1 --watch ./dist dist/server" \
- "node_modules/.bin/tsc --incremental --sourceMap --preserveWatchOutput -w"
+ "node_modules/.bin/tsc -b -w --preserveWatchOutput"
diff --git a/support/doc/development/lib.md b/support/doc/development/lib.md
index 9c67a39dd8..097afa4fb3 100644
--- a/support/doc/development/lib.md
+++ b/support/doc/development/lib.md
@@ -2,22 +2,24 @@
## @peertube/embed-api
-### Build
+### Build & Publish
```
$ cd client/src/standalone/player/
$ npm run build
+$ npm publish --access=public
```
## @peertube/peertube-types
-Typescript definition files generation is controlled by the various `tsconfig.types.json` files, see:
-```
-yarn tsc -b --verbose tsconfig.types.json
-```
+Typescript definition files generation is controlled by the various `tsconfig.types.json` files.
+
+The complete types package is generated via:
-But the complete types package is generated via:
```
-yarn generate-types-package
+$ npm run generate-types-package
+$ cd dist
+$ npm publish --access=public
```
+
> 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 e0bdd721ab..ae79374308 100644
--- a/types/generate-package.ts
+++ b/types/generate-package.ts
@@ -13,6 +13,7 @@ run()
async function run () {
execSync('npm run build:types', { stdio: 'inherit' })
+
const typesPath = resolve(cwd(), './types/')
const typesDistPath = resolve(cwd(), typesPath, './dist/')
const typesDistPackageJsonPath = resolve(typesDistPath, './package.json')
diff --git a/types/tsconfig.dist.json b/types/tsconfig.dist.json
index d9c3fdfc30..fc2dbe45bd 100644
--- a/types/tsconfig.dist.json
+++ b/types/tsconfig.dist.json
@@ -1,5 +1,5 @@
{
- "extends": "./tsconfig.base.json",
+ "extends": "./tsconfig.json",
"compilerOptions": {
"typeRoots": [
"node_modules/@types",