From 67c42f66314cb1622bfd49ab6ef188b4a236bade Mon Sep 17 00:00:00 2001 From: "Xc@centOs" Date: Sat, 13 Aug 2022 16:01:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E5=9C=A8=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E7=8E=AF=E5=A2=83=E4=B8=AD=E6=B5=8B=E8=AF=95=E4=BA=A7?= =?UTF-8?q?=E7=94=9F=E7=9A=84=E4=B8=80=E4=BA=9B=E5=B0=8FBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/config.d.ts | 2 +- lib/config.js | 2 +- lib/file-handle.d.ts | 1 + lib/template.js | 6 +++--- package.json | 9 ++++++++- scripts/build-app-domain.js | 2 +- src/config.ts | 4 ++-- src/template.ts | 8 ++++---- src/typings/polyfill.d.ts | 2 +- 9 files changed, 22 insertions(+), 14 deletions(-) diff --git a/lib/config.d.ts b/lib/config.d.ts index 5d634f0..79e64b3 100644 --- a/lib/config.d.ts +++ b/lib/config.d.ts @@ -1,5 +1,5 @@ export declare const CLI_VERSION: any; -export declare const CLI_NAME: any; +export declare const CLI_NAME: string; export declare const BASE_DIR: string; export declare const USER_CONFIG_FILE_NAME = "oak.config.json"; export declare const USER_CONFIG_FILE: string; diff --git a/lib/config.js b/lib/config.js index 8f28f6e..a0dc373 100644 --- a/lib/config.js +++ b/lib/config.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.MINI_VERSION_URL = exports.CNPM_BASE_URL = exports.NODE_MODULES_DIR_NAME = exports.USER_CONFIG_FILE = exports.USER_CONFIG_FILE_NAME = exports.BASE_DIR = exports.CLI_NAME = exports.CLI_VERSION = void 0; exports.CLI_VERSION = require('../package.json')['version']; -exports.CLI_NAME = require('../package.json')['name']; +exports.CLI_NAME = Object.keys(require('../package.json')['bin'])[0]; exports.BASE_DIR = process.cwd(); exports.USER_CONFIG_FILE_NAME = 'oak.config.json'; exports.USER_CONFIG_FILE = exports.BASE_DIR + '/' + exports.USER_CONFIG_FILE_NAME; diff --git a/lib/file-handle.d.ts b/lib/file-handle.d.ts index 0413e16..50447af 100644 --- a/lib/file-handle.d.ts +++ b/lib/file-handle.d.ts @@ -1,4 +1,5 @@ /// +/// import { PathLike } from 'fs'; import { checkFileExistsAndCreateType } from './enum'; /** diff --git a/lib/template.js b/lib/template.js index 5cf4ef9..fbd5489 100644 --- a/lib/template.js +++ b/lib/template.js @@ -8,7 +8,7 @@ function packageJsonContent({ name, version, description, cliversion, cliname, i "oak-common-aspect": "file:../oak-common-aspect", "oak-domain": "file:../oak-domain", "oak-frontend-base": "file:../oak-frontend-base", - "oak_external-sdk": "file:../oak-external-sdk", + "oak-external-sdk": "file:../oak-external-sdk", "oak-general-business": "file:../oak-general-business", "oak-memory-tree-store": "file:../oak-memory-tree-store",`; } @@ -18,7 +18,7 @@ function packageJsonContent({ name, version, description, cliversion, cliname, i "oak-domain": "^1.0.0", "oak-frontend-base": "^1.0.0", "oak-general-business": "^1.0.0", - "oak_external-sdk": "^1.0.0", + "oak-external-sdk": "^1.0.0", "oak-memory-tree-store": "^1.0.0",`; } return `{ @@ -64,7 +64,7 @@ function packageJsonContent({ name, version, description, cliversion, cliname, i "rmc-pull-to-refresh": "^1.0.13", "tdesign-icons-react": "^0.1.4", "tdesign-mobile-react": "^0.2.0", - "tdesign-react": "^0.37.1", + "tdesign-react": "^0.38.0", "url": "^0.11.0", "uuid": "^8.3.2" }, diff --git a/package.json b/package.json index 1a8f0e8..e861758 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xuchangzju/oak-cli", - "version": "1.0.0", + "version": "1.0.1", "description": "oak-cli脚手架", "main": "lib/index.js", "scripts": { @@ -10,6 +10,13 @@ "bin": { "oak-cli": "lib/index.js" }, + "files": [ + "config/**/*", + "lib/**/*", + "plugins/**/*", + "scripts/**/*", + "template/**/*" + ], "author": "", "license": "", "bugs": { diff --git a/scripts/build-app-domain.js b/scripts/build-app-domain.js index 953dcc8..a460192 100644 --- a/scripts/build-app-domain.js +++ b/scripts/build-app-domain.js @@ -2,7 +2,7 @@ const { buildSchema, analyzeEntities, -} = require(`${process.cwd()}/node_modules/oak-domain/src/compiler/schemalBuilder`); +} = require(`${process.cwd()}/node_modules/oak-domain/lib/compiler/schemalBuilder`); analyzeEntities(`${process.cwd()}/node_modules/oak-general-business/src/entities`); analyzeEntities(`${process.cwd()}/src/entities`); diff --git a/src/config.ts b/src/config.ts index 4b1b49b..e7bdcfb 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,6 +1,6 @@ -export const CLI_VERSION = require('../package.json')['version'] -export const CLI_NAME = require('../package.json')['name'] +export const CLI_VERSION = require('../package.json')['version']; +export const CLI_NAME = Object.keys(require('../package.json')['bin'])[0]; export const BASE_DIR = process.cwd() diff --git a/src/template.ts b/src/template.ts index efe16ad..9f17735 100644 --- a/src/template.ts +++ b/src/template.ts @@ -13,7 +13,7 @@ export function packageJsonContent({ "oak-common-aspect": "file:../oak-common-aspect", "oak-domain": "file:../oak-domain", "oak-frontend-base": "file:../oak-frontend-base", - "oak_external-sdk": "file:../oak-external-sdk", + "oak-external-sdk": "file:../oak-external-sdk", "oak-general-business": "file:../oak-general-business", "oak-memory-tree-store": "file:../oak-memory-tree-store",`; } @@ -23,7 +23,7 @@ export function packageJsonContent({ "oak-domain": "^1.0.0", "oak-frontend-base": "^1.0.0", "oak-general-business": "^1.0.0", - "oak_external-sdk": "^1.0.0", + "oak-external-sdk": "^1.0.0", "oak-memory-tree-store": "^1.0.0",`; } @@ -42,7 +42,7 @@ export function packageJsonContent({ "build": "tsc", "server:init": "cross-env NODE_ENV=development; cross-env OAK_PLATFORM=server ts-node scripts/initServer.ts", "server:start": "cross-env NODE_ENV=development; cross-env OAK_PLATFORM=server ts-node scripts/startServer.ts", - "postinstall": "${cliname} make" + "postinstall": "npm run make:domain" }, "keywords": [], "author": "", @@ -70,7 +70,7 @@ export function packageJsonContent({ "rmc-pull-to-refresh": "^1.0.13", "tdesign-icons-react": "^0.1.4", "tdesign-mobile-react": "^0.2.0", - "tdesign-react": "^0.37.1", + "tdesign-react": "^0.38.0", "url": "^0.11.0", "uuid": "^8.3.2" }, diff --git a/src/typings/polyfill.d.ts b/src/typings/polyfill.d.ts index 08ef402..4cff0af 100644 --- a/src/typings/polyfill.d.ts +++ b/src/typings/polyfill.d.ts @@ -1,4 +1,4 @@ -import { GenerateIdOption } from "oak-backend-base/src/polyfill"; +import { GenerateIdOption } from "oak-backend-base/lib/polyfill"; declare global { const generateNewId: (option?: GenerateIdOption) => Promise;