@dimina/compiler 1.0.4 → 1.0.6

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
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 编译工具
6
6
 
7
- 星河小程序编译工具(dmcc)用于将小程序源码编译为星河小程序运行时所需的文件格式。
7
+ 星河小程序编译工具(DMCC)用于将小程序源码编译为星河小程序运行时所需的文件格式。
8
8
 
9
9
  ### 安装
10
10
 
@@ -5,7 +5,7 @@ const path = require("node:path");
5
5
  const commander = require("commander");
6
6
  const chokidar = require("chokidar");
7
7
  const index = require("../index.cjs");
8
- const version = "1.0.4";
8
+ const version = "1.0.5";
9
9
  const pack = {
10
10
  version
11
11
  };
package/dist/bin/index.js CHANGED
@@ -4,7 +4,7 @@ import path from "node:path";
4
4
  import { program } from "commander";
5
5
  import chokidar from "chokidar";
6
6
  import build from "../index.js";
7
- const version = "1.0.4";
7
+ const version = "1.0.5";
8
8
  const pack = {
9
9
  version
10
10
  };
@@ -89,7 +89,9 @@ async function enhanceCSS(module2) {
89
89
  if (compileRes.has(absolutePath)) {
90
90
  return compileRes.get(absolutePath);
91
91
  }
92
- const fixedCSS = inputCSS.replace(/@import.*?(?<!;)\s*$/gm, "$&;");
92
+ const fixedCSS = inputCSS.replace(/@import[^;\n]*$/gm, (match) => {
93
+ return match.endsWith(";") ? match : `${match};`;
94
+ });
93
95
  const ast = postcss.parse(fixedCSS);
94
96
  const promises = [];
95
97
  ast.walk(async (node) => {
@@ -88,7 +88,9 @@ async function enhanceCSS(module) {
88
88
  if (compileRes.has(absolutePath)) {
89
89
  return compileRes.get(absolutePath);
90
90
  }
91
- const fixedCSS = inputCSS.replace(/@import.*?(?<!;)\s*$/gm, "$&;");
91
+ const fixedCSS = inputCSS.replace(/@import[^;\n]*$/gm, (match) => {
92
+ return match.endsWith(";") ? match : `${match};`;
93
+ });
92
94
  const ast = postcss.parse(fixedCSS);
93
95
  const promises = [];
94
96
  ast.walk(async (node) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimina/compiler",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "星河编译工具",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -45,24 +45,21 @@
45
45
  "星河"
46
46
  ],
47
47
  "dependencies": {
48
- "@babel/core": "^7.26.10",
49
- "@babel/traverse": "^7.27.0",
50
- "@babel/types": "^7.27.0",
51
- "@vue/compiler-sfc": "^3.5.13",
48
+ "@babel/core": "^7.27.1",
49
+ "@babel/traverse": "^7.27.1",
50
+ "@babel/types": "^7.27.1",
51
+ "@vue/compiler-sfc": "^3.5.14",
52
52
  "autoprefixer": "^10.4.21",
53
- "cheerio": "1.0.0-rc.12",
54
- "chokidar": "^3.6.0",
55
- "commander": "^12.1.0",
56
- "cssnano": "^6.1.2",
57
- "esbuild": "^0.24.2",
58
- "htmlparser2": "^9.1.0",
59
- "listr2": "^8.3.2",
53
+ "cheerio": "^1.0.0",
54
+ "chokidar": "^4.0.3",
55
+ "commander": "^14.0.0",
56
+ "cssnano": "^7.0.7",
57
+ "esbuild": "^0.25.4",
58
+ "htmlparser2": "^10.0.0",
59
+ "listr2": "^8.3.3",
60
60
  "postcss": "^8.5.3",
61
- "postcss-selector-parser": "^6.1.2",
62
- "shelljs": "^0.8.5"
63
- },
64
- "devDependencies": {
65
- "vitest": "2.1.8"
61
+ "postcss-selector-parser": "^7.1.0",
62
+ "shelljs": "^0.10.0"
66
63
  },
67
64
  "publishConfig": {
68
65
  "registry": "https://registry.npmjs.org/"