1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-08 04:33:38 +00:00

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

This commit is contained in:
addisonbeck
2025-06-04 11:47:25 -04:00
parent 0a3509575c
commit 6ff7999715
13 changed files with 115 additions and 4 deletions

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