2017-02-15 19:06:19 +01:00
|
|
|
// Package typescript provides a typescript compiler with hot-reloader
|
|
|
|
// and optionally a cloud-based editor, called 'alm-tools'.
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// typescript (by microsoft) and alm-tools (by @basarat) have their own (open-source) licenses
|
2017-02-15 19:06:19 +01:00
|
|
|
// the tools are not used directly by this adaptor, but it's good to know where you can find
|
|
|
|
// the software.
|
2017-02-14 04:54:11 +01:00
|
|
|
package typescript
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"strings"
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
"github.com/kataras/iris/typescript/npm"
|
2017-02-14 04:54:11 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// Typescript contains the unique iris' typescript loader, holds all necessary fields & methods.
|
|
|
|
Typescript struct {
|
2017-02-14 04:54:11 +01:00
|
|
|
Config *Config
|
2017-07-10 17:32:42 +02:00
|
|
|
log func(format string, a ...interface{})
|
2017-02-14 04:54:11 +01:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
// New creates & returns a new instnace typescript plugin
|
2017-07-10 17:32:42 +02:00
|
|
|
func New(cfg ...Config) *Typescript {
|
2017-02-14 04:54:11 +01:00
|
|
|
c := DefaultConfig()
|
2017-07-10 17:32:42 +02:00
|
|
|
if len(cfg) > 0 {
|
|
|
|
c = cfg[0]
|
|
|
|
}
|
|
|
|
|
|
|
|
return &Typescript{Config: &c}
|
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
|
|
// NoOpLogger can be used as the logger argument, it prints nothing.
|
|
|
|
NoOpLogger = func(string, ...interface{}) {}
|
|
|
|
)
|
|
|
|
|
|
|
|
// Run starts the typescript filewatcher watcher and the typescript compiler.
|
|
|
|
func (t *Typescript) Run(logger func(format string, a ...interface{})) {
|
|
|
|
c := t.Config
|
|
|
|
if c.Tsconfig == nil {
|
|
|
|
tsC := DefaultTsconfig()
|
|
|
|
c.Tsconfig = &tsC
|
|
|
|
}
|
|
|
|
|
|
|
|
if c.Dir == "" {
|
|
|
|
c.Tsconfig.CompilerOptions.OutDir = c.Dir
|
|
|
|
}
|
|
|
|
|
|
|
|
if c.Dir == "" {
|
|
|
|
c.Dir = "./"
|
|
|
|
}
|
2017-02-14 04:54:11 +01:00
|
|
|
|
|
|
|
if !strings.Contains(c.Ignore, nodeModules) {
|
|
|
|
c.Ignore += "," + nodeModules
|
|
|
|
}
|
|
|
|
|
2017-07-10 17:32:42 +02:00
|
|
|
if logger == nil {
|
|
|
|
logger = NoOpLogger
|
|
|
|
}
|
2017-02-14 04:54:11 +01:00
|
|
|
|
2017-07-10 17:32:42 +02:00
|
|
|
t.log = logger
|
2017-02-14 04:54:11 +01:00
|
|
|
|
2017-07-10 17:32:42 +02:00
|
|
|
t.start()
|
|
|
|
}
|
2017-02-14 04:54:11 +01:00
|
|
|
|
2017-07-10 17:32:42 +02:00
|
|
|
func (t *Typescript) start() {
|
2017-02-14 04:54:11 +01:00
|
|
|
if t.hasTypescriptFiles() {
|
|
|
|
//Can't check if permission denied returns always exists = true....
|
|
|
|
|
|
|
|
if !npm.NodeModuleExists(t.Config.Bin) {
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
t.log("installing typescript, please wait...")
|
2017-02-14 04:54:11 +01:00
|
|
|
res := npm.NodeModuleInstall("typescript")
|
|
|
|
if res.Error != nil {
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
t.log(res.Error.Error())
|
2017-02-14 04:54:11 +01:00
|
|
|
return
|
|
|
|
}
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
t.log(res.Message)
|
2017-02-14 04:54:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
projects := t.getTypescriptProjects()
|
|
|
|
if len(projects) > 0 {
|
|
|
|
watchedProjects := 0
|
2017-07-10 17:32:42 +02:00
|
|
|
// typescript project (.tsconfig) found
|
2017-02-14 04:54:11 +01:00
|
|
|
for _, project := range projects {
|
|
|
|
cmd := npm.CommandBuilder("node", t.Config.Bin, "-p", project[0:strings.LastIndex(project, npm.PathSeparator)]) //remove the /tsconfig.json)
|
|
|
|
projectConfig, perr := FromFile(project)
|
|
|
|
if perr != nil {
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
t.log("error while trying to read tsconfig: %s", perr.Error())
|
2017-02-14 04:54:11 +01:00
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
if projectConfig.CompilerOptions.Watch {
|
|
|
|
watchedProjects++
|
|
|
|
// if has watch : true then we have to wrap the command to a goroutine (I don't want to use the .Start here)
|
|
|
|
go func() {
|
|
|
|
_, err := cmd.Output()
|
|
|
|
if err != nil {
|
2017-07-10 17:32:42 +02:00
|
|
|
t.log("error when 'watch' is true: %v", err)
|
2017-02-14 04:54:11 +01:00
|
|
|
return
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
} else {
|
|
|
|
_, err := cmd.Output()
|
|
|
|
if err != nil {
|
2017-07-10 17:32:42 +02:00
|
|
|
t.log("unexpected error from output: %v", err)
|
2017-02-14 04:54:11 +01:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2017-07-10 17:32:42 +02:00
|
|
|
return
|
|
|
|
}
|
|
|
|
//search for standalone typescript (.ts) files and compile them
|
|
|
|
files := t.getTypescriptFiles()
|
|
|
|
if len(files) > 0 {
|
|
|
|
/* watchedFiles := 0
|
|
|
|
if t.Config.Tsconfig.CompilerOptions.Watch {
|
|
|
|
watchedFiles = len(files)
|
|
|
|
}*/
|
|
|
|
//it must be always > 0 if we came here, because of if hasTypescriptFiles == true.
|
|
|
|
for _, file := range files {
|
|
|
|
|
|
|
|
absPath, err := filepath.Abs(file)
|
|
|
|
if err != nil {
|
|
|
|
t.log("error while trying to resolve absolute path for %s: %v", file, err)
|
|
|
|
continue
|
|
|
|
}
|
2017-02-14 04:54:11 +01:00
|
|
|
|
2017-07-10 17:32:42 +02:00
|
|
|
// these will be used if no .tsconfig found.
|
|
|
|
// cmd := npm.CommandBuilder("node", t.Config.Bin)
|
|
|
|
// cmd.Arguments(t.Config.Bin, t.Config.Tsconfig.CompilerArgs()...)
|
|
|
|
// cmd.AppendArguments(absPath)
|
|
|
|
compilerArgs := t.Config.Tsconfig.CompilerArgs()
|
|
|
|
cmd := npm.CommandBuilder("node", t.Config.Bin)
|
2017-02-14 04:54:11 +01:00
|
|
|
|
2017-07-10 17:32:42 +02:00
|
|
|
for _, s := range compilerArgs {
|
|
|
|
cmd.AppendArguments(s)
|
|
|
|
}
|
|
|
|
cmd.AppendArguments(absPath)
|
|
|
|
go func() {
|
|
|
|
compilerMsgB, _ := cmd.Output()
|
|
|
|
compilerMsg := string(compilerMsgB)
|
|
|
|
cmd.Args = cmd.Args[0 : len(cmd.Args)-1] //remove the last, which is the file
|
|
|
|
|
|
|
|
if strings.Contains(compilerMsg, "error") {
|
|
|
|
t.log(compilerMsg)
|
|
|
|
}
|
2017-02-14 04:54:11 +01:00
|
|
|
|
2017-07-10 17:32:42 +02:00
|
|
|
}()
|
2017-02-14 04:54:11 +01:00
|
|
|
|
|
|
|
}
|
2017-07-10 17:32:42 +02:00
|
|
|
return
|
2017-02-14 04:54:11 +01:00
|
|
|
}
|
2017-07-10 17:32:42 +02:00
|
|
|
return
|
|
|
|
}
|
|
|
|
absPath, err := filepath.Abs(t.Config.Dir)
|
|
|
|
if err != nil {
|
|
|
|
t.log("no typescript file, the directory cannot be resolved: %v", err)
|
|
|
|
return
|
2017-02-14 04:54:11 +01:00
|
|
|
}
|
2017-07-10 17:32:42 +02:00
|
|
|
t.log("no typescript files found on : %s", absPath)
|
2017-02-14 04:54:11 +01:00
|
|
|
}
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
func (t *Typescript) hasTypescriptFiles() bool {
|
2017-02-14 04:54:11 +01:00
|
|
|
root := t.Config.Dir
|
2017-07-10 17:32:42 +02:00
|
|
|
ignoreFolders := t.getIgnoreFolders()
|
2017-02-14 04:54:11 +01:00
|
|
|
hasTs := false
|
|
|
|
if !npm.Exists(root) {
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
t.log("typescript error: directory '%s' couldn't be found,\nplease specify a valid path for your *.ts files", root)
|
2017-02-14 04:54:11 +01:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
// ignore error
|
|
|
|
filepath.Walk(root, func(path string, fi os.FileInfo, err error) error {
|
|
|
|
if fi.IsDir() {
|
|
|
|
return nil
|
|
|
|
}
|
2017-07-10 17:32:42 +02:00
|
|
|
for _, s := range ignoreFolders {
|
|
|
|
if strings.HasSuffix(path, s) || path == s {
|
|
|
|
return filepath.SkipDir
|
2017-02-14 04:54:11 +01:00
|
|
|
}
|
|
|
|
}
|
2017-07-10 17:32:42 +02:00
|
|
|
|
2017-02-14 04:54:11 +01:00
|
|
|
if strings.HasSuffix(path, ".ts") {
|
|
|
|
hasTs = true
|
2017-07-10 17:32:42 +02:00
|
|
|
return errors.New("typescript found, hope that will stop here")
|
2017-02-14 04:54:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
})
|
|
|
|
return hasTs
|
|
|
|
}
|
|
|
|
|
2017-07-10 17:32:42 +02:00
|
|
|
func (t *Typescript) getIgnoreFolders() (folders []string) {
|
|
|
|
ignoreFolders := strings.Split(t.Config.Ignore, ",")
|
|
|
|
|
|
|
|
for _, s := range ignoreFolders {
|
|
|
|
if s != "" {
|
|
|
|
folders = append(folders, s)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return folders
|
|
|
|
}
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
func (t *Typescript) getTypescriptProjects() []string {
|
2017-02-14 04:54:11 +01:00
|
|
|
var projects []string
|
2017-07-10 17:32:42 +02:00
|
|
|
ignoreFolders := t.getIgnoreFolders()
|
2017-02-14 04:54:11 +01:00
|
|
|
|
|
|
|
root := t.Config.Dir
|
|
|
|
//t.logger.Printf("\nSearching for typescript projects in %s", root)
|
|
|
|
|
|
|
|
// ignore error
|
|
|
|
filepath.Walk(root, func(path string, fi os.FileInfo, err error) error {
|
|
|
|
if fi.IsDir() {
|
|
|
|
return nil
|
|
|
|
}
|
2017-07-10 17:32:42 +02:00
|
|
|
for _, s := range ignoreFolders {
|
|
|
|
if strings.HasSuffix(path, s) || path == s {
|
2017-02-14 04:54:11 +01:00
|
|
|
return filepath.SkipDir
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if strings.HasSuffix(path, npm.PathSeparator+"tsconfig.json") {
|
|
|
|
//t.logger.Printf("\nTypescript project found in %s", path)
|
|
|
|
projects = append(projects, path)
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
})
|
|
|
|
return projects
|
|
|
|
}
|
|
|
|
|
|
|
|
// this is being called if getTypescriptProjects return 0 len, then we are searching for files using that:
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
func (t *Typescript) getTypescriptFiles() []string {
|
2017-02-14 04:54:11 +01:00
|
|
|
var files []string
|
2017-07-10 17:32:42 +02:00
|
|
|
ignoreFolders := t.getIgnoreFolders()
|
2017-02-14 04:54:11 +01:00
|
|
|
|
|
|
|
root := t.Config.Dir
|
|
|
|
|
|
|
|
// ignore error
|
|
|
|
filepath.Walk(root, func(path string, fi os.FileInfo, err error) error {
|
|
|
|
if fi.IsDir() {
|
|
|
|
return nil
|
|
|
|
}
|
2017-07-10 17:32:42 +02:00
|
|
|
for _, s := range ignoreFolders {
|
|
|
|
if strings.HasSuffix(path, s) || path == s {
|
2017-02-14 04:54:11 +01:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if strings.HasSuffix(path, ".ts") {
|
|
|
|
//t.logger.Printf("\nTypescript file found in %s", path)
|
|
|
|
files = append(files, path)
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
})
|
|
|
|
return files
|
|
|
|
}
|