@haxtheweb/create 9.0.17 → 9.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/dist/create.js +4 -4
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -63,12 +63,18 @@ Commands:
|
|
|
63
63
|
help [command] display help for command
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
##
|
|
66
|
+
## Manual
|
|
67
|
+
|
|
68
|
+
### Linux / macOS
|
|
69
|
+
|
|
70
|
+
Run `man hax` to get detailed manual.
|
|
71
|
+
|
|
72
|
+
## Site context
|
|
67
73
|
- listing stats
|
|
68
74
|
- launch site
|
|
69
75
|
- publish to surge.sh (if installed)
|
|
70
76
|
|
|
71
|
-
##
|
|
77
|
+
## Web component context
|
|
72
78
|
- launch element
|
|
73
79
|
|
|
74
80
|
# Alternative Usage
|
|
@@ -83,7 +89,6 @@ npm init @haxtheweb
|
|
|
83
89
|
"scripts": {
|
|
84
90
|
"hax": "hax"
|
|
85
91
|
}
|
|
86
|
-
}
|
|
87
92
|
```
|
|
88
93
|
|
|
89
94
|
```bash
|
|
@@ -94,6 +99,15 @@ npm run hax -- --name my-element --y
|
|
|
94
99
|
## Windows problems?
|
|
95
100
|
Try setting a different cache path to load from `npm config set cache C:\tmp\nodejs\npm-cache --global`
|
|
96
101
|
|
|
102
|
+
If you wish to use PowerShell over Command Prompt, you may need to change your execution policy to allow scripts using the `Set-ExecutionPolicy` command with the `-ExecutionPolicy` and `-Scope` parameters. You should **not** need to do this if you are using Command Prompt.
|
|
103
|
+
|
|
104
|
+
```powershell
|
|
105
|
+
# To see your current execution policy
|
|
106
|
+
Get-ExecutionPolicy
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
`Set-ExecutionPolicy` command documentation: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7.4
|
|
110
|
+
|
|
97
111
|
Follow the prompts and let's HAX the Web together!
|
|
98
112
|
|
|
99
113
|
## Web component
|
package/dist/create.js
CHANGED
|
@@ -34,7 +34,7 @@ async function main() {
|
|
|
34
34
|
.option('--org <char>', 'organization for package.json').option('--author <char>', 'author for site / package.json').option('--writeHaxProperties', 'Write haxProperties for the element')
|
|
35
35
|
|
|
36
36
|
// options for site
|
|
37
|
-
.option('--import-site <char>', 'URL of site to import').option('--import-structure <char>', `import method to use:\n\rpressbooksToSite\n\relmslnToSite\n\rhaxcmsToSite\n\rnotionToSite\n\rgitbookToSite\n\revolutionToSite\n\rhtmlToSite\n\rdocxToSite`).option('--node-op <char>', 'node operation to perform').option('--item-id <char>', 'node ID to operate on').option('--name <char>', 'name of the project').option('--domain <char>', 'published domain name').option('--title-scrape <char>', 'CSS Selector for `title` in resource').option('--content-scrape <char>', 'CSS Selector for `body` in resource').option('--items-import <char>', 'import items from a file / site').helpCommand(true);
|
|
37
|
+
.option('--import-site <char>', 'URL of site to import').option('--import-structure <char>', `import method to use:\n\rpressbooksToSite\n\relmslnToSite\n\rhaxcmsToSite\n\rnotionToSite\n\rgitbookToSite\n\revolutionToSite\n\rhtmlToSite\n\rdocxToSite`).option('--node-op <char>', 'node operation to perform').option('--item-id <char>', 'node ID to operate on').option('--name <char>', 'name of the project').option('--domain <char>', 'published domain name').option('--title-scrape <char>', 'CSS Selector for `title` in resource').option('--content-scrape <char>', 'CSS Selector for `body` in resource').option('--items-import <char>', 'import items from a file / site').version(await HAXCMS.getHAXCMSVersion()).helpCommand(true);
|
|
38
38
|
|
|
39
39
|
// default command which runs interactively
|
|
40
40
|
_commander.program.command('start').description('Interactive program to pick options').action(() => {
|
|
@@ -61,7 +61,7 @@ async function main() {
|
|
|
61
61
|
commandRun.arguments.action = action;
|
|
62
62
|
commandRun.options.skip = true;
|
|
63
63
|
}
|
|
64
|
-
}).option('--path <char>', 'path the project should be created in').option('--import-site <char>', 'URL of site to import').option('--import-structure <char>', `import method to use:\n\rpressbooksToSite\n\relmslnToSite\n\rhaxcmsToSite\n\rnotionToSite\n\rgitbookToSite\n\revolutionToSite\n\rhtmlToSite\n\rdocxToSite`).option('--name <char>', 'name of the site (when creating a new one)').option('--domain <char>', 'published domain name').option('--node-op <char>', 'node operation to perform').option('--no-i', 'prevent interactions / sub-process, good for scripting').option('--to-file <char>', 'redirect command output to a file').option('--item-import <char>', 'import items from a file / site').version(await HAXCMS.getHAXCMSVersion());
|
|
64
|
+
}).option('--path <char>', 'path the project should be created in').option('--import-site <char>', 'URL of site to import').option('--import-structure <char>', `import method to use:\n\rpressbooksToSite\n\relmslnToSite\n\rhaxcmsToSite\n\rnotionToSite\n\rgitbookToSite\n\revolutionToSite\n\rhtmlToSite\n\rdocxToSite`).option('--name <char>', 'name of the site (when creating a new one)').option('--domain <char>', 'published domain name').option('--node-op <char>', 'node operation to perform').option('--no-i', 'prevent interactions / sub-process, good for scripting').option('--title-scrape <char>', 'CSS Selector for `title` in resource').option('--content-scrape <char>', 'CSS Selector for `body` in resource').option('--to-file <char>', 'redirect command output to a file').option('--item-import <char>', 'import items from a file / site').version(await HAXCMS.getHAXCMSVersion());
|
|
65
65
|
let siteNodeOps = (0, _site.siteNodeOperations)();
|
|
66
66
|
for (var i in siteNodeOps) {
|
|
67
67
|
_commander.program.option(`--${(0, _utils.camelToDash)(siteNodeOps[i].value)} <char>`, `${siteNodeOps[i].label}`);
|
|
@@ -80,7 +80,7 @@ async function main() {
|
|
|
80
80
|
commandRun.arguments.name = name;
|
|
81
81
|
commandRun.options.skip = true;
|
|
82
82
|
}
|
|
83
|
-
}).option('--path <char>', 'path the project should be created in').option('--org <char>', 'organization for package.json').option('--author <char>', 'author for site / package.json').option('--writeHaxProperties', 'Write haxProperties for the element').option('--to-file <char>', 'redirect command output to a file').option('--no-i', 'prevent interactions / sub-process, good for scripting');
|
|
83
|
+
}).option('--path <char>', 'path the project should be created in').option('--org <char>', 'organization for package.json').option('--author <char>', 'author for site / package.json').option('--writeHaxProperties', 'Write haxProperties for the element').option('--to-file <char>', 'redirect command output to a file').option('--no-i', 'prevent interactions / sub-process, good for scripting').version(await HAXCMS.getHAXCMSVersion());
|
|
84
84
|
// process program arguments
|
|
85
85
|
_commander.program.parse();
|
|
86
86
|
commandRun.options = {
|
|
@@ -351,7 +351,7 @@ async function main() {
|
|
|
351
351
|
results
|
|
352
352
|
}) => {
|
|
353
353
|
let themes = await (0, _site.siteThemeList)();
|
|
354
|
-
if (!commandRun.options.theme) {
|
|
354
|
+
if (results.type === "site" && !commandRun.options.theme) {
|
|
355
355
|
// support having no theme but autoselecting
|
|
356
356
|
if (!commandRun.options.auto && !commandRun.options.skip) {
|
|
357
357
|
commandRun.options.theme = themes[0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haxtheweb/create",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.19",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
"dev": "nodemon --watch src",
|
|
27
27
|
"haxcms-nodejs": "haxcms-nodejs"
|
|
28
28
|
},
|
|
29
|
+
"man": [
|
|
30
|
+
"./docs/hax.1"
|
|
31
|
+
],
|
|
29
32
|
"bin": {
|
|
30
33
|
"create-haxtheweb": "./dist/create.js",
|
|
31
34
|
"hax": "./dist/create.js"
|