@faqir-ui/core 1.0.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/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@faqir-ui/core",
3
+ "version": "1.0.0",
4
+ "description": "Faqir UI runtime engine — the Alpine-style reactive core (faqir-core.js), minified CDN build, and prebuilt per-theme CSS bundles. Zero dependencies.",
5
+ "type": "module",
6
+ "main": "./dist/faqir-core.mjs",
7
+ "types": "./faqir-core.d.ts",
8
+ "module": "./dist/faqir-core.mjs",
9
+ "unpkg": "./dist/faqir-core.min.js",
10
+ "jsdelivr": "./dist/faqir-core.min.js",
11
+ "//exports": "`.` resolves to dist/faqir-core.mjs — real ESM, `export default` plus one named export per engine member. It must NOT resolve to dist/faqir-core.js: that file is UMD, this package is `\"type\": \"module\"`, and under ESM the UMD wrapper takes its global branch and exports nothing, so the documented `import Faqir from \"@faqir-ui/core\"` failed with `SyntaxError: … does not provide an export named 'default'`. The UMD build is still shipped and is still what `<script src>`, unpkg and jsdelivr load; reach it explicitly at `@faqir-ui/core/faqir-core.js`.",
12
+ "//require": "Deliberately absent. This package is ESM-only. The `require` condition used to point at the UMD file, which threw ERR_REQUIRE_ESM on Node 18 and 20 — most of the range `engines` promises — because `\"type\": \"module\"` classifies a `.js` file as ESM whatever its contents. Supporting `require` honestly would mean shipping a `.cjs` runtime AND a full-fidelity `.d.cts`, and a half-fidelity one recreates exactly the FalseCJS mismatch this shape was fixed to remove. On Node >=22.12 `require()` falls through to `default` and works; below that it fails with a message that names `import()`, which is the right answer.",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./faqir-core.d.ts",
16
+ "import": "./dist/faqir-core.mjs",
17
+ "default": "./dist/faqir-core.mjs"
18
+ },
19
+ "./faqir-core.js": {
20
+ "types": "./faqir-core.d.ts",
21
+ "default": "./dist/faqir-core.js"
22
+ },
23
+ "./faqir-core.mjs": {
24
+ "types": "./faqir-core.d.ts",
25
+ "default": "./dist/faqir-core.mjs"
26
+ },
27
+ "./faqir-core.min.js": "./dist/faqir-core.min.js",
28
+ "./sri.json": "./dist/sri.json",
29
+ "./dist/*": "./dist/*",
30
+ "./package.json": "./package.json"
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "faqir-core.d.ts",
35
+ "src",
36
+ "examples",
37
+ "cdn.json",
38
+ "README.md"
39
+ ],
40
+ "sideEffects": [
41
+ "./dist/faqir-core.mjs",
42
+ "./dist/faqir-core.js",
43
+ "./dist/faqir-core.min.js",
44
+ "./dist/*.css"
45
+ ],
46
+ "scripts": {
47
+ "build": "node ../../scripts/build-core-package.mjs",
48
+ "prepublishOnly": "node ../../scripts/build-core-package.mjs"
49
+ },
50
+ "keywords": [
51
+ "faqir",
52
+ "ui",
53
+ "reactive",
54
+ "cdn",
55
+ "runtime",
56
+ "zero-dependency",
57
+ "agent-native",
58
+ "html",
59
+ "css"
60
+ ],
61
+ "license": "MIT",
62
+ "repository": {
63
+ "type": "git",
64
+ "url": "git+https://github.com/Narcis13/faqir-ui.git",
65
+ "directory": "packages/core"
66
+ },
67
+ "homepage": "https://github.com/Narcis13/faqir-ui/tree/main/packages/core#readme",
68
+ "bugs": {
69
+ "url": "https://github.com/Narcis13/faqir-ui/issues"
70
+ },
71
+ "engines": {
72
+ "node": ">=18"
73
+ },
74
+ "publishConfig": {
75
+ "access": "public"
76
+ }
77
+ }
@@ -0,0 +1,12 @@
1
+ // CDN classic-script entry for `@faqir-ui/core`.
2
+ //
3
+ // `scripts/build-core-package.mjs` bundles this file with `--format=iife`, so a
4
+ // plain `<script src="faqir-core.min.js">` (no `type="module"`) executes the
5
+ // engine and assigns it to `window.Faqir` — the two-tag CDN story (§10.3).
6
+ //
7
+ // The unminified `dist/faqir-core.js` is the canonical UMD build and remains the
8
+ // entry for `import`/`require`; this wrapper exists only to give the minified
9
+ // classic-script artifact a global.
10
+ import Faqir from "../../../registry/core/faqir-core.js";
11
+
12
+ (typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this).Faqir = Faqir;
@@ -0,0 +1,58 @@
1
+ // ESM entry for `@faqir-ui/core` — the target of the `import` condition.
2
+ //
3
+ // WHY THIS FILE EXISTS. `registry/core/faqir-core.js` is a UMD wrapper, and the
4
+ // package is `"type": "module"`. Under ESM neither `exports` nor `module` nor
5
+ // `define` is defined, so the wrapper takes its *global* branch: it assigns
6
+ // `globalThis.Faqir` and exports nothing at all. Pointing the `import`
7
+ // condition at it made the shape both the README and `faqir-core.d.ts`
8
+ // document —
9
+ //
10
+ // import Faqir from "@faqir-ui/core";
11
+ //
12
+ // — fail at runtime with `SyntaxError: … does not provide an export named
13
+ // 'default'`. Bundling the same factory to real ESM here fixes it at the
14
+ // source: the engine gets `module`/`exports` from the bundler, takes the CJS
15
+ // branch, and its return value becomes an honest module export. No global is
16
+ // touched, so two copies of the package no longer race for `globalThis.Faqir`.
17
+ //
18
+ // The UMD file is still shipped and is still what `<script src>` and the CDN
19
+ // load — see `cdn-entry.js`, which is the same idea for the `iife` format.
20
+ //
21
+ // The named exports below are NOT decorative: they are the whole reason this is
22
+ // a wrapper rather than a re-export, since a UMD default cannot be destructured
23
+ // by a bundler. `tests/build/core-package.test.ts` holds this list against
24
+ // `Object.keys()` of the live engine in both directions, so an engine member
25
+ // added without a line here fails the build.
26
+ import Faqir from "../../../registry/core/faqir-core.js";
27
+
28
+ export default Faqir;
29
+
30
+ export const version = Faqir.version;
31
+
32
+ // ── Reactivity ──
33
+ export const reactive = Faqir.reactive;
34
+ export const effect = Faqir.effect;
35
+ export const batch = Faqir.batch;
36
+ export const untrack = Faqir.untrack;
37
+ export const nextTick = Faqir.nextTick;
38
+
39
+ // ── Expressions ──
40
+ export const evaluate = Faqir.evaluate;
41
+ export const evaluateAssignment = Faqir.evaluateAssignment;
42
+
43
+ // ── Registration ──
44
+ export const data = Faqir.data;
45
+ export const store = Faqir.store;
46
+ export const directive = Faqir.directive;
47
+ export const magic = Faqir.magic;
48
+ export const plugin = Faqir.plugin;
49
+ export const controller = Faqir.controller;
50
+
51
+ // ── Lifecycle ──
52
+ export const start = Faqir.start;
53
+ export const initTree = Faqir.initTree;
54
+ export const destroy = Faqir.destroy;
55
+
56
+ // ── Inspection ──
57
+ export const inspect = Faqir.inspect;
58
+ export const devtools = Faqir.devtools;