Skip to content

Commit f312a0c

Browse files
committed
Refactor build configuration and package details
- Update package name from "@starfederation/datastar-sdk" to "datastar-sdk". - Change repository and issue URLs to point to the new GitHub repository. - Adjust build entry points and output directory. - Update version in consts.ts to "1.0.0-RC.1". - Modify test imports to use the main JS bundle for consistency across environments. - Update Node.js version in GitHub Actions workflow to 23. This removes the need to build the node test file and simplifies things.
1 parent cdf72cc commit f312a0c

File tree

9 files changed

+34
-143
lines changed

9 files changed

+34
-143
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Install Node.js
2929
uses: actions/setup-node@v4
3030
with:
31-
node-version: '20'
31+
node-version: '23'
3232

3333
- name: Run all tests
3434
run: bash test/run-all.sh

build.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ await emptyDir("./npm");
77
await build({
88
entryPoints: [
99
"./src/node/serverSentEventGenerator.ts",
10-
"./src/web/serverSentEventGenerator.ts",
11-
"./test/node.ts",
10+
"./src/web/serverSentEventGenerator.ts"
1211
],
1312
outDir: "./npm",
1413
shims: {
@@ -17,16 +16,16 @@ await build({
1716
},
1817
package: {
1918
// package.json properties
20-
name: "@starfederation/datastar-sdk",
19+
name: "datastar-sdk",
2120
version: Deno.args[0] || VERSION,
2221
description: "Cross-runtime Javascript SDK for Datastar",
2322
license: "MIT",
2423
repository: {
2524
type: "git",
26-
url: "git+https://github.com/starfederation/datastar.git",
25+
url: "git+https://github.com/starfederation/datastar-typescript.git",
2726
},
2827
bugs: {
29-
url: "https://github.com/starfederation/datastar/issues",
28+
url: "https://github.com/starfederation/datastar-typescript/issues",
3029
},
3130
exports: {
3231
"./abstractServerSentEventGenerator": {

package-lock.json

Lines changed: 15 additions & 125 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@starfederation/datastar-sdk",
2+
"name": "datastar-sdk",
33
"version": "1.0.0-RC.1",
44
"description": "TypeScript SDK for Datastar",
55
"scripts": {
@@ -9,14 +9,17 @@
99
"type": "module",
1010
"repository": {
1111
"type": "git",
12-
"url": "git+https://github.com/starfederation/datastar.git"
12+
"url": "git+https://github.com/starfederation/datastar-typescript.git"
1313
},
1414
"author": "Patrick Marchand",
15+
"contributors": [
16+
"Edu Wass"
17+
],
1518
"license": "MIT",
1619
"bugs": {
17-
"url": "https://github.com/starfederation/datastar/issues"
20+
"url": "https://github.com/starfederation/datastar-typescript/issues"
1821
},
19-
"homepage": "https://github.com/starfederation/datastar#readme",
22+
"homepage": "https://github.com/starfederation/datastar-typescript#readme",
2023
"files": [
2124
"npm/script/src/",
2225
"npm/script/package.json",
@@ -26,9 +29,8 @@
2629
"npm/README.md",
2730
"README.md"
2831
],
29-
"dependencies": {},
3032
"devDependencies": {
31-
"typescript": "~5.6.2",
32-
"@types/node": "^22.10.2"
33+
"@types/node": "^22.10.2",
34+
"typescript": "~5.6.2"
3335
}
3436
}

src/consts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
export const DATASTAR = "datastar" as const;
44
export const DATASTAR_REQUEST = "Datastar-Request";
5-
export const VERSION = "1.0.0-RC.12";
5+
export const VERSION = "1.0.0-RC.1";
66

77
// #region Defaults
88

test/bun.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ServerSentEventGenerator } from "../src/web/serverSentEventGenerator";
1+
import { ServerSentEventGenerator } from "../npm/esm/web/serverSentEventGenerator.js";
22

33
// This server is used for testing the Bun web standard based sdk
44
const server = Bun.serve({

test/deno.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { serve } from "https://deno.land/[email protected]/http/server.ts";
2-
import { ServerSentEventGenerator } from "../src/web/serverSentEventGenerator.ts";
2+
import { ServerSentEventGenerator } from "../npm/esm/web/serverSentEventGenerator.js";
33
import type { Jsonifiable } from "../src/types.ts";
44

55
// This server is used for testing the web standard based sdk

test/node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createServer } from "node:http";
2-
import { ServerSentEventGenerator } from "../src/node/serverSentEventGenerator.ts";
2+
import { ServerSentEventGenerator } from "../npm/esm/node/serverSentEventGenerator.js";
33
import type { Jsonifiable } from "../src/types.ts";
44

55
const hostname = "127.0.0.1";

test/run-all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ deno run -A build.ts
2828
# Start servers and run tests
2929

3030
declare -A servers
31-
servers[node]="node npm/esm/test/node.js"
31+
servers[node]="node test/node.ts"
3232
servers[bun]="bun run test/bun.ts"
3333
servers[deno]="deno run --allow-net test/deno.ts"
3434
declare -A ports

0 commit comments

Comments
 (0)