Merge branch 'tw93:master' into master
This commit is contained in:
19
bin/builders/common.ts
vendored
19
bin/builders/common.ts
vendored
@@ -37,6 +37,25 @@ export async function mergeTauriConfig(
|
|||||||
transparent,
|
transparent,
|
||||||
resizable,
|
resizable,
|
||||||
};
|
};
|
||||||
|
// Package name is valid ?
|
||||||
|
// for Linux, package name must be a-z, 0-9 or "-", not allow to A-Z and other
|
||||||
|
if (process.platform === "linux") {
|
||||||
|
const reg = new RegExp(/[0-9]*[a-z]+[0-9]*\-?[0-9]*[a-z]*[0-9]*\-?[0-9]*[a-z]*[0-9]*/);
|
||||||
|
if (!reg.test(name) || reg.exec(name)[0].length != name.length) {
|
||||||
|
logger.error("package name is illegal, it must be lowercase letters, numbers, dashes, and it must contain the lowercase letters.")
|
||||||
|
logger.error("E.g com-123-xxx, 123pan, pan123,weread, we-read");
|
||||||
|
process.exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (process.platform === "win32" || process.platform === "darwin" ) {
|
||||||
|
const reg = new RegExp(/([0-9]*[a-zA-Z]+[0-9]*)+/);
|
||||||
|
if (!reg.test(name) || reg.exec(name)[0].length != name.length) {
|
||||||
|
logger.error("package name is illegal, it must be letters, numbers, and it must contain the letters")
|
||||||
|
logger.error("E.g 123pan,123Pan Pan123,weread, WeRead, WERead");
|
||||||
|
process.exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Object.assign(tauriConf.tauri.windows[0], { url, ...tauriConfWindowOptions });
|
Object.assign(tauriConf.tauri.windows[0], { url, ...tauriConfWindowOptions });
|
||||||
tauriConf.package.productName = name;
|
tauriConf.package.productName = name;
|
||||||
|
|||||||
20
dist/cli.js
vendored
20
dist/cli.js
vendored
@@ -1632,6 +1632,24 @@ function mergeTauriConfig(url, options, tauriConf) {
|
|||||||
transparent,
|
transparent,
|
||||||
resizable,
|
resizable,
|
||||||
};
|
};
|
||||||
|
// Package name is valid ?
|
||||||
|
// for Linux, package name must be a-z, 0-9 or "-", not allow to A-Z and other
|
||||||
|
if (process.platform === "linux") {
|
||||||
|
const reg = new RegExp(/[0-9]*[a-z]+[0-9]*\-?[0-9]*[a-z]*[0-9]*\-?[0-9]*[a-z]*[0-9]*/);
|
||||||
|
if (!reg.test(name) || reg.exec(name)[0].length != name.length) {
|
||||||
|
logger.error("package name is illegal, it must be lowercase letters, numbers, dashes, and it must contain the lowercase letters.");
|
||||||
|
logger.error("E.g com-123-xxx, 123pan, pan123,weread, we-read");
|
||||||
|
process.exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (process.platform === "win32" || process.platform === "darwin") {
|
||||||
|
const reg = new RegExp(/([0-9]*[a-zA-Z]+[0-9]*)+/);
|
||||||
|
if (!reg.test(name) || reg.exec(name)[0].length != name.length) {
|
||||||
|
logger.error("package name is illegal, it must be letters, numbers, and it must contain the letters");
|
||||||
|
logger.error("E.g 123pan,123Pan Pan123,weread, WeRead, WERead");
|
||||||
|
process.exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
Object.assign(tauriConf.tauri.windows[0], Object.assign({ url }, tauriConfWindowOptions));
|
Object.assign(tauriConf.tauri.windows[0], Object.assign({ url }, tauriConfWindowOptions));
|
||||||
tauriConf.package.productName = name;
|
tauriConf.package.productName = name;
|
||||||
tauriConf.tauri.bundle.identifier = identifier;
|
tauriConf.tauri.bundle.identifier = identifier;
|
||||||
@@ -2209,7 +2227,7 @@ var scripts = {
|
|||||||
tauri: "tauri",
|
tauri: "tauri",
|
||||||
cli: "rollup -c rollup.config.js --watch",
|
cli: "rollup -c rollup.config.js --watch",
|
||||||
"cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
|
"cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js",
|
||||||
"cli:publish": "npm run cli:build && npm publish"
|
prepublishOnly: "npm run cli:build"
|
||||||
};
|
};
|
||||||
var type = "module";
|
var type = "module";
|
||||||
var exports = "./dist/pake.js";
|
var exports = "./dist/pake.js";
|
||||||
|
|||||||
Reference in New Issue
Block a user