Skip to content

Commit 1f5c29a

Browse files
Adding typescript rootDir options to actions (#163)
* feat(actions): supports typescript rootDir options * set default RootDir to "" Co-authored-by: Dragan Obradović <[email protected]> --------- Co-authored-by: Dragan Obradović <[email protected]>
1 parent 54e5a99 commit 1f5c29a

File tree

5 files changed

+16
-178
lines changed

5 files changed

+16
-178
lines changed

commands/actions/publish.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ var (
3838
projectSlug string
3939
actions *actionsModel.ProjectActions
4040
outDir string
41+
sourcesDir string
4142
sources map[string]string
4243
logicExist bool
4344
dependenciesExist bool
@@ -141,6 +142,7 @@ func buildFunc(cmd *cobra.Command, args []string) {
141142
}
142143

143144
outDir = actions.Sources
145+
sourcesDir = actions.Sources
144146

145147
exists := util.PackageJSONExists(actions.Sources)
146148
if exists {
@@ -165,13 +167,16 @@ func buildFunc(cmd *cobra.Command, args []string) {
165167
}
166168

167169
if tsconfig != nil {
168-
outDir = filepath.Join(outDir, *tsconfig.CompilerOptions.OutDir)
170+
outDir = filepath.Join(actions.Sources, *tsconfig.CompilerOptions.OutDir)
171+
if *tsconfig.CompilerOptions.RootDir != "" {
172+
sourcesDir = filepath.Join(actions.Sources, *tsconfig.CompilerOptions.RootDir)
173+
}
169174
mustInstallDependencies(actions.Sources)
170175
mustBuildProject(actions.Sources, tsconfig)
171176
mustExistCompiledFiles(outDir, actions)
172177
}
173178

174-
sources = mustValidateAndGetSources(r, actions, projectSlug, actions.Sources)
179+
sources = mustValidateAndGetSources(r, actions, projectSlug, sourcesDir)
175180
logrus.Info(commands.Colorizer.Green("\nBuild completed."))
176181
}
177182

commands/logout.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ var logoutCmd = &cobra.Command{
2222
}
2323

2424
if config.GetAccessKeyId() != "" {
25-
// If logged in via token, don't revoke provided token.
26-
rest := NewRest()
27-
emailLogout(rest)
25+
// If logged in via token, don't revoke provided token.
26+
rest := NewRest()
27+
emailLogout(rest)
2828
}
2929

3030
config.SetGlobalConfig(config.Token, "")

go.mod

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ require (
1010
github.com/ghodss/yaml v1.0.0
1111
github.com/go-git/go-git/v5 v5.4.2
1212
github.com/google/go-github/v37 v37.0.0
13-
github.com/gorilla/websocket v1.4.2
1413
github.com/hashicorp/go-version v1.2.0
1514
github.com/logrusorgru/aurora v0.0.0-20190803045625-94edacc10f9b
1615
github.com/manifoldco/promptui v0.3.0
@@ -29,32 +28,17 @@ require (
2928
require (
3029
github.com/Microsoft/go-winio v0.4.16 // indirect
3130
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
32-
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
33-
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
3431
github.com/acomagu/bufpipe v1.0.3 // indirect
35-
github.com/allegro/bigcache v1.2.1 // indirect
36-
github.com/btcsuite/btcd v0.22.0-beta // indirect
37-
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
38-
github.com/cespare/xxhash/v2 v2.1.2 // indirect
3932
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
4033
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
4134
github.com/davecgh/go-spew v1.1.1 // indirect
42-
github.com/deckarep/golang-set v1.8.0 // indirect
43-
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
4435
github.com/emirpasic/gods v1.12.0 // indirect
4536
github.com/fatih/color v1.13.0 // indirect
4637
github.com/fsnotify/fsnotify v1.5.1 // indirect
4738
github.com/go-git/gcfg v1.5.0 // indirect
4839
github.com/go-git/go-billy/v5 v5.3.1 // indirect
49-
github.com/go-logfmt/logfmt v0.5.1 // indirect
50-
github.com/go-ole/go-ole v1.2.6 // indirect
51-
github.com/go-stack/stack v1.8.0 // indirect
52-
github.com/golang/snappy v0.0.4 // indirect
5340
github.com/google/go-querystring v1.0.0 // indirect
54-
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
5541
github.com/hashicorp/hcl v1.0.0 // indirect
56-
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
57-
github.com/holiman/uint256 v1.2.0 // indirect
5842
github.com/imdario/mergo v0.3.12 // indirect
5943
github.com/inconshreveable/mousetrap v1.0.0 // indirect
6044
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
@@ -65,33 +49,25 @@ require (
6549
github.com/magiconair/properties v1.8.5 // indirect
6650
github.com/mattn/go-colorable v0.1.12 // indirect
6751
github.com/mattn/go-isatty v0.0.14 // indirect
68-
github.com/mattn/go-runewidth v0.0.9 // indirect
6952
github.com/mitchellh/go-homedir v1.1.0 // indirect
7053
github.com/mitchellh/mapstructure v1.4.3 // indirect
71-
github.com/olekukonko/tablewriter v0.0.5 // indirect
7254
github.com/palantir/pkg v1.0.1 // indirect
7355
github.com/palantir/pkg/transform v1.0.0 // indirect
7456
github.com/pelletier/go-toml v1.9.4 // indirect
7557
github.com/pmezard/go-difflib v1.0.0 // indirect
76-
github.com/prometheus/tsdb v0.7.1 // indirect
7758
github.com/robertkrimen/otto v0.0.0-20211024170158-b87d35c0b86f // indirect
7859
github.com/sergi/go-diff v1.1.0 // indirect
79-
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
8060
github.com/spf13/afero v1.6.0 // indirect
8161
github.com/spf13/cast v1.4.1 // indirect
8262
github.com/spf13/jwalterweatherman v1.1.0 // indirect
8363
github.com/spf13/pflag v1.0.5 // indirect
8464
github.com/subosito/gotenv v1.2.0 // indirect
85-
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
86-
github.com/tklauser/go-sysconf v0.3.5 // indirect
87-
github.com/tklauser/numcpus v0.2.2 // indirect
8865
github.com/xanzy/ssh-agent v0.3.0 // indirect
8966
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
9067
golang.org/x/net v0.4.0 // indirect
9168
golang.org/x/sys v0.3.0 // indirect
9269
golang.org/x/text v0.5.0 // indirect
9370
gopkg.in/ini.v1 v1.66.2 // indirect
94-
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
9571
gopkg.in/warnings.v0 v0.1.2 // indirect
9672
gopkg.in/yaml.v2 v2.4.0 // indirect
9773
)

0 commit comments

Comments
 (0)