Skip to content

Commit

Permalink
feat(sdk): support cjs build
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm authored and AliMD committed Dec 25, 2023
1 parent 87970d4 commit 14572df
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 82 deletions.
45 changes: 0 additions & 45 deletions packages/sdk/esbuild.mjs

This file was deleted.

60 changes: 32 additions & 28 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,71 @@
"name": "@alwatr/storage-sdk",
"version": "4.0.4",
"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 <ali.mihandoost@gmail.com>",
"keywords": [
"database",
"storage",
"store",
"json",
"nosql",
"no-sql",
"data",
"data-storage",
"data-store",
"file",
"typescript",
"esm",
"alwatr"
],
"main": "storage-sdk.js",
"type": "module",
"types": "storage-sdk.d.ts",
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com> (https://ali.mihandoost.com)",
"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": [
"**/*.{d.ts.map,d.ts,js.map,js,html,md}"
"**/*.{js,mjs,cjs,map,d.ts,html,md}",
"!demo/**/*"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/Alwatr/storage",
"url": "https://github.com/Alwatr/store",
"directory": "packages/sdk"
},
"homepage": "https://github.com/Alwatr/storage/tree/next/packages/sdk#readme",
"homepage": "https://github.com/Alwatr/store/tree/next/packages/sdk#readme",
"bugs": {
"url": "https://github.com/Alwatr/storage/issues"
},
"esbuild": {
"entryPoints": [
"src/**/*.ts"
],
"outbase": "src",
"outdir": ".",
"minify": false,
"bundle": false,
"treeShaking": false,
"sourcemap": true,
"sourcesContent": true
"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": "run-s clean build",
"build": "run-p -l 'build:*'",
"build:es": "yarn node ./esbuild.mjs",
"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",
"clean": "rm -rfv *.js *.d.ts *.d.ts.map *.js.map .tsbuildinfo",
"watch:es": "yarn run build --watch"
"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"
},
"dependencies": {
"@alwatr/fetch": "^2.2.1",
"@alwatr/logger": "^2.4.1",
"tslib": "^2.6.2"
"@alwatr/logger": "^2.4.1"
},
"devDependencies": {
"@alwatr/nano-build": "^1.2.1",
"@alwatr/prettier-config": "^1.0.4",
"@alwatr/tsconfig-base": "^1.0.5",
"@alwatr/type": "^1.2.4",
"@alwatr/util": "^1.4.1",
"@types/node": "^20.10.5",
Expand Down
File renamed without changes.
12 changes: 4 additions & 8 deletions packages/sdk/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
"extends": "../../tsconfig.base",
"extends": "@alwatr/tsconfig-base/tsconfig.json",
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": ".tsbuildinfo",
"rootDir": "src",
"outDir": ".",
"outDir": "dist",
"emitDeclarationOnly": true,
"composite": true,
},

"include": ["src/**/*.ts"],
"exclude": [],
"references": []
"include": ["src/**/*.ts"]
}
4 changes: 3 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,14 @@ __metadata:
dependencies:
"@alwatr/fetch": "npm:^2.2.1"
"@alwatr/logger": "npm:^2.4.1"
"@alwatr/nano-build": "npm:^1.2.1"
"@alwatr/prettier-config": "npm:^1.0.4"
"@alwatr/tsconfig-base": "npm:^1.0.5"
"@alwatr/type": "npm:^1.2.4"
"@alwatr/util": "npm:^1.4.1"
"@types/node": "npm:^20.10.5"
esbuild: "npm:^0.19.10"
npm-run-all: "npm:^4.1.5"
tslib: "npm:^2.6.2"
typescript: "npm:^5.3.3"
languageName: unknown
linkType: soft
Expand Down

0 comments on commit 14572df

Please sign in to comment.