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

BUG Missing Git Ignore #106

Open
codingwithmanny opened this issue Feb 18, 2024 · 13 comments · May be fixed by #123
Open

BUG Missing Git Ignore #106

codingwithmanny opened this issue Feb 18, 2024 · 13 comments · May be fixed by #123
Labels
Good First Issue Misc: Good First Issue

Comments

@codingwithmanny
Copy link
Contributor

Context

Missing .gitignore when creating a new project.

Steps To Reproduce

pnpm create vocs;

# follow steps

Then take a look at the full directory.

tree .;

.
├── README.md
├── docs
│   └── pages
│       ├── example.mdx
│       ├── getting-started.mdx
│       └── index.mdx
├── package.json
├── tsconfig.json
└── vocs.config.ts

Solution

Include the .gitignore with ./create-vocs/templates/default/.gitignore

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# production
/docs/dist

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# typescript
*.tsbuildinfo
@tmm tmm added the Good First Issue Misc: Good First Issue label Feb 18, 2024
@FaybianB
Copy link

Hey @codingwithmanny @tmm, may I be assigned this issue?

@dicethedev
Copy link

@codingwithmanny is the issue assigned to somebody already?

@codingwithmanny
Copy link
Contributor Author

Hi @FaybianB and @dicethedev just need @jxom or @tmm to assign it.

I wish I was a maintainer on this repo, but just a contributor 😂

@dicethedev
Copy link

Hi @FaybianB and @dicethedev just need @jxom or @tmm to assign it.

I wish I was a maintainer on this repo, but just a contributor 😂

No problem

@jxom
Copy link
Member

jxom commented Feb 20, 2024

First PR wins.

@dicethedev
Copy link

Missing .gitignore when creating a new project.

I made a PR - #111

@FaybianB
Copy link

Well, I lost the PR race (nice quickness @dicethedev) but I still would like to submit a solution. It seems like init.ts is copying all of the contents of the templates/default directory to the user's project except .gitignore. I think either copySync is ignoring hidden files or the hidden file is being removed immediately after.

However, I haven't gotten init.ts to reflect any of my changes to the file to test my theory. Any suggestions @jxom @tmm? I've ran the build after my changes via pnpm build and still nothing.

@codingwithmanny
Copy link
Contributor Author

codingwithmanny commented Feb 20, 2024

Hey @FaybianB, not sure if this will help but the way I was testing it to try and figure out was trying was running the script directory in the create-vocs folder.

# FROM: ./

pnpm build;
cd ./create-vocs;

Then run the built binary in the newly created _lib

# FROM: ./create-vocs

# Modify permissions
chmod +x ./_lib/bin.js;

# Run binary
./_lib/bin.js;

# [Expected Output]:
# ┌  Welcome to Vocs!
#
# ◇  Enter the name of your project
# │  tmp
#
# ◆  Project successfully scaffolded in /path/to/vocs/create-vocs/tmp!
#
# │  Next steps:
#
# ◇  1. cd ./tmp - Navigate to project
#
# ◇  2. npm install - Install dependencies
#
# ◇  3. npm run dev - Start dev server
#
# ◇  4. Head to http://localhost:5173
#
# └  Happy documenting! 📝

This will create that new tmp folder, but as you can see it showing the .gitignore which is where I left off 🤷

# FROM: ./create-vocs

tree tmp -a; 

# [Expected Output]:
# tmp
# ├── .gitignore <------ HUH????
# ├── README.md
# ├── docs
# │   └── pages
# │       ├── example.mdx
# │       ├── getting-started.mdx
# │       └── index.mdx
# ├── package.json
# ├── tsconfig.json
# └── vocs.config.ts

@codingwithmanny
Copy link
Contributor Author

Missing .gitignore when creating a new project.

I made a PR - #111

How did you test that this worked?

@FaybianB
Copy link

@codingwithmanny You know, following your testing method works for me and I too see the .gitignore file present in the tree lol. I'm not sure where to go from here either, actually.

@codingwithmanny
Copy link
Contributor Author

codingwithmanny commented Feb 21, 2024

@FaybianB it's something to do with the bundling that goes to npm packages.

If you create a new folder and install create-vocs you can see it.

mkdir test-create-vocs;
cd test-create-vocs;
pnpm init;
pnpm add create-vocs;

Then tree the directory and you'll see that the .gitignore isn't present:

# FROM: test-create-vocs;

tree node_modules/create-vocs/templates/default -a;

# [Expected Output]:
# node_modules/create-vocs/templates/default
# ├── README.md
# ├── docs
# │   └── pages
# │       ├── example.mdx
# │       ├── getting-started.mdx
# │       └── index.mdx
# ├── package.json
# ├── tsconfig.json
# └── vocs.config.ts

I suspect it has to do with a script in the ./scripts folder.

Hopefully that would help with a direction.

codingwithmanny added a commit to codingwithmanny/wevm--vocs that referenced this issue Mar 2, 2024
Fixes the issue of when running `npm pack` which excludes `.gitignore`.

BREAKING CHANGE: No

Closes: wevm#106
codingwithmanny added a commit to codingwithmanny/wevm--vocs that referenced this issue Mar 2, 2024
Following the conventions of `init.ts` L33 which replaces dot files
starting with _ this prepack temporarily renames gitignore to fit within
the requirements

BREAKING CHANGE: No

Closes: wevm#106
codingwithmanny added a commit to codingwithmanny/wevm--vocs that referenced this issue Mar 2, 2024
This doesn't work

BREAKING CHANGE: No

Closes: wevm#106
@codingwithmanny codingwithmanny linked a pull request Mar 2, 2024 that will close this issue
@codingwithmanny
Copy link
Contributor Author

Ended up figuring it out @FaybianB see PR

@sarthakxv
Copy link

@codingwithmanny I was figuring out the fix, but just saw that you've already made a PR. Happy to see a solution.

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

Successfully merging a pull request may close this issue.

6 participants