@_tc/template-core 0.0.1-bate.27 → 0.0.1-bate.29

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.
@@ -1,6 +1,6 @@
1
1
  import { getAppPath } from "../../packages/core/paths.js";
2
- import nunjucks.js from "nunjucks";
3
- import path.js from "path";
2
+ import nunjucks from "nunjucks";
3
+ import path from "path";
4
4
  export default (app) => {
5
5
  const viewsPath = path.join(getAppPath(app, "frame"), "./public");
6
6
  const env = nunjucks.configure(viewsPath, {
@@ -1,4 +1,4 @@
1
- import Ajv from "ajv.js";
1
+ import Ajv from "ajv";
2
2
  const ajv = new Ajv();
3
3
  const $schema = "http://json-schema.org/draft-07/schema#";
4
4
  const validateFN = (key, data, schema) => {
@@ -1,4 +1,4 @@
1
- import md5.js from "md5";
1
+ import md5 from "md5";
2
2
  const keyTimeOut = 1000 * 60 * 10;
3
3
  export default (app) => async (ctx, next) => {
4
4
  const { path, method } = ctx;
@@ -1,8 +1,8 @@
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";
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";
6
6
  const koaBody = kb({
7
7
  formLimit: "1000mb",
8
8
  enableTypes: ["form", "json", "text"],
@@ -1,4 +1,4 @@
1
- import superagent.js from "superagent";
1
+ import superagent from "superagent";
2
2
  export default (app) => class BaseService {
3
3
  get app() {
4
4
  return app;
@@ -1,8 +1,8 @@
1
- import path.js from "path";
2
- import * as glob.js from "glob";
3
- import { build } from "vite.js";
1
+ import path from "path";
2
+ import * as glob from "glob";
3
+ import { build } from "vite";
4
4
  import { resolve } from "../packages/utils.js";
5
- import { copyFileSync, existsSync, readdirSync, readFileSync, rmdirSync, unlinkSync, writeFileSync, } from "fs.js";
5
+ import { copyFileSync, existsSync, readdirSync, readFileSync, rmdirSync, unlinkSync, writeFileSync, } from "fs";
6
6
  const base = process.cwd();
7
7
  // 瞄准输出后的产物路径
8
8
  const framePath = path.resolve(__dirname, "../../");
@@ -1,4 +1,4 @@
1
- import Koa from "koa.js";
1
+ import Koa from "koa";
2
2
  import "./types.js";
3
3
  import "../../app/typings.js";
4
4
  import env from "./env.js";
@@ -1,6 +1,6 @@
1
- import { sep } from 'path.js';
1
+ import { sep } from 'path';
2
2
  import { loadFileFn } from '../../utils/loadFile.js';
3
- import _ from 'lodash.js';
3
+ import _ from 'lodash';
4
4
  /**
5
5
  *
6
6
  * @param app
@@ -1,4 +1,4 @@
1
- import KoaRouter from "koa-router.js";
1
+ import KoaRouter from "koa-router";
2
2
  import { loadFileFn } from "../../utils/loadFile.js";
3
3
  import { resolve } from "../../utils/path.js";
4
4
  import { getAppPath, getAppPaths } from "../paths.js";
@@ -1,5 +1,5 @@
1
1
  import { resolve } from "./path.js";
2
- import * as glob.js from "glob";
2
+ import * as glob from "glob";
3
3
  export const getAllFilesInFolder = (...paths) => {
4
4
  const filePath = resolve(...paths);
5
5
  const fileList = glob.sync(resolve(filePath, "**", "*.js"));
@@ -1,6 +1,6 @@
1
1
  import { getAllFilesInFolder } from "./getAllFilesInFolder.js";
2
2
  import { resolve, splicing } from "./path.js";
3
- import { sep } from "path.js";
3
+ import { sep } from "path";
4
4
  /**
5
5
  *
6
6
  * @param baseDir
@@ -1,5 +1,5 @@
1
- import * as path.js from "path";
2
- import { sep } from "path.js";
1
+ import * as path from "path";
2
+ import { sep } from "path";
3
3
  /**
4
4
  * splicing('path') : /path
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@_tc/template-core",
3
- "version": "0.0.1-bate.27",
3
+ "version": "0.0.1-bate.29",
4
4
  "description": "A TypeScript Koa framework template - Monorepo root",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",