Skip to content

Commit

Permalink
feat(nanolib): add nanolib package to export the common packages (#141
Browse files Browse the repository at this point in the history
)
  • Loading branch information
alimd authored Oct 1, 2024
2 parents cc1ea8b + 0e98a3e commit 9021bdb
Show file tree
Hide file tree
Showing 7 changed files with 1,018 additions and 222 deletions.
661 changes: 661 additions & 0 deletions packages/nanolib/LICENSE

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions packages/nanolib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ECMAScript Nano Libs

This repository contains numerous small utility packages. These packages serve various useful purposes and are written in nano ESModule without any dependencies.

## Sponsors

The following companies, organizations, and individuals support Nitrobase ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.

[![Exir Studio](https://avatars.githubusercontent.com/u/181194967?s=200&v=4)](https://exirstudio.com)

### Contributing

Contributions are welcome! Please read our [contribution guidelines](https://github.com/Alwatr/.github/blob/next/CONTRIBUTING.md) before submitting a pull request.

### License

This project is licensed under the [AGPL-3.0 License](LICENSE).
5 changes: 5 additions & 0 deletions packages/nanolib/demo/test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {createLogger} from '@alwatr/nanolib';

const logger = createLogger('logger/demo1');

logger.banner('Alwatr Logger Demo');
95 changes: 95 additions & 0 deletions packages/nanolib/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"name": "@alwatr/nanolib",
"version": "0.0.0",
"description": "Necessary library for all ECMAScript (JavaScript/TypeScript) projects.",
"author": "S. Ali Mihandoost <[email protected]>",
"keywords": [
"fs",
"file",
"filesystem",
"readFile",
"writeFile",
"readJson",
"writeJson",
"JSON",
"async",
"queue",
"cross-platform",
"ECMAScript",
"typescript",
"javascript",
"node",
"nodejs",
"esm",
"module",
"utility",
"util",
"utils",
"nanolib",
"alwatr"
],
"type": "module",
"main": "./dist/main.cjs",
"module": "./dist/main.mjs",
"types": "./dist/main.d.ts",
"exports": {
".": {
"types": "./dist/main.d.ts",
"import": "./dist/main.mjs",
"require": "./dist/main.cjs"
}
},
"license": "AGPL-3.0-only",
"files": [
"**/*.{js,mjs,cjs,map,d.ts,html,md}",
"!demo/**/*"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/Alwatr/nanolib",
"directory": "packages/nanolib"
},
"homepage": "https://github.com/Alwatr/nanolib/tree/next/packages/nanolib#readme",
"bugs": {
"url": "https://github.com/Alwatr/nanolib/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 && yarn node --enable-source-maps --trace-warnings",
"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"
},
"dependencies": {
"@alwatr/async-queue": "workspace:^",
"@alwatr/dedupe": "workspace:^",
"@alwatr/deep-clone": "workspace:^",
"@alwatr/delay": "workspace:^",
"@alwatr/fetch": "workspace:^",
"@alwatr/flat-string": "workspace:^",
"@alwatr/flatomise": "workspace:^",
"@alwatr/is-number": "workspace:^",
"@alwatr/local-storage": "workspace:^",
"@alwatr/logger": "workspace:^",
"@alwatr/package-tracer": "workspace:^",
"@alwatr/parse-duration": "workspace:^",
"@alwatr/platform-info": "workspace:^",
"@alwatr/render-state": "workspace:^"
},
"devDependencies": {
"@alwatr/nano-build": "workspace:^",
"@alwatr/tsconfig-base": "workspace:^",
"typescript": "^5.6.2"
}
}
17 changes: 17 additions & 0 deletions packages/nanolib/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export * from '@alwatr/async-queue';
export * from '@alwatr/dedupe';
export * from '@alwatr/deep-clone';
export * from '@alwatr/delay';
// export * from '@alwatr/exit-hook';
export * from '@alwatr/fetch';
export * from '@alwatr/flat-string';
export * from '@alwatr/flatomise';
export * from '@alwatr/is-number';
export * from '@alwatr/local-storage';
export * from '@alwatr/logger';
// export * from '@alwatr/node-fs';
export * from '@alwatr/package-tracer';
export * from '@alwatr/parse-duration';
export * from '@alwatr/platform-info';
export * from '@alwatr/render-state';
// export type * from '@alwatr/type-helper/types';
12 changes: 12 additions & 0 deletions packages/nanolib/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "@alwatr/tsconfig-base/tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"emitDeclarationOnly": true,
"composite": true,
"types": ["@alwatr/nano-build"],
},
"include": ["src/**/*.ts"],
"references": [],
}
Loading

0 comments on commit 9021bdb

Please sign in to comment.