@stonyx/rest-server 0.2.1-alpha.37 → 0.2.1-alpha.38

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.
Files changed (2) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -27,8 +27,8 @@ There are no subpath exports.
27
27
 
28
28
  The request classes in [`test/sample/requests/`](https://github.com/abofs/stonyx-rest-server/tree/dev/test/sample/requests) are the canonical usage reference. They import only `@stonyx/rest-server`, `node:` built-ins and each other, so you can copy them into your app's `requests/` directory:
29
29
 
30
- * **As TypeScript:** copy them unchanged. `stonyx serve` runs them with Node's type stripping, which loads a relative import only by its real file name, so `accounts.ts` imports `./base/api-request.ts`, not `.js`. For `tsc` to accept that specifier, set `"rewriteRelativeImportExtensions": true` in your `tsconfig.json` (TypeScript 5.7+); the `stonyx new` tsconfig does not set it, and reports `TS5097` without it.
31
- * **As JavaScript:** delete the type annotations, rename each file to `.js`, and change the `.ts` in that relative import to `.js`.
30
+ * **As TypeScript:** copy them unchanged. `stonyx serve` runs them with Node's type stripping, which loads a relative import only by its real file name, so `accounts.ts` imports `./base/api-request.ts`, not `.js`. For `tsc` to accept that specifier, set `"rewriteRelativeImportExtensions": true` and `"noEmit": true` in your `tsconfig.json` (TypeScript 5.7+); the `stonyx new` tsconfig sets neither, and reports `TS5097` without the first. `noEmit` matters because the scaffold's `build` script compiles into the app directory: route discovery loads a `.js` left beside a `.ts` as well, and that stale copy keeps answering after you edit the `.ts`. `stonyx serve` runs the `.ts` files, so `pnpm build` then only type-checks. If you have built before, delete the `.js` files in `requests/`.
31
+ * **As JavaScript:** remove all TypeScript-only syntax (annotations, `interface`, `import type` and inline `type` imports, `!` assertions; `stripTypeScriptTypes` from `node:module` does this), rename each file to `.js`, and change the `.ts` in that relative import to `.js`.
32
32
 
33
33
  [`test/integration/sample-patterns-test.ts`](https://github.com/abofs/stonyx-rest-server/blob/dev/test/integration/sample-patterns-test.ts) exercises each one over HTTP. [`test/unit/sample-imports-test.ts`](https://github.com/abofs/stonyx-rest-server/blob/dev/test/unit/sample-imports-test.ts) fails if a sample imports anything other than `@stonyx/rest-server`, a `node:` built-in, or another sample file that exists under the exact name imported. The suite itself runs under tsx, which would load a `.js` specifier from a `.ts` file, so that check is what keeps the TypeScript copy loadable by `stonyx serve`. The samples are not included in the npm package.
34
34
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "stonyx-async",
5
5
  "stonyx-module"
6
6
  ],
7
- "version": "0.2.1-alpha.37",
7
+ "version": "0.2.1-alpha.38",
8
8
  "description": "Rest Server Module for Stonyx Framework",
9
9
  "repository": {
10
10
  "type": "git",