forked from labring/laf
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 将‘创建内部SDK包’的命令分离出来,在构建 docker 镜像时要单独用到;
- Loading branch information
Showing
3 changed files
with
34 additions
and
28 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
packages/less-api-framework/init/create-internal-package.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const fse = require('fs-extra') | ||
const path = require('path') | ||
|
||
|
||
/** | ||
* 在 node_modules 中创建 云函数 sdk 包:@, 这个包是为了云函数IDE 加载类型提示文件而创建的,不可发布 | ||
*/ | ||
function createCloudFunctionDeclarationPackage() { | ||
const source = path.resolve(__dirname, '../dist') | ||
const target = path.resolve(__dirname, '../node_modules/@') | ||
|
||
fse.ensureDirSync(target) | ||
fse.copySync(source, target) | ||
|
||
console.log(`copy success: ${source} => ${target}`) | ||
|
||
const packageJson = ` | ||
{ | ||
"name": "@", | ||
"version": "0.0.0" | ||
} | ||
` | ||
const pkgJsonPath = path.join(target, 'package.json') | ||
fse.writeFileSync(pkgJsonPath, packageJson) | ||
|
||
console.log(`write success: ${pkgJsonPath}`) | ||
} | ||
|
||
|
||
createCloudFunctionDeclarationPackage() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters