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

feat: add template option to plugin create command #3836

Merged
merged 3 commits into from
Aug 23, 2018

Conversation

lini
Copy link
Contributor

@lini lini commented Aug 23, 2018

Extension of #3800
Accepting .tar.gz path/URL for custom plugin seed.

  • test
  • help

Accepting .tar.gz path/URL for custom plugin seed.
+ test
+ help
@lini lini self-assigned this Aug 23, 2018
@lini lini requested a review from rosen-vladimirov August 23, 2018 08:12
extractPackage: (packageName: string, destinationDirectory: string) => {
dummyPacote.destinationDirectory = destinationDirectory;
dummyPacote.packageName = packageName;
Promise.resolve();
Copy link
Contributor

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:
Copy link
Contributor

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,

Copy link
Contributor Author

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.

Copy link
Contributor

@rosen-vladimirov rosen-vladimirov left a 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

@miroslavaivanova
Copy link
Contributor

run ci

@lini lini merged commit 9dd6f20 into master Aug 23, 2018
@lini lini deleted the lini/plugin-create-with-template branch August 23, 2018 11:59
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.

3 participants