FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TypeScript/scripts/createLanguageServiceBuild.ts at master · mprobst/TypeScript · GitHub
mprobst
/
TypeScript
Public
forked from
microsoft/TypeScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
TypeScript
/
scripts
/
createLanguageServiceBuild.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
46 lines (36 loc) · 1.56 KB
Breadcrumbs
TypeScript
/
scripts
/
createLanguageServiceBuild.ts
Copy path
File metadata and controls
46 lines (36 loc) · 1.56 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/// <reference types="node"/>
import
{
join
}
from
"path"
;
import
{
readFileSync
,
unlinkSync
}
from
"fs"
;
import
{
tmpdir
}
from
"os"
;
import
{
execSync
,
ExecSyncOptions
}
from
"child_process"
;
import
chalk
from
"chalk"
;
interface
PackageJson
{
name
:
string
;
version
:
string
}
const
exec
=
(
cmd
:
string
,
opts
?:
ExecSyncOptions
)
=>
{
console
.
log
(
chalk
.
gray
(
`>
${
cmd
}
${
opts
?
JSON
.
stringify
(
opts
)
:
""
}
`
)
)
;
execSync
(
cmd
,
opts
)
;
}
;
const
step
=
(
msg
:
string
)
=>
{
console
.
log
(
"\n\n"
+
chalk
.
bold
(
"- "
)
+
msg
)
;
}
;
function
main
(
)
:
void
{
console
.
log
(
chalk
.
bold
(
"## Creating the language services build of TypeScript"
)
)
;
process
.
stdout
.
write
(
chalk
.
grey
(
"> node /scripts/createLanguageServiceBuild.ts"
)
)
;
// Create a tarball of the current version
step
(
"Packing the current TypeScript via npm."
)
;
exec
(
"npm pack"
)
;
const
packageJsonValue
:
PackageJson
=
JSON
.
parse
(
readFileSync
(
"package.json"
,
"utf8"
)
)
;
const
tarballFileName
=
`
${
packageJsonValue
.
name
}
-
${
packageJsonValue
.
version
}
.tgz`
;
const
unzipDir
=
tmpdir
(
)
;
step
(
`Extracting the built version into a temporary folder.
${
unzipDir
}
/package`
)
;
exec
(
`tar -xvzf
${
tarballFileName
}
-C
${
unzipDir
}
`
)
;
unlinkSync
(
tarballFileName
)
;
step
(
`Updating the build metadata`
)
;
const
packagePath
=
join
(
unzipDir
,
"package"
)
;
exec
(
`node scripts/configureLanguageServiceBuild.js
${
join
(
packagePath
,
"package.json"
)
}
`
)
;
step
(
`Deploying the language service`
)
;
exec
(
"npm publish --access public"
,
{
cwd
:
packagePath
}
)
;
}
main
(
)
;
Back
|
FazBrowse Home
|
New Git URL