Merge branch 'release'
This commit is contained in:
commit
e789fa7ae5
|
|
@ -18,16 +18,16 @@ let moduleFileExtensions = [
|
|||
'ts',
|
||||
];
|
||||
|
||||
if (process.env.OAK_DEV_MODE === 'server') {
|
||||
moduleFileExtensions = [
|
||||
'server.js',
|
||||
'server.ts',
|
||||
].concat(moduleFileExtensions);
|
||||
} else {
|
||||
if (process.env.OAK_DEV_MODE === 'frontend') {
|
||||
moduleFileExtensions = [
|
||||
'frontend.js',
|
||||
'frontend.ts',
|
||||
].concat(moduleFileExtensions);
|
||||
} else {
|
||||
moduleFileExtensions = [
|
||||
'server.js',
|
||||
'server.ts',
|
||||
].concat(moduleFileExtensions);
|
||||
}
|
||||
|
||||
const prodFileExtensions = ['prod.mp.js', 'prod.mp.ts', 'prod.js', 'prod.ts'];
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ const assert = require('assert');
|
|||
|
||||
const REPLACE_HOLDERS = {
|
||||
OAK_PLATFORM: 'native',
|
||||
OAK_DEV_MODE: process.env.OAK_DEV_MODE,
|
||||
OAK_DEV_MODE: process.env.OAK_DEV_MODE || 'server',
|
||||
SUB_DIR_NAME: process.env.SUB_DIR_NAME || 'native',
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,20 +7,20 @@ const watchFolders = [
|
|||
|
||||
let moduleFileExtensions = ['js', 'ts', 'jsx', 'tsx', 'less', 'json', 'svg'];
|
||||
|
||||
if (process.env.OAK_DEV_MODE === 'server') {
|
||||
moduleFileExtensions = [
|
||||
'server.js',
|
||||
'server.ts',
|
||||
'server.tsx',
|
||||
'server.jsx',
|
||||
].concat(moduleFileExtensions);
|
||||
} else {
|
||||
if (process.env.OAK_DEV_MODE === 'frontend') {
|
||||
moduleFileExtensions = [
|
||||
'frontend.js',
|
||||
'frontend.ts',
|
||||
'frontend.tsx',
|
||||
'frontend.jsx',
|
||||
].concat(moduleFileExtensions);
|
||||
} else {
|
||||
moduleFileExtensions = [
|
||||
'server.js',
|
||||
'server.ts',
|
||||
'server.tsx',
|
||||
'server.jsx',
|
||||
].concat(moduleFileExtensions);
|
||||
}
|
||||
|
||||
const prodFileExtensions = [
|
||||
|
|
@ -47,9 +47,7 @@ else if (process.env.NODE_ENV === 'staging') {
|
|||
'staging.ts',
|
||||
'staging.jsx',
|
||||
'staging.tsx',
|
||||
]
|
||||
.concat(prodFileExtensions)
|
||||
.concat(moduleFileExtensions);
|
||||
].concat(prodFileExtensions).concat(moduleFileExtensions);
|
||||
} else {
|
||||
moduleFileExtensions = [
|
||||
'dev.native.js',
|
||||
|
|
|
|||
|
|
@ -77,21 +77,6 @@ function transform({ filename, options, plugins, src }) {
|
|||
|
||||
const transformResult = transformFromAstSync(sourceAst, src, babelConfig);
|
||||
|
||||
// 为page和componet下的OakComponent注入getRender函数,去取得同目录下的render.native.tsx
|
||||
// 改成plugin注入
|
||||
// const resultAst = transformResult.ast;
|
||||
// const { base } = path.parse(filename);
|
||||
// if (['index.ts', 'index.js'].includes(base)) {
|
||||
// traverse(resultAst, {
|
||||
// CallExpression(path) {
|
||||
// const node = path.node;
|
||||
// if (t.isIdentifier(node.callee) && node.callee.name === 'OakComponent') {
|
||||
// injectGetRender(node, options.projectRoot, filename, 'native');
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
return {
|
||||
ast: nullthrows(transformResult.ast),
|
||||
metadata: transformResult.metadata,
|
||||
|
|
@ -99,11 +84,6 @@ function transform({ filename, options, plugins, src }) {
|
|||
};
|
||||
|
||||
if (filename.endsWith('less')) {
|
||||
// return renderToCSS({ src, filename, options }).then((css) => {
|
||||
// const cssObject = renderCSSToReactNative(css);
|
||||
// const newSrc = `module.exports = ${JSON.stringify(cssObject)}`;
|
||||
// return transInner(newSrc);
|
||||
// });
|
||||
return lessTransformer.transform({ src, filename, options });
|
||||
}
|
||||
else if (filename.endsWith('.svg')) {
|
||||
|
|
|
|||
|
|
@ -41,16 +41,7 @@ let moduleFileExtensions = [
|
|||
'jsx',
|
||||
];
|
||||
|
||||
if (process.env.OAK_DEV_MODE === 'server') {
|
||||
moduleFileExtensions = [
|
||||
'server.mjs',
|
||||
'server.js',
|
||||
'server.ts',
|
||||
'server.tsx',
|
||||
'server.jsx',
|
||||
].concat(moduleFileExtensions);
|
||||
}
|
||||
else {
|
||||
if (process.env.OAK_DEV_MODE === 'frontend') {
|
||||
moduleFileExtensions = [
|
||||
'frontend.mjs',
|
||||
'frontend.js',
|
||||
|
|
@ -59,6 +50,15 @@ else {
|
|||
'frontend.jsx',
|
||||
].concat(moduleFileExtensions);
|
||||
}
|
||||
else {
|
||||
moduleFileExtensions = [
|
||||
'server.mjs',
|
||||
'server.js',
|
||||
'server.ts',
|
||||
'server.tsx',
|
||||
'server.jsx',
|
||||
].concat(moduleFileExtensions);
|
||||
}
|
||||
|
||||
const prodFileExtensions = [
|
||||
'prod.web.js',
|
||||
|
|
|
|||
39
lib/build.js
39
lib/build.js
|
|
@ -1,6 +1,5 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = build;
|
||||
const tslib_1 = require("tslib");
|
||||
const tip_style_1 = require("./tip-style");
|
||||
const cross_spawn_1 = tslib_1.__importDefault(require("cross-spawn"));
|
||||
|
|
@ -103,11 +102,12 @@ async function build(cmd) {
|
|||
let result;
|
||||
if (mode === 'production') {
|
||||
//cd native/android && cross-env NODE_ENV=production ./gradlew assembleRelease
|
||||
if (platform === 'android') {
|
||||
result = cross_spawn_1.default.sync(`cd android`, [
|
||||
'&& cross-env',
|
||||
`NODE_ENV=${mode}`,
|
||||
'OAK_PLATFORM=native',
|
||||
`OAK_DEV_MODE=${devMode}`,
|
||||
`OAK_DEV_MODE=server`,
|
||||
'./gradlew assembleRelease',
|
||||
].filter(Boolean), {
|
||||
cwd,
|
||||
|
|
@ -115,13 +115,29 @@ async function build(cmd) {
|
|||
shell: true,
|
||||
});
|
||||
}
|
||||
else {
|
||||
// cd native && cross-env NODE_ENV=staging OAK_PLATFORM=native OAK_DEV_MODE=server react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'
|
||||
result = cross_spawn_1.default.sync(`cd native`, [
|
||||
'&& cross-env',
|
||||
`NODE_ENV=${mode}`,
|
||||
'OAK_PLATFORM=native',
|
||||
`OAK_DEV_MODE=server`,
|
||||
"react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'",
|
||||
].filter(Boolean), {
|
||||
cwd,
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (mode === 'staging') {
|
||||
//cd native/android && cross-env NODE_ENV=production ./gradlew assembleStaging
|
||||
if (platform === 'android') {
|
||||
result = cross_spawn_1.default.sync(`cd android`, [
|
||||
'&& cross-env',
|
||||
`NODE_ENV=${mode}`,
|
||||
'OAK_PLATFORM=native',
|
||||
`OAK_DEV_MODE=${devMode}`,
|
||||
`OAK_DEV_MODE=server`,
|
||||
'./gradlew assembleStaging',
|
||||
].filter(Boolean), {
|
||||
cwd,
|
||||
|
|
@ -129,6 +145,20 @@ async function build(cmd) {
|
|||
shell: true,
|
||||
});
|
||||
}
|
||||
else {
|
||||
result = cross_spawn_1.default.sync(`cd native`, [
|
||||
'&& cross-env',
|
||||
`NODE_ENV=${mode}`,
|
||||
'OAK_PLATFORM=native',
|
||||
`OAK_DEV_MODE=server`,
|
||||
"react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'",
|
||||
].filter(Boolean), {
|
||||
cwd,
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = cross_spawn_1.default.sync(`cross-env`, [
|
||||
`NODE_ENV=${mode}`,
|
||||
|
|
@ -136,7 +166,7 @@ async function build(cmd) {
|
|||
`OAK_DEV_MODE=${devMode}`,
|
||||
'react-native',
|
||||
'start',
|
||||
cmd.resetCache && '--reset-cache',
|
||||
cmd.reset && '--reset-cache',
|
||||
].filter(Boolean), {
|
||||
cwd,
|
||||
stdio: 'inherit',
|
||||
|
|
@ -154,3 +184,4 @@ async function build(cmd) {
|
|||
(0, tip_style_1.Error)(`${(0, tip_style_1.error)(`target could only be web or mp(wechatMp) or rn(native)`)}`);
|
||||
}
|
||||
}
|
||||
exports.default = build;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = run;
|
||||
const tslib_1 = require("tslib");
|
||||
const tip_style_1 = require("./tip-style");
|
||||
const cross_spawn_1 = tslib_1.__importDefault(require("cross-spawn"));
|
||||
|
|
@ -49,3 +48,4 @@ async function run(options) {
|
|||
process.exit(-1);
|
||||
}
|
||||
}
|
||||
exports.default = run;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.create = create;
|
||||
exports.update = update;
|
||||
exports.update = exports.create = void 0;
|
||||
const tslib_1 = require("tslib");
|
||||
const ts = tslib_1.__importStar(require("typescript"));
|
||||
const fs_1 = require("fs");
|
||||
|
|
@ -243,7 +242,7 @@ async function create(dirName, cmd) {
|
|||
}
|
||||
// 获取package.json内容
|
||||
const packageJson = (0, template_1.packageJsonContent)({
|
||||
name: DEFAULT_PROJECT_NAME, // 后面再统一rename
|
||||
name: DEFAULT_PROJECT_NAME,
|
||||
version,
|
||||
description,
|
||||
cliName: config_1.CLI_NAME,
|
||||
|
|
@ -266,6 +265,7 @@ async function create(dirName, cmd) {
|
|||
(0, tip_style_1.Error)((0, tip_style_1.error)(err));
|
||||
}
|
||||
}
|
||||
exports.create = create;
|
||||
async function update(dirName, subDirName, cmd) {
|
||||
const isDev = cmd.dev ? true : false;
|
||||
try {
|
||||
|
|
@ -292,3 +292,4 @@ async function update(dirName, subDirName, cmd) {
|
|||
console.error((0, tip_style_1.error)(err.message));
|
||||
}
|
||||
}
|
||||
exports.update = update;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CreateCompilerConfig = CreateCompilerConfig;
|
||||
exports.CreateCompilerConfig = void 0;
|
||||
/**
|
||||
* 创建一个oak编译器配置
|
||||
* @param raw 原始配置
|
||||
|
|
@ -11,6 +11,7 @@ function CreateCompilerConfig(raw) {
|
|||
// 在这里可以做配置的预处理
|
||||
return raw;
|
||||
}
|
||||
exports.CreateCompilerConfig = CreateCompilerConfig;
|
||||
/**
|
||||
* 将compiler.js中的模块导出使用以下形式:
|
||||
* module.exports = CreateComilerConfig({})
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import { PathLike } from 'fs';
|
||||
import { checkFileExistsAndCreateType } from './enum';
|
||||
/**
|
||||
|
|
@ -37,7 +39,7 @@ export declare function writeFile(path: string | PathLike, data: any): void;
|
|||
export declare function readFile(path: string | PathLike, options?: {
|
||||
encoding?: null | undefined;
|
||||
flag?: string | undefined;
|
||||
} | null): Buffer<ArrayBufferLike> | undefined;
|
||||
} | null): Buffer | undefined;
|
||||
/**
|
||||
* @name 拷贝文件夹
|
||||
* @export
|
||||
|
|
|
|||
|
|
@ -1,15 +1,6 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.readDirPath = readDirPath;
|
||||
exports.readDirGetFile = readDirGetFile;
|
||||
exports.parseJsonFiles = parseJsonFiles;
|
||||
exports.parseJsonFile = parseJsonFile;
|
||||
exports.deleteFolderRecursive = deleteFolderRecursive;
|
||||
exports.writeFile = writeFile;
|
||||
exports.readFile = readFile;
|
||||
exports.copyFolder = copyFolder;
|
||||
exports.checkFileExists = checkFileExists;
|
||||
exports.checkFileExistsAndCreate = checkFileExistsAndCreate;
|
||||
exports.checkFileExistsAndCreate = exports.checkFileExists = exports.copyFolder = exports.readFile = exports.writeFile = exports.deleteFolderRecursive = exports.parseJsonFile = exports.parseJsonFiles = exports.readDirGetFile = exports.readDirPath = void 0;
|
||||
const fs_1 = require("fs");
|
||||
const path_1 = require("path");
|
||||
const enum_1 = require("./enum");
|
||||
|
|
@ -34,6 +25,7 @@ function readDirPath(entry) {
|
|||
}
|
||||
return pathList;
|
||||
}
|
||||
exports.readDirPath = readDirPath;
|
||||
/**
|
||||
* @name 读取指定目录的文件(不进行深度遍历,只获取根目录)
|
||||
* @export
|
||||
|
|
@ -44,6 +36,7 @@ function readDirGetFile(entry) {
|
|||
const dirInfo = (0, fs_1.readdirSync)(entry);
|
||||
return dirInfo;
|
||||
}
|
||||
exports.readDirGetFile = readDirGetFile;
|
||||
/**
|
||||
* @name 解析json文件(数组)
|
||||
* @export
|
||||
|
|
@ -58,6 +51,7 @@ function parseJsonFiles(arr) {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
exports.parseJsonFiles = parseJsonFiles;
|
||||
/**
|
||||
* @name 解析单个文件json
|
||||
* @export
|
||||
|
|
@ -73,6 +67,7 @@ function parseJsonFile(file) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
exports.parseJsonFile = parseJsonFile;
|
||||
/**
|
||||
* @name 删除文件夹
|
||||
* @export
|
||||
|
|
@ -102,6 +97,7 @@ function deleteFolderRecursive(entry) {
|
|||
// console.log("文件夹不存在");
|
||||
}
|
||||
}
|
||||
exports.deleteFolderRecursive = deleteFolderRecursive;
|
||||
;
|
||||
function writeFile(path, data) {
|
||||
try {
|
||||
|
|
@ -112,6 +108,7 @@ function writeFile(path, data) {
|
|||
(0, tip_style_1.Error)((0, tip_style_1.error)('文件写入失败'));
|
||||
}
|
||||
}
|
||||
exports.writeFile = writeFile;
|
||||
function readFile(path, options) {
|
||||
try {
|
||||
const data = (0, fs_1.readFileSync)(path, options);
|
||||
|
|
@ -122,6 +119,7 @@ function readFile(path, options) {
|
|||
(0, tip_style_1.Error)((0, tip_style_1.error)('文件读取失败'));
|
||||
}
|
||||
}
|
||||
exports.readFile = readFile;
|
||||
/**
|
||||
* @name 拷贝文件夹
|
||||
* @export
|
||||
|
|
@ -183,6 +181,7 @@ function copyFolder(currentDir, targetDir, overwrite = false) {
|
|||
throw new global.Error(`需要copy的文件夹不存在: ${currentDir}`);
|
||||
}
|
||||
}
|
||||
exports.copyFolder = copyFolder;
|
||||
/**
|
||||
* @name 检测文件/文件夹是否存在
|
||||
* @export
|
||||
|
|
@ -192,6 +191,7 @@ function copyFolder(currentDir, targetDir, overwrite = false) {
|
|||
function checkFileExists(path) {
|
||||
return (0, fs_1.existsSync)(path);
|
||||
}
|
||||
exports.checkFileExists = checkFileExists;
|
||||
/**
|
||||
* @name 检测文件/文件夹是否存在,不存在则创建
|
||||
* @export
|
||||
|
|
@ -217,3 +217,4 @@ function checkFileExistsAndCreate(path, data, type = enum_1.checkFileExistsAndCr
|
|||
throw new global.Error(`${path} already exists!`);
|
||||
}
|
||||
}
|
||||
exports.checkFileExistsAndCreate = checkFileExistsAndCreate;
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ commander_1.default
|
|||
.option('-d, --subDir <subDirName>', 'subDirName')
|
||||
.option('-p, --port <port>', 'port')
|
||||
.option('-dm, --devMode <devMode>', 'devMode')
|
||||
.option('--resetCache', 'react native start --reset-cache')
|
||||
.option('--reset', 'react native start --reset-cache')
|
||||
.description('build project of start on demand')
|
||||
.action(build_1.default);
|
||||
commander_1.default
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = make;
|
||||
const tslib_1 = require("tslib");
|
||||
const tip_style_1 = require("./tip-style");
|
||||
const cross_spawn_1 = tslib_1.__importDefault(require("cross-spawn"));
|
||||
|
|
@ -21,3 +20,4 @@ async function make(cmd) {
|
|||
process.exit(-1);
|
||||
}
|
||||
}
|
||||
exports.default = make;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = make;
|
||||
const tslib_1 = require("tslib");
|
||||
const tip_style_1 = require("./tip-style");
|
||||
const cross_spawn_1 = tslib_1.__importDefault(require("cross-spawn"));
|
||||
|
|
@ -21,3 +20,4 @@ async function make() {
|
|||
process.exit(-1);
|
||||
}
|
||||
}
|
||||
exports.default = make;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = make;
|
||||
const tslib_1 = require("tslib");
|
||||
const tip_style_1 = require("./tip-style");
|
||||
const localeBuilder_1 = tslib_1.__importDefault(require("oak-domain/lib/compiler/localeBuilder"));
|
||||
|
|
@ -19,3 +18,4 @@ async function make(cmd) {
|
|||
process.exit(-1);
|
||||
}
|
||||
}
|
||||
exports.default = make;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = make;
|
||||
const tslib_1 = require("tslib");
|
||||
const tip_style_1 = require("./tip-style");
|
||||
const cross_spawn_1 = tslib_1.__importDefault(require("cross-spawn"));
|
||||
|
|
@ -31,3 +30,4 @@ async function make(cmd, watch) {
|
|||
process.exit(-1);
|
||||
}
|
||||
}
|
||||
exports.default = make;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.renameProject = renameProject;
|
||||
exports.rename = rename;
|
||||
exports.rename = exports.renameProject = void 0;
|
||||
const path_1 = require("path");
|
||||
const fs_1 = require("fs");
|
||||
const editTemplate_1 = require("@react-native-community/cli/build/commands/init/editTemplate");
|
||||
|
|
@ -45,6 +44,7 @@ async function renameProject(dir, name, title, placeholderName, placeholderTitle
|
|||
process.chdir(cwd);
|
||||
(0, tip_style_1.Success)(`${(0, tip_style_1.success)(`Change project name to ${(0, tip_style_1.primary)(name)}, project title to ${(0, tip_style_1.primary)(title)}`)}`);
|
||||
}
|
||||
exports.renameProject = renameProject;
|
||||
async function rename(cmd) {
|
||||
const { oldName, newName, oldTitle, newTitle } = cmd;
|
||||
if (!oldName) {
|
||||
|
|
@ -65,3 +65,4 @@ async function rename(cmd) {
|
|||
}
|
||||
renameProject(process.cwd(), newName, newTitle, oldName, oldTitle);
|
||||
}
|
||||
exports.rename = rename;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = run;
|
||||
const tslib_1 = require("tslib");
|
||||
const tip_style_1 = require("./tip-style");
|
||||
const cross_spawn_1 = tslib_1.__importDefault(require("cross-spawn"));
|
||||
|
|
@ -60,3 +59,4 @@ async function run(options) {
|
|||
process.exit(-1);
|
||||
}
|
||||
}
|
||||
exports.default = run;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/// <reference path="../../src/typings/polyfill.d.ts" />
|
||||
import { EntityDict } from 'oak-domain/lib/types';
|
||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
|
||||
import { BackendRuntimeContext } from 'oak-frontend-base/lib/context/BackendRuntimeContext';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.initialize = initialize;
|
||||
exports.initialize = void 0;
|
||||
/// <reference path="../typings/polyfill.d.ts" />
|
||||
const oak_backend_base_1 = require("oak-backend-base");
|
||||
async function initialize(path) {
|
||||
|
|
@ -10,3 +10,4 @@ async function initialize(path) {
|
|||
await appLoader.unmount();
|
||||
console.log('data initialized');
|
||||
}
|
||||
exports.initialize = initialize;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/// <reference path="../../src/typings/polyfill.d.ts" />
|
||||
import './polyfill';
|
||||
import { BackendRuntimeContext } from 'oak-frontend-base/lib/context/BackendRuntimeContext';
|
||||
import { Connector, EntityDict } from 'oak-domain/lib/types';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.startup = startup;
|
||||
exports.startup = void 0;
|
||||
const tslib_1 = require("tslib");
|
||||
/// <reference path="../typings/polyfill.d.ts" />
|
||||
require("./polyfill");
|
||||
|
|
@ -63,7 +63,7 @@ async function startup(path, connector, omitWatchers, omitTimers, routine) {
|
|||
}
|
||||
: serverConfiguration.cors
|
||||
? {
|
||||
origin: serverConfiguration.cors.origin, //socket.io配置cors origin是支持数组和字符串
|
||||
origin: serverConfiguration.cors.origin,
|
||||
allowedHeaders: [
|
||||
...corsHeaders.concat(connector.getCorsHeader()),
|
||||
...(serverConfiguration.cors.headers || []),
|
||||
|
|
@ -145,7 +145,7 @@ async function startup(path, connector, omitWatchers, omitTimers, routine) {
|
|||
if (!ui?.disable) {
|
||||
(0, admin_ui_1.instrument)(io, {
|
||||
auth: {
|
||||
type: "basic", // 使用基本认证,生产建议关闭或换成自定义 auth
|
||||
type: "basic",
|
||||
username: ui?.username || "admin",
|
||||
password: bcryptjs_1.default.hashSync(passwordForAdminUI, 10), // 使用 bcrypt 加密密码
|
||||
},
|
||||
|
|
@ -273,7 +273,8 @@ async function startup(path, connector, omitWatchers, omitTimers, routine) {
|
|||
let subscribeUrl = concat(url, DATA_SUBSCRIBE_NAMESPACE);
|
||||
let socketUrl = concat(url, SOCKET_NAMESPACE);
|
||||
if (typeof getSocketConfig === 'function') {
|
||||
const { url: url2 } = getSocketConfig(ctx);
|
||||
const socketConfig = getSocketConfig(ctx);
|
||||
const url2 = socketConfig?.url;
|
||||
if (url2) {
|
||||
subscribeUrl = concat(url2, DATA_SUBSCRIBE_NAMESPACE);
|
||||
socketUrl = concat(url2, SOCKET_NAMESPACE);
|
||||
|
|
@ -305,7 +306,6 @@ async function startup(path, connector, omitWatchers, omitTimers, routine) {
|
|||
return;
|
||||
}
|
||||
catch (err) {
|
||||
console.log(err);
|
||||
ctx.response.status = 500;
|
||||
return;
|
||||
}
|
||||
|
|
@ -314,9 +314,12 @@ async function startup(path, connector, omitWatchers, omitTimers, routine) {
|
|||
router.get(connector.getEndpointRouter(), async (ctx) => {
|
||||
ctx.response.body = endpoints;
|
||||
});
|
||||
const socketAdminMountRaw = ui?.path || '/socket-admin';
|
||||
const socketAdminMount = socketAdminMountRaw.startsWith('/')
|
||||
? socketAdminMountRaw : `/${socketAdminMountRaw}`;
|
||||
// 注册静态资源
|
||||
if (!ui?.disable) {
|
||||
koa.use((0, koa_mount_1.default)('/socket-admin', (0, koa_static_1.default)(socketAdminUI)));
|
||||
koa.use((0, koa_mount_1.default)(socketAdminMount, (0, koa_static_1.default)(socketAdminUI)));
|
||||
}
|
||||
koa.use(router.routes());
|
||||
koa.on('error', (err) => {
|
||||
|
|
@ -328,7 +331,7 @@ async function startup(path, connector, omitWatchers, omitTimers, routine) {
|
|||
const host = hostname || 'localhost';
|
||||
const port = nginx?.port || (clusterInfo.usingCluster ? (process.env.PM2_PORT || 8080) : serverConfiguration.port);
|
||||
const baseUrl = `${protocol}://${host}:${port}`;
|
||||
const adminUIUrl = `${baseUrl}/socket-admin`;
|
||||
const adminUIUrl = `${baseUrl}${socketAdminMount}`;
|
||||
console.log(chalk_1.default.greenBright.bold('\n🚀 Server started successfully!\n'));
|
||||
console.log(`🔗 ${chalk_1.default.cyan('Server URL')}: ${chalk_1.default.underline(baseUrl)}`);
|
||||
// socketio地址
|
||||
|
|
@ -363,3 +366,4 @@ async function startup(path, connector, omitWatchers, omitTimers, routine) {
|
|||
};
|
||||
return shutdown;
|
||||
}
|
||||
exports.startup = startup;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/// <reference types="node" />
|
||||
export type LogFormatterProp = {
|
||||
level: "info" | "warn" | "error";
|
||||
caller: NodeJS.CallSite | null;
|
||||
|
|
|
|||
|
|
@ -1,16 +1,6 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.packageJsonContent = packageJsonContent;
|
||||
exports.tsConfigJsonContent = tsConfigJsonContent;
|
||||
exports.tsConfigBuildJsonContent = tsConfigBuildJsonContent;
|
||||
exports.tsConfigPathsJsonContent = tsConfigPathsJsonContent;
|
||||
exports.tsConfigMpJsonContent = tsConfigMpJsonContent;
|
||||
exports.tsConfigWebJsonContent = tsConfigWebJsonContent;
|
||||
exports.projectConfigContentWithWeChatMp = projectConfigContentWithWeChatMp;
|
||||
exports.appJsonContentWithWeChatMp = appJsonContentWithWeChatMp;
|
||||
exports.oakConfigContentWithWeChatMp = oakConfigContentWithWeChatMp;
|
||||
exports.oakConfigContentWithWeb = oakConfigContentWithWeb;
|
||||
exports.updateCompilerJsContent = updateCompilerJsContent;
|
||||
exports.updateCompilerJsContent = exports.oakConfigContentWithWeb = exports.oakConfigContentWithWeChatMp = exports.appJsonContentWithWeChatMp = exports.projectConfigContentWithWeChatMp = exports.tsConfigWebJsonContent = exports.tsConfigMpJsonContent = exports.tsConfigPathsJsonContent = exports.tsConfigBuildJsonContent = exports.tsConfigJsonContent = exports.packageJsonContent = void 0;
|
||||
const tslib_1 = require("tslib");
|
||||
const child_process_1 = require("child_process");
|
||||
const fs_1 = require("fs");
|
||||
|
|
@ -309,6 +299,7 @@ function packageJsonContent({ name, version, description, cliName, cliBinName, i
|
|||
}
|
||||
`;
|
||||
}
|
||||
exports.packageJsonContent = packageJsonContent;
|
||||
function tsConfigJsonContent() {
|
||||
return `{
|
||||
"extends": "./tsconfig.paths.json",
|
||||
|
|
@ -360,6 +351,7 @@ function tsConfigJsonContent() {
|
|||
]
|
||||
}`;
|
||||
}
|
||||
exports.tsConfigJsonContent = tsConfigJsonContent;
|
||||
function tsConfigBuildJsonContent() {
|
||||
return `{
|
||||
"extends": "./tsconfig.build.paths.json",
|
||||
|
|
@ -399,6 +391,7 @@ function tsConfigBuildJsonContent() {
|
|||
]
|
||||
}`;
|
||||
}
|
||||
exports.tsConfigBuildJsonContent = tsConfigBuildJsonContent;
|
||||
function tsConfigPathsJsonContent(deps) {
|
||||
const paths = {
|
||||
"@project/*": [
|
||||
|
|
@ -427,6 +420,7 @@ function tsConfigPathsJsonContent(deps) {
|
|||
}
|
||||
}, null, '\t');
|
||||
}
|
||||
exports.tsConfigPathsJsonContent = tsConfigPathsJsonContent;
|
||||
function tsConfigMpJsonContent() {
|
||||
return `{
|
||||
"extends": "./tsconfig.paths.json",
|
||||
|
|
@ -474,6 +468,7 @@ function tsConfigMpJsonContent() {
|
|||
]
|
||||
}`;
|
||||
}
|
||||
exports.tsConfigMpJsonContent = tsConfigMpJsonContent;
|
||||
function tsConfigWebJsonContent() {
|
||||
return `{
|
||||
"extends": "./tsconfig.paths.json",
|
||||
|
|
@ -523,6 +518,7 @@ function tsConfigWebJsonContent() {
|
|||
]
|
||||
}`;
|
||||
}
|
||||
exports.tsConfigWebJsonContent = tsConfigWebJsonContent;
|
||||
function projectConfigContentWithWeChatMp(oakConfigName, projectname, miniVersion) {
|
||||
return `{
|
||||
"description": "项目配置文件",
|
||||
|
|
@ -598,6 +594,7 @@ function projectConfigContentWithWeChatMp(oakConfigName, projectname, miniVersio
|
|||
}
|
||||
}`;
|
||||
}
|
||||
exports.projectConfigContentWithWeChatMp = projectConfigContentWithWeChatMp;
|
||||
function appJsonContentWithWeChatMp(isDev) {
|
||||
const pages = [
|
||||
'@project/pages/store/list/index',
|
||||
|
|
@ -621,18 +618,21 @@ function appJsonContentWithWeChatMp(isDev) {
|
|||
"sitemapLocation": "sitemap.json"
|
||||
}`;
|
||||
}
|
||||
exports.appJsonContentWithWeChatMp = appJsonContentWithWeChatMp;
|
||||
function oakConfigContentWithWeChatMp() {
|
||||
return `{
|
||||
"theme": {
|
||||
}
|
||||
}`;
|
||||
}
|
||||
exports.oakConfigContentWithWeChatMp = oakConfigContentWithWeChatMp;
|
||||
function oakConfigContentWithWeb() {
|
||||
return `{
|
||||
"theme": {
|
||||
}
|
||||
}`;
|
||||
}
|
||||
exports.oakConfigContentWithWeb = oakConfigContentWithWeb;
|
||||
function updateCompilerJsContent(directory, deps) {
|
||||
const compilerJsPath = (0, path_1.join)(directory, 'configuration', 'compiler.js');
|
||||
(0, assert_1.default)((0, fs_1.existsSync)(compilerJsPath));
|
||||
|
|
@ -691,3 +691,4 @@ function updateCompilerJsContent(directory, deps) {
|
|||
(0, fs_1.writeFileSync)(compilerJsPath, code);
|
||||
}
|
||||
}
|
||||
exports.updateCompilerJsContent = updateCompilerJsContent;
|
||||
|
|
|
|||
17
lib/utils.js
17
lib/utils.js
|
|
@ -1,13 +1,6 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.findJson = findJson;
|
||||
exports.getStr = getStr;
|
||||
exports.difference = difference;
|
||||
exports.intersect = intersect;
|
||||
exports.union = union;
|
||||
exports.formatJsonByFile = formatJsonByFile;
|
||||
exports.deWeight = deWeight;
|
||||
exports.randomString = randomString;
|
||||
exports.randomString = exports.deWeight = exports.formatJsonByFile = exports.union = exports.intersect = exports.difference = exports.getStr = exports.findJson = void 0;
|
||||
/**
|
||||
* @name 从一组路径里查找到所有json文件
|
||||
* @export
|
||||
|
|
@ -25,6 +18,7 @@ function findJson(pathArr) {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
exports.findJson = findJson;
|
||||
/**
|
||||
* @name 已知前后文取中间文本
|
||||
* @export
|
||||
|
|
@ -38,6 +32,7 @@ function getStr(str, start, end) {
|
|||
let res = str.match(reg);
|
||||
return res ? res[1] : null;
|
||||
}
|
||||
exports.getStr = getStr;
|
||||
/**
|
||||
* @name 差集
|
||||
* @export
|
||||
|
|
@ -49,6 +44,7 @@ function getStr(str, start, end) {
|
|||
function difference(current, target) {
|
||||
return new Set([...target].filter(x => !current.has(x)));
|
||||
}
|
||||
exports.difference = difference;
|
||||
/**
|
||||
* @name 获取交集
|
||||
* @export
|
||||
|
|
@ -60,6 +56,7 @@ function difference(current, target) {
|
|||
function intersect(current, target) {
|
||||
return new Set([...target].filter(x => current.has(x)));
|
||||
}
|
||||
exports.intersect = intersect;
|
||||
/**
|
||||
* @name 获取并集
|
||||
* @export
|
||||
|
|
@ -71,6 +68,7 @@ function intersect(current, target) {
|
|||
function union(current, target) {
|
||||
return new Set([...current, ...target]);
|
||||
}
|
||||
exports.union = union;
|
||||
/**
|
||||
* @name 格式化json
|
||||
* @export
|
||||
|
|
@ -81,6 +79,7 @@ function union(current, target) {
|
|||
function formatJsonByFile(data) {
|
||||
return JSON.stringify(data, null, 2);
|
||||
}
|
||||
exports.formatJsonByFile = formatJsonByFile;
|
||||
/**
|
||||
* @name 数组对象去重
|
||||
* @export
|
||||
|
|
@ -97,6 +96,7 @@ function deWeight(arr, type) {
|
|||
}
|
||||
return new Set([...map.values()]);
|
||||
}
|
||||
exports.deWeight = deWeight;
|
||||
/**
|
||||
* @name 随机字符串
|
||||
* @export
|
||||
|
|
@ -112,3 +112,4 @@ function randomString(length) {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
exports.randomString = randomString;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@xuchangzju/oak-cli",
|
||||
"version": "4.0.22",
|
||||
"version": "4.0.23",
|
||||
"description": "client for oak framework",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
|
|
@ -112,9 +112,9 @@
|
|||
"lodash": "^4.17.21",
|
||||
"mini-css-extract-plugin": "^2.5.3",
|
||||
"node-watch": "^0.7.4",
|
||||
"oak-backend-base": "^4.1.19",
|
||||
"oak-domain": "^5.1.24",
|
||||
"oak-frontend-base": "^5.3.31",
|
||||
"oak-backend-base": "^4.1.20",
|
||||
"oak-domain": "^5.1.26",
|
||||
"oak-frontend-base": "^5.3.33",
|
||||
"parse-asn1": "5.1.6",
|
||||
"postcss": "^8.4.4",
|
||||
"postcss-flexbugs-fixes": "^5.0.2",
|
||||
|
|
|
|||
45
src/build.ts
45
src/build.ts
|
|
@ -132,13 +132,14 @@ export default async function build(cmd: any) {
|
|||
let result;
|
||||
if (mode === 'production') {
|
||||
//cd native/android && cross-env NODE_ENV=production ./gradlew assembleRelease
|
||||
if (platform === 'android') {
|
||||
result = spawn.sync(
|
||||
`cd android`,
|
||||
[
|
||||
'&& cross-env',
|
||||
`NODE_ENV=${mode}`,
|
||||
'OAK_PLATFORM=native',
|
||||
`OAK_DEV_MODE=${devMode}`,
|
||||
`OAK_DEV_MODE=server`,
|
||||
'./gradlew assembleRelease',
|
||||
].filter(Boolean),
|
||||
{
|
||||
|
|
@ -147,15 +148,35 @@ export default async function build(cmd: any) {
|
|||
shell: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
else {
|
||||
// cd native && cross-env NODE_ENV=staging OAK_PLATFORM=native OAK_DEV_MODE=server react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'
|
||||
result = spawn.sync(
|
||||
`cd native`,
|
||||
[
|
||||
'&& cross-env',
|
||||
`NODE_ENV=${mode}`,
|
||||
'OAK_PLATFORM=native',
|
||||
`OAK_DEV_MODE=server`,
|
||||
"react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'",
|
||||
].filter(Boolean),
|
||||
{
|
||||
cwd,
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
} else if (mode === 'staging') {
|
||||
//cd native/android && cross-env NODE_ENV=production ./gradlew assembleStaging
|
||||
if (platform === 'android') {
|
||||
result = spawn.sync(
|
||||
`cd android`,
|
||||
[
|
||||
'&& cross-env',
|
||||
`NODE_ENV=${mode}`,
|
||||
'OAK_PLATFORM=native',
|
||||
`OAK_DEV_MODE=${devMode}`,
|
||||
`OAK_DEV_MODE=server`,
|
||||
'./gradlew assembleStaging',
|
||||
].filter(Boolean),
|
||||
{
|
||||
|
|
@ -164,6 +185,24 @@ export default async function build(cmd: any) {
|
|||
shell: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
else {
|
||||
result = spawn.sync(
|
||||
`cd native`,
|
||||
[
|
||||
'&& cross-env',
|
||||
`NODE_ENV=${mode}`,
|
||||
'OAK_PLATFORM=native',
|
||||
`OAK_DEV_MODE=server`,
|
||||
"react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'",
|
||||
].filter(Boolean),
|
||||
{
|
||||
cwd,
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
} else {
|
||||
result = spawn.sync(
|
||||
`cross-env`,
|
||||
|
|
@ -173,7 +212,7 @@ export default async function build(cmd: any) {
|
|||
`OAK_DEV_MODE=${devMode}`,
|
||||
'react-native',
|
||||
'start',
|
||||
cmd.resetCache && '--reset-cache',
|
||||
cmd.reset && '--reset-cache',
|
||||
].filter(Boolean),
|
||||
{
|
||||
cwd,
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ program
|
|||
.option('-d, --subDir <subDirName>', 'subDirName')
|
||||
.option('-p, --port <port>', 'port')
|
||||
.option('-dm, --devMode <devMode>', 'devMode')
|
||||
.option('--resetCache', 'react native start --reset-cache')
|
||||
.option('--reset', 'react native start --reset-cache')
|
||||
.description('build project of start on demand')
|
||||
.action(build);
|
||||
|
||||
|
|
|
|||
|
|
@ -346,7 +346,8 @@ export async function startup<ED extends EntityDict & BaseEntityDict, FrontCxt e
|
|||
let subscribeUrl = concat(url, DATA_SUBSCRIBE_NAMESPACE);
|
||||
let socketUrl = concat(url, SOCKET_NAMESPACE);
|
||||
if (typeof getSocketConfig === 'function') {
|
||||
const { url: url2 } = getSocketConfig(ctx);
|
||||
const socketConfig = getSocketConfig(ctx);
|
||||
const url2 = socketConfig?.url;
|
||||
if (url2) {
|
||||
subscribeUrl = concat(url2, DATA_SUBSCRIBE_NAMESPACE);
|
||||
socketUrl = concat(url2, SOCKET_NAMESPACE);
|
||||
|
|
@ -381,8 +382,6 @@ export async function startup<ED extends EntityDict & BaseEntityDict, FrontCxt e
|
|||
}
|
||||
return;
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
|
||||
ctx.response.status = 500;
|
||||
return;
|
||||
}
|
||||
|
|
@ -393,9 +392,12 @@ export async function startup<ED extends EntityDict & BaseEntityDict, FrontCxt e
|
|||
ctx.response.body = endpoints;
|
||||
});
|
||||
|
||||
const socketAdminMountRaw = ui?.path || '/socket-admin'
|
||||
const socketAdminMount = socketAdminMountRaw.startsWith('/')
|
||||
? socketAdminMountRaw : `/${socketAdminMountRaw}`;
|
||||
// 注册静态资源
|
||||
if (!ui?.disable) {
|
||||
koa.use(mount('/socket-admin', serve(socketAdminUI)));
|
||||
koa.use(mount(socketAdminMount, serve(socketAdminUI)));
|
||||
}
|
||||
|
||||
koa.use(router.routes());
|
||||
|
|
@ -410,7 +412,7 @@ export async function startup<ED extends EntityDict & BaseEntityDict, FrontCxt e
|
|||
const host = hostname || 'localhost';
|
||||
const port = nginx?.port || (clusterInfo.usingCluster ? (process.env.PM2_PORT || 8080) : serverConfiguration.port);
|
||||
const baseUrl = `${protocol}://${host}:${port}`;
|
||||
const adminUIUrl = `${baseUrl}/socket-admin`;
|
||||
const adminUIUrl = `${baseUrl}${socketAdminMount}`;
|
||||
|
||||
console.log(chalk.greenBright.bold('\n🚀 Server started successfully!\n'));
|
||||
console.log(`🔗 ${chalk.cyan('Server URL')}: ${chalk.underline(baseUrl)}`);
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
<svg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet">
|
||||
<circle cx="128" cy="128" r="114" stroke="#FFF" stroke-width="20" fill="none" />
|
||||
<path d="M97.637 121.69c27.327-22.326 54.058-45.426 81.98-67.097-14.646 22.505-29.708 44.711-44.354 67.215-12.562.06-25.123.06-37.626-.119zM120.737 134.132c12.621 0 25.183 0 37.745.179-27.505 22.206-54.117 45.484-82.099 67.096 14.646-22.505 29.708-44.77 44.354-67.275z" fill="#FFF"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 473 B |
|
|
@ -1,4 +0,0 @@
|
|||
<svg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet">
|
||||
<circle cx="128" cy="128" r="114" stroke="#010101" stroke-width="20" fill="none" />
|
||||
<path d="M97.637 121.69c27.327-22.326 54.058-45.426 81.98-67.097-14.646 22.505-29.708 44.711-44.354 67.215-12.562.06-25.123.06-37.626-.119zM120.737 134.132c12.621 0 25.183 0 37.745.179-27.505 22.206-54.117 45.484-82.099 67.096 14.646-22.505 29.708-44.77 44.354-67.275z" fill="#010101"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 478 B |
|
|
@ -1 +1,23 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/socket-admin/favicon.png"><title>Socket.IO Admin For OAK</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link href="/socket-admin/css/app.cc95923b.css" rel="preload" as="style"><link href="/socket-admin/css/chunk-vendors.9f55d012.css" rel="preload" as="style"><link href="/socket-admin/js/app.8f417b7c.js" rel="preload" as="script"><link href="/socket-admin/js/chunk-vendors.1619c6bb.js" rel="preload" as="script"><link href="/socket-admin/css/chunk-vendors.9f55d012.css" rel="stylesheet"><link href="/socket-admin/css/app.cc95923b.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but Socket.IO Admin For OAK doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/socket-admin/js/chunk-vendors.1619c6bb.js"></script><script src="/socket-admin/js/app.8f417b7c.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.png"><title>Socket.IO Admin For OAK</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><script>(function() {
|
||||
const rawUrl= window.location.href.split('#')[0]
|
||||
const basePath = rawUrl.endsWith('/') ? rawUrl : rawUrl + '/';
|
||||
// 处理basePath
|
||||
window.__BASE_PATH__ = basePath;
|
||||
})();</script><script>(function(){
|
||||
const assetsList = ['css/app.cc95923b.css','js/app.b14a0147.js','css/chunk-vendors.9f55d012.css','js/chunk-vendors.1619c6bb.js']//inject
|
||||
const basePath = window.__BASE_PATH__;
|
||||
// 如果是js开头则创建script标签,css开头则创建link标签
|
||||
assetsList.forEach((item) => {
|
||||
const tag = item.startsWith('js') ? 'script' : 'link';
|
||||
const el = document.createElement(tag);
|
||||
if (tag === 'script') {
|
||||
el.src = basePath + item;
|
||||
el.async = true;
|
||||
} else {
|
||||
el.rel = 'stylesheet';
|
||||
el.href = basePath + item;
|
||||
}
|
||||
document.head.appendChild(el);
|
||||
});
|
||||
})()</script></head><script>// Additional script to handle dynamic loading
|
||||
console.log("Dynamic loading script initialized.");</script><body><noscript><strong>We're sorry but Socket.IO Admin For OAK doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script>window.__TIMESTAMP__ = 1746759862617;</script></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue