@_tc/template-core 0.0.1-bate.26 → 0.0.1-bate.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/app/controller/project.js +1 -1
- package/esm/app/extend/render-view.js +3 -3
- package/esm/app/middleware/api-params-verify.js +1 -1
- package/esm/app/middleware/api-sign-verify.js +1 -1
- package/esm/app/middleware.js +5 -5
- package/esm/app/service/bese.js +1 -1
- package/esm/app/service/project.js +1 -1
- package/esm/bundler/dev.js +1 -1
- package/esm/bundler/index.js +2 -2
- package/esm/bundler/prod.js +1 -1
- package/esm/bundler/utils.js +5 -5
- package/esm/index.js +4 -4
- package/esm/packages/core/index.js +13 -13
- package/esm/packages/core/loader/config.js +2 -2
- package/esm/packages/core/loader/controller.js +3 -3
- package/esm/packages/core/loader/extend.js +3 -3
- package/esm/packages/core/loader/middleware.js +2 -2
- package/esm/packages/core/loader/model.js +3 -3
- package/esm/packages/core/loader/router-schema.js +3 -3
- package/esm/packages/core/loader/router.js +4 -4
- package/esm/packages/core/loader/service.js +2 -2
- package/esm/packages/utils/getAllFilesInFolder.js +2 -2
- package/esm/packages/utils/index.js +4 -4
- package/esm/packages/utils/loadFile.js +3 -3
- package/esm/packages/utils/path.js +2 -2
- package/fe/frontend/main.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getAppPath } from "../../packages/core/paths";
|
|
2
|
-
import nunjucks from "nunjucks";
|
|
3
|
-
import path from "path";
|
|
1
|
+
import { getAppPath } from "../../packages/core/paths.js";
|
|
2
|
+
import nunjucks from "nunjucks.js";
|
|
3
|
+
import path from "path.js";
|
|
4
4
|
export default (app) => {
|
|
5
5
|
const viewsPath = path.join(getAppPath(app, "frame"), "./public");
|
|
6
6
|
const env = nunjucks.configure(viewsPath, {
|
package/esm/app/middleware.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { resolve } from "path";
|
|
2
|
-
import compress from "koa-compress";
|
|
3
|
-
// import koaNunjucks from "koa-nunjucks-2";
|
|
4
|
-
import koaStatic from "koa-static";
|
|
5
|
-
import kb from "koa-bodyparser";
|
|
1
|
+
import { resolve } from "path.js";
|
|
2
|
+
import compress from "koa-compress.js";
|
|
3
|
+
// import koaNunjucks from "koa-nunjucks-2.js";
|
|
4
|
+
import koaStatic from "koa-static.js";
|
|
5
|
+
import kb from "koa-bodyparser.js";
|
|
6
6
|
const koaBody = kb({
|
|
7
7
|
formLimit: "1000mb",
|
|
8
8
|
enableTypes: ["form", "json", "text"],
|
package/esm/app/service/bese.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loaderModel } from "../../packages/core/index.js";
|
|
2
|
-
import getBaseService from "./bese";
|
|
2
|
+
import getBaseService from "./bese.js";
|
|
3
3
|
const getProjectService = (app) => {
|
|
4
4
|
const BaseService = getBaseService(app);
|
|
5
5
|
// const modelData = require('../../model')(app) as ModelItem[];
|
package/esm/bundler/dev.js
CHANGED
package/esm/bundler/index.js
CHANGED
package/esm/bundler/prod.js
CHANGED
package/esm/bundler/utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import * as glob from "glob";
|
|
3
|
-
import { build } from "vite";
|
|
4
|
-
import { resolve } from "../packages/utils";
|
|
5
|
-
import { copyFileSync, existsSync, readdirSync, readFileSync, rmdirSync, unlinkSync, writeFileSync, } from "fs";
|
|
1
|
+
import path from "path.js";
|
|
2
|
+
import * as glob from "glob.js";
|
|
3
|
+
import { build } from "vite.js";
|
|
4
|
+
import { resolve } from "../packages/utils.js";
|
|
5
|
+
import { copyFileSync, existsSync, readdirSync, readFileSync, rmdirSync, unlinkSync, writeFileSync, } from "fs.js";
|
|
6
6
|
const base = process.cwd();
|
|
7
7
|
// 瞄准输出后的产物路径
|
|
8
8
|
const framePath = path.resolve(__dirname, "../../");
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { start } from "./packages/core/index.js";
|
|
2
|
-
import "./app/typings";
|
|
2
|
+
import "./app/typings.js";
|
|
3
3
|
import { resolve } from "./packages/utils/index.js";
|
|
4
|
-
import baseControllerFn from "./app/controller/base";
|
|
5
|
-
import baseServiceFn from "./app/service/bese";
|
|
4
|
+
import baseControllerFn from "./app/controller/base.js";
|
|
5
|
+
import baseServiceFn from "./app/service/bese.js";
|
|
6
6
|
export const serverStart = (options) => {
|
|
7
7
|
return start({ ...options, frameBaseDir: resolve(__dirname, ".") });
|
|
8
8
|
};
|
|
@@ -10,4 +10,4 @@ export const baseFn = {
|
|
|
10
10
|
baseControllerFn,
|
|
11
11
|
baseServiceFn,
|
|
12
12
|
};
|
|
13
|
-
export { default as modelLoader } from "./packages/core/loader/model";
|
|
13
|
+
export { default as modelLoader } from "./packages/core/loader/model.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import Koa from "koa";
|
|
2
|
-
import "./types";
|
|
3
|
-
import "../../app/typings";
|
|
4
|
-
import env from "./env";
|
|
5
|
-
import middlewareLoader from "./loader/middleware";
|
|
6
|
-
import routerSchemaLoader from "./loader/router-schema";
|
|
7
|
-
import routerLoader from "./loader/router";
|
|
8
|
-
import controllerLoader from "./loader/controller";
|
|
9
|
-
import serviceLoader from "./loader/service";
|
|
10
|
-
import configLoader from "./loader/config";
|
|
11
|
-
import extendLoader from "./loader/extend";
|
|
12
|
-
import modelLoader from "./loader/model";
|
|
13
|
-
import { resolve } from "../utils/path";
|
|
1
|
+
import Koa from "koa.js";
|
|
2
|
+
import "./types.js";
|
|
3
|
+
import "../../app/typings.js";
|
|
4
|
+
import env from "./env.js";
|
|
5
|
+
import middlewareLoader from "./loader/middleware.js";
|
|
6
|
+
import routerSchemaLoader from "./loader/router-schema.js";
|
|
7
|
+
import routerLoader from "./loader/router.js";
|
|
8
|
+
import controllerLoader from "./loader/controller.js";
|
|
9
|
+
import serviceLoader from "./loader/service.js";
|
|
10
|
+
import configLoader from "./loader/config.js";
|
|
11
|
+
import extendLoader from "./loader/extend.js";
|
|
12
|
+
import modelLoader from "./loader/model.js";
|
|
13
|
+
import { resolve } from "../utils/path.js";
|
|
14
14
|
import { runFileFn } from "../utils/index.js";
|
|
15
15
|
export const loaderModel = modelLoader;
|
|
16
16
|
export const start = (options = {}) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolve } from "../../utils/path";
|
|
2
|
-
import { getAllFilesInFolder } from "../../utils/getAllFilesInFolder";
|
|
1
|
+
import { resolve } from "../../utils/path.js";
|
|
2
|
+
import { getAllFilesInFolder } from "../../utils/getAllFilesInFolder.js";
|
|
3
3
|
/**
|
|
4
4
|
* config loader 只处理一级
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { resolve } from '../../utils/path';
|
|
2
|
-
import { loadFileFn } from '../../utils/loadFile';
|
|
3
|
-
import { getAppPaths } from '../paths';
|
|
1
|
+
import { resolve } from '../../utils/path.js';
|
|
2
|
+
import { loadFileFn } from '../../utils/loadFile.js';
|
|
3
|
+
import { getAppPaths } from '../paths.js';
|
|
4
4
|
import { runFileFn } from '../../utils/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* 加载 xx/app/controller 文件夹下所有文件,可通过'app.controller.${目录}.'},访问
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { loadFileFn } from "../../utils/loadFile";
|
|
2
|
-
import { resolve } from "../../utils/path";
|
|
3
|
-
import { getAppPaths } from "../paths";
|
|
1
|
+
import { loadFileFn } from "../../utils/loadFile.js";
|
|
2
|
+
import { resolve } from "../../utils/path.js";
|
|
3
|
+
import { getAppPaths } from "../paths.js";
|
|
4
4
|
import { runFileFn } from "../../utils/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* extend loader 扩展 koa app属性 只加载一级
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { loadFileFn } from '../../utils/loadFile';
|
|
2
|
-
import { resolve } from '../../utils/path';
|
|
3
|
-
import { getAppPaths } from '../paths';
|
|
1
|
+
import { loadFileFn } from '../../utils/loadFile.js';
|
|
2
|
+
import { resolve } from '../../utils/path.js';
|
|
3
|
+
import { getAppPaths } from '../paths.js';
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
6
|
* router-schema loader 只处理一级
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import KoaRouter from "koa-router";
|
|
2
|
-
import { loadFileFn } from "../../utils/loadFile";
|
|
3
|
-
import { resolve } from "../../utils/path";
|
|
4
|
-
import { getAppPath, getAppPaths } from "../paths";
|
|
1
|
+
import KoaRouter from "koa-router.js";
|
|
2
|
+
import { loadFileFn } from "../../utils/loadFile.js";
|
|
3
|
+
import { resolve } from "../../utils/path.js";
|
|
4
|
+
import { getAppPath, getAppPaths } from "../paths.js";
|
|
5
5
|
import { runFileFn } from "../../utils/index.js";
|
|
6
6
|
/**
|
|
7
7
|
* reouter loader
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { loadFileFn } from '../../utils/loadFile';
|
|
2
|
-
import { getAppPaths } from '../paths';
|
|
1
|
+
import { loadFileFn } from '../../utils/loadFile.js';
|
|
2
|
+
import { getAppPaths } from '../paths.js';
|
|
3
3
|
import { runFileFn } from '../../utils/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* 加载 xx/app/service 文件夹下所有文件 可通过'app.service.${目录}..},访问
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolve } from "./path";
|
|
2
|
-
import * as glob from "glob";
|
|
1
|
+
import { resolve } from "./path.js";
|
|
2
|
+
import * as glob from "glob.js";
|
|
3
3
|
export const getAllFilesInFolder = (...paths) => {
|
|
4
4
|
const filePath = resolve(...paths);
|
|
5
5
|
const fileList = glob.sync(resolve(filePath, "**", "*.js"));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./path";
|
|
2
|
-
export * from "./loadFile";
|
|
3
|
-
export * from "./getAllFilesInFolder";
|
|
4
|
-
export * from "./runFileFn";
|
|
1
|
+
export * from "./path.js";
|
|
2
|
+
export * from "./loadFile.js";
|
|
3
|
+
export * from "./getAllFilesInFolder.js";
|
|
4
|
+
export * from "./runFileFn.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getAllFilesInFolder } from "./getAllFilesInFolder";
|
|
2
|
-
import { resolve, splicing } from "./path";
|
|
3
|
-
import { sep } from "path";
|
|
1
|
+
import { getAllFilesInFolder } from "./getAllFilesInFolder.js";
|
|
2
|
+
import { resolve, splicing } from "./path.js";
|
|
3
|
+
import { sep } from "path.js";
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
6
|
* @param baseDir
|
package/fe/frontend/main.js
CHANGED