fix: wcsc 索引与 一个括号 (#12)

* fix: wine environment

* fix: wine environment

* fix: environment

* perf: remove recommend

* fix: env

* Update release.yml

* fix: permission of wcsc.exe

* fix: 一处越界问题

* fix: pnpm install

* fix: wine prepare

* fix: wine cfg

* feat: error console

* fix: 兼容clang

* perf: 调整位置

* perf: 带入环境

* fix: version

* perf: log

* fix: version check

* fix: version

* fix: wcsc 索引与 一个括号
处理一处索引出现负数的问题;
一处css输出了多余的括号。

* fix: ci
This commit is contained in:
msojocs 2025-02-16 22:43:43 +08:00 committed by GitHub
parent 754a09886e
commit f31c7dbe8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 342 additions and 6 deletions

View File

@ -71,7 +71,7 @@ jobs:
ls -l
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
# Artifact name
name: wx-compiler-${{ matrix.ARCH }}.build
@ -99,7 +99,7 @@ jobs:
node-version: '18.12.0'
check-latest: false
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
- name: Inspect directory after downloading artifacts
run: ls -alFR
@ -153,7 +153,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
- name: Inspect directory after downloading artifacts
run: ls -alFR

View File

@ -7,6 +7,7 @@ module.exports = {
// spec: "./test/spec/**/*.spec.ts",
spec: [
"./test/spec/**/*.spec.ts",
// 'test/spec/issue/129/issue129.spec.ts',
// 'test/spec/issue/115/issue115.spec.ts',
// 'test/spec/wcc/module/module.spec.ts',
],

12
.vscode/launch.json vendored
View File

@ -4,6 +4,18 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Linux module test",
"program": "${workspaceFolder}/cache/nwjs-sdk-v0.55.0-linux-x64/nw",
"args": [
"${workspaceFolder}/test/runner/nwjs/compiler.js",
"wcsc",
"${workspaceFolder}/test/spec/issue/129/data/example.json"
],
"cwd": "${workspaceFolder}"
},
{
"name": "wcc wxs sample2",

View File

@ -86,5 +86,6 @@
"--background-index",
"--compile-commands-dir=${workspaceFolder}/build/"
],
"cmake.sourceDirectory": "/home/msojocs/github/wx-compiler"
"cmake.sourceDirectory": "/home/msojocs/github/wx-compiler",
"clangd.path": "clangd-18"
}

View File

@ -1,3 +1,10 @@
## 🌈 v0.1.2 / 2025-02-16
🐞 Bug Fixes
- `WXML::RPX::accept`: 数组出现负数的问题。
- `WXML::Rewrite::RewriteImg`: 输出了多余的右括号。
## 🌈 v0.1.1 / 2024-08-10
🐞 Bug Fixes

View File

@ -301,7 +301,7 @@ namespace WXML {
{
std::stringstream v29;
v29 << "url(" << sa << "-do-not-use-local-path-" << a3;
v29 << "&" << a4 << "&" << a5 << ")";
v29 << "&" << a4 << "&" << a5;
std::string v26 = v29.str();
a2 += v26;
result = 1;

View File

@ -33,7 +33,7 @@ namespace WXML
for (i = a3; i > 0; i--)
{
v7 = v4;
v4 = a1[266 * v4 + *a4]; // 266 * 4 = 0x428
v4 = a1[266 * v4 + (uint8_t)*a4]; // 266 * 4 = 0x428
if (v4 == -1)
{
break;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,38 @@
import assert from "assert"
import path from "path"
import { describe } from "mocha";
import linux from '../../../runner/module-linux'
import windows from '../../../runner/module-windows'
import * as fs from 'fs'
describe("issue - 129", function () {
describe("issue: linux output should equal with wine", function () {
it("crash", async function () {
const p = path.resolve(__dirname, './data/example.json')
const storagePath = path.resolve(
__dirname,
`issue-129/${this.test?.title}`
);
try {
fs.mkdirSync(storagePath, { recursive: true });
} catch (error) {}
const w = await windows.wcsc(p);
const n = await linux.wcsc(p, '', storagePath);
// console.log('windows:', typeof w)
// console.log('linux:', typeof n)
fs.writeFileSync(
`${storagePath}/wine-output.json`,
JSON.stringify(w, null, 4)
);
fs.writeFileSync(
`${storagePath}/node-output.json`,
JSON.stringify(n, null, 4)
);
assert.equal(typeof n, typeof w);
assert.equal(w.success, true)
assert.deepEqual(n, w);
});
});
});

4
test/spec/issue/129/prepare.sh Executable file
View File

@ -0,0 +1,4 @@
#! /bin/bash
dir=$(cd `dirname $0` && pwd -P)

3
test/test-linux-module.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
/home/msojocs/github/wx-compiler/cache/nwjs-sdk-v0.55.0-linux-x64/nw /home/msojocs/github/wx-compiler/test/runner/nwjs/compiler.js wcsc /home/msojocs/github/wx-compiler/test/spec/issue/129/data/example.json