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

Add minimal template #1090

Merged
merged 3 commits into from
Aug 15, 2021
Merged

Add minimal template #1090

merged 3 commits into from
Aug 15, 2021

Conversation

jonathantneal
Copy link
Contributor

Changes

This adds a new minimal template to create-astro.

  • Minimal includes no framework.
  • Minimal includes no components.
  • Minimal includes no frontmatter in src/pages/index.astro.
  • Minimal includes astro.config.js & snowpack.config.js configurations to (hopefully) disable any default plugins or renderers.
  • Minimal uses "type": "module". (because it’s available in the oldest Node LTS at the time of this writing).
  • Minimal uses 1 tab instead of 4 spaces.

Testing

I was unable to test this. I encountered a strange error running npm run test:templates:

create-astro: > Gathering mission details...
create-astro: ✔ Using template's default renderers › Preact
create-astro: > Copying project files...
create-astro:     at makeError (~/astro/node_modules/execa/lib/error.js:60:11)
create-astro:     at handlePromise (~/astro/node_modules/execa/index.js:118:26)
create-astro:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
create-astro:     at async ~/astro/packages/create-astro/test/create-astro.test.js:112:7
create-astro:     at async Promise.all (index 2)
create-astro:     at async testAll (~/astro/packages/create-astro/test/create-astro.test.js:109:3) {
create-astro:   shortMessage: 'Command failed with exit code 1: ../../create-astro.mjs docs --template docs --commit 42a5c5507a2ca941f8b255a13b369f5f88402987 --force-overwrite',
create-astro:   command: '../../create-astro.mjs docs --template docs --commit 42a5c5507a2ca941f8b255a13b369f5f88402987 --force-overwrite',
create-astro:   escapedCommand: '"../../create-astro.mjs" docs --template docs --commit 42a5c5507a2ca941f8b255a13b369f5f88402987 --force-overwrite',
create-astro:   exitCode: 1

Docs

This might not have any affect on documentation.

@changeset-bot
Copy link

changeset-bot bot commented Aug 12, 2021

⚠️ No Changeset found

Latest commit: a5d39ea

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Aug 12, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

astro-www – ./www

🔍 Inspect: https://vercel.com/pikapkg/astro-www/C4ankSjrxs63czGiN4SXXtx3PZXL
✅ Preview: Failed

[Deployment for a5d39ea canceled]

astro-docs – ./docs

🔍 Inspect: https://vercel.com/pikapkg/astro-docs/HzL6KnB7RqYerJReKUqRPXKZUmVf
✅ Preview: https://astro-docs-git-fork-jonathantneal-jnadd-minimal-92fe0d-pikapkg.vercel.app

[Deployment for a5d39ea canceled]

examples/minimal/snowpack.config.js Outdated Show resolved Hide resolved
@@ -0,0 +1,3 @@
export default {
renderers: [],
Copy link
Member

Choose a reason for hiding this comment

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

For another PR, but I really want to make this the default soon, so this file wouldn't be necessary either.

Copy link
Contributor Author

@jonathantneal jonathantneal Aug 13, 2021

Choose a reason for hiding this comment

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

I may be wrong, but an empty array might trigger their installation anyway. Therefore, with your approval, I’d like to remove this file as well, and move my +1 over to your suggestion that "no renderers" be the default.

Copy link
Member

@natemoo-re natemoo-re Aug 13, 2021

Choose a reason for hiding this comment

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

I do think it's about time to do that, but not in the scope of this PR. Let's leave this file for now.

A todo item for me is to add some warnings about the upcoming behavior change to the next version so we can make the switch in the version after that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If an empty array doesn’t currently limit the renderers, should I still keep this line? Not sure if I’m to:

  • A. Keep the line. It has an effect.
  • B. Remove the line. It has no effect.
  • C. Remove the file, because the line has no effect.

If the line has an effect, then I would vote A, but if it has no effect then I’m on the fence between B and C.

examples/minimal/package.json Outdated Show resolved Hide resolved
examples/minimal/src/pages/index.astro Show resolved Hide resolved
@jonathantneal
Copy link
Contributor Author

Thanks for the thoughtful dialog, @natemoo-re! Thanks for making me smile, @jasikpark!

Following your suggestion, I’ve removed snowpack.config.js in dfc2525. I’ve also left some feedback that I hope will help us resolve our remaining questions.

@vercel vercel bot temporarily deployed to Preview – astro-www August 13, 2021 16:10 Inactive
@vercel vercel bot temporarily deployed to Preview – astro-docs August 13, 2021 16:10 Inactive
@jasikpark
Copy link
Contributor

Adjacent to this PR, it'd be nice to have a setup that works similar to create-react-app that will setup eslint and various linters for you + a super-minimal scaffolding.. similar also to hugo new site

Copy link
Contributor

@jasikpark jasikpark left a comment

Choose a reason for hiding this comment

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

LGTM! @natemoo-re do you have any more feedback or can this be merged?

@natemoo-re
Copy link
Member

@jasikpark LGTM! Feel free to merge.

@jasikpark jasikpark merged commit d68ac85 into withastro:main Aug 15, 2021
FredKSchott pushed a commit that referenced this pull request Aug 16, 2021
@jonathantneal jonathantneal deleted the jn.add-minimal-template branch August 27, 2021 13:30
matthewp added a commit that referenced this pull request Aug 27, 2021
matthewp added a commit that referenced this pull request Aug 27, 2021
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 this pull request may close these issues.

None yet

3 participants