-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(cli): 改造脚手架提供,packages内可以直接注册webpack配置跟脚手架命令
- Loading branch information
luoxue
committed
Dec 19, 2019
1 parent
0828922
commit f340e6f
Showing
121 changed files
with
1,317 additions
and
10,361 deletions.
There are no files selected for viewing
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,24 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "attach", | ||
"name": "Attach", | ||
"port": 9229, | ||
"skipFiles": ["<node_internals>/**"] | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Launch Program", | ||
"skipFiles": ["<node_internals>/**"], | ||
"program": "${workspaceFolder}/index.js", | ||
"preLaunchTask": "tsc: build - tsconfig.json", | ||
"outFiles": ["${workspaceFolder}/dist/**/*.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
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
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,14 @@ | ||
module.exports.getAllCwds = function() { | ||
const path = require('path') | ||
const fs = require('fs') | ||
const localCwdPath = path.join(__dirname, '..', 'cwd') | ||
const localCwdNames = [...fs.readdirSync(localCwdPath)] | ||
const cwdFns = [] | ||
const { getConfigsByName } = require('../util/getLocalConfigByPath') | ||
localCwdNames.forEach(name => { | ||
const cwdPath = path.join(localCwdPath, name) | ||
cwdFns.push(require(cwdPath)) | ||
}) | ||
cwdFns.push(...getConfigsByName('packages', 'cwd.config.js')) | ||
return cwdFns | ||
} |
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 |
---|---|---|
@@ -1,18 +1,15 @@ | ||
#!/usr/bin/env node | ||
process.env.NODE_ENV = 'none' | ||
const commandsName = ['build', 'dev', 'dll', 'build:ssr', 'ssr:server', 'lint', 'upgrade', 'inspect', 'server:gql'] | ||
const { getAllCwds } = require('../api/CwdAPI') | ||
|
||
const { | ||
injectCommand, | ||
commandComplete, | ||
commandName | ||
commandComplete | ||
} = require('../api/CommandAPI') | ||
const PluginAPI = require('../api/PluginAPI') | ||
|
||
commandName.push(...commandsName) | ||
// 注册命令行 | ||
commandsName.forEach(name => { | ||
const cwd = require(`../cwd/${name}`) | ||
cwd({ cliName: name, injectCommand, api: PluginAPI }) | ||
getAllCwds().forEach(cwd => { | ||
cwd({ injectCommand, api: PluginAPI }) | ||
}) | ||
// 命令行注册完成 | ||
commandComplete() |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.