mirror of
https://github.com/msojocs/wx-compiler.git
synced 2025-07-19 00:00:04 +08:00
update: wcc, wcsc版本
This commit is contained in:
parent
76434aa12a
commit
9d4b959e5a
@ -1,3 +1,9 @@
|
|||||||
|
## 🌈 v0.0.6 / 2024-06-30
|
||||||
|
|
||||||
|
🚀Features
|
||||||
|
|
||||||
|
- 版本:更新至 -> 3c3eb3ac0ec1f85e5a72a9e7608a770a wcc.exe, 472fef6c6e0f6b3217e3d3dfa85188b2 wcsc.exe
|
||||||
|
|
||||||
## 🌈 v0.0.5 / 2023-09-23
|
## 🌈 v0.0.5 / 2023-09-23
|
||||||
|
|
||||||
🐞 Bug Fixes
|
🐞 Bug Fixes
|
||||||
@ -12,6 +18,7 @@
|
|||||||
- `WXSS::CSSTreeLib::RewriteSelectorRule::MarkGood`: 比较字符串错误
|
- `WXSS::CSSTreeLib::RewriteSelectorRule::MarkGood`: 比较字符串错误
|
||||||
|
|
||||||
🚀Features
|
🚀Features
|
||||||
|
|
||||||
- feat: 添加新的`wcsc`的测试用例
|
- feat: 添加新的`wcsc`的测试用例
|
||||||
|
|
||||||
## 🌈 v0.0.3 / 2023-08-31
|
## 🌈 v0.0.3 / 2023-08-31
|
||||||
|
File diff suppressed because one or more lines are too long
10
src/wcc.cpp
10
src/wcc.cpp
@ -268,13 +268,17 @@ int main(int argc, const char **argv)
|
|||||||
{
|
{
|
||||||
std::string versionInfo;
|
std::string versionInfo;
|
||||||
WXML::Compiler::GetVersionInfo(versionInfo, "global");
|
WXML::Compiler::GetVersionInfo(versionInfo, "global");
|
||||||
|
FILE *f;
|
||||||
if (!outputFileName.empty())
|
if (!outputFileName.empty())
|
||||||
{
|
{
|
||||||
FILE *f;
|
|
||||||
f = fopen(outputFileName.c_str(), "w");
|
f = fopen(outputFileName.c_str(), "w");
|
||||||
fprintf(f, "%s\n", versionInfo.c_str());
|
|
||||||
fclose(f);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
f = stdout;
|
||||||
|
}
|
||||||
|
fprintf(f, "%s\n", versionInfo.c_str());
|
||||||
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// main - 30
|
// main - 30
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
const char *sCliVersion = "20230804";
|
||||||
//----- (00401726) --------------------------------------------------------
|
//----- (00401726) --------------------------------------------------------
|
||||||
int usage(int argc, const char **argv)
|
int usage(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
printf("Wechat WXML Compiler, version %s\n", "v0.5vv_20200413_syb_scopedata");
|
printf("Wechat WXML Compiler, core version %s, cli version %s\n", "v0.5vv_20211229_syb_scopedata", sCliVersion);
|
||||||
printf(
|
printf(
|
||||||
"Usage: %s [-d] [-o OUTPUT] [-xc XComponentDefine] [-om XComponentDefine] [-cb [callback.js...]] [-llcommon] [-llw/-l"
|
"Usage: %s [-d] [-o OUTPUT] [-xc XComponentDefine] [-om XComponentDefine] [-cb [callback.js...]] [-llcommon] [-llw/-l"
|
||||||
"la XCPath] <FILES... | -s <SINGLE_FILE>\n",
|
"la XCPath] [--wxs ContentMapFile] <FILES... | -s <SINGLE_FILE>\n",
|
||||||
*argv);
|
*argv);
|
||||||
printf(" Options:\n");
|
printf(" Options:\n");
|
||||||
printf(" -d: output code for debug\n");
|
printf(" -d: output code for debug\n");
|
||||||
@ -19,5 +20,8 @@ int usage(int argc, const char **argv)
|
|||||||
printf(" -llw: compile in lazy load mode (webiew)\n");
|
printf(" -llw: compile in lazy load mode (webiew)\n");
|
||||||
printf(" -lla: compile in lazy load mode (app service)\n");
|
printf(" -lla: compile in lazy load mode (app service)\n");
|
||||||
printf(" args XCPath: custom component paths connected by comma or --split (./page/index,./comp/comp)\n");
|
printf(" args XCPath: custom component paths connected by comma or --split (./page/index,./comp/comp)\n");
|
||||||
|
printf(" --wxs: compile wxs scripts for glass-easel\n");
|
||||||
|
puts(" --gdc: gdc function for glass-easel");
|
||||||
|
puts(" --wxs-env: wxs env for glass-easel");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
@ -3,7 +3,7 @@
|
|||||||
//----- (00401726) --------------------------------------------------------
|
//----- (00401726) --------------------------------------------------------
|
||||||
int usage(int argc, const char **argv)
|
int usage(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
printf("*** WeChat Stylesheet Compiler, Version %s ***\n", "v0.4me_20190328_db");
|
printf("*** WeChat Stylesheet Compiler, Version %s ***\n", "v0.4me_20200724_db");
|
||||||
printf(
|
printf(
|
||||||
"Usage: %s [-lc] [-o OUTPUT] [-s <NAME OF FILE>] [-st] [-js] [-db] [-cp <CLASS PREFIX>] [-pc <FILE COUNT>] <[-sd <SOU"
|
"Usage: %s [-lc] [-o OUTPUT] [-s <NAME OF FILE>] [-st] [-js] [-db] [-cp <CLASS PREFIX>] [-pc <FILE COUNT>] <[-sd <SOU"
|
||||||
"RCE DIRECTLY>] | <root_css_file..> [import_css_files..]>\n",
|
"RCE DIRECTLY>] | <root_css_file..> [import_css_files..]>\n",
|
||||||
|
@ -447,7 +447,7 @@ namespace WXML{
|
|||||||
*ss << "__WXML_GLOBAL__.modules = __WXML_GLOBAL__.modules || {};" << lineEndMark;
|
*ss << "__WXML_GLOBAL__.modules = __WXML_GLOBAL__.modules || {};" << lineEndMark;
|
||||||
if (v225 && gwxMark != "$gwx" && (mark & 0x60) == 0)
|
if (v225 && gwxMark != "$gwx" && (mark & 0x60) == 0)
|
||||||
{
|
{
|
||||||
*ss << "$gwx('init', global);" << lineEndMark;
|
*ss << "if (typeof $gwx === 'function') $gwx('init', global);" << lineEndMark;
|
||||||
}
|
}
|
||||||
*ss << "var " << eMark << "={}" << lineEndMark;
|
*ss << "var " << eMark << "={}" << lineEndMark;
|
||||||
*ss << "if(typeof(global.entrys)==='undefined')global.entrys={};" << eMark << "=global.entrys;" << lineEndMark;
|
*ss << "if(typeof(global.entrys)==='undefined')global.entrys={};" << eMark << "=global.entrys;" << lineEndMark;
|
||||||
@ -1782,12 +1782,12 @@ namespace WXML{
|
|||||||
{
|
{
|
||||||
std::stringstream result;
|
std::stringstream result;
|
||||||
result << "/*";
|
result << "/*";
|
||||||
result << "v0.5vv_20200413_syb_scopedata";
|
result << "v0.5vv_20211229_syb_scopedata";
|
||||||
result << "*/";
|
result << "*/";
|
||||||
|
|
||||||
result << a2;
|
result << a2;
|
||||||
result << ".__wcc_version__='";
|
result << ".__wcc_version__='";
|
||||||
result << "v0.5vv_20200413_syb_scopedata";
|
result << "v0.5vv_20211229_syb_scopedata";
|
||||||
result << "';";
|
result << "';";
|
||||||
result << a2;
|
result << a2;
|
||||||
result << ".__wcc_version_info__={\"customComponents\":true,\"fixZeroRpx\":true,\"propValueDeepCopy\":false};";
|
result << ".__wcc_version_info__={\"customComponents\":true,\"fixZeroRpx\":true,\"propValueDeepCopy\":false};";
|
||||||
|
@ -40,7 +40,7 @@ namespace WXSS
|
|||||||
int ret = v12.offset_0;
|
int ret = v12.offset_0;
|
||||||
if (!v12.offset_0)
|
if (!v12.offset_0)
|
||||||
{
|
{
|
||||||
a3 = "/*v0.4me_20190328_db*/\n";
|
a3 = "/*v0.4me_20200724_db*/\n";
|
||||||
if (a8)
|
if (a8)
|
||||||
{
|
{
|
||||||
ret = v12.ShowTree(a3);
|
ret = v12.ShowTree(a3);
|
||||||
@ -75,7 +75,7 @@ namespace WXSS
|
|||||||
ret = v32.GetCommHead(a2, v21, true, a8);
|
ret = v32.GetCommHead(a2, v21, true, a8);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
a3 = "version=v0.4me_20190328_db=";
|
a3 = "version=v0.4me_20200724_db=";
|
||||||
std::string v28 = WXML::Rewrite::ToStringCode2(v21);
|
std::string v28 = WXML::Rewrite::ToStringCode2(v21);
|
||||||
v28 = v28.insert(0, "comm=");
|
v28 = v28.insert(0, "comm=");
|
||||||
v28.append("=");
|
v28.append("=");
|
||||||
|
@ -62,7 +62,8 @@ const wcc = (args: string[], projectPath: string): Promise<string> => {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
wine.on("close", (n) => {
|
wine.on("close", (n) => {
|
||||||
// console.log("wine n: ", n);
|
// console.log("wine n: ", n);
|
||||||
if (0 === n) {
|
const errMsg = Buffer.concat(errData).toString()
|
||||||
|
if (0 === n || errMsg.length == 0) {
|
||||||
let result = Buffer.concat(spwanData).toString();
|
let result = Buffer.concat(spwanData).toString();
|
||||||
// result = JSON.parse(result);
|
// result = JSON.parse(result);
|
||||||
resolve(result);
|
resolve(result);
|
||||||
|
34
test/spec/wcc/empty/version.spec.ts
Normal file
34
test/spec/wcc/empty/version.spec.ts
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
|
||||||
|
import assert from 'assert';
|
||||||
|
import path from 'path';
|
||||||
|
import linux from '../../../runner/linux'
|
||||||
|
import windows from '../../../runner/windows'
|
||||||
|
import * as fs from 'fs'
|
||||||
|
|
||||||
|
describe("wcc - empty", function () {
|
||||||
|
describe("Empty: default command output", function () {
|
||||||
|
it("版本", async function () {
|
||||||
|
const projectPath = __dirname;
|
||||||
|
const args: string[] = [
|
||||||
|
"-v"
|
||||||
|
];
|
||||||
|
let w = ""
|
||||||
|
try
|
||||||
|
{
|
||||||
|
w = (await windows.wcc(args, projectPath)).replace(/\r\n/g, '\n')
|
||||||
|
}catch{}
|
||||||
|
const n = await linux.wcc(args, projectPath);
|
||||||
|
const storagePath = path.resolve(
|
||||||
|
__dirname,
|
||||||
|
`version/${this.test?.title}`
|
||||||
|
);
|
||||||
|
try {
|
||||||
|
fs.mkdirSync(storagePath, { recursive: true });
|
||||||
|
} catch (error) {}
|
||||||
|
|
||||||
|
fs.writeFileSync(`${storagePath}/wine-output.js`, w);
|
||||||
|
fs.writeFileSync(`${storagePath}/node-output.js`, n);
|
||||||
|
assert.equal(w, n);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
32
test/spec/wcsc/empty/version.spec.ts
Normal file
32
test/spec/wcsc/empty/version.spec.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
import assert from 'assert';
|
||||||
|
import path from 'path';
|
||||||
|
import linux from '../../../runner/linux'
|
||||||
|
import windows from '../../../runner/windows'
|
||||||
|
import * as fs from 'fs'
|
||||||
|
|
||||||
|
describe("wcsc - empty", function () {
|
||||||
|
describe("Empty: default command output", function () {
|
||||||
|
it("使用说明", async function () {
|
||||||
|
const projectPath = __dirname;
|
||||||
|
const args: string[] = [
|
||||||
|
"-v"
|
||||||
|
];
|
||||||
|
let w = (await windows.wcsc(args, projectPath)).replace(/\r\n/g, '\n')
|
||||||
|
let n = await linux.wcsc(args, projectPath);
|
||||||
|
const storagePath = path.resolve(
|
||||||
|
__dirname,
|
||||||
|
`version/${this.test?.title}`
|
||||||
|
);
|
||||||
|
w = w.replace('wcsc.exe', '')
|
||||||
|
n = n.replace(/\/.*?\/wcsc/, '')
|
||||||
|
try {
|
||||||
|
fs.mkdirSync(storagePath, { recursive: true });
|
||||||
|
} catch (error) {}
|
||||||
|
|
||||||
|
fs.writeFileSync(`${storagePath}/wine-output.js`, w);
|
||||||
|
fs.writeFileSync(`${storagePath}/linux-output.js`, n);
|
||||||
|
assert.equal(w, n);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
387743
test/wcc.disassembly.cpp
387743
test/wcc.disassembly.cpp
File diff suppressed because one or more lines are too long
354537
test/wcsc.disassembly.cpp
354537
test/wcsc.disassembly.cpp
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,3 @@
|
|||||||
root@DESKTOP-AL3TQTI:~/github/wx-compiler/test/wine# md5sum wcc.exe wcsc.exe
|
msojocs@DESKTOP-1TV4OAG:~/github/wx-compiler/test/wine$ md5sum wcc.exe wcsc.exe
|
||||||
a310e176feb4bff40eb6d901d7b8e083 wcc.exe
|
3c3eb3ac0ec1f85e5a72a9e7608a770a wcc.exe
|
||||||
1a9ed324400861c62d2d22c709bab105 wcsc.exe
|
472fef6c6e0f6b3217e3d3dfa85188b2 wcsc.exe
|
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user