Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
btopro committed Oct 3, 2024
1 parent cb7c302 commit 2751084
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ npx @haxtheweb/create
npm init @haxtheweb
```

## Windows problems?
Try setting a different cache path to load from `npm config set cache C:\tmp\nodejs\npm-cache --global`

Follow the prompts and let's HAX the Web together!

## Web component
Expand Down
17 changes: 17 additions & 0 deletions src/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ const fakeSend = {
send: (json) => console.log(json),
sendStatus: (data) => console.log(data)
}
var hasGit = false;
exec('git --version', error => {
if (error) {
hasGit = false;
}
});
var hasSurge = true;
exec('surge --version', error => {
if (error) {
hasSurge = false;
}
});

// standardize merlin statements visually
function merlinSays(text) {
return `${color.yellow(color.bgBlack(` 🧙 Merlin: `))} ${color.bgBlack(color.green(` ${text} `))}`;
Expand Down Expand Up @@ -260,6 +273,10 @@ async function main() {
{ value: 'git', label: 'Apply version control via git', hint: 'recommended' },
];
initialValues = ['launch', 'install', 'git']
if (!hasGit) {
options.pop();
initialValues.pop();
}
}
else {
options = [
Expand Down
1 change: 0 additions & 1 deletion src/templates/webcomponent/hax/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ before_install:
- npm install -g web-component-tester
install:
- npm install
before_script:
script:
- xvfb-run npm run test
2 changes: 1 addition & 1 deletion src/templates/webcomponent/hax/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"repository": {
"type": "git",
"url": "<%= githubLink =>"
"url": "<%= githubLink %>"
},
"type": "module",
"main": "<%= name %>.js",
Expand Down
3 changes: 1 addition & 2 deletions src/templates/webcomponent/hax/webcomponent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright <%= year => <%= author =>
* Copyright <%= year %> <%= author %>
* @license Apache-2.0, see LICENSE for full text.
*/
import { LitElement, html, css } from "lit";
Expand All @@ -9,7 +9,6 @@ import { I18NMixin } from "@haxtheweb/i18n-manager/lib/I18NMixin.js";
/**
* `<%= name %>`
*
*
* @demo index.html
* @element <%= name %>
*/
Expand Down

0 comments on commit 2751084

Please sign in to comment.