diff --git a/packages/store-reference/README.md b/packages/store-reference/README.md new file mode 100644 index 00000000..22b19669 --- /dev/null +++ b/packages/store-reference/README.md @@ -0,0 +1,5 @@ +# Alwatr Store + +Extremely fast and compact JSON-based database that operates in memory, includes a JSON file backup, and serve over the highly accelerated Nginx. + +## for more information please visit [Alwatr Store](https://github.com/Alwatr/store#readme) diff --git a/packages/store-reference/package.json b/packages/store-reference/package.json new file mode 100644 index 00000000..69424a82 --- /dev/null +++ b/packages/store-reference/package.json @@ -0,0 +1,72 @@ +{ + "name": "@alwatr/store-reference", + "version": "5.0.0-alpha.0", + "description": "Extremely fast and compact JSON-based database that operates in memory, includes a JSON file backup, and serve over the highly accelerated Nginx.", + "author": "S. Ali Mihandoost ", + "keywords": [ + "database", + "storage", + "json", + "nosql", + "no-sql", + "data", + "data-storage", + "file", + "typescript", + "esm", + "alwatr" + ], + "type": "module", + "main": "./dist/main.cjs", + "module": "./dist/main.mjs", + "types": "./dist/main.d.ts", + "exports": { + ".": { + "import": "./dist/main.mjs", + "require": "./dist/main.cjs", + "types": "./dist/main.d.ts" + } + }, + "license": "MIT", + "files": [ + "**/*.{js,mjs,cjs,map,d.ts,html,md}", + "!demo/**/*" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/Alwatr/store", + "directory": "packages/reference" + }, + "homepage": "https://github.com/Alwatr/store#readme", + "bugs": { + "url": "https://github.com/Alwatr/store/issues" + }, + "prettier": "@alwatr/prettier-config", + "scripts": { + "b": "yarn run build", + "w": "yarn run watch", + "c": "yarn run clean", + "cb": "yarn run clean && yarn run build", + "d": "yarn run build:es && ALWATR_DEBUG=1 yarn node", + "build": "yarn run build:ts & yarn run build:es", + "build:es": "nano-build --preset=module", + "build:ts": "tsc --build", + "watch": "yarn run watch:ts & yarn run watch:es", + "watch:es": "yarn run build:es --watch", + "watch:ts": "yarn run build:ts --watch --preserveWatchOutput", + "clean": "rm -rfv dist *.tsbuildinfo" + }, + "devDependencies": { + "@alwatr/flat-string": "^1.0.9", + "@alwatr/logger": "^2.4.1", + "@alwatr/nano-build": "^1.2.1", + "@alwatr/prettier-config": "^1.0.4", + "@alwatr/store-types": "workspace:^", + "@alwatr/tsconfig-base": "^1.0.5", + "@types/node": "^20.10.5", + "typescript": "^5.3.3" + } +} diff --git a/packages/store-reference/src/collection-reference.ts b/packages/store-reference/src/collection-reference.ts index 04528731..0dfcbd59 100644 --- a/packages/store-reference/src/collection-reference.ts +++ b/packages/store-reference/src/collection-reference.ts @@ -1,6 +1,4 @@ import {createLogger} from '@alwatr/logger'; - -import {logger} from '/Users/alimd/repo/alwatr/store/packages/engine5/src/logger.js'; import { StoreFileType, type CollectionContext, @@ -9,7 +7,10 @@ import { type Region, type StoreFileMeta, type StoreFileContext, -} from '/Users/alimd/repo/alwatr/store/packages/engine5/src/type.js'; +} from '@alwatr/store-types'; + +import {logger} from './logger.js'; + logger.logModule?.('collection-reference'); diff --git a/packages/store-reference/src/document-reference.ts b/packages/store-reference/src/document-reference.ts index 3e3c8adb..773b9909 100644 --- a/packages/store-reference/src/document-reference.ts +++ b/packages/store-reference/src/document-reference.ts @@ -1,15 +1,15 @@ import {flatString} from '@alwatr/flat-string'; import {createLogger} from '@alwatr/logger'; - -import {logger} from '/Users/alimd/repo/alwatr/store/packages/engine5/src/logger.js'; import { StoreFileType, - type DocumentContext, - type StoreFileMeta, StoreFileStat, StoreFileId, StoreFileExtension, -} from '/Users/alimd/repo/alwatr/store/packages/engine5/src/type.js'; + type DocumentContext, + type StoreFileMeta, +} from '@alwatr/store-types'; + +import {logger} from './logger.js'; logger.logModule?.('document-reference'); diff --git a/packages/store-reference/src/logger.ts b/packages/store-reference/src/logger.ts new file mode 100644 index 00000000..d7f76958 --- /dev/null +++ b/packages/store-reference/src/logger.ts @@ -0,0 +1,10 @@ +import {createLogger, definePackage} from '@alwatr/logger'; + +declare global { + // eslint-disable-next-line no-var + var __package_version: string; +} + +definePackage('store-reference', __package_version); + +export const logger = createLogger('store-reference'); diff --git a/packages/store-reference/src/main.ts b/packages/store-reference/src/main.ts new file mode 100644 index 00000000..84cea46c --- /dev/null +++ b/packages/store-reference/src/main.ts @@ -0,0 +1,2 @@ +export * from './collection-reference.js'; +export * from './document-reference.js'; diff --git a/packages/store-reference/tsconfig.1.json b/packages/store-reference/tsconfig.1.json new file mode 100644 index 00000000..58185341 --- /dev/null +++ b/packages/store-reference/tsconfig.1.json @@ -0,0 +1,10 @@ +{ + "extends": "@alwatr/tsconfig-base/tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "emitDeclarationOnly": true, + "composite": true, + }, + "include": ["src/**/*.ts"] +} diff --git a/packages/store-reference/tsconfig.json b/packages/store-reference/tsconfig.json new file mode 100644 index 00000000..58185341 --- /dev/null +++ b/packages/store-reference/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@alwatr/tsconfig-base/tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "emitDeclarationOnly": true, + "composite": true, + }, + "include": ["src/**/*.ts"] +} diff --git a/yarn.lock b/yarn.lock index a62713a6..9f408539 100644 --- a/yarn.lock +++ b/yarn.lock @@ -63,6 +63,13 @@ __metadata: languageName: node linkType: hard +"@alwatr/flat-string@npm:^1.0.9": + version: 1.0.9 + resolution: "@alwatr/flat-string@npm:1.0.9" + checksum: 3b05617358bed88d44be4ec541aff8d64f716ca10effa4f18d113342f7d83605594fbaddf7330dc937275f7757f77c47c86422c0ae5a3297bdbd37813e1f9458 + languageName: node + linkType: hard + "@alwatr/logger@npm:^2.4.1": version: 2.4.1 resolution: "@alwatr/logger@npm:2.4.1" @@ -174,7 +181,22 @@ __metadata: languageName: unknown linkType: soft -"@alwatr/store-types@workspace:packages/types": +"@alwatr/store-reference@workspace:packages/store-reference": + version: 0.0.0-use.local + resolution: "@alwatr/store-reference@workspace:packages/store-reference" + dependencies: + "@alwatr/flat-string": "npm:^1.0.9" + "@alwatr/logger": "npm:^2.4.1" + "@alwatr/nano-build": "npm:^1.2.1" + "@alwatr/prettier-config": "npm:^1.0.4" + "@alwatr/store-types": "workspace:^" + "@alwatr/tsconfig-base": "npm:^1.0.5" + "@types/node": "npm:^20.10.5" + typescript: "npm:^5.3.3" + languageName: unknown + linkType: soft + +"@alwatr/store-types@workspace:^, @alwatr/store-types@workspace:packages/types": version: 0.0.0-use.local resolution: "@alwatr/store-types@workspace:packages/types" dependencies: