Skip to content

Commit

Permalink
chore(alien-signals): setup @coaction/alien-signals
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Jan 25, 2025
1 parent d3c65b1 commit 62d5eb1
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/coaction-alien-signals/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# @coaction/alien-signals

![Node CI](https://github.com/unadlib/coaction/workflows/Node%20CI/badge.svg)
[![npm](https://img.shields.io/npm/v/@coaction/alien-signals.svg)](https://www.npmjs.com/package/@coaction/alien-signals)
![license](https://img.shields.io/npm/l/@coaction/alien-signals)

A Coaction integration tool for alien-signals

## Installation

You can install it via npm, yarn or pnpm.

```sh
npm install coaction @coaction/alien-signals
```

## Usage

```jsx
import { create } from '@coaction/alien-signals';

const useStore = create((set) => ({
count: 0,
get double() {
return this.count * 2;
},
increment: () => set((state) => state.count++)
}));
```
Binary file added packages/coaction-alien-signals/benchmark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/coaction-alien-signals/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src';
86 changes: 86 additions & 0 deletions packages/coaction-alien-signals/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"name": "@coaction/alien-signals",
"version": "0.1.5",
"description": "A Coaction integration tool for alien-signals",
"keywords": [
"state",
"coaction",
"alien-signals"
],
"authors": [
"Michael Lin <[email protected]> (https://github.com/unadlib)"
],
"homepage": "https://github.com/unadlib/coaction/tree/main/packages/coaction-alien-signals#readme",
"license": "MIT",
"main": "dist/coaction-alien-signals.cjs.js",
"module": "dist/coaction-alien-signals.esm.js",
"umd:main": "dist/coaction-alien-signals.umd.min.js",
"exports": {
".": {
"types": {
"import": "./dist/coaction-alien-signals.cjs.mjs",
"default": "./dist/coaction-alien-signals.cjs.js"
},
"module": "./dist/coaction-alien-signals.esm.js",
"import": "./dist/coaction-alien-signals.cjs.mjs",
"default": "./dist/coaction-alien-signals.cjs.js"
},
"./package.json": "./package.json"
},
"types": "dist/coaction-alien-signals.cjs.d.ts",
"sideEffects": false,
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/unadlib/coaction.git"
},
"scripts": {},
"bugs": {
"url": "https://github.com/unadlib/coaction/issues"
},
"preconstruct": {
"umdName": "CoactionAlienSignals",
"entrypoints": [
"./index.ts"
]
},
"peerDependencies": {
"alien-signals": "^1.0.1",
"coaction": "^0.1.5",
"mutative": "^1.1.0",
"react": "^17.0.0 || ^18.0.0 || ^19.0.0"
},
"peerDependenciesMeta": {
"coaction": {
"optional": true
},
"alien-signals": {
"optional": true
},
"mutative": {
"optional": true
},
"react": {
"optional": true
}
},
"devDependencies": {
"@testing-library/react": "^14.2.1",
"@types/jsdom": "^12.2.3",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.0",
"@types/use-sync-external-store": "^0.0.6",
"alien-signals": "^1.0.1",
"coaction": "^0.1.5",
"jsdom": "^25.0.1",
"jsdom-global": "^3.0.2",
"mutative": "^1.1.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"dependencies": {
"mutability": "^1.1.1"
}
}
1 change: 1 addition & 0 deletions packages/coaction-alien-signals/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//
6 changes: 6 additions & 0 deletions packages/coaction-alien-signals/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
test('alien-signals', () => {
// const store = create((set) => ({
// count: 0,
// increment: () => set((state) => state.count++)
// }));
});
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3028,6 +3028,11 @@ ajv@^8.11.0:
require-from-string "^2.0.2"
uri-js "^4.4.1"

alien-signals@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/alien-signals/-/alien-signals-1.0.1.tgz#2de3b216e52e28db44efb42c1941a09a025ec7d7"
integrity sha512-oOo4M4xdTUCFK2oG2shusk7FR4hmpg0OJGlGEeLwQYctoJ+6UWOpHtU6Y6rBuFUaR34mgLpakcCFKeGFaoeJ0A==

ansi-colors@^3.0.0:
version "3.2.4"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf"
Expand Down

0 comments on commit 62d5eb1

Please sign in to comment.