luvit / lit

Toolkit for developing, sharing, and running luvit/lua programs and libraries.
http://lit.luvit.io/
Apache License 2.0
249 stars 58 forks source link

lit publish `tag.type must be string` #308

Closed Corotyest closed 2 years ago

Corotyest commented 2 years ago

I having this error when trying to publish a single file.

image

Bilal2453 commented 2 years ago

As the error explains, you are missing the tags field, which is required. An example of a working metadata is:

--[[lit-meta
  name = "luvit/codec"
  version = "2.0.1"
  dependencies = {
    "luvit/utils@2.1.0",
  }
  license = "Apache 2"
  homepage = "https://github.com/luvit/luvit/blob/master/deps/codec.lua"
  description = "Utilities for working with luvit streams and codecs."
  tags = {"luvit", "codec", "stream"}
]]

The Lit wiki may be a bit outdated regarding this.

Corotyest commented 2 years ago

image

Corotyest commented 2 years ago

but if i change it to init image

into task:: image

Bilal2453 commented 2 years ago

The metadata comment is only supposed to be put in a single-file module (or in an init.lua). For directory module use package.lua (just like you have done in your last example). In all of the mentioned examples, you were trying to publish a directory, which had a single module file which is not how it is done.

For a single module-file, you have something like this:

task.lua

--[[lit-meta
name = "Corotyest/task"
version = "0.0.1"
dependencies = {}
license = "Apache 2"
homepage = "https://github.com/Corotyest/task"
description = "A manager for uv.new_timer..."
tags = {"luvit", "uv", "time"}
]]
-- etc

And to publish it you do lit publish task.lua (Note the .lua indicating it is a file).

Corotyest commented 2 years ago

AYAYA GRACIAS TE QUIERO: THANK YOU <3 (sorry about i am dumb)