Closed Erudition closed 1 year ago
Hi @Erudition couple things:
swift-ui
plugin is currently managed here, we have testing code for it here: https://github.com/NativeScript/plugins/blob/main/tools/assets/App_Resources/iOS/src/BasicViewProvider.swift ... however when focusing on any other plugins, you would need to rename those .swift
> .off
so they aren't included in the demo to work with other plugins. Since the supporting .swift files include SwiftUIProvider
which comes from only the swift-ui
plugin.@Erudition added these notes here: https://github.com/NativeScript/plugins/blob/main/README.md#prerequisites Thank you for mentioning ❤️
Thanks so much for the swift response! I think the bullets I mentioned aren't fully covered, though. I see this added to the readme:
Node 18+ is recommended yarn is recommended
&& yarn config set ignore-engines true
part of the npm run setup
script.nps
requirement, otherwise there would be a way to follow the setup instructions without nps - but I still can't see how that can be the case, as the setup scripts call nps (and nps-i).That said, I hacked at it some more, and learned that I had to not only install yarn and nps, but do so after the npm run setup script (which deletes node-modules
) so that yarn and nps could be reached (as again, they're not in package.json
and don't come with npm install, nor nps with yarn install) and that yarn install does a whole bunch of stuff but in my case didn't actually recreate the node-modules folder - I managed to fix that by running npm install first, then yarn install. Now, suddenly, nps is finding the relocated package-scripts.json. Thanks!
I'm almost ready to push my contributions to local-notifications
, but alas the nps project-specific "build" script (nor build.all
) seems to actually run the gradle build required for the plugin...
@Erudition really excellent. Thank you for all this and the forthcoming contribution. On node version recommendation, it should also work with 16 as others have been productive using that as well. Long story short, we try to not get in the weeds on node versions due to fact that many actually work. Just generally we recommend LTS versions, but again even latest 19 works.
Regarding yarn, I just added that as well (yarn v1 is required) - good point 🤗 https://github.com/NativeScript/plugins#prerequisites
nps
is not required to be handled directly at all. Assuming node/yarn are there, npm run setup
should very much handle all that for you. nps
is a transient dependency from @nstudio/nps-i
which is relied upon by @nativescript/plugin-tools
themselves:
https://github.com/NativeScript/plugin-tools/blob/a6489fb49d2884178d88dab628ad3e59df34bfc8/packages/plugin-tools/package.json#L38
https://github.com/nstudio/nps-i/blob/809b0328bb03c0deb5a9b8042a659367a5ae8ea1/package.json#L18
Huh, I don't know why npm install
or yarn
didn't automatically add it, then. Maybe transitive dev dependencies aren't added to node-modules/.bin
(and thus PATH) by default the way root dependencies are.
I'm having a lot of trouble getting this project running. The Readme says to just run
npm run setup
but it seems to be wayyy more complicated than that.yarn
installation, even though it's not taken care of automatically inpackage.json
or anything, so I figured out to install yarn.npm run setup
gives meUsage Error: Couldn't find a configuration settings named "ignore-engines"
, which I found was historically an option, so I guess there's also a dependency on a specific version of yarn. Skipping that option-setting part of the command worked for now, moving on...npm start
command runsnps
, another dependency that isn't handled by the setup script or mentioned anywhere.nps-i
, perhaps evennps-utils
./nativescript-plugins/package-scripts.js
is Module not found. Indeed, there is no package-scripts file there, so why was nps just run with that expectation, I don't know..npsrc
file, which seems to point to an alternative path to the above file, which explains that, but nps doesn't seem to know about it, and info online about this file is scarce.nps-with-rc
that seems to add this .npsrc file... another assumed dependency? Unfortunately, installing this package withnpm i nps-with-rc
did not help.After a work day spent on this, I just can't get the tooling right to even run the very first command in the documentation. Is this all documented somewhere I just don't know about? Would love to contribute here, but I can't get set up for building...