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

[Q] How can lib generator be used to create NS plugins? #26

Open
mahmoudajawad opened this issue May 24, 2021 · 2 comments
Open

[Q] How can lib generator be used to create NS plugins? #26

mahmoudajawad opened this issue May 24, 2021 · 2 comments

Comments

@mahmoudajawad
Copy link
Contributor

I'm trying to create a plugin to be used across two apps in the workspace. The plugin requires native libs, so simply using lib generator doesn't seem to create structure to allow me to add native libs. I tried to configure tsconfig, but it seems without having a package definition at the lib-level, building a plugin won't be possible, and I'm not sure how that can be achieved.

@mahmoudajawad
Copy link
Contributor Author

mahmoudajawad commented May 24, 2021

I tried this and it didn't work, which makes me wonder how do these things work:

  • Created new Nx workspaces.
  • Cloned https://github.com/NativeScript/plugin-seed.
  • Copied the following files to the new Nx workspaces:
    • nx.json.
    • package.json.
    • tsconfig.base.json.
    • workspace.json.
  • Ran npm run config && npm run setup.
  • Got the following:
TypeError: Cannot read property 'toString' of null
    at /path/to/workspace/node_modules/@nativescript/plugin-tools/src/schematics/add-package/index.js:114:62
    at MergeMapSubscriber.project (/path/to/workspace/node_modules/@angular-devkit/schematics/src/rules/call.js:75:24)
    at MergeMapSubscriber._tryNext (/path/to/workspace/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:67:27)
    at MergeMapSubscriber._next (/path/to/workspace/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:57:18)
    at MergeMapSubscriber.Subscriber.next (/path/to/workspace/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:66:18)
    at MergeMapSubscriber.notifyNext (/path/to/workspace/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:93:26)
    at SimpleInnerSubscriber._next (/path/to/workspace/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/innerSubscribe.js:27:21)
    at SimpleInnerSubscriber.Subscriber.next (/path/to/workspace/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:66:18)
    at MergeMapSubscriber.notifyNext (/path/to/workspace/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:93:26)
    at SimpleInnerSubscriber._next (/path/to/workspace/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/innerSubscribe.js:27:21)
Cannot read property 'toString' of null

@mahmoudajawad
Copy link
Contributor Author

I updated the error message (in previous comment) after I found that one of the child apps tsconfig.json is the reason behind the previous parsing error, however, another error came up, and though I tried hunting it down at @nativescript/build-tools/src/generators/add-package, I failed as it expects to have a demo app in the workspace, and without it, the plugin package won't be created. I hope to give this more time in the coming days to figure out a recipe that allows me to get it working.

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

No branches or pull requests

1 participant