Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-cli into dev
This commit is contained in:
commit
9f905f5f4e
|
|
@ -32,7 +32,7 @@ module.exports = (babel) => {
|
||||||
ele => t.isObjectProperty(ele) && t.isIdentifier(ele.key) && ele.key.name === 'path'
|
ele => t.isObjectProperty(ele) && t.isIdentifier(ele.key) && ele.key.name === 'path'
|
||||||
);
|
);
|
||||||
if (pathProperty) {
|
if (pathProperty) {
|
||||||
console.warn(`${rel}页面的OakPage中还是定义了path,可以删除掉了`);
|
console.warn(`${resolvePath}页面的OakPage中还是定义了path,可以删除掉了`);
|
||||||
pathProperty.value = t.stringLiteral(relativePath);
|
pathProperty.value = t.stringLiteral(relativePath);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,21 @@ function transformCode(text, namespace, moduleName) {
|
||||||
const { node } = path;
|
const { node } = path;
|
||||||
if (t.isIdentifier(node.callee) && node.callee.name === 't') {
|
if (t.isIdentifier(node.callee) && node.callee.name === 't') {
|
||||||
const { arguments } = node;
|
const { arguments } = node;
|
||||||
// 在t的后面加五个参数(oakLocales, oakLng, oakDefaultLng, oakNamespace, oakModule)
|
// 在t的后面加五个参数(oakLocales, oakLng, oakDefaultLng, oakNamespace,
|
||||||
|
// 增强能力:如果t后面的第二个参数是字符串,说明想指定oakNamespace,在一些抽象模块中会有此需求
|
||||||
|
if (arguments[1] && t.isStringLiteral(arguments[1])) {
|
||||||
|
arguments.splice(
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
t.identifier('oakLocales'),
|
||||||
|
t.identifier('oakLng'),
|
||||||
|
t.identifier('oakDefaultLng')
|
||||||
|
);
|
||||||
|
arguments.push(
|
||||||
|
t.stringLiteral(moduleName)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
arguments.push(
|
arguments.push(
|
||||||
t.identifier('oakLocales'),
|
t.identifier('oakLocales'),
|
||||||
t.identifier('oakLng'),
|
t.identifier('oakLng'),
|
||||||
|
|
@ -145,6 +159,7 @@ function transformCode(text, namespace, moduleName) {
|
||||||
t.stringLiteral(namespace),
|
t.stringLiteral(namespace),
|
||||||
t.stringLiteral(moduleName)
|
t.stringLiteral(moduleName)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
node.callee = t.memberExpression(
|
node.callee = t.memberExpression(
|
||||||
t.identifier('i18n'),
|
t.identifier('i18n'),
|
||||||
t.identifier('t')
|
t.identifier('t')
|
||||||
|
|
@ -253,7 +268,8 @@ module.exports = async function (content) {
|
||||||
x.indexOf('missed quot(")!') === -1 &&
|
x.indexOf('missed quot(")!') === -1 &&
|
||||||
x.indexOf('unclosed xml attribute') == -1
|
x.indexOf('unclosed xml attribute') == -1
|
||||||
) {
|
) {
|
||||||
console.log(x);
|
|
||||||
|
console.warn(`${filePath}文件出现警告:${x}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ const nullthrows = require("nullthrows");
|
||||||
const replaceEnvExpressionPlugin = require('./babelEnvPlugin');
|
const replaceEnvExpressionPlugin = require('./babelEnvPlugin');
|
||||||
|
|
||||||
const { injectGetRender } = require('../utils/injectGetRender');
|
const { injectGetRender } = require('../utils/injectGetRender');
|
||||||
|
const oakPathTsxPlugin = require('../babel-plugin/oakPath');
|
||||||
|
|
||||||
async function renderToCSS({ src, filename, options = {} }) {
|
async function renderToCSS({ src, filename, options = {} }) {
|
||||||
const { lessOptions = {} } = options;
|
const { lessOptions = {} } = options;
|
||||||
|
|
@ -50,7 +51,7 @@ function transform({ filename, options, plugins, src }) {
|
||||||
cwd: options.projectRoot,
|
cwd: options.projectRoot,
|
||||||
highlightCode: true,
|
highlightCode: true,
|
||||||
filename,
|
filename,
|
||||||
plugins: plugins.concat(replaceEnvExpressionPlugin),
|
plugins: plugins.concat([replaceEnvExpressionPlugin, oakPathTsxPlugin]),
|
||||||
sourceType: "module",
|
sourceType: "module",
|
||||||
// NOTE(EvanBacon): We split the parse/transform steps up to accommodate
|
// NOTE(EvanBacon): We split the parse/transform steps up to accommodate
|
||||||
// Hermes parsing, but this defaults to cloning the AST which increases
|
// Hermes parsing, but this defaults to cloning the AST which increases
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ async function startup(path, contextBuilder, connector, omitWatchers, omitTimers
|
||||||
allowedHeaders: ["oak-cxt"],
|
allowedHeaders: ["oak-cxt"],
|
||||||
};
|
};
|
||||||
const io = new socket_io_1.Server(httpServer, socketOption);
|
const io = new socket_io_1.Server(httpServer, socketOption);
|
||||||
if (process.env.PM2_STATUS) {
|
if (process.env.pm_id || process.env.PM_ID) {
|
||||||
// pm2环境下要接入clusterAdapter
|
// pm2环境下要接入clusterAdapter
|
||||||
// https://socket.io/zh-CN/docs/v4/pm2/
|
// https://socket.io/zh-CN/docs/v4/pm2/
|
||||||
io.adapter((0, cluster_adapter_1.createAdapter)());
|
io.adapter((0, cluster_adapter_1.createAdapter)());
|
||||||
|
|
@ -148,5 +148,9 @@ async function startup(path, contextBuilder, connector, omitWatchers, omitTimers
|
||||||
if (!omitTimers) {
|
if (!omitTimers) {
|
||||||
appLoader.startTimers();
|
appLoader.startTimers();
|
||||||
}
|
}
|
||||||
|
process.on('SIGINT', async () => {
|
||||||
|
await appLoader.unmount();
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
exports.startup = startup;
|
exports.startup = startup;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ export async function startup<ED extends EntityDict & BaseEntityDict, Cxt extend
|
||||||
allowedHeaders: ["oak-cxt"],
|
allowedHeaders: ["oak-cxt"],
|
||||||
};
|
};
|
||||||
const io = new Server(httpServer, socketOption);
|
const io = new Server(httpServer, socketOption);
|
||||||
if (process.env.PM2_STATUS) {
|
if (process.env.pm_id || process.env.PM_ID) {
|
||||||
// pm2环境下要接入clusterAdapter
|
// pm2环境下要接入clusterAdapter
|
||||||
// https://socket.io/zh-CN/docs/v4/pm2/
|
// https://socket.io/zh-CN/docs/v4/pm2/
|
||||||
io.adapter(createAdapter());
|
io.adapter(createAdapter());
|
||||||
|
|
@ -170,4 +170,9 @@ export async function startup<ED extends EntityDict & BaseEntityDict, Cxt extend
|
||||||
if (!omitTimers) {
|
if (!omitTimers) {
|
||||||
appLoader.startTimers();
|
appLoader.startTimers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
process.on('SIGINT', async () => {
|
||||||
|
await appLoader.unmount();
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -1,24 +1,19 @@
|
||||||
/** app.wxss **/
|
/** app.wxss **/
|
||||||
|
|
||||||
@font-face {
|
page {
|
||||||
font-family: "Material Symbols Rounded";
|
height: 100%;
|
||||||
font-style: normal;
|
width: 100%;
|
||||||
font-weight: 400;
|
|
||||||
src: url(https://fonts.gstatic.com/s/sandbox/materialsymbolsrounded/v7/syl0-zNym6YjUruM-QrEh7-nyTnjDwKNJ_190FjpZIvDmUSVOK7BDB_Qb9vUSzq3wzLK-P0J-V_Zs-QtQth3-jOc7TOVpeRL2w5rwZu2rIelXxc.woff2) format("woff2");
|
|
||||||
}
|
|
||||||
|
|
||||||
.material-symbols-rounded {
|
--oak-color-primary: #0052d9;
|
||||||
font-family: "Material Symbols Rounded";
|
--oak-color-error: #e34d59;
|
||||||
font-weight: normal;
|
--oak-color-warning: #db7b2f;
|
||||||
font-style: normal;
|
--oak-color-success: #00a870;
|
||||||
font-size: 44rpx;
|
--oak-color-info: #d4e3fc;
|
||||||
line-height: 1;
|
--oak-bg-color-page: #eee;
|
||||||
letter-spacing: normal;
|
--oak-bg-color-container: #fff;
|
||||||
text-transform: none;
|
--oak-bg-color-component: #e7e7e7;
|
||||||
display: inline-block;
|
--oak-text-color-primary: rgb(0 0 0 / 90%);
|
||||||
white-space: nowrap;
|
--oak-text-color-secondary: rgb(0 0 0 / 60%);
|
||||||
word-wrap: normal;
|
--oak-text-color-placeholder: rgb(0 0 0 / 40%);
|
||||||
direction: ltr;
|
--oak-text-color-disabled: rgb(0 0 0 / 26%);
|
||||||
font-feature-settings: "liga";
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue