MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Deps

Method Deps

tools/mage/js.go:122–149  ·  view source on GitHub ↗

Deps installs the javascript dependencies.

()

Source from the content-addressed store, hash-verified

120
121// Deps installs the javascript dependencies.
122func (js Js) Deps() error {
123 ok, err := target.Dir(
124 "node_modules",
125 "package.json",
126 "yarn.lock",
127 filepath.Join("sdk", "js", "src"),
128 filepath.Join("sdk", "js", "generated"),
129 )
130 if err != nil {
131 return targetError(err)
132 }
133 if !ok {
134 return nil
135 }
136 mg.Deps(JsSDK.Build)
137 if !js.isProductionMode() {
138 if mg.Verbose() {
139 fmt.Println("Linking ttn-lw package")
140 }
141 if err := runYarn(yarnWorkingDirectoryArg("sdk", "js"), "link"); err != nil {
142 return fmt.Errorf("failed to create JS SDK link: %w", err)
143 }
144 if err := runYarn("link", "ttn-lw"); err != nil {
145 return fmt.Errorf("failed to link JS SDK: %w", err)
146 }
147 }
148 return js.deps()
149}
150
151// BuildDll runs the webpack command to build the DLL bundle
152func (js Js) BuildDll() error {

Callers 15

runCypressMethod · 0.45
BuildDllMethod · 0.45
BuildMethod · 0.45
ServeMethod · 0.45
MessagesMethod · 0.45
BackendTranslationsMethod · 0.45
TestMethod · 0.45
FmtMethod · 0.45
LintMethod · 0.45
LintSnapMethod · 0.45
LintAllMethod · 0.45
StorybookMethod · 0.45

Calls 8

isProductionModeMethod · 0.95
depsMethod · 0.95
targetErrorFunction · 0.85
runYarnFunction · 0.85
yarnWorkingDirectoryArgFunction · 0.85
DirMethod · 0.80
JoinMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected