kaxori
09/11/2024, 4:13 PMjag pkg registry add local t:\packages --local
it returned with:
Unhandled error: open C:\Users\Axel\.config\toit\config.yaml: Das System kann den angegebenen Pfad nicht finden.
=> then I copied C:\Users\Axel\.config\jaguar\config.yaml to
C:\Users\Axel\.config\toit and the command above succeeded.
jag pkg registry list
toit: github.com/toitware/registry (git)
local: t:\packages (local)
A path specification may need to be adjusted ?kaxori
09/12/2024, 8:32 AMimport pixel_strip show * // github.com/toitware/toit-pixel-strip
import rgb-strip show * // local package
reports: Package for prefix 'pixel-strip' not found
I struggle with package.yaml/.lock ?
Does anyone have a tip?floitsch
09/12/2024, 3:39 PMfloitsch
09/12/2024, 3:41 PMfloitsch
09/12/2024, 3:43 PMfloitsch
09/12/2024, 3:44 PMjag pkg install pixel_strip inside the examples folder.floitsch
09/12/2024, 4:00 PMpackage.yaml/lock you are a separate project.floitsch
09/12/2024, 4:01 PMfloitsch
09/12/2024, 4:01 PMfloitsch
09/12/2024, 4:01 PMfloitsch
09/12/2024, 4:02 PMkaxori
09/12/2024, 4:02 PMfloitsch
09/12/2024, 4:02 PMfloitsch
09/12/2024, 4:02 PMfloitsch
09/12/2024, 4:03 PMfloitsch
09/12/2024, 4:03 PMfloitsch
09/12/2024, 4:04 PMrgb-strip it could suggest to install pixel_strip too.kaxori
09/12/2024, 4:12 PMrgb-strip was to encapsulate PixelStrip, ByteArray, Colors, ... and to reuse that package in different applications. I thought if pixel_strip is globally installed in `.packages' and 'rgb-strip' is installed in 'local-packages'.
And the jag apps have only to import a single rgb-strip definition.floitsch
09/12/2024, 4:37 PMfloitsch
09/12/2024, 4:40 PMimport pixel-strip show *
import something-else show *
export *
If you then import that library (in a package or not) you get all the types from it.
However, it also means that you lose the prefix. So all of the identifiers would be mixed together.
You could avoid that by having different files:
// pixel-strip.toit
import pixel-strip show *
export *
// something-else.toit
import something-else show *
export *
You could then import merged.pixel-strip or import merged.something-else.floitsch
09/12/2024, 4:40 PMkaxori
09/12/2024, 4:42 PMimport .color show *
import .bytearray show *
import pixel_strip show *
import gpio
export *
/**
Implements a universal (application independent) Neopixel led strip interface.
*/
class Rgb-Strip:
...
thats what I tried, but i always get an error after >>> import pixel_strip show *floitsch
09/12/2024, 4:43 PMkaxori
09/12/2024, 4:43 PMfloitsch
09/12/2024, 4:43 PMfloitsch
09/12/2024, 4:44 PMkaxori
09/12/2024, 4:45 PMkaxori
09/12/2024, 4:45 PMPS T:\local-packages\rgb-strip\examples> jag run .\app.toit --device Radar
Scanning for device with name: 'Radar'
Running '.\app.toit' on 'Radar' ...
<pkg:..>\rgb-strip.toit:4:8: error: Package for prefix 'pixel-strip' not found
import pixel_strip show *
^~~~~~~~~~~
Compilation failed
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x15b1a3b]
goroutine 1 [running]:
main.main()
D:/a/jaguar/jaguar/cmd/jag/main.go:38 +0x1db
PS T:\local-packages\rgb-strip\examples>floitsch
09/12/2024, 4:46 PMfloitsch
09/12/2024, 4:47 PMjag pkg install in your example folderfloitsch
09/12/2024, 4:48 PMkaxori
09/12/2024, 4:48 PMPS T:\local-packages\rgb-strip\examples> jag pkg install
Error: Failed to parse package description 'T:\local-packages\rgb-strip\package.yaml': %!w(*yaml.TypeError=&{[line 5: cannot unmarshal !!map into []tpkg.descPackage]})
PS T:\local-packages\rgb-strip\examples>floitsch
09/12/2024, 4:49 PMfloitsch
09/12/2024, 4:50 PMfloitsch
09/12/2024, 4:50 PMkaxori
09/12/2024, 4:51 PMPS T:\local-packages\rgb-strip> jag pkg install
Error: Failed to parse package description 'T:\local-packages\rgb-strip\package.yaml': %!w(*yaml.TypeError=&{[line 5: cannot unmarshal !!map into []tpkg.descPackage]})`floitsch
09/12/2024, 4:51 PMfloitsch
09/12/2024, 4:51 PMkaxori
09/12/2024, 4:51 PMfloitsch
09/12/2024, 4:52 PMkaxori
09/12/2024, 4:53 PMfloitsch
09/12/2024, 4:53 PMfloitsch
09/12/2024, 4:54 PMjag pkg initfloitsch
09/12/2024, 4:54 PMjag pkg install toit-pixel-stripkaxori
09/12/2024, 4:56 PMPS T:\local-packages\rgb-strip> jag pkg init
PS T:\local-packages\rgb-strip> jag pkg install toit-pixel-strip
Error: Description at 'T:\local-packages\rgb-strip\package.yaml' is missing a namefloitsch
09/12/2024, 4:59 PMname and description to your package filefloitsch
09/12/2024, 5:01 PMpkg install.floitsch
09/12/2024, 5:08 PMkaxori
09/12/2024, 9:35 PMkaxori
09/12/2024, 9:36 PMfloitsch
09/12/2024, 9:36 PMkaxori
09/12/2024, 9:37 PMfloitsch
09/13/2024, 8:32 AMjag pkg init
jag pkg install --local ..
And then removed the pixel_strip line:
// import pixel_strip show * // github.com/toitware/toit-pixel-strip
With that everything worked.floitsch
09/13/2024, 8:33 AMkaxori
09/13/2024, 8:44 AMPS T:\local-packages\rgb-strip\examples> jag pkg init
PS T:\local-packages\rgb-strip\examples> jag pkg install --local ..
Error: Description at 'T:\local-packages\rgb-strip\examples\package.yaml' is missing a namefloitsch
09/13/2024, 8:57 AMkaxori
09/13/2024, 8:58 AMfloitsch
09/13/2024, 8:58 AMkaxori
09/13/2024, 9:03 AMPS T:\local-packages\rgb-strip\examples> jag pkg init
PS T:\local-packages\rgb-strip\examples> jag pkg install --local ..
Error: Description at 'T:\local-packages\rgb-strip\examples\package.yaml' is missing a name
PS T:\local-packages\rgb-strip\examples> jag version
Version: v1.41.0
SDK version: v2.0.0-alpha.160
Build date: 2024-09-01T11:40:26Zfloitsch
09/13/2024, 9:04 AMfloitsch
09/13/2024, 9:05 AMfloitsch
09/13/2024, 9:05 AMfloitsch
09/13/2024, 9:07 AMfloitsch
09/13/2024, 9:08 AMjag pkg registry list ?floitsch
09/13/2024, 9:08 AMkaxori
09/13/2024, 9:08 AMfloitsch
09/13/2024, 9:08 AMfloitsch
09/13/2024, 9:09 AMfloitsch
09/13/2024, 9:10 AMfloitsch
09/13/2024, 9:10 AMjag pkg install xxx where xxx is not on pkg.toit.io but only in your local registry.floitsch
09/13/2024, 9:11 AMfloitsch
09/13/2024, 9:12 AMfloitsch
09/13/2024, 9:12 AMfloitsch
09/13/2024, 9:12 AMfloitsch
09/13/2024, 9:12 AMfloitsch
09/13/2024, 9:13 AMjag pkg describefloitsch
09/13/2024, 9:15 AMfloitsch
09/13/2024, 9:16 AMkaxori
09/13/2024, 9:17 AMfloitsch
09/13/2024, 9:17 AMjag pkg install --local ...floitsch
09/13/2024, 9:18 AMjag pkg that it should add a certain local folder as URL@version for resolution.floitsch
09/13/2024, 9:18 AMfloitsch
09/13/2024, 9:19 AMfloitsch
09/13/2024, 9:19 AMfloitsch
09/13/2024, 9:20 AMlocal registry again. Any yaml file in the local-packages folder will trip up the package manager.kaxori
09/13/2024, 9:20 AMkaxori
09/13/2024, 11:07 AMPS T:\> jag pkg install --local t:\rgb-strip
Info: Package 't:\rgb-strip' installed with name 'rgb-strip'
PS T:\> jag pkg list rgb-strip
Error: Failed to parse package description 'rgb-strip\examples\package.yaml': %!w(*yaml.TypeError=&{[line 2: cannot unmarshal !!map into []tpkg.descPackage]})kaxori
09/13/2024, 11:08 AMkaxori
09/13/2024, 11:14 AMname: rgb-strip
description: Implements a universal (application independent) Neopixel led strip interface.
license: proprietary
version: v1.0.0
url: T:/rgb-strip
PS T:\> jag pkg list rgb-strip
rgb-strip:
rgb-strip - 1.0.0floitsch
09/13/2024, 11:15 AMkaxori
09/13/2024, 11:15 AMfloitsch
09/13/2024, 11:16 AMjag pkg list find the rgb-strip package from?kaxori
09/13/2024, 11:16 AMfloitsch
09/13/2024, 11:17 AMjag pkg list lists all packages of a registry.floitsch
09/13/2024, 11:17 AMfloitsch
09/13/2024, 11:18 AMfloitsch
09/13/2024, 11:18 AMfloitsch
09/13/2024, 11:19 AMfloitsch
09/13/2024, 11:20 AMjag pkg list rgb-strip in which directory were you?floitsch
09/13/2024, 11:20 AMrgb-strip there?kaxori
09/13/2024, 11:20 AMfloitsch
09/13/2024, 11:20 AMfloitsch
09/13/2024, 11:21 AMfloitsch
09/13/2024, 11:21 AMjag pkg list rgb-strip
Error: Failed to parse package description 'rgb-strip\examples\package.yaml': %!w(*yaml.TypeError=&{[line 2: cannot unmarshal !!map into []tpkg.descPackage]})floitsch
09/13/2024, 11:21 AMjag pkg list to list all packages that are in the registry folder 'rgb-strip'.floitsch
09/13/2024, 11:21 AMfloitsch
09/13/2024, 11:21 AMfloitsch
09/13/2024, 11:22 AMfloitsch
09/13/2024, 11:22 AMjag pkg list rgb-strip?floitsch
09/13/2024, 11:23 AMjag pkg install --local t:\rgb-stripkaxori
09/13/2024, 11:25 AMimport rgb-strip show *floitsch
09/13/2024, 11:25 AMfloitsch
09/13/2024, 11:25 AMfloitsch
09/13/2024, 11:26 AMrgb-strip at the given path.kaxori
09/13/2024, 11:29 AMfloitsch
09/13/2024, 11:29 AMjag pkg init and jag pkg install --local t:\rgb-strip
That should do it.floitsch
09/13/2024, 11:30 AMrgb-strip (since you do an export from it).kaxori
09/13/2024, 11:31 AMfloitsch
09/13/2024, 11:37 AMfloitsch
09/13/2024, 11:37 AMfloitsch
09/13/2024, 11:38 AMkaxori
09/13/2024, 11:39 AMkaxori
09/13/2024, 11:40 AMfloitsch
09/13/2024, 11:42 AMkaxori
09/13/2024, 11:42 AMfloitsch
09/13/2024, 11:42 AMfloitsch
09/13/2024, 11:42 AMkaxori
09/13/2024, 11:43 AMfloitsch
09/13/2024, 11:44 AMkaxori
09/13/2024, 11:44 AMkaxori
09/13/2024, 4:04 PM