@mindees/core 0.1.0 → 0.2.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.
package/README.md CHANGED
@@ -13,17 +13,12 @@ frameworks), written in strict TypeScript.
13
13
 
14
14
  ## Install
15
15
 
16
- > ⚠️ **Not published to npm yet.** `@mindees/core` is pre-1.0 and not on the npm
17
- > registry. The command below is what you'll use **once it's published** (Phase
18
- > 12). For now, work with it from the monorepo via the
19
- > [contributor quick-start](../../README.md#-quickstart-contributors):
20
- > `corepack enable && pnpm install && pnpm verify`.
21
-
22
16
  ```bash
23
- # coming soon (not yet published):
24
17
  pnpm add @mindees/core
25
18
  ```
26
19
 
20
+ > 🧪 APIs are experimental (pre-1.0) and may change before `1.0`.
21
+
27
22
  ## Quick start
28
23
 
29
24
  ```ts
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import { ThreadPool, WorkerLike, WorkerPoolOptions, createInlineThreadPool, crea
10
10
  /** The npm package name. */
11
11
  declare const name = "@mindees/core";
12
12
  /** The package version. All `@mindees/*` packages share one locked version line. */
13
- declare const VERSION = "0.1.0";
13
+ declare const VERSION = "0.2.0";
14
14
  /**
15
15
  * Current maturity of this package. See the repository `STATUS.md`.
16
16
  *
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { createInlineThreadPool, createNativeThreadPool, createWorkerPool } from
8
8
  /** The npm package name. */
9
9
  const name = "@mindees/core";
10
10
  /** The package version. All `@mindees/*` packages share one locked version line. */
11
- const VERSION = "0.1.0";
11
+ const VERSION = "0.2.0";
12
12
  /**
13
13
  * Current maturity of this package. See the repository `STATUS.md`.
14
14
  *
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { Maturity, PackageInfo } from './types'\n\n/**\n * Component model: a renderer-agnostic element tree plus selector-based,\n * re-render-isolated context. (Phase 2)\n */\nexport {\n type Component,\n type Context,\n type ContextProvider,\n createContext,\n createElement,\n createProvider,\n ELEMENT_TYPE,\n type ElementType,\n Fragment,\n hasOwner,\n isElement,\n type MindeesElement,\n type MindeesNode,\n renderComponent,\n type SelectorEquals,\n} from './component'\nexport { NotImplementedError } from './errors'\nexport { notImplemented } from './not-implemented'\n/**\n * Fine-grained reactivity: signals, computed values, effects, batching, and\n * disposal scopes. This is the reactive core of MindeesNative.\n */\nexport {\n type Accessor,\n batch,\n type ComputedOptions,\n computed,\n createRoot,\n type EqualsFn,\n effect,\n getOwner,\n type Memo,\n memo,\n type Owner,\n onCleanup,\n runWithOwner,\n type Signal,\n type SignalOptions,\n signal,\n untrack,\n} from './reactive'\n/**\n * Priority scheduler: two-lane (sync/normal), microtask-batched, with\n * cancellable and dedupable tasks. (Phase 2)\n */\nexport {\n createScheduler,\n type Priority,\n type ScheduledTask,\n type ScheduleOptions,\n Scheduler,\n type SchedulerOptions,\n type Task,\n} from './scheduler'\n/**\n * Threading abstraction: a {@link ThreadPool} contract with a working Web Worker\n * backend and an inline fallback. Native multi-threading is a research track. (Phase 2)\n */\nexport {\n createInlineThreadPool,\n createNativeThreadPool,\n createWorkerPool,\n type ThreadPool,\n type WorkerLike,\n type WorkerPoolOptions,\n} from './threading'\nexport type { Maturity, PackageInfo } from './types'\n\n/** The npm package name. */\nexport const name = '@mindees/core'\n\n/** The package version. All `@mindees/*` packages share one locked version line. */\nexport const VERSION = '0.1.0'\n\n/**\n * Current maturity of this package. See the repository `STATUS.md`.\n *\n * The reactivity layer (signals/computed/effect/batch), the component model with\n * selector-isolated context, the priority scheduler, and the thread-pool\n * abstraction (Web Worker + inline) are all implemented and tested. Native\n * multi-threading remains a research track (throws `NotImplementedError`).\n */\nexport const maturity: Maturity = 'experimental'\n\n/**\n * Static identity + maturity metadata for this package. Frozen so the\n * self-reported identity tooling introspects cannot be mutated at runtime,\n * matching the `readonly` fields of {@link PackageInfo}.\n */\nexport const info: PackageInfo = Object.freeze({ name, version: VERSION, maturity })\n"],"mappings":";;;;;;;;AA4EA,MAAa,OAAO;;AAGpB,MAAa,UAAU;;;;;;;;;AAUvB,MAAa,WAAqB;;;;;;AAOlC,MAAa,OAAoB,OAAO,OAAO;CAAE;CAAM,SAAS;CAAS;AAAS,CAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { Maturity, PackageInfo } from './types'\n\n/**\n * Component model: a renderer-agnostic element tree plus selector-based,\n * re-render-isolated context. (Phase 2)\n */\nexport {\n type Component,\n type Context,\n type ContextProvider,\n createContext,\n createElement,\n createProvider,\n ELEMENT_TYPE,\n type ElementType,\n Fragment,\n hasOwner,\n isElement,\n type MindeesElement,\n type MindeesNode,\n renderComponent,\n type SelectorEquals,\n} from './component'\nexport { NotImplementedError } from './errors'\nexport { notImplemented } from './not-implemented'\n/**\n * Fine-grained reactivity: signals, computed values, effects, batching, and\n * disposal scopes. This is the reactive core of MindeesNative.\n */\nexport {\n type Accessor,\n batch,\n type ComputedOptions,\n computed,\n createRoot,\n type EqualsFn,\n effect,\n getOwner,\n type Memo,\n memo,\n type Owner,\n onCleanup,\n runWithOwner,\n type Signal,\n type SignalOptions,\n signal,\n untrack,\n} from './reactive'\n/**\n * Priority scheduler: two-lane (sync/normal), microtask-batched, with\n * cancellable and dedupable tasks. (Phase 2)\n */\nexport {\n createScheduler,\n type Priority,\n type ScheduledTask,\n type ScheduleOptions,\n Scheduler,\n type SchedulerOptions,\n type Task,\n} from './scheduler'\n/**\n * Threading abstraction: a {@link ThreadPool} contract with a working Web Worker\n * backend and an inline fallback. Native multi-threading is a research track. (Phase 2)\n */\nexport {\n createInlineThreadPool,\n createNativeThreadPool,\n createWorkerPool,\n type ThreadPool,\n type WorkerLike,\n type WorkerPoolOptions,\n} from './threading'\nexport type { Maturity, PackageInfo } from './types'\n\n/** The npm package name. */\nexport const name = '@mindees/core'\n\n/** The package version. All `@mindees/*` packages share one locked version line. */\nexport const VERSION = '0.2.0'\n\n/**\n * Current maturity of this package. See the repository `STATUS.md`.\n *\n * The reactivity layer (signals/computed/effect/batch), the component model with\n * selector-isolated context, the priority scheduler, and the thread-pool\n * abstraction (Web Worker + inline) are all implemented and tested. Native\n * multi-threading remains a research track (throws `NotImplementedError`).\n */\nexport const maturity: Maturity = 'experimental'\n\n/**\n * Static identity + maturity metadata for this package. Frozen so the\n * self-reported identity tooling introspects cannot be mutated at runtime,\n * matching the `readonly` fields of {@link PackageInfo}.\n */\nexport const info: PackageInfo = Object.freeze({ name, version: VERSION, maturity })\n"],"mappings":";;;;;;;;AA4EA,MAAa,OAAO;;AAGpB,MAAa,UAAU;;;;;;;;;AAUvB,MAAa,WAAqB;;;;;;AAOlC,MAAa,OAAoB,OAAO,OAAO;CAAE;CAAM,SAAS;CAAS;AAAS,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Fragment, MindeesElement, MindeesNode } from "./component/component.js";
2
+ import { JSX } from "./jsx-runtime.js";
3
+
4
+ //#region src/jsx-dev-runtime.d.ts
5
+ /** Dev JSX factory; the trailing debug args (`isStaticChildren`, `source`, `self`) are ignored. */
6
+ declare function jsxDEV(type: string | ((props: never) => MindeesNode) | symbol, props: (Record<string, unknown> & {
7
+ children?: MindeesNode;
8
+ }) | null | undefined, key?: string | number): MindeesElement;
9
+ //#endregion
10
+ export { Fragment, type JSX, jsxDEV };
11
+ //# sourceMappingURL=jsx-dev-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-dev-runtime.d.ts","names":[],"sources":["../src/jsx-dev-runtime.ts"],"mappings":";;;;;iBAgBgB,MAAA,CACd,IAAA,aAAiB,KAAA,YAAiB,WAAA,YAClC,KAAA,GAAQ,MAAA;EAA4B,QAAA,GAAW,WAAA;AAAA,uBAC/C,GAAA,qBACC,cAAA"}
@@ -0,0 +1,11 @@
1
+ import { Fragment } from "./component/component.js";
2
+ import { jsx } from "./jsx-runtime.js";
3
+ //#region src/jsx-dev-runtime.ts
4
+ /** Dev JSX factory; the trailing debug args (`isStaticChildren`, `source`, `self`) are ignored. */
5
+ function jsxDEV(type, props, key) {
6
+ return jsx(type, props, key);
7
+ }
8
+ //#endregion
9
+ export { Fragment, jsxDEV };
10
+
11
+ //# sourceMappingURL=jsx-dev-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-dev-runtime.js","names":[],"sources":["../src/jsx-dev-runtime.ts"],"sourcesContent":["/**\n * Automatic JSX **dev** runtime — the target of TypeScript's `react-jsxdev` transform\n * (used by dev/HMR builds). It carries the same `jsxImportSource: \"@mindees/core\"`\n * setup as {@link import('./jsx-runtime')}; the dev factory receives extra debug\n * arguments (source location, self), which we ignore and delegate to the same impl.\n *\n * @module\n */\n\nimport type { MindeesElement, MindeesNode } from './component'\nimport { jsx } from './jsx-runtime'\n\nexport { Fragment } from './component'\nexport type { JSX } from './jsx-runtime'\n\n/** Dev JSX factory; the trailing debug args (`isStaticChildren`, `source`, `self`) are ignored. */\nexport function jsxDEV(\n type: string | ((props: never) => MindeesNode) | symbol,\n props: (Record<string, unknown> & { children?: MindeesNode }) | null | undefined,\n key?: string | number,\n): MindeesElement {\n return jsx(type, props, key)\n}\n"],"mappings":";;;;AAgBA,SAAgB,OACd,MACA,OACA,KACgB;CAChB,OAAO,IAAI,MAAM,OAAO,GAAG;AAC7B"}
@@ -0,0 +1,35 @@
1
+ import { Fragment, MindeesElement, MindeesNode } from "./component/component.js";
2
+
3
+ //#region src/jsx-runtime.d.ts
4
+ /** Props as the automatic runtime delivers them: regular props plus `children`. */
5
+ type JsxProps = (Record<string, unknown> & {
6
+ children?: MindeesNode;
7
+ }) | null | undefined;
8
+ declare function jsxImpl(type: string | ((props: never) => MindeesNode) | symbol, props: JsxProps, key?: string | number): MindeesElement;
9
+ /** JSX factory for an element with zero or one child (automatic runtime). */
10
+ declare const jsx: typeof jsxImpl;
11
+ /** JSX factory for an element with static multiple children (automatic runtime). */
12
+ declare const jsxs: typeof jsxImpl;
13
+ /**
14
+ * The JSX type environment TypeScript resolves from `jsxImportSource`. Host tags are
15
+ * intentionally permissive for v1 (any lowercase tag with arbitrary props); component
16
+ * elements are checked against their own props by TS. `Element`/`ElementType` tie JSX
17
+ * back to the MindeesNative node model.
18
+ */
19
+ declare namespace JSX {
20
+ /** The type of a JSX expression. */
21
+ type Element = MindeesElement;
22
+ /** Valid JSX element tags: host strings or component functions. */
23
+ type ElementType = string | ((props: never) => MindeesNode);
24
+ /** Host intrinsic tags (`<view>`, `<text>`, …) — permissive prop bags for v1. */
25
+ interface IntrinsicElements {
26
+ [tag: string]: Record<string, unknown>;
27
+ }
28
+ /** Tells TS which prop carries children (so `<X>child</X>` type-checks). */
29
+ interface ElementChildrenAttribute {
30
+ children: Record<string, never>;
31
+ }
32
+ }
33
+ //#endregion
34
+ export { Fragment, JSX, jsx, jsxs };
35
+ //# sourceMappingURL=jsx-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-runtime.d.ts","names":[],"sources":["../src/jsx-runtime.ts"],"mappings":";;;;KAwBK,QAAA,IAAY,MAAA;EAA4B,QAAA,GAAW,WAAW;AAAA;AAAA,iBAE1D,OAAA,CACP,IAAA,aAAiB,KAAA,YAAiB,WAAA,YAClC,KAAA,EAAO,QAAA,EACP,GAAA,qBACC,cAAA;;cAWU,GAAA,SAAG,OAAU;;cAEb,IAAA,SAAI,OAAU;AAF3B;;;;AAA0B;AAE1B;AAFA,kBAWiB,GAAA;;OAEH,OAAA,GAAU,cAAA;EAXG;EAAA,KAab,WAAA,cAAyB,KAAA,YAAiB,WAAA;EAJpC;EAAA,UAMD,iBAAA;IAAA,CACd,GAAA,WAAc,MAAA;EAAA;EAAA;EAAA,UAGA,wBAAA;IACf,QAAA,EAAU,MAAA;EAAA;AAAA"}
@@ -0,0 +1,35 @@
1
+ import { Fragment, createElement } from "./component/component.js";
2
+ //#region src/jsx-runtime.ts
3
+ /**
4
+ * Automatic JSX runtime for MindeesNative — the target of TypeScript's `react-jsx`
5
+ * transform (and the same transform in esbuild/oxc/rolldown bundlers).
6
+ *
7
+ * Set this in `tsconfig.json` and write `<View/>` with **no manual import**:
8
+ *
9
+ * ```jsonc
10
+ * { "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "@mindees/core" } }
11
+ * ```
12
+ *
13
+ * The compiler then injects `jsx`/`jsxs`/`Fragment` from here automatically. Both
14
+ * delegate to {@link createElement}; the only wrinkle is that the automatic runtime
15
+ * delivers children inside `props.children` (a single node, or an array for static
16
+ * multi-children) — we hand them to `createElement` as positional children so arrays
17
+ * never nest.
18
+ *
19
+ * @module
20
+ */
21
+ function jsxImpl(type, props, key) {
22
+ const { children, ...rest } = props ?? {};
23
+ if (key !== void 0) rest.key = key;
24
+ const factory = type;
25
+ if (children === void 0) return createElement(factory, rest);
26
+ return Array.isArray(children) ? createElement(factory, rest, ...children) : createElement(factory, rest, children);
27
+ }
28
+ /** JSX factory for an element with zero or one child (automatic runtime). */
29
+ const jsx = jsxImpl;
30
+ /** JSX factory for an element with static multiple children (automatic runtime). */
31
+ const jsxs = jsxImpl;
32
+ //#endregion
33
+ export { Fragment, jsx, jsxs };
34
+
35
+ //# sourceMappingURL=jsx-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-runtime.js","names":[],"sources":["../src/jsx-runtime.ts"],"sourcesContent":["/**\n * Automatic JSX runtime for MindeesNative — the target of TypeScript's `react-jsx`\n * transform (and the same transform in esbuild/oxc/rolldown bundlers).\n *\n * Set this in `tsconfig.json` and write `<View/>` with **no manual import**:\n *\n * ```jsonc\n * { \"compilerOptions\": { \"jsx\": \"react-jsx\", \"jsxImportSource\": \"@mindees/core\" } }\n * ```\n *\n * The compiler then injects `jsx`/`jsxs`/`Fragment` from here automatically. Both\n * delegate to {@link createElement}; the only wrinkle is that the automatic runtime\n * delivers children inside `props.children` (a single node, or an array for static\n * multi-children) — we hand them to `createElement` as positional children so arrays\n * never nest.\n *\n * @module\n */\n\nimport { createElement, type MindeesElement, type MindeesNode } from './component'\n\nexport { Fragment } from './component'\n\n/** Props as the automatic runtime delivers them: regular props plus `children`. */\ntype JsxProps = (Record<string, unknown> & { children?: MindeesNode }) | null | undefined\n\nfunction jsxImpl(\n type: string | ((props: never) => MindeesNode) | symbol,\n props: JsxProps,\n key?: string | number,\n): MindeesElement {\n const { children, ...rest } = props ?? {}\n if (key !== undefined) rest.key = key\n const factory = type as Parameters<typeof createElement>[0]\n if (children === undefined) return createElement(factory, rest)\n return Array.isArray(children)\n ? createElement(factory, rest, ...children)\n : createElement(factory, rest, children)\n}\n\n/** JSX factory for an element with zero or one child (automatic runtime). */\nexport const jsx = jsxImpl\n/** JSX factory for an element with static multiple children (automatic runtime). */\nexport const jsxs = jsxImpl\n\n/**\n * The JSX type environment TypeScript resolves from `jsxImportSource`. Host tags are\n * intentionally permissive for v1 (any lowercase tag with arbitrary props); component\n * elements are checked against their own props by TS. `Element`/`ElementType` tie JSX\n * back to the MindeesNative node model.\n */\n// biome-ignore lint/style/noNamespace: TypeScript resolves JSX typings only from a `JSX` namespace.\nexport namespace JSX {\n /** The type of a JSX expression. */\n export type Element = MindeesElement\n /** Valid JSX element tags: host strings or component functions. */\n export type ElementType = string | ((props: never) => MindeesNode)\n /** Host intrinsic tags (`<view>`, `<text>`, …) — permissive prop bags for v1. */\n export interface IntrinsicElements {\n [tag: string]: Record<string, unknown>\n }\n /** Tells TS which prop carries children (so `<X>child</X>` type-checks). */\n export interface ElementChildrenAttribute {\n children: Record<string, never>\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0BA,SAAS,QACP,MACA,OACA,KACgB;CAChB,MAAM,EAAE,UAAU,GAAG,SAAS,SAAS,CAAC;CACxC,IAAI,QAAQ,KAAA,GAAW,KAAK,MAAM;CAClC,MAAM,UAAU;CAChB,IAAI,aAAa,KAAA,GAAW,OAAO,cAAc,SAAS,IAAI;CAC9D,OAAO,MAAM,QAAQ,QAAQ,IACzB,cAAc,SAAS,MAAM,GAAG,QAAQ,IACxC,cAAc,SAAS,MAAM,QAAQ;AAC3C;;AAGA,MAAa,MAAM;;AAEnB,MAAa,OAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindees/core",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "MindeesNative core — fine-grained reactivity (signals/computed/effect/batch), component model with selector-isolated context, priority scheduler, and a thread-pool abstraction (Web Worker + inline; native is a research track).",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
@@ -12,6 +12,14 @@
12
12
  ".": {
13
13
  "types": "./dist/index.d.ts",
14
14
  "import": "./dist/index.js"
15
+ },
16
+ "./jsx-runtime": {
17
+ "types": "./dist/jsx-runtime.d.ts",
18
+ "import": "./dist/jsx-runtime.js"
19
+ },
20
+ "./jsx-dev-runtime": {
21
+ "types": "./dist/jsx-dev-runtime.d.ts",
22
+ "import": "./dist/jsx-dev-runtime.js"
15
23
  }
16
24
  },
17
25
  "publishConfig": {