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

unuseable template - preact-typescript #1612

Closed
markfirmware opened this issue Nov 15, 2020 · 7 comments · Fixed by #1648
Closed

unuseable template - preact-typescript #1612

markfirmware opened this issue Nov 15, 2020 · 7 comments · Fixed by #1648

Comments

@markfirmware
Copy link
Contributor

Even with chai installed:

npx create-snowpack-app --template @snowpack/app-template-preact-typescript unuseable-preact-typescript
...
cd unuseable-preact-typescript
npm i @types/chai
...
npm run build
...
[@snowpack/plugin-typescript] src/App.test.tsx(6,1): error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.
[@snowpack/plugin-typescript] src/App.test.tsx(7,3): error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.
[@snowpack/plugin-typescript] Error: Command failed with exit code 2: tsc --noEmit
src/App.test.tsx(6,1): error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.
src/App.test.tsx(7,3): error TS2582: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha`.
...
@markfirmware
Copy link
Contributor Author

Needs

npm i @types/chai
npm i @types/jest or npm i @types/mocha

https://github.com/markfirmware/audit/runs/1410602357?check_suite_focus=true

@markfirmware
Copy link
Contributor Author

markfirmware commented Nov 17, 2020

I do not know which of jest or mocha is correct.

@FredKSchott reminder

@Mozart409
Copy link
Contributor

#611 https://github.com/Mozart409/snowpack-app-template-preact-hmr-tailwind/issues/1

I would like to add my "custom template" to the official templates so you can install them via

npx create-snowpack-app --template snowpack-app-template-preact-hmr-tailwind <YOUR-APPNAME>

It this possible? Which steps would I need to do and how can I help you @FredKSchott @drwpow ?

@drwpow
Copy link
Collaborator

drwpow commented Nov 18, 2020

#611 Mozart409/snowpack-app-template-preact-hmr-tailwind#1

I would like to add my "custom template" to the official templates so you can install them via

npx create-snowpack-app --template snowpack-app-template-preact-hmr-tailwind <YOUR-APPNAME>

It this possible? Which steps would I need to do and how can I help you @FredKSchott @drwpow ?

The --template flag specifies any npm package. So if you deploy that to npm, you should be able to use that now! You can also test it locally by running npx create-snowpack-app --template /Users/Mozart409/path/to/my/template <YOUR-APPNAME> which will be faster than testing on npm.

@drwpow
Copy link
Collaborator

drwpow commented Nov 18, 2020

Added a fix for this in #1648

Needs

npm i @types/chai
npm i @types/jest or npm i @types/mocha

https://github.com/markfirmware/audit/runs/1410602357?check_suite_focus=true

I’m seeing this work without @types/jest or @types/mocha, at least with the unmodified template. Is that correct? I’d like to simply let people install additional tools or swap the test runner if they so choose.

@markfirmware
Copy link
Contributor Author

FYI github removes closed issues from the dashboard without any notice to the opener.

@markfirmware
Copy link
Contributor Author

All of the other official templates come with a working npm run build.

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 a pull request may close this issue.

3 participants