@wrnrlr/prelude 0.2.4 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,32 @@
1
+ name: Prelude CI/CD
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - release
7
+
8
+ permissions:
9
+ contents: read
10
+ id-token: write
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: denoland/setup-deno@v2
18
+ with:
19
+ deno-version: v2.x
20
+ - run: deno install
21
+ # - name: Lint
22
+ # run: deno lint
23
+ - run: deno task test
24
+ publish-jsr:
25
+ needs: test
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: denoland/setup-deno@v2
30
+ with:
31
+ deno-version: v2.x
32
+ - run: deno publish --allow-slow-types --allow-dirty
@@ -0,0 +1,32 @@
1
+ name: Prelude CI/CD
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - release
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: denoland/setup-deno@v2
15
+ with:
16
+ deno-version: v2.x
17
+ - run: deno install
18
+ # - run: deno lint
19
+ - run: deno task test
20
+
21
+ # Moving artifacts, website and docs into their own project...
22
+ # - name: Setup Pages
23
+ # uses: actions/configure-pages@v5
24
+
25
+ # - name: Upload artifact
26
+ # uses: actions/upload-pages-artifact@v3
27
+ # with:
28
+ # path: './www/dist'
29
+
30
+ # - name: Deploy to GitHub Pages
31
+ # id: deployment
32
+ # uses: actions/deploy-pages@v4
@@ -0,0 +1,23 @@
1
+ # name: Prelude CI/CD
2
+
3
+ # on:
4
+ # push:
5
+ # branches:
6
+ # - release
7
+
8
+ # permissions:
9
+ # contents: read
10
+ # id-token: write
11
+
12
+ # jobs:
13
+ # publish-npm:
14
+ # runs-on: ubuntu-latest
15
+ # steps:
16
+ # - uses: actions/checkout@v4
17
+ # - uses: actions/setup-node@v4
18
+ # with:
19
+ # node-version: 20
20
+ # registry-url: 'https://registry.npmjs.org/'
21
+ # - run: npm publish
22
+ # env:
23
+ # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/deno.jsonc CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrnrlr/prelude",
3
- "version": "0.2.4",
3
+ "version": "0.2.14",
4
4
  "exports": "./src/mod.ts",
5
5
  "compilerOptions": {
6
6
  "strict": true,
@@ -11,18 +11,16 @@
11
11
  "@std/fs": "jsr:@std/fs@^1.0.5",
12
12
  "@std/path": "jsr:@std/path@^1.0.6",
13
13
  "@std/testing": "jsr:@std/testing@^0.225.3",
14
- "happy-dom": "npm:happy-dom@^17.1.0",
15
- "typedoc": "npm:typedoc@^0.26.6",
16
- "vite": "npm:vite@^5.4.9",
17
- "esbuild": "npm:esbuild@^0.24.0"
14
+ "happy-dom": "npm:happy-dom@^17.1.0"
18
15
  },
19
16
  "tasks": {
20
17
  "dev": "deno run -A npm:vite --config www/vite.config.js",
21
18
  "test": "deno test -A ./test/*.[jt]s",
22
- "release": "deno publish --allow-slow-types --allow-dirty && npm publish --access public"
19
+ "release": "git push origin main:release"
23
20
  },
24
21
  "lint": {
25
- "include": ["src"]
22
+ "include": ["src"],
23
+ "exclude": ["src/runtime.ts"]
26
24
  },
27
25
  "fmt": {
28
26
  "lineWidth": 120,
package/package.json CHANGED
@@ -1,14 +1,10 @@
1
1
  {
2
2
  "name": "@wrnrlr/prelude",
3
3
  "type": "module",
4
- "version": "0.2.4",
4
+ "version": "0.2.14",
5
5
  "author": "Werner Laurensse",
6
6
  "description": "A signal based frontend library with fine-grained reactivity",
7
7
  "main": "./src/mod.ts",
8
8
  "scripts": {},
9
- "dependencies": {
10
- "@codemirror/lang-html": "^6.4.9",
11
- "codemirror": "^6.0.1",
12
- "happy-dom": "^17.1.0"
13
- }
9
+ "dependencies": {}
14
10
  }
@@ -188,7 +188,7 @@ export function listArray<T, U extends Mountable>(
188
188
  return (mapped = temp);
189
189
  })
190
190
  }
191
- function newValueGetter(a:unknown) { console.log({a}); return newValue }
191
+ function newValueGetter() { return newValue }
192
192
  function changeBoth() {
193
193
  item!.index = i!
194
194
  item!.indexSetter?.(i)
package/src/resource.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @ts-nocheck:
2
- import {signal,effect,untrack,memo,batch,useContext,onCleanup} from './reactive.ts'
2
+ import {signal,effect,untrack,memo,batch,onCleanup} from './reactive.ts'
3
3
 
4
4
  const NO_INIT = {}
5
5
 
@@ -53,9 +53,9 @@ export function resource(pSource,pFetcher,pOptions) {
53
53
  }, false)
54
54
  }
55
55
 
56
- function read() {
57
- const v = value(),
58
- err = error();
56
+ function read(...a) {
57
+ const v = a.length===0 ? value() : value(a[0])
58
+ const err = error();
59
59
  if (err !== undefined && !pr) throw err;
60
60
  return v;
61
61
  }
package/test/list.js CHANGED
@@ -25,10 +25,10 @@ import { listArray } from '../src/controlflow.ts'
25
25
  // l(l => [3, ...l])
26
26
  // assertEquals(r(), [{e:3,i:0}, {e:0,i:1}, {e:1,i:2}, {e:2,i:3}])
27
27
  // })
28
- const l1 = signal(['a'])
29
- const r1 = listArray(l1, (e,i)=>([i(),e()]))
28
+ // const l1 = signal(['a'])
29
+ // const r1 = listArray(l1, (e,i)=>([i(),e()]))
30
30
  // r1()
31
- l1(l => ['x', ...l])
31
+ // l1(l => ['x', ...l])
32
32
  // l1(l => [...l, 'x', 'y'])
33
- console.log(JSON.stringify(r1()))
33
+ // console.log(JSON.stringify(r1()))
34
34
  // assertEquals(r(), )
package/test/reactive.js CHANGED
@@ -128,7 +128,6 @@ describe('wrap', ()=>{
128
128
  const obj = signal({todos:[{done:false,name:'a'}, {done:false,name:'b'}]}), todos = wrap(obj, 'todos'), todo = wrap(todos, 0),
129
129
  name = wrap(todo, 'name'), done = wrap(todo,'done')
130
130
  assertEquals(done(true),true)
131
- console.log('OBJ',obj())
132
131
  effect(()=>{
133
132
  name();done()
134
133
  })
@@ -1,58 +0,0 @@
1
- name: Publish
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- permissions:
9
- contents: read
10
- pages: write
11
- id-token: write
12
-
13
- jobs:
14
- publish:
15
- runs-on: ubuntu-latest
16
- environment:
17
- name: github-pages
18
- url: ${{ steps.deployment.outputs.page_url }}
19
- steps:
20
- - name: Check out the repository to the runner
21
- uses: actions/checkout@v4
22
-
23
- - name: Setup Deno
24
- uses: denoland/setup-deno@v2
25
- with:
26
- deno-version: v2.x
27
-
28
- - name: Deno install
29
- run: deno install
30
-
31
- # - name: Lint
32
- # run: deno lint
33
-
34
- - name: Run tests
35
- run: deno task test
36
-
37
- - name: Build
38
- run: deno task build
39
-
40
- # Moving artifacts, website and docs into their own project...
41
- # - name: Setup Pages
42
- # uses: actions/configure-pages@v5
43
-
44
- # - name: Upload artifact
45
- # uses: actions/upload-pages-artifact@v3
46
- # with:
47
- # path: './www/dist'
48
-
49
- # - name: Deploy to GitHub Pages
50
- # id: deployment
51
- # uses: actions/deploy-pages@v4
52
-
53
- # - name: Setup NPM
54
- # run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > /home/runner/.npmrc
55
- # env:
56
- # NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
57
- # - name: Run release script
58
- # run: /home/runner/.deno/bin/deno task release