@lark-apaas/coding-template-html-standard-webapp 0.1.0-alpha.20260827110728

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/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Lark Technologies Pte. Ltd. and/or its affiliates
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted,provided that the above copyright notice and this permission notice appear in all copies.
6
+
7
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
8
+ IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
9
+ INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
10
+ EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
11
+ CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
12
+ DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
13
+ ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # @lark-apaas/coding-template-html-standard-webapp
2
+
3
+ Buildless HTML template for [miaoda coding](https://code.byted.org/apaas/miaoda-coding) — 面向本地开发的纯 HTML 多页模板(无构建、无依赖、无平台 SDK),产物托管协议 buildless 形态的参考实现。
4
+
5
+ **Tech stack:** plain HTML · CSS · ES modules
6
+
7
+ ## Usage
8
+
9
+ This package is consumed by [miaoda-cli](https://code.byted.org/apaas/miaoda-cli). It is not intended to be installed as a runtime dependency — the CLI fetches the tarball, renders `template/` into a user project, then discards the package reference.
10
+
11
+ ## 与 html 模板(妙搭沙箱形态)的区别
12
+
13
+ - 无 `@lark-apaas/coding-html-devserver` 依赖,也无 package.json——`dev.command` 在 miaoda.json 中直接声明 `npx serve`
14
+ - 无构建:`miaoda.json` 不声明 `build.command`,`build.output: "."` 项目目录直接打包(协议 v0.3 buildless 形态)
15
+ - routes.json 由 lark-cli 打包时扫描 `.html` 文件树生成,工程侧零协议心智
16
+ - Level 1 同源:资源相对路径引用,不消费任何 `MIAODA_*` 环境变量
17
+
18
+ ## Contents
19
+
20
+ | Path | Purpose |
21
+ |---|---|
22
+ | `template/` | Files copied to the user project at init time |
23
+ | `hooks/` | Lifecycle hooks (no-op) |
@@ -0,0 +1,3 @@
1
+ export default async function after_install(ctx) {
2
+ // no-op
3
+ }
@@ -0,0 +1,3 @@
1
+ export default async function after_render(ctx) {
2
+ // no-op
3
+ }
@@ -0,0 +1,3 @@
1
+ export default async function before_render(ctx) {
2
+ // no-op
3
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@lark-apaas/coding-template-html-standard-webapp",
3
+ "version": "0.1.0-alpha.20260827110728",
4
+ "description": "Buildless HTML template for miaoda local development (no build step, no platform SDK)",
5
+ "type": "module",
6
+ "files": [
7
+ "template",
8
+ "hooks"
9
+ ],
10
+ "scripts": {
11
+ "validate-manifest": "node ../../../scripts/validate-template.mjs .",
12
+ "smoke": "node ../../../scripts/smoke-template.mjs .",
13
+ "prepublishOnly": "pnpm validate-manifest"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public",
17
+ "registry": "https://registry.npmjs.org/"
18
+ },
19
+ "keywords": [
20
+ "miaoda",
21
+ "coding-template",
22
+ "html",
23
+ "webapp"
24
+ ],
25
+ "license": "MIT",
26
+ "miaodaTemplate": {
27
+ "schemaVersion": 1,
28
+ "archType": 4,
29
+ "hooks": {
30
+ "beforeRender": "hooks/before-render.mjs",
31
+ "afterRender": "hooks/after-render.mjs",
32
+ "afterInstall": "hooks/after-install.mjs"
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,24 @@
1
+ # 项目技术规范
2
+
3
+ ## 形态
4
+
5
+ 纯 HTML 多页应用,**无构建步骤(buildless)**:`miaoda.json` 未声明 `build.command`,部署时项目目录(`build.output: "."`)直接打包上传,routes.json 由部署工具扫描 `.html` 文件树自动生成。
6
+
7
+ ## 开发
8
+
9
+ - 启动本地静态服务:`npx -y serve -l 5173 -n .`(即 `miaoda.json` 里 `dev.command` 声明的命令),编辑文件后刷新页面即可
10
+ - 无 package.json、无 node_modules、无依赖安装步骤——`miaoda.json` 即项目的全部声明
11
+
12
+ ## 目录与路由
13
+
14
+ | 文件 | 访问路径 |
15
+ |------|---------|
16
+ | `index.html` | `/` |
17
+ | `foo/index.html` 或 `foo.html` | `/foo` |
18
+ | `assets/*`(图片 / 数据 / 样式) | 相对路径引用 |
19
+
20
+ ## 资源引用规则(重要)
21
+
22
+ - 页面与资源之间**必须使用相对路径**引用(`./assets/logo.png`、`../style.css`)
23
+ - **禁止裸根路径**(`src="/foo.js"`)——本地能跑、上线 404
24
+ - 无需消费任何 `MIAODA_*` 环境变量(相对路径在任意部署 base 下都成立)
@@ -0,0 +1,2 @@
1
+ node_modules
2
+ .DS_Store
@@ -0,0 +1,44 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>应用标题</title>
7
+ <style>
8
+ :root {
9
+ color-scheme: light dark;
10
+ --bg: #0f172a;
11
+ --fg: #e2e8f0;
12
+ --accent: #38bdf8;
13
+ }
14
+ * { box-sizing: border-box; }
15
+ body {
16
+ margin: 0;
17
+ min-height: 100vh;
18
+ display: grid;
19
+ place-items: center;
20
+ font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
21
+ background: var(--bg);
22
+ color: var(--fg);
23
+ }
24
+ main {
25
+ text-align: center;
26
+ padding: 2rem;
27
+ }
28
+ h1 { margin: 0 0 0.5rem; font-size: clamp(1.5rem, 4vw, 2.5rem); }
29
+ p { margin: 0.25rem 0; opacity: 0.8; }
30
+ code {
31
+ padding: 0.1rem 0.4rem;
32
+ border-radius: 0.3rem;
33
+ background: rgba(148, 163, 184, 0.2);
34
+ }
35
+ </style>
36
+ </head>
37
+ <body>
38
+ <main>
39
+ <h1>应用已就绪</h1>
40
+ <p>编辑 <code>index.html</code> 开始开发,保存后刷新页面即可</p>
41
+ <p>新增页面:添加 <code>foo/index.html</code>,访问路径即为 <code>/foo</code></p>
42
+ </main>
43
+ </body>
44
+ </html>
@@ -0,0 +1,10 @@
1
+ {
2
+ "stack": "html-standard-webapp",
3
+ "dev": {
4
+ "command": ["npx", "-y", "serve", "-l", "5173", "-n", "."],
5
+ "port": 5173
6
+ },
7
+ "build": {
8
+ "output": "."
9
+ }
10
+ }