lightview 1.8.2 → 2.0.1
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/.codacy/cli.sh +149 -0
- package/.codacy/codacy.yaml +15 -0
- package/.github/instructions/codacy.instructions.md +72 -0
- package/.wranglerignore +21 -0
- package/README.md +1330 -19
- package/_headers +4 -0
- package/build.js +70 -0
- package/components/actions/button.js +151 -0
- package/components/actions/dropdown.js +120 -0
- package/components/actions/modal.js +146 -0
- package/components/actions/swap.js +118 -0
- package/components/daisyui.js +288 -0
- package/components/data-display/accordion.js +128 -0
- package/components/data-display/alert.js +112 -0
- package/components/data-display/avatar.js +170 -0
- package/components/data-display/badge.js +82 -0
- package/components/data-display/card.js +151 -0
- package/components/data-display/carousel.js +94 -0
- package/components/data-display/chart.js +220 -0
- package/components/data-display/chat.js +128 -0
- package/components/data-display/collapse.js +103 -0
- package/components/data-display/countdown.js +69 -0
- package/components/data-display/diff.js +111 -0
- package/components/data-display/kbd.js +65 -0
- package/components/data-display/loading.js +75 -0
- package/components/data-display/progress.js +79 -0
- package/components/data-display/radial-progress.js +88 -0
- package/components/data-display/skeleton.js +66 -0
- package/components/data-display/stats.js +159 -0
- package/components/data-display/table.js +146 -0
- package/components/data-display/timeline.js +146 -0
- package/components/data-display/toast.js +72 -0
- package/components/data-display/tooltip.js +74 -0
- package/components/data-input/checkbox.js +253 -0
- package/components/data-input/file-input.js +224 -0
- package/components/data-input/input.js +264 -0
- package/components/data-input/radio.js +338 -0
- package/components/data-input/range.js +204 -0
- package/components/data-input/rating.js +219 -0
- package/components/data-input/select.js +287 -0
- package/components/data-input/textarea.js +287 -0
- package/components/data-input/toggle.js +201 -0
- package/components/index.js +137 -0
- package/components/layout/divider.js +72 -0
- package/components/layout/drawer.js +142 -0
- package/components/layout/footer.js +100 -0
- package/components/layout/hero.js +109 -0
- package/components/layout/indicator.js +90 -0
- package/components/layout/join.js +78 -0
- package/components/layout/navbar.js +110 -0
- package/components/navigation/breadcrumbs.js +91 -0
- package/components/navigation/dock.js +103 -0
- package/components/navigation/menu.js +126 -0
- package/components/navigation/pagination.js +105 -0
- package/components/navigation/steps.js +89 -0
- package/components/navigation/tabs.css +177 -0
- package/components/navigation/tabs.js +123 -0
- package/components/theme/theme-switch.css +65 -0
- package/components/theme/theme-switch.js +177 -0
- package/docs/about.html +164 -0
- package/docs/api/computed.html +184 -0
- package/docs/api/effects.html +173 -0
- package/docs/api/elements.html +180 -0
- package/docs/api/enhance.html +225 -0
- package/docs/api/hypermedia.html +165 -0
- package/docs/api/index.html +178 -0
- package/docs/api/nav.html +18 -0
- package/docs/api/signals.html +136 -0
- package/docs/api/state.html +217 -0
- package/docs/assets/images/logo-favicon.svg +42 -0
- package/docs/assets/images/logo-static.svg +40 -0
- package/docs/assets/images/logo.svg +66 -0
- package/docs/assets/js/examplify.js +395 -0
- package/docs/assets/styles/site.css +1102 -0
- package/docs/assets/styles/themes.css +236 -0
- package/docs/components/accordion.html +439 -0
- package/docs/components/alert.html +528 -0
- package/docs/components/avatar.html +586 -0
- package/docs/components/badge.html +531 -0
- package/docs/components/breadcrumbs.html +278 -0
- package/docs/components/button.html +579 -0
- package/docs/components/card.html +561 -0
- package/docs/components/carousel.html +286 -0
- package/docs/components/chart-area.html +702 -0
- package/docs/components/chart-bar.html +782 -0
- package/docs/components/chart-column.html +735 -0
- package/docs/components/chart-line.html +794 -0
- package/docs/components/chart-pie.html +823 -0
- package/docs/components/chart.html +610 -15
- package/docs/components/chat.html +547 -0
- package/docs/components/checkbox.html +641 -0
- package/docs/components/collapse.html +536 -0
- package/docs/components/component-nav.html +53 -0
- package/docs/components/countdown.html +470 -0
- package/docs/components/diff.html +245 -0
- package/docs/components/divider.html +240 -0
- package/docs/components/dock.html +277 -0
- package/docs/components/drawer.html +515 -0
- package/docs/components/dropdown.html +479 -0
- package/docs/components/file-input.html +591 -0
- package/docs/components/footer.html +301 -0
- package/docs/components/gallery.html +504 -0
- package/docs/components/hero.html +264 -0
- package/docs/components/index.css +840 -0
- package/docs/components/index.html +735 -0
- package/docs/components/indicator.html +342 -0
- package/docs/components/input.html +644 -0
- package/docs/components/join.html +285 -0
- package/docs/components/kbd.html +322 -0
- package/docs/components/loading.html +521 -0
- package/docs/components/menu.html +461 -0
- package/docs/components/modal.html +639 -0
- package/docs/components/navbar.html +321 -0
- package/docs/components/pagination.html +279 -0
- package/docs/components/progress.html +514 -0
- package/docs/components/radial-progress.html +434 -0
- package/docs/components/radio.html +655 -0
- package/docs/components/range.html +611 -0
- package/docs/components/rating.html +642 -0
- package/docs/components/select.html +696 -0
- package/docs/components/sidebar-setup.js +93 -0
- package/docs/components/skeleton.html +447 -0
- package/docs/components/spinner.html +68 -0
- package/docs/components/stats.html +486 -0
- package/docs/components/steps.html +356 -0
- package/docs/components/swap.html +517 -0
- package/docs/components/switch.html +68 -0
- package/docs/components/table.html +668 -0
- package/docs/components/tabs.html +506 -0
- package/docs/components/text-input.html +68 -0
- package/docs/components/textarea.html +603 -0
- package/docs/components/timeline.html +485 -42
- package/docs/components/toast.html +474 -0
- package/docs/components/toggle.html +564 -0
- package/docs/components/tooltip.html +423 -0
- package/docs/examples/getting-started-example.html +40 -0
- package/docs/examples/index.html +93 -0
- package/docs/getting-started/index.html +739 -0
- package/docs/getting-started/reviews.html +23 -0
- package/docs/getting-started/reviews.odom +108 -0
- package/docs/getting-started/reviews.vdom +84 -0
- package/docs/index.html +132 -42
- package/docs/playground.html +416 -0
- package/docs/router.html +285 -0
- package/docs/styles/index.html +190 -0
- package/functions/_middleware.js +32 -0
- package/index.html +309 -0
- package/lightview-router.js +364 -0
- package/lightview-x.js +1577 -0
- package/lightview.js +659 -1200
- package/middleware/locale.js +25 -0
- package/middleware/markdown.js +44 -0
- package/middleware/notFound.js +37 -0
- package/package.json +27 -41
- package/watch.js +92 -0
- package/wrangler.toml +12 -0
- package/.idea/lightview.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/LICENSE +0 -21
- package/codepen-no-tabs-embed.css +0 -2
- package/docs/CNAME +0 -1
- package/docs/api.html +0 -674
- package/docs/blank.html +0 -10
- package/docs/comparedto.html +0 -89
- package/docs/components/chart-repl.html +0 -69
- package/docs/components/components.js +0 -113
- package/docs/components/contents.html +0 -17
- package/docs/components/gantt-repl.html +0 -61
- package/docs/components/gantt.html +0 -42
- package/docs/components/gauge-repl.html +0 -66
- package/docs/components/gauge.html +0 -20
- package/docs/components/orgchart-repl.html +0 -64
- package/docs/components/orgchart.html +0 -41
- package/docs/components/repl-as-src.html +0 -17
- package/docs/components/repl-repl.html +0 -95
- package/docs/components/repl.html +0 -527
- package/docs/components/timeline-repl.html +0 -72
- package/docs/components.html +0 -14
- package/docs/css/highlightjs.min.css +0 -9
- package/docs/css/tutorial.css +0 -35
- package/docs/examples/anchor.html +0 -11
- package/docs/examples/chart.html +0 -34
- package/docs/examples/counter.html +0 -26
- package/docs/examples/counter.test.mjs +0 -47
- package/docs/examples/counter2.html +0 -26
- package/docs/examples/directives.html +0 -79
- package/docs/examples/foreign.html +0 -50
- package/docs/examples/forgeinform.html +0 -98
- package/docs/examples/form.html +0 -61
- package/docs/examples/gauge.html +0 -18
- package/docs/examples/invalid-template-literals.html +0 -44
- package/docs/examples/medium/remote.html +0 -60
- package/docs/examples/message.html +0 -18
- package/docs/examples/nested.html +0 -11
- package/docs/examples/object-bound-form.html +0 -34
- package/docs/examples/remote-server.js +0 -51
- package/docs/examples/remote.html +0 -34
- package/docs/examples/remote.json +0 -1
- package/docs/examples/scratch.html +0 -69
- package/docs/examples/sensors/index.html +0 -44
- package/docs/examples/sensors/sensor-server.js +0 -30
- package/docs/examples/shared.html +0 -41
- package/docs/examples/template.html +0 -33
- package/docs/examples/timeline.html +0 -21
- package/docs/examples/todo.html +0 -40
- package/docs/examples/top.html +0 -10
- package/docs/examples/types.html +0 -94
- package/docs/examples/xor.html +0 -62
- package/docs/examples.html +0 -25
- package/docs/javascript/codejar.min.js +0 -8
- package/docs/javascript/highlightjs.min.js +0 -1173
- package/docs/javascript/isomorphic-git.js +0 -9
- package/docs/javascript/json5.min.js +0 -1
- package/docs/javascript/lightning-fs.js +0 -1
- package/docs/javascript/lightview.js +0 -1285
- package/docs/javascript/marked.min.js +0 -6
- package/docs/javascript/peerjs.min.js +0 -70
- package/docs/javascript/turndown.js +0 -973
- package/docs/javascript/types.js +0 -606
- package/docs/javascript/utils.js +0 -45
- package/docs/lightview.html +0 -63
- package/docs/old_index.html +0 -965
- package/docs/old_index.md +0 -1132
- package/docs/slidein.html +0 -51
- package/docs/tutorial/0-getting-started.html +0 -67
- package/docs/tutorial/1-intro-to-variables.html +0 -103
- package/docs/tutorial/10-template-components.html +0 -80
- package/docs/tutorial/11-linked-components.html +0 -76
- package/docs/tutorial/12-imported-components.html +0 -67
- package/docs/tutorial/13-input-binding.html +0 -94
- package/docs/tutorial/14-automatic-variable-creation.html +0 -74
- package/docs/tutorial/15-form-binding.html +0 -110
- package/docs/tutorial/16-if-directive.html +0 -60
- package/docs/tutorial/17-loop-directives.html +0 -83
- package/docs/tutorial/18-sanitizing-and-escaping-input.html +0 -79
- package/docs/tutorial/2-imported-and-exported-variables.html +0 -80
- package/docs/tutorial/3-data-types.html +0 -89
- package/docs/tutorial/4-extended-data-types.html +0 -83
- package/docs/tutorial/5-extended-functional-types.html +0 -96
- package/docs/tutorial/5.1-extended-functional-types.html +0 -79
- package/docs/tutorial/5.2-extended-functional-types.html +0 -70
- package/docs/tutorial/6-conventional-javascript.html +0 -75
- package/docs/tutorial/7-monitoring-with-observers.html +0 -107
- package/docs/tutorial/8-event-listeners.html +0 -65
- package/docs/tutorial/9-intro-to-components.html +0 -91
- package/docs/tutorial/contents.html +0 -32
- package/docs/tutorial/my-component.html +0 -29
- package/docs/tutorial/remote-value.json +0 -4
- package/docs/websiterepl.html +0 -46
- package/jest-puppeteer.config.js +0 -5
- package/jest.config.json +0 -12
- package/lightview.min.js +0 -1
- package/lightview_good.js +0 -1267
- package/lightview_optimized.js +0 -1274
- package/repl_hold.html +0 -320
- package/test/basic.html +0 -104
- package/test/basic.test.mjs +0 -315
- package/test/extended.html +0 -29
- package/test/extended.test.mjs +0 -448
- package/types.js +0 -607
- package/unsplash.key +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locale Prefix Handler
|
|
3
|
+
* Extracts locale from path (e.g. /en/about -> /about with locale='en')
|
|
4
|
+
*/
|
|
5
|
+
export const localeHandler = (ctx) => {
|
|
6
|
+
const path = typeof ctx === 'string' ? ctx : ctx.path;
|
|
7
|
+
|
|
8
|
+
// Match /en/ or /en at start of path
|
|
9
|
+
const match = path.match(/^\/([a-z]{2})($|\/)/);
|
|
10
|
+
|
|
11
|
+
if (match) {
|
|
12
|
+
const locale = match[1];
|
|
13
|
+
// Remove locale prefix
|
|
14
|
+
let newPath = path.substring(3);
|
|
15
|
+
if (!newPath.startsWith('/')) newPath = '/' + newPath;
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
...ctx,
|
|
19
|
+
path: newPath,
|
|
20
|
+
locale: locale
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return ctx;
|
|
25
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown Handler
|
|
3
|
+
* Intercepts .md requests, loads marked.js on demand, and renders HTML
|
|
4
|
+
*/
|
|
5
|
+
let marked = null;
|
|
6
|
+
|
|
7
|
+
export const markdownHandler = async (ctx) => {
|
|
8
|
+
const path = typeof ctx === 'string' ? ctx : ctx.path;
|
|
9
|
+
|
|
10
|
+
// Only process .md files
|
|
11
|
+
if (!path.endsWith('.md')) return ctx;
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
// 1. Load marked if needed
|
|
15
|
+
if (!marked) {
|
|
16
|
+
console.log('[Markdown] Loading processor...');
|
|
17
|
+
const module = await import('https://cdn.jsdelivr.net/npm/marked/+esm');
|
|
18
|
+
marked = module.marked;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// 2. Fetch the raw markdown content
|
|
22
|
+
const response = await fetch(path);
|
|
23
|
+
if (!response.ok) return null; // Let other handlers try or 404
|
|
24
|
+
|
|
25
|
+
const text = await response.text();
|
|
26
|
+
|
|
27
|
+
// 3. Convert to HTML
|
|
28
|
+
// marked.parse can be synchronous or async depending on extensions,
|
|
29
|
+
// but usually synchronous for standard usage.
|
|
30
|
+
const html = marked.parse(text);
|
|
31
|
+
|
|
32
|
+
// 4. Wrap the HTML in a container if needed, or just return it.
|
|
33
|
+
// For Lightview docs, we might want a wrapper, but raw HTML is fine for now.
|
|
34
|
+
// We'll return a Response object which the router understands as a final result.
|
|
35
|
+
return new Response(html, {
|
|
36
|
+
status: 200,
|
|
37
|
+
headers: { 'Content-Type': 'text/html' }
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
} catch (err) {
|
|
41
|
+
console.error('[Markdown] Error processing file:', err);
|
|
42
|
+
return null; // Fallthrough
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 404 Not Found Middleware
|
|
3
|
+
*
|
|
4
|
+
* Returns a configured Not Found handler that renders a 404 page
|
|
5
|
+
* into a target element or returns a 404 response.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* appRouter.use(notFound({
|
|
9
|
+
* contentEl: document.getElementById('content'),
|
|
10
|
+
* html: '<h1>404 Not Found</h1>' // Optional custom HTML
|
|
11
|
+
* }));
|
|
12
|
+
*/
|
|
13
|
+
export const notFound = (options = {}) => {
|
|
14
|
+
const {
|
|
15
|
+
contentEl = null,
|
|
16
|
+
html = `
|
|
17
|
+
<div class="error-page" style="text-align: center; padding: 4rem 1rem;">
|
|
18
|
+
<h1 style="font-size: 3rem; margin-bottom: 1rem;">404</h1>
|
|
19
|
+
<p style="font-size: 1.25rem; margin-bottom: 2rem;">Page not found</p>
|
|
20
|
+
<a href="/" class="btn btn-primary">Go Home</a>
|
|
21
|
+
</div>
|
|
22
|
+
`
|
|
23
|
+
} = options;
|
|
24
|
+
|
|
25
|
+
return async (ctx) => {
|
|
26
|
+
const targetEl = contentEl || ctx.contentEl;
|
|
27
|
+
|
|
28
|
+
// If contentEl is provided (either via options or context), render directly
|
|
29
|
+
if (targetEl) {
|
|
30
|
+
targetEl.innerHTML = html;
|
|
31
|
+
return new Response(html, { status: 404, statusText: 'Not Found' });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Otherwise return a response and let the caller handle it
|
|
35
|
+
return new Response(html, { status: 404, statusText: 'Not Found' });
|
|
36
|
+
};
|
|
37
|
+
};
|
package/package.json
CHANGED
|
@@ -1,41 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "lightview",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "lightview.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
},
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"bugs": {
|
|
29
|
-
"url": "https://github.com/anywhichway/lightview/issues"
|
|
30
|
-
},
|
|
31
|
-
"homepage": "https://lightview.dev",
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@editorjs/editorjs": "^2.16.0",
|
|
34
|
-
"editorjs-inline-tool": "^0.4.0",
|
|
35
|
-
"jest": "^27.5.1",
|
|
36
|
-
"jest-puppeteer": "^6.1.0"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"froala-editor": "^4.0.11"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "lightview",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "A lightweight reactive UI library with features of Bau, Juris, and HTMX",
|
|
5
|
+
"main": "lightview.js",
|
|
6
|
+
"directories": {
|
|
7
|
+
"doc": "docs"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "wrangler pages dev . --port 3000",
|
|
11
|
+
"preview": "npm run build && wrangler pages dev ./dist --port 8788",
|
|
12
|
+
"build": "node build.js",
|
|
13
|
+
"watch": "node watch.js",
|
|
14
|
+
"deploy": "npm run build && wrangler pages deploy dist",
|
|
15
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [],
|
|
18
|
+
"author": "",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"type": "commonjs",
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"wrangler": "^4.54.0"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"marked": "^17.0.1"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/watch.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
|
+
|
|
5
|
+
const rootDir = __dirname;
|
|
6
|
+
const distDir = path.join(rootDir, 'dist');
|
|
7
|
+
|
|
8
|
+
// Configuration (must match build.js)
|
|
9
|
+
const allowedExtensions = ['.html', '.js', '.css', '.txt', '.xml', '.ico', '.png', '.svg', '.jpg', '.jpeg', '.md'];
|
|
10
|
+
const includeFiles = ['_headers'];
|
|
11
|
+
const excludeFiles = ['build.js', 'watch.js', 'package.json', 'package-lock.json', 'wrangler.toml'];
|
|
12
|
+
const allowedDirs = ['docs', 'components', 'middleware'];
|
|
13
|
+
|
|
14
|
+
function build() {
|
|
15
|
+
try {
|
|
16
|
+
console.log('Running full build...');
|
|
17
|
+
execSync('node build.js', { stdio: 'inherit' });
|
|
18
|
+
} catch (e) {
|
|
19
|
+
console.error('Build failed:', e);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function copyFile(srcPath, relativePath) {
|
|
24
|
+
try {
|
|
25
|
+
const destPath = path.join(distDir, relativePath);
|
|
26
|
+
const destDir = path.dirname(destPath);
|
|
27
|
+
|
|
28
|
+
if (!fs.existsSync(destDir)) {
|
|
29
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
fs.copyFileSync(srcPath, destPath);
|
|
33
|
+
console.log(`Updated: ${relativePath}`);
|
|
34
|
+
} catch (err) {
|
|
35
|
+
// Ignore errors for deleted files or temporary locks
|
|
36
|
+
if (err.code !== 'ENOENT' && err.code !== 'EBUSY') {
|
|
37
|
+
console.error(`Error copying ${relativePath}:`, err.message);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Initial build
|
|
43
|
+
build();
|
|
44
|
+
|
|
45
|
+
console.log('Watching for changes...');
|
|
46
|
+
|
|
47
|
+
fs.watch(rootDir, { recursive: true }, (eventType, filename) => {
|
|
48
|
+
if (!filename) return;
|
|
49
|
+
|
|
50
|
+
// Ignore .git, node_modules, dist, etc.
|
|
51
|
+
if (filename.startsWith('.git') ||
|
|
52
|
+
filename.startsWith('node_modules') ||
|
|
53
|
+
filename.startsWith('dist') ||
|
|
54
|
+
filename.startsWith('.gemini')) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const srcPath = path.join(rootDir, filename);
|
|
59
|
+
const parts = filename.split(path.sep);
|
|
60
|
+
const topLevel = parts[0];
|
|
61
|
+
|
|
62
|
+
// Check if it's in one of the allowed directories
|
|
63
|
+
if (allowedDirs.includes(topLevel)) {
|
|
64
|
+
// Check if file exists to handle deletions gracefully
|
|
65
|
+
if (fs.existsSync(srcPath)) {
|
|
66
|
+
// Check if it's a directory
|
|
67
|
+
try {
|
|
68
|
+
const stat = fs.statSync(srcPath);
|
|
69
|
+
if (stat.isDirectory()) return;
|
|
70
|
+
} catch (e) {
|
|
71
|
+
return; // Ignore if stat fails
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
copyFile(srcPath, filename);
|
|
75
|
+
}
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Check if it's a file in the root directory
|
|
80
|
+
if (parts.length === 1) {
|
|
81
|
+
const ext = path.extname(filename).toLowerCase();
|
|
82
|
+
const isAllowedExt = allowedExtensions.includes(ext);
|
|
83
|
+
const isExplicitInclude = includeFiles.includes(filename);
|
|
84
|
+
const isExcluded = excludeFiles.includes(filename) || filename.startsWith('.');
|
|
85
|
+
|
|
86
|
+
if ((isAllowedExt || isExplicitInclude) && !isExcluded) {
|
|
87
|
+
if (fs.existsSync(srcPath)) {
|
|
88
|
+
copyFile(srcPath, filename);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
package/wrangler.toml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
name = "lightview"
|
|
2
|
+
compatibility_date = "2024-01-01"
|
|
3
|
+
|
|
4
|
+
# [build]
|
|
5
|
+
# command = "npm run build"
|
|
6
|
+
|
|
7
|
+
# Cloudflare Pages configuration
|
|
8
|
+
# Note: Static asset headers are now defined in _headers file
|
|
9
|
+
# and the build directory is specified in the deploy command or dashboard.
|
|
10
|
+
|
|
11
|
+
[assets]
|
|
12
|
+
directory = "./dist"
|
package/.idea/lightview.iml
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager">
|
|
4
|
-
<content url="file://$MODULE_DIR$">
|
|
5
|
-
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
6
|
-
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
7
|
-
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
-
</content>
|
|
9
|
-
<orderEntry type="inheritedJdk" />
|
|
10
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
-
</component>
|
|
12
|
-
</module>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/lightview.iml" filepath="$PROJECT_DIR$/.idea/lightview.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/vcs.xml
DELETED
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 Simon Y. Blackwell
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/docs/CNAME
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
lightview.dev
|