transone-cli 0.6.3 → 0.7.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
@@ -52,6 +52,10 @@ transone build --target mp-xiaohongshu # Xiaohongshu mini-program project (XHSML
52
52
  - `--base` sets the deployment base path (e.g. a GitHub Pages sub-path).
53
53
  - `--library` builds in library mode (no page entry required).
54
54
 
55
+ Web `dev` and `build` emit fixed component `initStyles()` rules that can be resolved safely and document styles as static CSS files, loaded through `<link rel="stylesheet">`. Component extraction supports literal values and immutable module constants, including hover, media queries and rpx conversion. Methods that depend on props/state, mutate their style manager later, or contain unsupported statements keep runtime styling. When selectors or inheritance cannot be resolved safely, the bundle retains runtime component styling. Identified document `<style>` elements and sheets with relative resource URLs stay inline to preserve their behavior. Use component-specific selectors: extracted rules are available before component mount and follow a stable source-file order.
56
+
57
+ Web production entry and chunk JavaScript filenames contain a content hash (for example `main-<hash>.js`); HTML references the emitted filenames. Unchanged content keeps its hash. Mini-program and library entry filenames follow their existing platform/package contracts.
58
+
55
59
  The iOS, Android, and Harmony native app targets are implemented. A generated project should still be opened in its platform IDE for runtime/device validation.
56
60
 
57
61
  ## Targets
package/README.zh-CN.md CHANGED
@@ -27,6 +27,10 @@ transone dev # 开发服务(仅 web)
27
27
  transone create # 脚手架
28
28
  ```
29
29
 
30
+ Web 的 `dev`、`build` 会将可安全静态确定的组件 `initStyles()` 样式与文档样式输出为静态 CSS,通过 `<link rel="stylesheet">` 加载。组件提取支持字面量、不可变模块常量、hover、media 与 rpx 换算;依赖 props/state、后续修改 StyleManager 或含不支持语句的方法继续在运行时处理。无法安全确定选择器或跨模块继承关系时,当前 bundle 的组件样式保留在运行时。带标识的文档 `<style>` 和含相对资源 URL 的样式保留内联,以维持原有行为。组件应使用专属选择器:提取的规则在挂载前就已生效,并按稳定的源文件顺序排列。
31
+
32
+ Web 生产入口与分块 JS 文件名包含内容 hash,例如 `main-<hash>.js`,HTML 自动引用实际文件名;内容不变时 hash 不变。小程序及库入口保留平台与包约定的文件名。
33
+
30
34
  ```bash
31
35
  bun test # 测试
32
36
  bun run build # 构建 dist(CLI bundle + .d.ts)
package/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  createProject,
6
6
  isTargetType,
7
7
  startDevServer
8
- } from "./index-8k9x2k6m.js";
8
+ } from "./index-x5rrsfyb.js";
9
9
  import"./index-k1qfvp0y.js";
10
10
  import"./index-yb2wsc7f.js";
11
11
 
package/dist/create.d.ts CHANGED
@@ -11,6 +11,6 @@ export interface CreateProjectResult {
11
11
  /** Published framework version referenced by generated projects. */
12
12
  export declare const TRANSONE_FRAMEWORK_VERSION = "0.4.0";
13
13
  /** Published CLI version referenced by generated projects. */
14
- export declare const TRANSONE_CLI_VERSION = "0.6.3";
14
+ export declare const TRANSONE_CLI_VERSION = "0.7.0";
15
15
  export declare const GITHUB_URL = "https://github.com/geektech-team/transone";
16
16
  export declare function createProject(options?: CreateProjectOptions): CreateProjectResult;
@@ -0,0 +1,7 @@
1
+ export interface DocumentStylesResult {
2
+ html: string;
3
+ assets: string[];
4
+ }
5
+ /** Externalize the document shell's CSS without changing stylesheet order. */
6
+ export declare function emitDocumentStyles(html: string, outDir: string, assetUrl: (path: string) => string, stylesheets: string[], componentStylesheets?: string[]): Promise<DocumentStylesResult>;
7
+ export declare function emitComponentStyles(styles: ReadonlyMap<string, string>, outDir: string): Promise<string[]>;