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

Reduce create-astro dependencies #8077

Merged
merged 1 commit into from
Aug 14, 2023
Merged

Reduce create-astro dependencies #8077

merged 1 commit into from
Aug 14, 2023

Conversation

natemoo-re
Copy link
Member

@natemoo-re natemoo-re commented Aug 14, 2023

Changes

  • Fixes PLT-777
  • Moves mocha and chai to devDependencies
  • Updates giget since downloadTemplate broken since last update unjs/giget#81 was merged in February, but we never updated
  • Moves from execa to a thin child_process wrapper since we don't need more advanced features
  • Included as a minor for safety. Internal refactor, but better safe than sorry.

Testing

Existing tests pass

Docs

N/A, maintenance only

@changeset-bot
Copy link

changeset-bot bot commented Aug 14, 2023

🦋 Changeset detected

Latest commit: fe5ae23

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions bot added the pkg: create-astro Related to the `create-astro` package (scope) label Aug 14, 2023
Comment on lines +1 to +2
// This is an extremely simplified version of [`execa`](https://github.com/sindresorhus/execa)
// intended to keep our dependency size down
Copy link
Member Author

Choose a reason for hiding this comment

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

Node built-ins are pretty powerful these days, so execa isn't really needed

Copy link
Member

Choose a reason for hiding this comment

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

Doing this for Astro itself would probably be also great

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed! We can follow-up on that

Comment on lines +33 to +57
describe('git initialized', () => {
const fixture = setup();
const dir = new URL(new URL('./fixtures/not-empty/.git', import.meta.url));

before(async () => {
await mkdir(dir, { recursive: true });
await writeFile(new URL('./git.json', dir), '{}', { encoding: 'utf8' });
})

it('already initialized', async () => {
const context = {
git: true,
cwd: './test/fixtures/not-empty',
dryRun: false,
prompt: () => ({ git: false }),
};
await git(context);

expect(fixture.hasMessage('Git has already been initialized')).to.be.true;
});

after(() => {
rmSync(dir, { recursive: true, force: true });
})
})
Copy link
Member Author

Choose a reason for hiding this comment

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

Updated this test just for clarity

Comment on lines +41 to +42
"chai": "^4.3.7",
"mocha": "^9.2.2",
Copy link
Member Author

Choose a reason for hiding this comment

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

These should have always been dev deps!

"execa": "^6.1.0",
"giget": "1.0.0",
"mocha": "^9.2.2",
"giget": "^1.1.2",
Copy link
Member Author

Choose a reason for hiding this comment

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

giget was pinned, but that's no longer needed

@@ -32,15 +32,14 @@
"//b": "DEPENDENCIES IS FOR UNBUNDLED PACKAGES",
"dependencies": {
"@astrojs/cli-kit": "^0.2.3",
"chai": "^4.3.7",
"execa": "^6.1.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed this!

@natemoo-re natemoo-re merged commit 44cf30a into main Aug 14, 2023
13 checks passed
@natemoo-re natemoo-re deleted the create-astro-deps branch August 14, 2023 19:23
This was referenced Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: create-astro Related to the `create-astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants