Skip to content

Commit

Permalink
feat(reference): package structure
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm authored and alimd committed Dec 26, 2023
1 parent 13303b5 commit 070ba0e
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 9 deletions.
5 changes: 5 additions & 0 deletions packages/store-reference/README.md
Original file line number Diff line number Diff line change
@@ -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)
72 changes: 72 additions & 0 deletions packages/store-reference/package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"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"
}
}
7 changes: 4 additions & 3 deletions packages/store-reference/src/collection-reference.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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');

Expand Down
10 changes: 5 additions & 5 deletions packages/store-reference/src/document-reference.ts
Original file line number Diff line number Diff line change
@@ -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');

Expand Down
10 changes: 10 additions & 0 deletions packages/store-reference/src/logger.ts
Original file line number Diff line number Diff line change
@@ -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');
2 changes: 2 additions & 0 deletions packages/store-reference/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './collection-reference.js';
export * from './document-reference.js';
10 changes: 10 additions & 0 deletions packages/store-reference/tsconfig.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "@alwatr/tsconfig-base/tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"emitDeclarationOnly": true,
"composite": true,
},
"include": ["src/**/*.ts"]
}
10 changes: 10 additions & 0 deletions packages/store-reference/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "@alwatr/tsconfig-base/tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"emitDeclarationOnly": true,
"composite": true,
},
"include": ["src/**/*.ts"]
}
24 changes: 23 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 070ba0e

Please sign in to comment.