Skip to content

Commit b775a20

Browse files
authored
Merge pull request #3 from solidjs/rahim
port over tests, fix builds, add missing APIs
2 parents 2b0654c + 2484acc commit b775a20

43 files changed

Lines changed: 3425 additions & 411 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎packages/solid-signals/.gitignore‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
node_modules/
22
dist/
3-
types/
3+
types/
4+
sandbox/
5+
.DS_STORE
2.76 KB
Loading
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<html>
2+
<head>
3+
<title>X-Reactivity Sandbox</title>
4+
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
8+
<link
9+
rel="icon"
10+
type="image/png"
11+
sizes="32x32"
12+
href="/sandbox/favicon-32x32.png"
13+
/>
14+
15+
<script type="module" src="/sandbox/main.ts"></script>
16+
</head>
17+
18+
<body>
19+
<h1>X-Reactivity Sandbox</h1>
20+
<p style="margin-top: 24px">
21+
Play with X-Reactivity in your browser, see the
22+
<code style="font-weight: bold">`sandbox`</code>
23+
directory. None of your changes will be commited (git-ignored folder).
24+
</p>
25+
</body>
26+
</html>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { execSync } from "child_process";
2+
import fs from "fs";
3+
import path from "path";
4+
5+
const SANDBOX_TEMPLATE = path.resolve(process.cwd(), ".sandbox"),
6+
SANDBOX_DIR = path.resolve(process.cwd(), "sandbox"),
7+
IGNORED_FILES = new Set(["launch.js"]);
8+
9+
// Copy files from .sandbox template directory to sandbox.
10+
if (!fs.existsSync(SANDBOX_DIR)) {
11+
fs.mkdirSync(SANDBOX_DIR);
12+
const files = fs.readdirSync(SANDBOX_TEMPLATE);
13+
for (const file of files) {
14+
if (IGNORED_FILES.has(file)) continue;
15+
const from = path.resolve(SANDBOX_TEMPLATE, file);
16+
const to = path.resolve(SANDBOX_DIR, file);
17+
fs.writeFileSync(to, fs.readFileSync(from, "utf-8"));
18+
}
19+
}
20+
21+
execSync("vite --open=/sandbox/index.html --port=3100 --host", {
22+
stdio: "inherit",
23+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { createSignal, createMemo, createEffect } from "../src";
2+
3+
// ...

‎packages/solid-signals/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# @solidjs/reactivity
22

3-
The start of something good.
3+
The start of something good.

‎packages/solid-signals/build.js‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎packages/solid-signals/example/basic.ts‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎packages/solid-signals/example/build.js‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎packages/solid-signals/package.json‎

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,45 @@
22
"name": "@solidjs/reactivity",
33
"version": "0.0.8",
44
"description": "",
5+
"license": "ISC",
56
"type": "module",
6-
"main": "dist/index.cjs",
7-
"module": "dist/index.js",
8-
"types": "dist/index.d.ts",
7+
"main": "dist/node.cjs",
8+
"module": "dist/prod.js",
9+
"types": "dist/types/index.d.ts",
910
"publishConfig": {
1011
"access": "public"
1112
},
1213
"files": [
1314
"dist"
1415
],
1516
"scripts": {
16-
"build": "pnpm build:types && node build.js",
17-
"build:types": "tsc",
18-
"example": "node ./example/build.js | node",
19-
"test": "vitest",
20-
"coverage": "vitest run --coverage"
17+
"build": "rimraf dist && tsup && pnpm types",
18+
"types": "tsc -p tsconfig.build.json",
19+
"format": "prettier src --write --loglevel warn",
20+
"sandbox": "node ./.sandbox/launch.js",
21+
"test": "vitest run",
22+
"test:watch": "vitest watch tests",
23+
"test:gc": "node --expose-gc ./vitest.js",
24+
"test:gc:watch": "node --expose-gc ./vitest.js --watch",
25+
"test:coverage": "vitest run --coverage"
2126
},
22-
"keywords": [],
23-
"author": "",
24-
"license": "ISC",
2527
"devDependencies": {
26-
"esbuild-plugin-replace": "^1.3.0",
27-
"esbuild": "^0.16.3",
28+
"@types/node": "^18.14.1",
29+
"rimraf": "^4.1.2",
30+
"tsup": "^6.6.3",
2831
"typescript": "4.9.4",
29-
"vitest": "^0.26.2"
32+
"vite": "^4.1.4",
33+
"vitest": "^0.29.1"
34+
},
35+
"exports": {
36+
".": {
37+
"types": "./dist/types/index.d.ts",
38+
"import": {
39+
"test": "./dist/dev.js",
40+
"development": "./dist/dev.js",
41+
"default": "./dist/prod.js"
42+
},
43+
"require": "./dist/node.cjs"
44+
}
3045
}
3146
}

0 commit comments

Comments
 (0)