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

106 fix/bug missing git ignore #123

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

Conversation

codingwithmanny
Copy link
Contributor

@codingwithmanny codingwithmanny commented Mar 2, 2024

Context

Fixes the issue of when running npm pack which excludes .gitignore.

BREAKING CHANGE: No

Closes: #106

Issue (Before)

Assuming that npm pack is used to bundle the create-vocs. When running that command, it results in a tgz file.

# FROM ./create-vocs

mkdir tmp;
npm pack; # Results in 'create-vocs-1.0.0-alpha.5.tgz'
tar zxvf create-vocs-1.0.0-alpha.5.tgz -C tmp;
tree tmp/package/templates -a;

# NOTE: `.gitignore` is not present
# [Expected Output]:
# tmp/package/templates
# └── default
#     ├── README.md
#     ├── docs
#     │   └── pages
#     │       ├── example.mdx
#     │       ├── getting-started.mdx
#     │       └── index.mdx
#     ├── package.json
#     ├── tsconfig.json
#     └── vocs.config.ts

Fix (After)

# FROM ./create-vocs

mkdir tmp;
npm pack; # Results in 'create-vocs-1.0.0-alpha.5.tgz'
tar zxvf create-vocs-1.0.0-alpha.5.tgz -C tmp;
tree tmp/package/templates -a;

# NOTE: `_gitignore` is now present
# [Expected Output]:
# tmp/package/templates
# └── default
#     ├── README.md
#     ├── _gitignore <------ Hello there!
#     ├── docs
#     │   └── pages
#     │       ├── example.mdx
#     │       ├── getting-started.mdx
#     │       └── index.mdx
#     ├── package.json
#     ├── tsconfig.json
#     └── vocs.config.ts

Now when running this library with the new template, we do the following:

# FROM ./create-vocs/tmp/package

# modify permissions to use
chmod +x ./_lib/bin.js;
./_lib/bin.js;

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

Then when we tree into that directory, we should see the following result:

# FROM ./create-vocs/tmp/package

tree cmaaaaaan-work -a;

# [Expected Output]:
# cmaaaaaan-work
# ├── .gitignore <------- LET'S GOOOOO!!
# ├── README.md
# ├── docs
# │   └── pages
# │       ├── example.mdx
# │       ├── getting-started.mdx
# │       └── index.mdx
# ├── package.json
# ├── tsconfig.json
# └── vocs.config.ts

This also follows some of the same conventions as seen in create-t3-app, see this repo for reference: https://github.com/t3-oss/create-t3-app/tree/main/cli/template/base

Fixes the issue of when running `npm pack` which excludes `.gitignore`.

BREAKING CHANGE: No

Closes: wevm#106
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
This doesn't work

BREAKING CHANGE: No

Closes: wevm#106
Copy link

vercel bot commented Mar 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vocs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 2, 2024 8:44am

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] environment, filesystem Transitive: eval, network, shell, unsafe +477 77.6 MB jmoxey

🚮 Removed packages: npm/@types/[email protected], npm/[email protected]

View full report↗︎

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.

BUG Missing Git Ignore
1 participant