-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
feat: add template option to plugin create command #3836
Conversation
Accepting .tar.gz path/URL for custom plugin seed. + test + help
test/plugin-create.ts
Outdated
extractPackage: (packageName: string, destinationDirectory: string) => { | ||
dummyPacote.destinationDirectory = destinationDirectory; | ||
dummyPacote.packageName = packageName; | ||
Promise.resolve(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to return this Promise
* `<Plugin Repository Name>` is the name of repository where your plugin will reside. A directory with the same name will be created. For example: `nativescript-awesome-list`. If a directory with the name already exists and is not empty, the plugin create command will fail.<% if(isHtml) { %> | ||
* `<Template>` can be a URL or a local path to a `.tar.gz` file with the contents of a seed repository. This must be a clone of the [NativeScript Plugin Seed](https://github.com/NativeScript/nativescript-plugin-seed) and must contain a `src` directory with a package.json file and a script at `src/scripts/postclone.js`. After the archive is extracted, the postclone script will be executed with the username (`gitHubUsername`) and plugin name (`pluginName`) parameters given to the `tns plugin create` command prompts. For more information, visit the default plugin seed repository and [examine the source script](https://github.com/NativeScript/nativescript-plugin-seed/blob/master/src/scripts/postclone.js) there. Examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be a URL or a local path to a .tar.gz
-> in fact it can be anything that can be npm installed, you can pass a local dir path with correct structure (i.e. local copy of the plugin seed for example) and it should work,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it and it only worked with .tar.gz archive. I suppose this is because the plugin seed does not have a package.json file in the root of the repository and it cannot be packed directly as an npm package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After handling the comments
run ci |
Extension of #3800
Accepting .tar.gz path/URL for custom plugin seed.