mirror of
https://github.com/bitwarden/browser
synced 2026-02-06 11:43:51 +00:00
generate client-type library
This commit is contained in:
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@@ -98,6 +98,7 @@ libs/messaging @bitwarden/team-platform-dev
|
||||
libs/messaging-internal @bitwarden/team-platform-dev
|
||||
libs/serialization @bitwarden/team-platform-dev
|
||||
libs/guid @bitwarden/team-platform-dev
|
||||
libs/client-type @bitwarden/team-platform-dev
|
||||
# Web utils used across app and connectors
|
||||
apps/web/src/utils/ @bitwarden/team-platform-dev
|
||||
# Web core and shared files
|
||||
|
||||
5
libs/client-type/README.md
Normal file
5
libs/client-type/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# client-type
|
||||
|
||||
Owned by: platform
|
||||
|
||||
Exports the ClientType enum
|
||||
3
libs/client-type/eslint.config.mjs
Normal file
3
libs/client-type/eslint.config.mjs
Normal file
@@ -0,0 +1,3 @@
|
||||
import baseConfig from "../../eslint.config.mjs";
|
||||
|
||||
export default [...baseConfig];
|
||||
10
libs/client-type/jest.config.js
Normal file
10
libs/client-type/jest.config.js
Normal file
@@ -0,0 +1,10 @@
|
||||
module.exports = {
|
||||
displayName: "client-type",
|
||||
preset: "../../jest.preset.js",
|
||||
testEnvironment: "node",
|
||||
transform: {
|
||||
"^.+\\.[tj]s$": ["ts-jest", { tsconfig: "<rootDir>/tsconfig.spec.json" }],
|
||||
},
|
||||
moduleFileExtensions: ["ts", "js", "html"],
|
||||
coverageDirectory: "../../coverage/libs/client-type",
|
||||
};
|
||||
11
libs/client-type/package.json
Normal file
11
libs/client-type/package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "@bitwarden/client-type",
|
||||
"version": "0.0.1",
|
||||
"description": "Exports the ClientType enum",
|
||||
"private": true,
|
||||
"type": "commonjs",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"license": "GPL-3.0",
|
||||
"author": "platform"
|
||||
}
|
||||
33
libs/client-type/project.json
Normal file
33
libs/client-type/project.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "client-type",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "libs/client-type/src",
|
||||
"projectType": "library",
|
||||
"tags": [],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/js:tsc",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"outputPath": "dist/libs/client-type",
|
||||
"main": "libs/client-type/src/index.ts",
|
||||
"tsConfig": "libs/client-type/tsconfig.lib.json",
|
||||
"assets": ["libs/client-type/*.md"]
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["libs/client-type/**/*.ts"]
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||
"options": {
|
||||
"jestConfig": "libs/client-type/jest.config.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
8
libs/client-type/src/client-type.spec.ts
Normal file
8
libs/client-type/src/client-type.spec.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import * as lib from "./index";
|
||||
|
||||
describe("client-type", () => {
|
||||
// This test will fail until something is exported from index.ts
|
||||
it("should work", () => {
|
||||
expect(lib).toBeDefined();
|
||||
});
|
||||
});
|
||||
10
libs/client-type/src/index.ts
Normal file
10
libs/client-type/src/index.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// FIXME: update to use a const object instead of a typescript enum
|
||||
// eslint-disable-next-line @bitwarden/platform/no-enums
|
||||
export enum ClientType {
|
||||
Web = "web",
|
||||
Browser = "browser",
|
||||
Desktop = "desktop",
|
||||
// Mobile = "mobile",
|
||||
Cli = "cli",
|
||||
// DirectoryConnector = "connector",
|
||||
}
|
||||
6
libs/client-type/tsconfig.eslint.json
Normal file
6
libs/client-type/tsconfig.eslint.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"files": [],
|
||||
"include": ["src/**/*.ts", "src/**/*.js"],
|
||||
"exclude": ["**/build", "**/dist"]
|
||||
}
|
||||
13
libs/client-type/tsconfig.json
Normal file
13
libs/client-type/tsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.spec.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
10
libs/client-type/tsconfig.lib.json
Normal file
10
libs/client-type/tsconfig.lib.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src/**/*.ts"],
|
||||
"exclude": ["jest.config.js", "src/**/*.spec.ts"]
|
||||
}
|
||||
10
libs/client-type/tsconfig.spec.json
Normal file
10
libs/client-type/tsconfig.spec.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node10",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
|
||||
}
|
||||
@@ -1,10 +1 @@
|
||||
// FIXME: update to use a const object instead of a typescript enum
|
||||
// eslint-disable-next-line @bitwarden/platform/no-enums
|
||||
export enum ClientType {
|
||||
Web = "web",
|
||||
Browser = "browser",
|
||||
Desktop = "desktop",
|
||||
// Mobile = "mobile",
|
||||
Cli = "cli",
|
||||
// DirectoryConnector = "connector",
|
||||
}
|
||||
export { ClientType } from "@bitwarden/client-type";
|
||||
|
||||
9
package-lock.json
generated
9
package-lock.json
generated
@@ -318,6 +318,11 @@
|
||||
"version": "0.0.0",
|
||||
"license": "GPL-3.0"
|
||||
},
|
||||
"libs/client-type": {
|
||||
"name": "@bitwarden/client-type",
|
||||
"version": "0.0.1",
|
||||
"license": "GPL-3.0"
|
||||
},
|
||||
"libs/common": {
|
||||
"name": "@bitwarden/common",
|
||||
"version": "0.0.0",
|
||||
@@ -4555,6 +4560,10 @@
|
||||
"resolved": "apps/cli",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@bitwarden/client-type": {
|
||||
"resolved": "libs/client-type",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@bitwarden/common": {
|
||||
"resolved": "libs/common",
|
||||
"link": true
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"@bitwarden/billing": ["./libs/billing/src"],
|
||||
"@bitwarden/bit-common/*": ["./bitwarden_license/bit-common/src/*"],
|
||||
"@bitwarden/cli/*": ["./apps/cli/src/*"],
|
||||
"@bitwarden/client-type": ["libs/client-type/src/index.ts"],
|
||||
"@bitwarden/common/*": ["./libs/common/src/*"],
|
||||
"@bitwarden/components": ["./libs/components/src"],
|
||||
"@bitwarden/dirt-card": ["./libs/dirt/card/src"],
|
||||
|
||||
Reference in New Issue
Block a user