Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Serverless Devs
Commits
e251aa3a
Commit
e251aa3a
authored
3 years ago
by
xsahxl
Browse files
Options
Download
Email Patches
Plain Diff
feat:
s edit 初始化
parent
ff62fe6a
pkg
develop
2.1.7
2.1.7-beta.1
2.1.6
2.1.6-beta.2
2.1.6-beta.1
2.1.5
2.1.5-beta.1
2.1.4
2.1.4-beta.1
2.1.3
2.1.3-beta.2
2.1.3-beta.1
2.1.2
2.1.2-beta.2
2.1.2-beta.1
2.1.1
2.1.1-beta.11
2.1.1-beta.10
2.1.1-beta.9
2.1.1-beta.8
2.1.1-beta.7
2.1.1-beta.6
2.1.1-beta.5
2.1.1-beta.4
2.1.1-beta.3
2.1.1-beta.2
No related merge requests found
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
Makefile
+1
-1
Makefile
bin/s-edit
+2
-0
bin/s-edit
package.json
+1
-0
package.json
shell/postbuild.sh
+1
-0
shell/postbuild.sh
src/constant.ts
+1
-1
src/constant.ts
src/edit/index.ts
+49
-0
src/edit/index.ts
src/help/index.ts
+1
-0
src/help/index.ts
src/index.ts
+1
-0
src/index.ts
with
57 additions
and
2 deletions
+57
-2
Makefile
+
1
-
1
View file @
e251aa3a
...
...
@@ -15,7 +15,7 @@ push:
git push
--force-with-lease
origin
$(CURRENT_BRANCH_NAME)
release-dev
:
gh release create 2.
0
.1
00
-beta.
6
--notes
"release dev"
--target
shl/parse
--title
"Release dev"
--prerelease
gh release create 2.
1
.1-beta.
1
--notes
"release dev"
--target
develop
--title
"Release dev"
--prerelease
roll-back-dev
:
git reset
--soft
HEAD~1
...
...
This diff is collapsed.
Click to expand it.
bin/s-edit
0 → 100755
+
2
-
0
View file @
e251aa3a
#!/usr/bin/env node
require
(
'
../lib/edit
'
);
This diff is collapsed.
Click to expand it.
package.json
+
1
-
0
View file @
e251aa3a
...
...
@@ -67,6 +67,7 @@
"
jest
"
:
"
^27.4.7
"
,
"
latest-version
"
:
"
^5.1.0
"
,
"
lint-staged
"
:
"
^10.0.8
"
,
"
open
"
:
"
^8.4.0
"
,
"
os-locale
"
:
"
5.0.0
"
,
"
prettier
"
:
"
^2.2.1
"
,
"
semver
"
:
"
^7.3.5
"
,
...
...
This diff is collapsed.
Click to expand it.
shell/postbuild.sh
+
1
-
0
View file @
e251aa3a
...
...
@@ -15,5 +15,6 @@ esbuild lib/clean/index.js --bundle --log-level=error --minify --external:@serve
esbuild lib/component/index.js
--bundle
--log-level
=
error
--minify
--external
:@serverless-devs/core
--platform
=
node
--format
=
cjs
--target
=
node10.4
--allow-overwrite
--outfile
=
lib/component/index.js
esbuild lib/update-notifier/index.js
--bundle
--log-level
=
error
--minify
--external
:@serverless-devs/core
--platform
=
node
--format
=
cjs
--target
=
node10.4
--allow-overwrite
--outfile
=
lib/update-notifier/index.js
esbuild lib/verify/index.js
--bundle
--log-level
=
error
--minify
--external
:@serverless-devs/core
--platform
=
node
--format
=
cjs
--target
=
node10.4
--allow-overwrite
--outfile
=
lib/verify/index.js
esbuild lib/edit/index.js
--bundle
--log-level
=
error
--minify
--external
:@serverless-devs/core
--platform
=
node
--format
=
cjs
--target
=
node10.4
--allow-overwrite
--outfile
=
lib/edit/index.js
This diff is collapsed.
Click to expand it.
src/constant.ts
+
1
-
1
View file @
e251aa3a
export
const
DEFAULT_REGIRSTRY
=
'
http://registry.devsapp.cn/simple
'
;
export
const
UPDATE_CHECK_INTERVAL
=
1000
*
60
*
60
*
12
;
export
const
COMMAND_LIST
=
[
'
clean
'
,
'
cli
'
,
'
component
'
,
'
config
'
,
'
init
'
,
'
set
'
,
'
verify
'
];
export
const
COMMAND_LIST
=
[
'
clean
'
,
'
cli
'
,
'
component
'
,
'
config
'
,
'
init
'
,
'
set
'
,
'
verify
'
,
'
edit
'
];
This diff is collapsed.
Click to expand it.
src/edit/index.ts
0 → 100644
+
49
-
0
View file @
e251aa3a
import
program
from
'
@serverless-devs/commander
'
;
import
core
from
'
../utils/core
'
;
import
{
emoji
,
getProcessArgv
,
i18n
}
from
'
../utils
'
;
import
{
HandleError
}
from
'
../error
'
;
import
execa
from
'
execa
'
;
import
open
from
'
open
'
;
const
{
colors
}
=
core
;
const
description
=
`Get details of installed components.
Example:
$ s component
$ s component --component fc-api
${
emoji
(
'
📖
'
)}
Document:
${
colors
.
underline
(
'
https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/component.md
'
,
)}
`
;
const
command
=
program
.
name
(
'
s component
'
)
.
usage
(
'
[options]
'
)
.
option
(
'
--component [componentName]
'
,
'
Gets the specified component information (like: fc, fc@0.0.1)
'
)
.
helpOption
(
'
-h, --help
'
,
i18n
(
'
display_help_for_command
'
))
.
description
(
description
)
.
addHelpCommand
(
false
)
.
parse
(
process
.
argv
);
(
async
()
=>
{
console
.
log
(
process
.
argv
);
const
{
help
,
template
}
=
getProcessArgv
();
if
(
help
)
{
command
.
help
();
}
const
spath
=
await
core
.
getTemplatePath
(
template
);
const
port
=
await
core
.
getAvailablePort
(
7000
);
console
.
log
(
spath
);
execa
(
process
.
execPath
,
[
'
/Users/shihuali/workspace/serverless-devs-ui/server/app.js
'
,
'
--template
'
,
spath
,
'
--port
'
,
port
],
{
stdio
:
'
inherit
'
,
shell
:
true
,
},
);
await
core
.
sleep
(
1000
);
await
open
(
`http://localhost:
${
port
}
`
);
})().
catch
(
async
error
=>
{
await
HandleError
(
error
);
});
This diff is collapsed.
Click to expand it.
src/help/index.ts
+
1
-
0
View file @
e251aa3a
...
...
@@ -22,6 +22,7 @@ const descption = {
{
set
:
'
🔧 Settings for the tool.
'
},
{
clean
:
'
💥 Clean up the environment.
'
},
{
component
:
'
🔌 Installed component information.
'
},
{
edit
:
'
🔌 Installed component information.
'
},
],
Examples
:
[{
init
:
'
Perform [s init] fast experience Serverless Devs.
'
}],
};
...
...
This diff is collapsed.
Click to expand it.
src/index.ts
+
1
-
0
View file @
e251aa3a
...
...
@@ -28,6 +28,7 @@ const { join, includes } = lodash;
.
command
(
'
set
'
,
`
${
emoji
(
'
🔧
'
)}
Settings for the tool.`
)
.
command
(
'
clean
'
,
`
${
emoji
(
'
💥
'
)}
Clean up the environment.`
)
.
command
(
'
component
'
,
`
${
emoji
(
'
🔌
'
)}
Installed component information.`
)
.
command
(
'
edit
'
,
`
${
emoji
(
'
🔌
'
)}
Installed component information.`
)
.
version
(
getVersion
(),
'
-v, --version
'
,
'
Output the version number.
'
)
.
addHelpCommand
(
false
);
// 将参数argv存储到env
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help