Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constructor 0.50 #141

Merged
merged 4 commits into from
May 28, 2024
Merged

Constructor 0.50 #141

merged 4 commits into from
May 28, 2024

Conversation

hexarobi
Copy link
Contributor

If I am updating an existing package...

  • I have ensured that all modified files now have a different URL.
  • If resources were modified, I also made sure to bump the resources_version.

@Sainan
Copy link
Member

Sainan commented May 26, 2024

You should also declare the dependency of lua/json. Btw., you don't need a dependency for this at all, you can just require "pluto:json".

@hexarobi
Copy link
Contributor Author

You should also declare the dependency of lua/json. Btw., you don't need a dependency for this at all, you can just require "pluto:json".

Updated to

util.ensure_package_is_installed('lua/json')
local json = require_dependency("json")

I tried

local json = require "pluto:json"

instead but this still crashes me 100% of the time

@Sainan
Copy link
Member

Sainan commented May 27, 2024

util.ensure_package_is_installed is not the way dependencies for repository packages should be declared.

Also, do you have steps to reproduce the crash with Pluto's JSON library?

@hexarobi
Copy link
Contributor Author

util.ensure_package_is_installed is not the way dependencies for repository packages should be declared.

Also, do you have steps to reproduce the crash with Pluto's JSON library?

I reproduce it currently by scrollling through a list of JSON constructs. I can try to narrow down exactly what file is causing it and make a stand-alone example script, but I haven't had a chance to do that yet, so for now just trying to stop the crashes.

What is the better way?

@Sainan
Copy link
Member

Sainan commented May 27, 2024

Literally just add it to the depends array.

@hexarobi
Copy link
Contributor Author

hexarobi commented May 27, 2024

Literally just add it to the depends array.

Any docs for that or examples?

local depends = {
  "lua/json",
  ... more dependencies...
}

?

@Sainan
Copy link
Member

Sainan commented May 27, 2024

Bro, a package on the repository has all its dependencies installed before your code is even run.

@hexarobi
Copy link
Contributor Author

Bro, a package on the repository has all its dependencies installed before your code is even run.

Ah its because I still support running this outside of the repo. But ya that makes sense, maybe I can figure out how to retire that.

@hexarobi
Copy link
Contributor Author

Added lua/json and lua/ScaleformLib to depends list. Reworked requires to be simpler across the board. Got rid of dev branch to simplify down to just main git and repo (stable) version

@Sainan
Copy link
Member

Sainan commented May 27, 2024

Could you verify that the crash issue is now resolved on the latest build, and use the pluto:json library, instead, if you have no other reason to use lua/json?

@hexarobi
Copy link
Contributor Author

Could you verify that the crash issue is now resolved on the latest build, and use the pluto:json library, instead, if you have no other reason to use lua/json?

yes looks good in latest. updated to use pluto json

@Sainan Sainan merged commit fb57a2c into calamity-inc:main May 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants