-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
10,972 additions
and
1,595 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: build | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
cache: npm | ||
|
||
- name: Install dependencies 📦 | ||
run: npm ci | ||
|
||
- name: Lint 🧹 | ||
run: | | ||
npm run lint | ||
npm run ts-check | ||
- name: Build 🔧 | ||
run: npm run build | ||
|
||
- name: Test 🧪 | ||
run: npm run test:ci | ||
|
||
- name: Coveralls 🎉 | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build Docs 📖 | ||
run: npm run docs | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
on: ["pull_request"] | ||
|
||
name: Build and Test PR | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
cache: npm | ||
|
||
- name: Install dependencies 📦 | ||
run: npm ci | ||
|
||
- name: Lint 🧹 | ||
run: | | ||
npm run lint | ||
npm run ts-check | ||
- name: Build 🔧 | ||
run: npm run build | ||
|
||
- name: Test 🧪 | ||
run: npm run test:ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Node.js Package | ||
|
||
on: | ||
push: | ||
tags: "v**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
registry-url: "https://registry.npmjs.org" | ||
cache: npm | ||
|
||
- name: Install dependencies 📦 | ||
run: npm install | ||
|
||
- name: Build 🔧 | ||
run: npm run build | ||
|
||
- name: Publish Package 🚀 | ||
run: npm publish --provenance --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,28 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"cSpell.enabled": true, | ||
"eslint.enable": true, | ||
"prettier.enable": true, | ||
"conventionalCommits.gitmoji": false, | ||
"conventionalCommits.promptFooter": false, | ||
"editor.tabSize": 2, | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": true, | ||
"source.addMissingImports": true | ||
}, | ||
"eslint.validate": ["javascript", "javascriptreact", "html", "vue", "svelte"], | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"[html]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[css]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[scss]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[json]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
"source.fixAll": "explicit", | ||
"source.addMissingImports": "explicit", | ||
"source.organizeImports": "never" | ||
}, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"[javascript]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[svelte]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "svelte.svelte-vscode" | ||
"[javascriptreact]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[typescript]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[markdown]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[yaml]": { | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,36 @@ | ||
# @wopjs/template | ||
# [value-enhancer](https://github.com/crimx/value-enhancer) | ||
|
||
[![Docs](https://www.paka.dev/badges/v0/cute.svg)](https://www.paka.dev/npm/@wopjs/template) | ||
<p align="center"> | ||
<img width="200" src="https://raw.githubusercontent.com/crimx/value-enhancer/main/assets/value-enhancer.svg"> | ||
</p> | ||
|
||
Collection of common utilities. | ||
[![Docs](https://img.shields.io/badge/Docs-read-%23fdf9f5)](https://crimx.github.io/value-enhancer) | ||
[![Build Status](https://github.com/crimx/value-enhancer/actions/workflows/build.yml/badge.svg)](https://github.com/crimx/value-enhancer/actions/workflows/build.yml) | ||
[![npm-version](https://img.shields.io/npm/v/value-enhancer.svg)](https://www.npmjs.com/package/value-enhancer) | ||
[![Coverage Status](https://img.shields.io/coverallsCoverage/github/crimx/value-enhancer)](https://coveralls.io/github/crimx/value-enhancer) | ||
[![minified-size](https://img.shields.io/bundlephobia/minzip/value-enhancer)](https://bundlephobia.com/package/value-enhancer) | ||
|
||
## Install | ||
Enhance value with plain and explicit reactive wrapper. Think of it as hook-style signals. | ||
|
||
``` | ||
npm add @wopjs/template | ||
``` | ||
Docs: <https://value-enhancer.js.org> | ||
|
||
## Features | ||
|
||
## License | ||
- Plain reactivity. | ||
Without the implicit-cast Proxy magic like Vue Reactivity and MobX. | ||
- Single-layer shallow reactivity. | ||
It does not convert the value with `Object.defineProperty` nor `Proxy`. Keeping everything as plain JavaScript value makes it easier to work with other libraries and easier for the JavaScript engine to optimize. | ||
- Safe and fast lazy computation. | ||
It solves multi-level derivation issue (like in [Svelte Stores](<(https://svelte.dev/repl/6218ae0ecf5c455195b4a76d7f0cff9f?version=3.49.0)>)) with smart lazy value evaluation. | ||
- Weak side effects. | ||
`Val`s are managed with `FinalizationRegistry` and `WeakRef` which means you can create and access derived `Val.value` without worrying about memory leaks. Disposers returned by subscriptions can also be easily managed with libraries like [`@wopjs/disposable`](https://github.com/wopjs/disposable). | ||
- Explicit. | ||
Reactive objects are easy to tell since their types are different from normal objects. Subscription also requires explicit dependency declaration which reduce the work of repetitive dynamic dependency collection in Proxy/Signal implementations. | ||
- Simple DX. | ||
Designed with ergonomics in mind. No hidden rules for getting or setting values. What you see is what you get. | ||
|
||
MIT @ [wopjs](https://github.com/wopjs) | ||
## Install | ||
|
||
```bash | ||
npm add value-enhancer | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.tsd-hierarchy { | ||
display: none; | ||
} | ||
|
||
@media (min-width: 1025px) { | ||
.tsd-index-group { | ||
display: none; | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import jsEslint from "@eslint/js"; | ||
import gitignore from "eslint-config-flat-gitignore"; | ||
import eslintConfigPrettier from "eslint-config-prettier"; | ||
import importX from "eslint-plugin-import-x"; | ||
import perfectionist from "eslint-plugin-perfectionist"; | ||
import tsEslint from "typescript-eslint"; | ||
|
||
export default tsEslint.config( | ||
jsEslint.configs.recommended, | ||
...tsEslint.configs.recommended, | ||
eslintConfigPrettier, | ||
importX.flatConfigs.recommended, | ||
perfectionist.configs["recommended-natural"], | ||
gitignore(), | ||
{ | ||
languageOptions: { | ||
ecmaVersion: "latest", | ||
globals: { | ||
console: true, | ||
process: true, | ||
}, | ||
sourceType: "module", | ||
}, | ||
rules: { | ||
"prefer-const": "off", | ||
"sort-imports": "off", | ||
}, | ||
}, | ||
{ | ||
rules: { | ||
"import-x/consistent-type-specifier-style": ["error", "prefer-inline"], | ||
"import-x/no-duplicates": ["error", { considerQueryString: true, "prefer-inline": true }], | ||
"import-x/no-unresolved": "off", | ||
"import-x/order": "off", | ||
"perfectionist/sort-imports": [ | ||
"error", | ||
{ | ||
groups: [ | ||
"side-effect-style", | ||
"style", | ||
["builtin-type", "external-type", "internal-type", "parent-type", "sibling-type", "index-type"], | ||
["builtin", "external"], | ||
["internal", "parent", "sibling", "index"], | ||
"object", | ||
"unknown", | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"], | ||
languageOptions: { | ||
parser: tsEslint.parser, | ||
}, | ||
plugins: { | ||
"@typescript-eslint": tsEslint.plugin, | ||
}, | ||
rules: { | ||
"@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }], | ||
"@typescript-eslint/no-empty-interface": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/no-unused-expressions": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
argsIgnorePattern: "^_", | ||
destructuredArrayIgnorePattern: "^_", | ||
ignoreRestSiblings: true, | ||
varsIgnorePattern: "^_", | ||
}, | ||
], | ||
}, | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Oops, something went wrong.