@mpen/jsxhtml 0.2.2 → 0.3.0

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.
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
- var jsxRuntime = require("./jsx-runtime-DpEMYmD9.js");
3
+ var jsxRuntime = require("./jsx-runtime-cimCxEOU.js");
4
4
 
5
5
  exports.Fragment = jsxRuntime.Fragment;
6
6
 
7
+ exports.JSX = jsxRuntime.JSX;
8
+
7
9
  exports.jsx = jsxRuntime.jsx;
8
10
 
9
11
  exports.jsxs = jsxRuntime.jsxs;
@@ -1 +1 @@
1
- export { F as Fragment, b as jsx, j as jsxs } from "./jsx-runtime-CsQM2fQb.js";
1
+ export { F as Fragment, m as JSX, b as jsx, j as jsxs } from "./jsx-runtime-Dh9PxNQe.js";
@@ -1,12 +1,14 @@
1
1
  import type { JsxNode } from './jsx-node';
2
2
  import type { AllGlobalAttributes } from './htmlspec/GlobalAttributes';
3
3
  import type { Override } from './util-types';
4
+ import type { Class } from 'classcat';
5
+ import type { Properties, PropertiesHyphen } from 'csstype';
4
6
  export interface Stringable {
5
7
  toString(): string;
6
8
  }
7
9
  export type PlainObject = Record<PropertyKey, unknown>;
8
- export type ClassNames = import('classcat').Class;
9
- export type StyleObject = import('csstype').Properties | import('csstype').PropertiesHyphen;
10
+ export type ClassNames = Class;
11
+ export type StyleObject = Properties | PropertiesHyphen;
10
12
  export type AttributeValue = Stringable | StyleObject | ClassNames;
11
13
  export type AttrKvPair = [name: string, value: AttributeValue];
12
14
  export type AttrArr = AttrKvPair[];
@@ -27,8 +29,8 @@ export type SpecialProps = {
27
29
  */
28
30
  class?: ClassNames;
29
31
  };
30
- export type CommonProps = Override<AllGlobalAttributes, SpecialProps>;
31
- export type AnyAttributes = Override<AttrObj, CommonProps>;
32
+ export type CommonProps<E = HTMLElement> = Override<AllGlobalAttributes<E>, SpecialProps>;
33
+ export type AnyAttributes<E = HTMLElement> = Override<AttrObj, CommonProps<E>>;
32
34
  export type JsxComponent<P = AnyAttributes> = ((props: P) => JsxNode) & {
33
35
  displayName?: string;
34
36
  name?: string;
package/dist/jsx.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference no-default-lib="true"/>
2
- import { JsxNode } from './jsx-node';
3
- import * as instrinsic from './htmlspec/IntrinsicElements';
2
+ import type { JsxNode } from './jsx-node';
3
+ import type * as instrinsic from './htmlspec/IntrinsicElements';
4
4
  export type ComponentType<P = {}> = FunctionComponent<P>;
5
5
  export type JsxChild = string | number | boolean | null | undefined | JsxNode | JsxNode[];
6
6
  export interface FunctionComponent<P = {}> {
@@ -31,3 +31,4 @@ export declare namespace JSX {
31
31
  interface IntrinsicElements extends instrinsic.IntrinsicElements {
32
32
  }
33
33
  }
34
+ export declare const JSX: {};
@@ -0,0 +1 @@
1
+ export {};
package/dist/log.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare function devLog(...vars: any[]): void;
2
+ export declare function logFull(...vars: any[]): void;
@@ -0,0 +1,12 @@
1
+ export declare class JsFrag {
2
+ private readonly str;
3
+ constructor(str: string);
4
+ toString(): string;
5
+ }
6
+ export declare function js(strings: TemplateStringsArray, ...values: any[]): JsFrag;
7
+ export declare class CssFrag {
8
+ private readonly str;
9
+ constructor(str: string);
10
+ toString(): string;
11
+ }
12
+ export declare function css(strings: TemplateStringsArray, ...values: any[]): CssFrag;
@@ -0,0 +1,6 @@
1
+ declare module 'bun:test' {
2
+ interface Matchers<T = unknown> {
3
+ toStrEq(expected: string): void;
4
+ }
5
+ }
6
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpen/jsxhtml",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "packageManager": "bun@1.2.9",
5
5
  "exports": {
6
6
  ".": {
@@ -32,17 +32,20 @@
32
32
  },
33
33
  "keywords": [
34
34
  "jsx",
35
+ "tsx",
35
36
  "html",
36
37
  "render",
37
- "server-side",
38
- "elysia"
38
+ "server",
39
+ "ssr"
39
40
  ],
40
41
  "scripts": {
41
- "dev:build": "rollup -cw",
42
+ "_dev:build": "rollup -cw",
42
43
  "_dev:serve": "serve -l tcp://0.0.0.0:8080",
43
44
  "dev": "run-p \"dev:**\"",
44
- "dev:serve": "bun run --hot src/dev.tsx",
45
- "test": "NODE_ENV=production bun test",
45
+ "dev:run": "NODE_ENV=production bun --watch run --jsx=react-jsx --jsx-import-source=. src/dev.tsx",
46
+ "dev:build": "NODE_ENV=production bun --watch --no-clear-screen build src/dev.tsx --outdir=dist --packages=external --external '*'",
47
+ "typecheck": "tsc --noEmit src/dev.tsx --jsx react-jsx --jsxImportSource . --moduleResolution bundler --module esnext --lib dom,esnext --target esnext",
48
+ "test": "NODE_ENV=production bun test --jsx-import-source=@mpen/jsxhtml",
46
49
  "bundle:clean": "rm -rf dist/",
47
50
  "bundle:build": "NODE_ENV=production rollup -c",
48
51
  "bundle": "run-s bundle:clean bundle:build",
@@ -61,7 +64,7 @@
61
64
  "@types/eslint": "^8.56.12",
62
65
  "@typescript-eslint/eslint-plugin": "^8.29.1",
63
66
  "@typescript-eslint/parser": "^8.29.1",
64
- "bun-types": "^1.2.9",
67
+ "bun-types": "^1.2.15",
65
68
  "classnames": "^2.5.1",
66
69
  "csstype": "^3.1.3",
67
70
  "elysia": ">=1.2.25",
@@ -70,6 +73,7 @@
70
73
  "eslint-plugin-react-hooks": "^5.2.0",
71
74
  "eslint-plugin-react-refresh": "^0.4.19",
72
75
  "eslint-plugin-unused-imports": "^4.1.4",
76
+ "js-serialize": "^0.6.0",
73
77
  "npm-run-all": "^4.1.5",
74
78
  "rimraf": "^5.0.10",
75
79
  "rollup": "^4.40.0",