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

Update new template #734

Merged
merged 9 commits into from
Jan 19, 2022
Merged

Conversation

fabien0102
Copy link
Contributor

@fabien0102 fabien0102 commented Mar 15, 2021

fixes #737

Hello,

First of all, very nice project, this looks really amazing and I can't wait to try this framework on my projects 😁

This said, the new template looks a bit out-of-date, so this is my little contribution to this project

What's inside?

  1. Bump the main dependencies (jest, typescript, ts-node, …)
  2. Use copyfiles to be able to build the project on a windows machine
  3. Migrate ts-lint to eslint
  4. Add husky & pretty-quick to format on pre-commit
  5. Use import instead of require on typescript project (so eslint is happy)

How to test

  • Generate a javascript project with gluegun new and run yarn test
  • Generate a typescript project with gluegun new and run yarn test / yarn build

@@ -124,7 +124,7 @@ const NewCommand: GluegunCommand = {

const target =
`${props.name}/` +
(props.language === 'typescript' && file.includes('.js.ejs')
(props.language === 'typescript' && file.includes('.js.ejs') && !file.startsWith('.')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to avoid .eslintrc.jsΒ to be convert into a typescript file

@@ -0,0 +1,20 @@
/**
* @type {import("eslint").Linter.Config}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to have autocomplete on the eslint config (very practicle πŸ˜€ )

@@ -1,4 +1,8 @@
const { system, filesystem } = require('gluegun')
<% if (props.language === "typescript") { %>
import { system, filesystem } from 'gluegun'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eslint was not happy with require syntax and this is more natural in a typescript setup

"clean-build": "rm -rf ./build",
"compile": "tsc -p .",
"copy-templates": "if [ -e ./src/templates ]; then cp -a ./src/templates ./build/; fi",
"build": "yarn format && yarn lint && yarn clean-build && yarn compile && yarn copy-templates",
"copy-templates": "copyfiles ./src/templates/* ./build/templates",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the exact same but in a cross-platform version (I'm working on windows πŸ™„)

@fabien0102
Copy link
Contributor Author

On CI:
image

Locally:
image

I guess I was just not lucky regarding the timeout πŸ˜•

@fabien0102
Copy link
Contributor Author

@jamonholmgren Can you help me on this failing CI? Not really sure why this is taking so much time…

@jamonholmgren
Copy link
Member

@fabien0102 I apparently missed this PR, apologies. I'll be looking at it soon!

@jamonholmgren
Copy link
Member

Can you push a new empty commit to this to restart the CI and see if it passes?

@fabien0102
Copy link
Contributor Author

Can you push a new empty commit to this to restart the CI and see if it passes?

I can, but will be tomorrow, no computer around ;) (but I think I already tried... But with a bit of luck 🀞)

@fabien0102
Copy link
Contributor Author

@jamonholmgren The CI is still failing…

@jamonholmgren
Copy link
Member

This has taken me way too long to get to, @fabien0102, but it looks amazing. I'll be publishing a new version this week.

@jamonholmgren jamonholmgren merged commit 627bcb8 into infinitered:master Jan 19, 2022
infinitered-circleci pushed a commit that referenced this pull request Jan 21, 2022
# [5.0.0](v4.7.1...v5.0.0) (2022-01-21)

### Bug Fixes

* **deps:** Pin colors to 1.3.3 ([#745](#745) by [@otaviopace](https://github.com/otaviopace)) ([c33f24f](c33f24f)), closes [#744](#744)
* **deps:** Updates cli-table, cosmiconfig, ejs, execa, and fs-jetpack ([#741](#741) by [@jamonholmgren](https://github.com/jamonholmgren)) ([ee9d84a](ee9d84a))

### Features

* **boilerplate:** New CLI template includes eslint and better Windows support ([#734](#734) by [@fabien0102](https://github.com/fabien0102)) ([627bcb8](627bcb8))

### BREAKING CHANGES

* **deps:** Updates cli-table, cosmiconfig, ejs, execa, and fs-jetpack major (breaking) versions

* Also updates other dependencies to minor or patch versions
@infinitered-circleci
Copy link

πŸŽ‰ This PR is included in version 5.0.0 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not Working on Windows
3 participants