mirror of
https://github.com/bitwarden/browser
synced 2025-12-29 14:43:31 +00:00
[PM-29607] Create @bitwarden/subscription (#17997)
* Create @bitwarden/subscription * Fix changed import in tsconfig.base.json
This commit is contained in:
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@@ -232,3 +232,4 @@ libs/pricing @bitwarden/team-billing-dev
|
||||
.claude/ @bitwarden/team-ai-sme
|
||||
.github/workflows/respond.yml @bitwarden/team-ai-sme
|
||||
.github/workflows/review-code.yml @bitwarden/team-ai-sme
|
||||
libs/subscription @bitwarden/team-billing-dev
|
||||
|
||||
@@ -59,6 +59,7 @@ module.exports = {
|
||||
"<rootDir>/libs/tools/send/send-ui/jest.config.js",
|
||||
"<rootDir>/libs/user-core/jest.config.js",
|
||||
"<rootDir>/libs/vault/jest.config.js",
|
||||
"<rootDir>/libs/subscription/jest.config.js",
|
||||
],
|
||||
|
||||
// Workaround for a memory leak that crashes tests in CI:
|
||||
|
||||
5
libs/subscription/README.md
Normal file
5
libs/subscription/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Subscription
|
||||
|
||||
Owned by: billing
|
||||
|
||||
Components and services for managing Bitwarden subscriptions.
|
||||
3
libs/subscription/eslint.config.mjs
Normal file
3
libs/subscription/eslint.config.mjs
Normal file
@@ -0,0 +1,3 @@
|
||||
import baseConfig from "../../eslint.config.mjs";
|
||||
|
||||
export default [...baseConfig];
|
||||
10
libs/subscription/jest.config.js
Normal file
10
libs/subscription/jest.config.js
Normal file
@@ -0,0 +1,10 @@
|
||||
module.exports = {
|
||||
displayName: "subscription",
|
||||
preset: "../../jest.preset.js",
|
||||
testEnvironment: "node",
|
||||
transform: {
|
||||
"^.+\\.[tj]s$": ["ts-jest", { tsconfig: "<rootDir>/tsconfig.spec.json" }],
|
||||
},
|
||||
moduleFileExtensions: ["ts", "js", "html"],
|
||||
coverageDirectory: "../../coverage/libs/subscription",
|
||||
};
|
||||
11
libs/subscription/package.json
Normal file
11
libs/subscription/package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "@bitwarden/subscription",
|
||||
"version": "0.0.1",
|
||||
"description": "Components and services for managing Bitwarden subscriptions.",
|
||||
"private": true,
|
||||
"type": "commonjs",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"license": "GPL-3.0",
|
||||
"author": "billing"
|
||||
}
|
||||
34
libs/subscription/project.json
Normal file
34
libs/subscription/project.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "subscription",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "libs/subscription/src",
|
||||
"projectType": "library",
|
||||
"tags": [],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/js:tsc",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"outputPath": "dist/libs/subscription",
|
||||
"main": "libs/subscription/src/index.ts",
|
||||
"tsConfig": "libs/subscription/tsconfig.lib.json",
|
||||
"assets": ["libs/subscription/*.md"],
|
||||
"rootDir": "libs/subscription/src"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": ["{options.outputFile}"],
|
||||
"options": {
|
||||
"lintFilePatterns": ["libs/subscription/**/*.ts"]
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||
"options": {
|
||||
"jestConfig": "libs/subscription/jest.config.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
libs/subscription/src/index.ts
Normal file
1
libs/subscription/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export type Placeholder = unknown;
|
||||
8
libs/subscription/src/subscription.spec.ts
Normal file
8
libs/subscription/src/subscription.spec.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import * as lib from "./index";
|
||||
|
||||
describe("subscription", () => {
|
||||
// This test will fail until something is exported from index.ts
|
||||
it("should work", () => {
|
||||
expect(lib).toBeDefined();
|
||||
});
|
||||
});
|
||||
6
libs/subscription/tsconfig.eslint.json
Normal file
6
libs/subscription/tsconfig.eslint.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"files": [],
|
||||
"include": ["src/**/*.ts", "src/**/*.js"],
|
||||
"exclude": ["**/build", "**/dist"]
|
||||
}
|
||||
13
libs/subscription/tsconfig.json
Normal file
13
libs/subscription/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/subscription/tsconfig.lib.json
Normal file
10
libs/subscription/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/subscription/tsconfig.spec.json
Normal file
10
libs/subscription/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"]
|
||||
}
|
||||
9
package-lock.json
generated
9
package-lock.json
generated
@@ -628,6 +628,11 @@
|
||||
"version": "0.0.1",
|
||||
"license": "GPL-3.0"
|
||||
},
|
||||
"libs/subscription": {
|
||||
"name": "@bitwarden/subscription",
|
||||
"version": "0.0.1",
|
||||
"license": "GPL-3.0"
|
||||
},
|
||||
"libs/tools/export/vault-export/vault-export-core": {
|
||||
"name": "@bitwarden/vault-export-core",
|
||||
"version": "0.0.0",
|
||||
@@ -5011,6 +5016,10 @@
|
||||
"resolved": "libs/storage-test-utils",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@bitwarden/subscription": {
|
||||
"resolved": "libs/subscription",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@bitwarden/ui-common": {
|
||||
"resolved": "libs/ui/common",
|
||||
"link": true
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
"@bitwarden/state-test-utils": ["libs/state-test-utils/src/index.ts"],
|
||||
"@bitwarden/storage-core": ["libs/storage-core/src/index.ts"],
|
||||
"@bitwarden/storage-test-utils": ["libs/storage-test-utils/src/index.ts"],
|
||||
"@bitwarden/subscription": ["libs/subscription/src/index.ts"],
|
||||
"@bitwarden/ui-common": ["./libs/ui/common/src"],
|
||||
"@bitwarden/ui-common/setup-jest": ["./libs/ui/common/src/setup-jest"],
|
||||
"@bitwarden/user-core": ["libs/user-core/src/index.ts"],
|
||||
|
||||
Reference in New Issue
Block a user