Skip to content

Commit

Permalink
https://github.com/haxtheweb/issues/issues/2153
Browse files Browse the repository at this point in the history
  • Loading branch information
btopro committed Oct 1, 2024
1 parent d0ffff4 commit cb7c302
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 89 deletions.
2 changes: 1 addition & 1 deletion src/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ async function main() {
await fs.renameSync(`${project.path}/${project.name}/locales/${file}`, `${project.path}/${project.name}/locales/${file.replace('webcomponent', project.name)}`);
});
});
await fs.renameSync(`${project.path}/${project.name}/src/webcomponent.js`, `${project.path}/${project.name}/src/${project.name}.js`);
await fs.renameSync(`${project.path}/${project.name}/webcomponent.js`, `${project.path}/${project.name}/${project.name}.js`);
await fs.renameSync(`${project.path}/${project.name}/test/webcomponent.test.js`, `${project.path}/${project.name}/test/${project.name}.test.js`);
s.stop(merlinSays('Files copied'));
await setTimeout(500);
Expand Down
5 changes: 3 additions & 2 deletions src/templates/webcomponent/hax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ DDD + Lit web component based on OpenWC toolchain. This is intended to provide t
- `npm run release` - this will build your code, update the version, and publish it to npm for others to use

## Working with your web component
- edit `/src/<%= name %>.js`
- edit `./<%= name %>.js`
- edit your 'demo' by modifying `./index.html`
- add dependencies using `npm install --save @whatever/repo` or editing `./package.json` directly
- if you must reference additional non-JS files, ensure you use the `new URL('./my-file.jpg', import.meta.url).href` syntax so that it builds correctly
- if you add additional `.js` files / web components then place them under `/src/`
- if you add additional `.js` files / web components then place them under `/lib/`
- to improve HAX wiring edit file in `/lib/<%= name %>.haxProperties.json`
- for i18n / internationalization efforts, see associated language `.json` files in `/locales/` as well as `/lib/` for haxProperties related translation examples.

## Recommended setup
- Load VS code in 1 window to project root
Expand Down
2 changes: 1 addition & 1 deletion src/templates/webcomponent/hax/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h2>Slot usage</h2>
<h2>Property usage</h2>
<<%= name %> id="example" title="Sample property title"></<%= name %>>
</div>
<script type="module" src="./src/<%= name %>.js"></script>
<script type="module" src="./<%= name %>.js"></script>

<!-- Take HAX, the Web and you further down the rabbit hole -->
<style>
Expand Down
85 changes: 0 additions & 85 deletions src/templates/webcomponent/hax/src/webcomponent.js

This file was deleted.

0 comments on commit cb7c302

Please sign in to comment.