diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index df099efa1d6..5c77a5d23fa 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -18,6 +18,7 @@ apps/cli/src/auth @bitwarden/team-auth-dev apps/desktop/src/auth @bitwarden/team-auth-dev apps/web/src/app/auth @bitwarden/team-auth-dev libs/auth @bitwarden/team-auth-dev +libs/logout @bitwarden/team-auth-dev # web connectors used for auth apps/web/src/connectors @bitwarden/team-auth-dev bitwarden_license/bit-web/src/app/auth @bitwarden/team-auth-dev diff --git a/libs/logout/README.md b/libs/logout/README.md new file mode 100644 index 00000000000..d406ae3be46 --- /dev/null +++ b/libs/logout/README.md @@ -0,0 +1,5 @@ +# logout + +Owned by: auth + +Services, functions, and types for logging out of Bitwarden applications diff --git a/libs/logout/eslint.config.mjs b/libs/logout/eslint.config.mjs new file mode 100644 index 00000000000..9c37d10e3ff --- /dev/null +++ b/libs/logout/eslint.config.mjs @@ -0,0 +1,3 @@ +import baseConfig from "../../eslint.config.mjs"; + +export default [...baseConfig]; diff --git a/libs/logout/jest.config.js b/libs/logout/jest.config.js new file mode 100644 index 00000000000..06ef23552df --- /dev/null +++ b/libs/logout/jest.config.js @@ -0,0 +1,10 @@ +module.exports = { + displayName: "logout", + preset: "../../jest.preset.js", + testEnvironment: "node", + transform: { + "^.+\\.[tj]s$": ["ts-jest", { tsconfig: "/tsconfig.spec.json" }], + }, + moduleFileExtensions: ["ts", "js", "html"], + coverageDirectory: "../../coverage/libs/logout", +}; diff --git a/libs/logout/package.json b/libs/logout/package.json new file mode 100644 index 00000000000..c1a26b72675 --- /dev/null +++ b/libs/logout/package.json @@ -0,0 +1,11 @@ +{ + "name": "@bitwarden/logout", + "version": "0.0.1", + "description": "Services, functions, and types for logging out of Bitwarden applications", + "private": true, + "type": "commonjs", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "license": "GPL-3.0", + "author": "auth" +} diff --git a/libs/logout/project.json b/libs/logout/project.json new file mode 100644 index 00000000000..92588ca1e01 --- /dev/null +++ b/libs/logout/project.json @@ -0,0 +1,33 @@ +{ + "name": "logout", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/logout/src", + "projectType": "library", + "tags": [], + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/logout", + "main": "libs/logout/src/index.ts", + "tsConfig": "libs/logout/tsconfig.lib.json", + "assets": ["libs/logout/*.md"] + } + }, + "lint": { + "executor": "@nx/eslint:lint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["libs/logout/**/*.ts"] + } + }, + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/logout/jest.config.js" + } + } + } +} diff --git a/libs/logout/src/index.ts b/libs/logout/src/index.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libs/logout/src/logout.spec.ts b/libs/logout/src/logout.spec.ts new file mode 100644 index 00000000000..7ea62abc8b3 --- /dev/null +++ b/libs/logout/src/logout.spec.ts @@ -0,0 +1,8 @@ +import * as lib from "./index"; + +describe("logout", () => { + // This test will fail until something is exported from index.ts + it("should work", () => { + expect(lib).toBeDefined(); + }); +}); diff --git a/libs/logout/tsconfig.json b/libs/logout/tsconfig.json new file mode 100644 index 00000000000..62ebbd94647 --- /dev/null +++ b/libs/logout/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/logout/tsconfig.lib.json b/libs/logout/tsconfig.lib.json new file mode 100644 index 00000000000..9cbf6736007 --- /dev/null +++ b/libs/logout/tsconfig.lib.json @@ -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"] +} diff --git a/libs/logout/tsconfig.spec.json b/libs/logout/tsconfig.spec.json new file mode 100644 index 00000000000..901c72378dd --- /dev/null +++ b/libs/logout/tsconfig.spec.json @@ -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"] +} diff --git a/package-lock.json b/package-lock.json index b7380305799..37beaee0da5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -304,6 +304,11 @@ "version": "0.0.0", "license": "GPL-3.0" }, + "libs/logout": { + "name": "@bitwarden/logout", + "version": "0.0.1", + "license": "GPL-3.0" + }, "libs/node": { "name": "@bitwarden/node", "version": "0.0.0", @@ -312,10 +317,7 @@ "libs/nx-plugin": { "name": "@bitwarden/nx-plugin", "version": "0.0.1", - "dependencies": { - "@nx/devkit": "21.1.2", - "tslib": "^2.3.0" - } + "license": "GPL-3.0" }, "libs/platform": { "name": "@bitwarden/platform", @@ -3783,6 +3785,10 @@ "resolved": "libs/key-management-ui", "link": true }, + "node_modules/@bitwarden/logout": { + "resolved": "libs/logout", + "link": true + }, "node_modules/@bitwarden/node": { "resolved": "libs/node", "link": true diff --git a/tsconfig.base.json b/tsconfig.base.json index 956e9999332..15c768b1f03 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -37,6 +37,7 @@ "@bitwarden/importer-ui": ["./libs/importer/src/components"], "@bitwarden/key-management": ["./libs/key-management/src"], "@bitwarden/key-management-ui": ["./libs/key-management-ui/src"], + "@bitwarden/logout": ["libs/logout/src/index.ts"], "@bitwarden/node/*": ["./libs/node/src/*"], "@bitwarden/nx-plugin": ["libs/nx-plugin/src/index.ts"], "@bitwarden/platform": ["./libs/platform/src"],