You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/man_pages/lib-management/plugin-create.md
+13-2
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,8 @@ position: 1
6
6
7
7
Usage | Synopsis
8
8
---|---
9
-
Create a new plugin | `$ tns plugin create <Plugin Repository Name> [--path <Directory>]`
9
+
Create from the default plugin seed | `$ tns plugin create <Plugin Repository Name> [--path <Directory>]`
10
+
Create from a custom plugin seed | `$ tns plugin create <Plugin Repository Name> [--path <Directory>] --template <Template>`
10
11
11
12
Creates a new project for NativeScript plugin development. The project uses the [NativeScript Plugin Seed](https://github.com/NativeScript/nativescript-plugin-seed) as a base and contains the following directories:
12
13
@@ -20,9 +21,19 @@ The project is setup for easy commit in Github, which is why the command will as
20
21
### Options
21
22
22
23
*`--path` - Specifies the directory where you want to create the project, if different from the current directory.
24
+
*`--template` - Specifies the custom seed archive, which you want to use to create your plugin. If `--template` is not set, the NativeScript CLI creates the plugin from the default NativeScript Plugin Seed.
23
25
*`--username` - Specifies the Github username, which will be used to build the URLs in the plugin's package.json file.
24
26
*`--pluginName` - Used to set the default file and class names in the plugin source.
25
27
26
28
### Attributes
27
29
28
-
*`<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.
30
+
*`<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) { %>
31
+
*`<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:
this.$errors.fail("Path already exists and is not empty %s",projectDir);
74
74
}
75
75
76
+
if(selectedTemplate){
77
+
this.$logger.printMarkdown("Make sure your custom template is compatible with the Plugin Seed at https://github.com/NativeScript/nativescript-plugin-seed/");
78
+
}else{
79
+
this.$logger.printMarkdown("Downloading the latest version of NativeScript Plugin Seed...");
0 commit comments