From 8b03e2ce1a2098261de2f729f660b1ae2a320b65 Mon Sep 17 00:00:00 2001 From: lutangar Date: Tue, 9 Nov 2021 13:49:08 +0100 Subject: feat(types): create peertube-types package Create dedicated Typescript "types" configuration file for each "projects". Create a types folder which includes every useful ts definition: - client - server - shared Add tooling to create a proper package, extract dependencies, etc... Add CI Github task. refactor(types): publish types package in release script --- client/src/index.ts | 1 + client/src/types/index.ts | 6 ++++++ client/tsconfig.json | 1 + client/tsconfig.types.json | 18 ++++++++++++++++++ 4 files changed, 26 insertions(+) create mode 100644 client/src/index.ts create mode 100644 client/src/types/index.ts create mode 100644 client/tsconfig.types.json (limited to 'client') diff --git a/client/src/index.ts b/client/src/index.ts new file mode 100644 index 000000000..c9f6f047d --- /dev/null +++ b/client/src/index.ts @@ -0,0 +1 @@ +export * from './types' diff --git a/client/src/types/index.ts b/client/src/types/index.ts new file mode 100644 index 000000000..5508515fd --- /dev/null +++ b/client/src/types/index.ts @@ -0,0 +1,6 @@ +export * from './client-script.model' +export * from './job-state-client.type' +export * from './job-type-client.type' +export * from './link.type' +export * from './register-client-option.model' +export * from './select-options-item.model' diff --git a/client/tsconfig.json b/client/tsconfig.json index 56e7b68ee..d68b3058e 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -13,6 +13,7 @@ "suppressImplicitAnyIndexErrors":true, "alwaysStrict": true, "importHelpers": true, + "allowSyntheticDefaultImports": true, "strictBindCallApply": true, "target": "es2015", "typeRoots": [ diff --git a/client/tsconfig.types.json b/client/tsconfig.types.json new file mode 100644 index 000000000..35a5e92cc --- /dev/null +++ b/client/tsconfig.types.json @@ -0,0 +1,18 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "stripInternal": true, + "removeComments": false, + "declaration": true, + "outDir": "../types/client/", + "emitDeclarationOnly": true, + "composite": true, + "rootDir": "src/", + "tsBuildInfoFile": "../types/client.tsbuildinfo" + }, + "references": [ + { "path": "../shared/tsconfig.types.json" } + ], + "files": ["src/index.ts"], + "include": ["src/index.ts", "src/types/**/*"] +} -- cgit v1.2.3