@ozsarman/clarityjs 0.6.1 → 0.6.3
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 +1 -1
- package/src/clarity-bundle.js +2 -1
- package/src/clarity-test.js +2 -1
- package/src/font.js +2 -1
- package/src/image.js +4 -2
- package/src/index.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ozsarman/clarityjs",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "An AI-native, permission-aware frontend framework and DSL — components declare what AI agents may read, act on, and never touch.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
package/src/clarity-bundle.js
CHANGED
|
@@ -125,7 +125,8 @@ export async function bundleWithEsbuild(opts = {}) {
|
|
|
125
125
|
|
|
126
126
|
// Try esbuild
|
|
127
127
|
try {
|
|
128
|
-
const
|
|
128
|
+
const _esbuildPkg = 'esbuild';
|
|
129
|
+
const esbuild = await import(/* @vite-ignore */ _esbuildPkg);
|
|
129
130
|
log(C.cyan, '⚙ esbuild', `${entry} → ${outfile}${minify ? ' (minified)' : ''}`);
|
|
130
131
|
|
|
131
132
|
const result = await esbuild.build({
|
package/src/clarity-test.js
CHANGED
|
@@ -43,7 +43,8 @@ export async function setupDOM(html = '<!DOCTYPE html><html><body></body></html>
|
|
|
43
43
|
if (typeof window !== 'undefined' && typeof window.document !== 'undefined') return;
|
|
44
44
|
|
|
45
45
|
try {
|
|
46
|
-
const
|
|
46
|
+
const _jsdomPkg = 'jsdom';
|
|
47
|
+
const { JSDOM } = await import(/* @vite-ignore */ _jsdomPkg);
|
|
47
48
|
_dom = new JSDOM(html, {
|
|
48
49
|
url: opts.url ?? 'http://localhost/',
|
|
49
50
|
pretendToBeVisual: opts.pretendToBeVisual ?? true,
|
package/src/font.js
CHANGED
|
@@ -506,7 +506,8 @@ async function _getFetch() {
|
|
|
506
506
|
// Node 18+ global fetch destekler; daha eski sürümlerde node-fetch
|
|
507
507
|
if (typeof globalThis.fetch === 'function') return { fetch: globalThis.fetch };
|
|
508
508
|
try {
|
|
509
|
-
|
|
509
|
+
const _nodeFetchPkg = 'node-fetch';
|
|
510
|
+
return await import(/* @vite-ignore */ _nodeFetchPkg);
|
|
510
511
|
} catch {
|
|
511
512
|
throw new Error('[clarity/font] fetch API gerekli (Node 18+ veya node-fetch paketi)');
|
|
512
513
|
}
|
package/src/image.js
CHANGED
|
@@ -253,7 +253,8 @@ export function createImageMiddleware(opts = {}) {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
// Production: sharp ile WebP dönüşümü
|
|
256
|
-
const
|
|
256
|
+
const _sharpPkg = 'sharp';
|
|
257
|
+
const sharp = await import(/* @vite-ignore */ _sharpPkg);
|
|
257
258
|
const { resolve } = await import('node:path');
|
|
258
259
|
const filePath = resolve('.' + decodeURIComponent(url));
|
|
259
260
|
|
|
@@ -287,7 +288,8 @@ export async function optimizeImages(publicDir, outDir, opts = {}) {
|
|
|
287
288
|
|
|
288
289
|
let sharp;
|
|
289
290
|
try {
|
|
290
|
-
|
|
291
|
+
const _sharpPkg = 'sharp';
|
|
292
|
+
sharp = (await import(/* @vite-ignore */ _sharpPkg)).default;
|
|
291
293
|
} catch {
|
|
292
294
|
console.warn('[clarity/image] sharp bulunamadı — görüntü optimizasyonu atlandı. npm install sharp');
|
|
293
295
|
return;
|
package/src/index.js
CHANGED
|
@@ -34,6 +34,10 @@ export {
|
|
|
34
34
|
buildRouteTable, createPagesRouter,
|
|
35
35
|
} from './pages-router.js';
|
|
36
36
|
|
|
37
|
+
// Core reactive primitives + DOM mount — the essentials every app needs from
|
|
38
|
+
// the package entry (also importable from '@ozsarman/clarityjs/runtime').
|
|
39
|
+
export { signal, computed, effect, batch, mount, h } from './runtime.js';
|
|
40
|
+
|
|
37
41
|
// Reactivity extras
|
|
38
42
|
export { reactive, createContext, useContext, _pushContext, _popContext,
|
|
39
43
|
_withComponent, beforeMount, onMount, onCleanup, onUpdate,
|