1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-06 19:53:59 +00:00

feat(platform): generate @bitwarden/storage-core boilerplate

This commit is contained in:
addisonbeck
2025-06-04 11:47:25 -04:00
parent aa4a9babc5
commit 79957edd45
13 changed files with 114 additions and 0 deletions

1
.github/CODEOWNERS vendored
View File

@@ -88,6 +88,7 @@ libs/common/src/platform @bitwarden/team-platform-dev
libs/common/spec @bitwarden/team-platform-dev
libs/common/src/state-migrations @bitwarden/team-platform-dev
libs/platform @bitwarden/team-platform-dev
libs/storage-core @bitwarden/team-platform-dev
# Web utils used across app and connectors
apps/web/src/utils/ @bitwarden/team-platform-dev
# Web core and shared files

View File

@@ -0,0 +1,5 @@
# storage-core
Owned by: platform
Abstractions over storage APIs

View File

@@ -0,0 +1,3 @@
import baseConfig from "../../eslint.config.mjs";
export default [...baseConfig];

View File

@@ -0,0 +1,10 @@
module.exports = {
displayName: "storage-core",
preset: "../../jest.preset.js",
testEnvironment: "node",
transform: {
"^.+\\.[tj]s$": ["ts-jest", { tsconfig: "<rootDir>/tsconfig.spec.json" }],
},
moduleFileExtensions: ["ts", "js", "html"],
coverageDirectory: "../../coverage/libs/storage-core",
};

View File

@@ -0,0 +1,11 @@
{
"name": "@bitwarden/storage-core",
"version": "0.0.1",
"description": "Abstractions over storage APIs",
"private": true,
"type": "commonjs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "GPL-3.0",
"author": "platform"
}

View File

@@ -0,0 +1,33 @@
{
"name": "storage-core",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/storage-core/src",
"projectType": "library",
"tags": [],
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/storage-core",
"main": "libs/storage-core/src/index.ts",
"tsConfig": "libs/storage-core/tsconfig.lib.json",
"assets": ["libs/storage-core/*.md"]
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/storage-core/**/*.ts"]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/storage-core/jest.config.js"
}
}
}
}

View File

View File

@@ -0,0 +1,8 @@
import * as lib from "./index";
describe("storage-core", () => {
// This test will fail until something is exported from index.ts
it("should work", () => {
expect(lib).toBeDefined();
});
});

View File

@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}

View 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"]
}

View 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
View File

@@ -336,6 +336,11 @@
"version": "0.0.0",
"license": "GPL-3.0"
},
"libs/storage-core": {
"name": "@bitwarden/storage-core",
"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",
@@ -4402,6 +4407,10 @@
"resolved": "libs/tools/send/send-ui",
"link": true
},
"node_modules/@bitwarden/storage-core": {
"resolved": "libs/storage-core",
"link": true
},
"node_modules/@bitwarden/ui-common": {
"resolved": "libs/ui/common",
"link": true

View File

@@ -42,6 +42,7 @@
"@bitwarden/platform": ["./libs/platform/src"],
"@bitwarden/platform/*": ["./libs/platform/src/*"],
"@bitwarden/send-ui": ["./libs/tools/send/send-ui/src"],
"@bitwarden/storage-core": ["libs/storage-core/src/index.ts"],
"@bitwarden/ui-common": ["./libs/ui/common/src"],
"@bitwarden/ui-common/setup-jest": ["./libs/ui/common/src/setup-jest"],
"@bitwarden/vault": ["./libs/vault/src"],