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 create-yoga-app for - feature #1387

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

b4s36t4
Copy link
Contributor

@b4s36t4 b4s36t4 commented Jul 12, 2022

This PR is for the feature #1354

@changeset-bot
Copy link

changeset-bot bot commented Jul 12, 2022

⚠️ No Changeset found

Latest commit: 5842c6c

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

@b4s36t4
Copy link
Contributor Author

b4s36t4 commented Jul 12, 2022

@Urigo @saihaj Please have a look at this PR, thanks

@n1ru4l n1ru4l changed the base branch from master to v3 July 13, 2022 08:38
@n1ru4l
Copy link
Collaborator

n1ru4l commented Jul 13, 2022

I changed the base branch to v3, I will add further feedback later.

@n1ru4l n1ru4l added this to the v3 milestone Jul 13, 2022
"https://codeload.github.com/dotansimha/graphql-yoga/tar.gz/master"
),
tar.extract({ cwd: root, strip: 3 }, [
`graphql-yoga-master/examples/${name}`,
Copy link
Collaborator

@n1ru4l n1ru4l Jul 13, 2022

Choose a reason for hiding this comment

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

I am not sure whether we want to pull the examples from master as they might use different "functionality" than the one already released in a stable yoga version. 🤔

Maybe we can when we release a new yoga version create a git tag (e.g. stable-examples) and it will fetch the examples from there.

Maybe we should even publish the examples to NPM and pull them from there?

I see right now that it is downloading the full tar and then extracting the example out of it 🤔 That seems like too much is downloaded to me.

appPath: string;
packageManager: any;
template?: string;
templatePath: string;
Copy link
Owner

Choose a reason for hiding this comment

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

I guess we don't need two flags? what's the reason for having two?


interface YogaProps {
appPath: string;
packageManager: any;
Copy link
Owner

Choose a reason for hiding this comment

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

should be typed?

Copy link
Owner

Choose a reason for hiding this comment

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

maybe as InstallArgs['packageManager'] ?

import { install } from "./utils/install.js";
import os from "os";

interface YogaProps {
Copy link
Owner

Choose a reason for hiding this comment

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

Can you please add some comments explaining the flags here?

packageManager: any;
template?: string;
templatePath: string;
typescript: string;
Copy link
Owner

Choose a reason for hiding this comment

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

I think we might not need --typescript flags, as this is already part of the examples setting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will remove that.

"engines": {
"node": ">=14"
},
"devDependencies": {
Copy link
Owner

Choose a reason for hiding this comment

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

We are usually pinning all devDepenencies

import path from "path";

export function isFolderEmpty(root: string, name: string): boolean {
const validFiles = [
Copy link
Owner

Choose a reason for hiding this comment

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

Where did this list come from? should we document this somehow?

@@ -0,0 +1,25 @@
import { execaSync } from "execa";
export function getPackageManager(npm: boolean, pnpm: boolean) {
Copy link
Owner

Choose a reason for hiding this comment

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

Should this be typed? InstallArgs['packageManager'] ?

/**
* Indicate whether there is an active Internet connection.
*/
isOnline: boolean;
Copy link
Owner

Choose a reason for hiding this comment

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

What's the reason for having isOnline configured? what's the use-case?

/**
* Indicate whether the given dependencies are devDependencies.
*/
devDependencies?: boolean;
Copy link
Owner

Choose a reason for hiding this comment

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

I assume this should be decided by the template?

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