Skip to content

refactor: refactor source to mono repo #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
run: pnpm install

- name: Build
run: pnpm build
run: pnpm core:build

- name: Typecheck
run: pnpm typecheck
Expand All @@ -72,7 +72,7 @@ jobs:
run: pnpm install

- name: Build
run: pnpm build
run: pnpm core:build

- name: Test
run: pnpm test
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- run: pnpm run publish
- name: Publish
run: node scripts/publish.js
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
2 changes: 1 addition & 1 deletion docs/.vitepress/plugins/contributors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const ID = '/virtual-contributors'

export function Contributors(data: Record<string, any[]>): Plugin {
return {
name: 'vueusjs-utils-contributors',
name: 'js-utils-contributors',
resolveId(id) {
return id === ID ? ID : null
},
Expand Down
4 changes: 1 addition & 3 deletions docs/.vitepress/plugins/markdownTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ export function MarkdownTransform(): Plugin {
}
}

const GITHUB_BLOB_URL = 'https://github.com/agiletech-web-dev/js-utils-es/blob/main/src';
const GITHUB_BLOB_URL = 'https://github.com/agiletech-web-dev/js-utils-es/blob/main/packages/core/src';
const GITHUB_BLOB_DOCS_URL = 'https://github.com/agiletech-web-dev/js-utils-es/blob/main/docs/reference';
// https://github.com/agiletech-web-dev/js-utils-es/blob/main/src/array/chunk.ts
// https://github.com/agiletech-web-dev/js-utils-es/blob/main/docs/reference/array/chunk.md

export async function getFunctionMarkdown(pkg: string, name: string) {
const fileNameTs = name.replace('.md', '.ts');
Expand Down
12 changes: 5 additions & 7 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "docs",
"name": "@js-utils-es/docs",
"type": "module",
"version": "0.0.0",
"private": true,
Expand All @@ -8,19 +8,17 @@
"build": "vitepress build",
"preview": "vitepress preview"
},
"dependencies": {
"@shikijs/transformers": "^1.10.3",
"js-utils-es": "workspace:*",
"prettier": "^3.3.2",
"shiki": "^1.10.3"
},
"devDependencies": {
"@nolebase/vitepress-plugin-enhanced-mark": "^2.2.1",
"@nolebase/vitepress-plugin-enhanced-readabilities": "^2.2.1",
"@nolebase/vitepress-plugin-highlight-targeted-heading": "^2.2.1",
"@shikijs/transformers": "^1.10.3",
"@shikijs/vitepress-twoslash": "^1.10.3",
"@vitejs/plugin-vue-jsx": "^4.0.0",
"js-utils-es": "workspace:*",
"prettier": "^3.3.2",
"sharp": "^0.33.4",
"shiki": "^1.10.3",
"unocss": "^0.61.3",
"vite": "^5.3.3",
"vitepress": "^1.3.0",
Expand Down
217 changes: 14 additions & 203 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,211 +1,21 @@
{
"name": "js-utils-es",
"type": "module",
"version": "1.0.8",
"packageManager": "[email protected]",
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
"license": "MIT",
"homepage": "https://js-utils-es.vercel.app",
"repository": {
"type": "git",
"url": "https://github.com/agiletech-web-dev/js-utils-es.git"
},
"bugs": "https://github.com/agiletech-web-dev/js-utils-es/issues",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./array": {
"import": {
"types": "./dist/array/index.d.mts",
"default": "./dist/array/index.mjs"
},
"require": {
"types": "./dist/array/index.d.ts",
"default": "./dist/array/index.js"
}
},
"./function": {
"import": {
"types": "./dist/function/index.d.mts",
"default": "./dist/function/index.mjs"
},
"require": {
"types": "./dist/function/index.d.ts",
"default": "./dist/function/index.js"
}
},
"./math": {
"import": {
"types": "./dist/math/index.d.mts",
"default": "./dist/math/index.mjs"
},
"require": {
"types": "./dist/math/index.d.ts",
"default": "./dist/math/index.js"
}
},
"./object": {
"import": {
"types": "./dist/object/index.d.mts",
"default": "./dist/object/index.mjs"
},
"require": {
"types": "./dist/object/index.d.ts",
"default": "./dist/object/index.js"
}
},
"./predicate": {
"import": {
"types": "./dist/predicate/index.d.mts",
"default": "./dist/predicate/index.mjs"
},
"require": {
"types": "./dist/predicate/index.d.ts",
"default": "./dist/predicate/index.js"
}
},
"./promise": {
"import": {
"types": "./dist/promise/index.d.mts",
"default": "./dist/promise/index.mjs"
},
"require": {
"types": "./dist/promise/index.d.ts",
"default": "./dist/promise/index.js"
}
},
"./string": {
"import": {
"types": "./dist/string/index.d.mts",
"default": "./dist/string/index.mjs"
},
"require": {
"types": "./dist/string/index.d.ts",
"default": "./dist/string/index.js"
}
},
"./package.json": "./package.json"
},
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"*.d.ts",
"dist"
],
"publishConfig": {
"access": "public",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./array": {
"import": {
"types": "./dist/array/index.d.mts",
"default": "./dist/array/index.mjs"
},
"require": {
"types": "./dist/array/index.d.ts",
"default": "./dist/array/index.js"
}
},
"./function": {
"import": {
"types": "./dist/function/index.d.mts",
"default": "./dist/function/index.mjs"
},
"require": {
"types": "./dist/function/index.d.ts",
"default": "./dist/function/index.js"
}
},
"./math": {
"import": {
"types": "./dist/math/index.d.mts",
"default": "./dist/math/index.mjs"
},
"require": {
"types": "./dist/math/index.d.ts",
"default": "./dist/math/index.js"
}
},
"./object": {
"import": {
"types": "./dist/object/index.d.mts",
"default": "./dist/object/index.mjs"
},
"require": {
"types": "./dist/object/index.d.ts",
"default": "./dist/object/index.js"
}
},
"./predicate": {
"import": {
"types": "./dist/predicate/index.d.mts",
"default": "./dist/predicate/index.mjs"
},
"require": {
"types": "./dist/predicate/index.d.ts",
"default": "./dist/predicate/index.js"
}
},
"./promise": {
"import": {
"types": "./dist/promise/index.d.mts",
"default": "./dist/promise/index.mjs"
},
"require": {
"types": "./dist/promise/index.d.ts",
"default": "./dist/promise/index.js"
}
},
"./string": {
"import": {
"types": "./dist/string/index.d.mts",
"default": "./dist/string/index.mjs"
},
"require": {
"types": "./dist/string/index.d.ts",
"default": "./dist/string/index.js"
}
},
"./package.json": "./package.json"
}
},
"packageManager": "[email protected]",
"scripts": {
"build": "tsup && ./scripts/postbuild.sh",
"test": "vitest run --typecheck",
"bench": "vitest bench",
"core:build": "pnpm --filter js-utils-es... build",
"verify-commit": "verify-commit-msg",
"lint": "eslint .",
"lint-fix": "eslint . --fix",
"format": "prettier --write .",
"release": "bumpp package.json packages/*/package.json --all",
"bench": "vitest bench",
"test": "vitest",
"prepare": "git-scm-hooks",
"prepublishOnly": "npm run build",
"release": "bumpp --commit --push --tag",
"docs:dev": "pnpm run -C ./docs dev",
"docs:preview": "pnpm run -C ./docs preview",
"docs:build": "pnpm run -C ./docs build",
"verify-commit": "verify-commit-msg",
"gen-changelog": "esno ./scripts/genFuncUtils.ts && esno ./scripts/changelog.ts",
"typecheck": "tsc --noEmit"
"docs:dev": "pnpm --parallel --filter docs... dev",
"docs:build": "pnpm --filter docs... build",
"docs:preview": "pnpm -C docs preview",
"typecheck": "pnpm -r --filter js-utils-es typecheck",
"gen-changelog": "esno ./scripts/genFuncUtils.ts && esno ./scripts/changelog.ts"
},
"devDependencies": {
"@antfu/eslint-config": "^2.22.0",
Expand All @@ -221,7 +31,8 @@
"tsup": "^8.1.0",
"typescript": "^5.4.5",
"verify-commit-msg": "^0.0.10",
"vitest": "^1.5.2"
"vitest": "^1.5.2",
"zx": "^8.1.4"
},
"git-hooks": {
"pre-commit": "npm run lint",
Expand Down
19 changes: 19 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# js-utils-es

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

Documentation is available at [https://js-utils-es.vercel.app](https://js-utils-es.vercel.app).

## Installation

```sh
npm install js-utils-es
```

## Development

- Clone this repository
- Install latest LTS version of [Node.js](https://nodejs.org/en/)
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
- Install dependencies using `pnpm install`
- Run interactive tests using `pnpm dev`
Loading