-
-
Notifications
You must be signed in to change notification settings - Fork 1
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 package manager selection and --dry-run option #92
Draft
outslept
wants to merge
45
commits into
stylelint:main
Choose a base branch
from
outslept:idkgene/pkg
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
e6f5a40
feat(actions): introduce action for creating Stylelint configuration
outslept b07e8a7
feat(actions): introduce action for ensuring `package.json` existence
outslept 776bf62
feat(actions): introduce action for installing project dependencies
outslept 456d46f
feat(prompts): introduce prompt for installing dependencies
outslept a9d2f84
feat(prompts): introduce prompt for selecting package manager
outslept e0a6fea
feat(prompts): introduce prompt for usage preference
outslept 12b04f7
feat: introduce messages module for user feedback
outslept bf3932a
feat: introduce signal handler for graceful cancellation
outslept b7282ce
feat: orchestrate Stylelint setup process in main application
outslept 4b55675
chore(deps): added prompts, @types/prompts and @types/semver to the p…
outslept 0d175b2
chore: removing the old implementation
outslept 12218d4
feat: Update package.json description and keywords for broader packag…
outslept d5b43b6
style: removed extra space from package description + changed the REA…
outslept 8fc8f4c
style: typo in readme
outslept 7399d35
chore(rename): rename install-dependencies to install
outslept 3ea00a9
chore: removing process-handlers
outslept 1ded092
chore: removing messages file
outslept bc4c36b
feat(shell): created a mini-execa version
outslept 13449ff
feat: took messages from a separate file directly into functions, add…
outslept b8372e4
chore: removing is cancelled from index.ts
outslept d7fbace
chore(meta): making keywords more concise
outslept df390ff
chore: removing extra [
outslept 60af269
Merge branch 'idkgene/pkg' of https://github.com/idkgene/create-style…
outslept b9893d2
refactor: simplify install command by using 'add' directly
outslept 93eed34
refactor: creating package.json with an `add` command, not the `init`
outslept 7154888
refactor: removing usage-preference + adding package manager dependan…
outslept 283d24a
feat: throwing an error with not package.json existing
outslept e0a9bdd
feat: more flexible post-install
outslept 3ad07e0
feat: more tweaks to the project
outslept d12d28b
feat: cancel support for prompts
outslept 239b62b
feat: major updates
outslept a8c1f11
tests: isWriteable
outslept d1b5bde
tests: helpers
outslept 0f6184e
tests: shell
outslept 8ce881a
tests: post-install
outslept 96f0269
tests: help
outslept 43dbf9a
feat: partial fixes
outslept ff7e27b
more fixes
outslept 2e148ea
more tests, vitest configuration, esbuild setup, some pedantic naming…
outslept 37dd272
npm-run-all is no longer maintained. migrated to concurrently
outslept 1e1d526
refactored the code to reduce overall complexity, added some of the t…
outslept 1c09c8f
minor changes to fix the previous problems, full unit tests suite add…
outslept 1edacbf
removing eslint disable comment
outslept ad7d5f6
removing mentions of nvm because nodejs/download mentions them already
outslept 1162ec9
comment about init command
outslept File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ node_modules/ | |
.vscode/ | ||
*.log | ||
.DS_Store | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
#!/usr/bin/env node | ||
/* eslint no-console: 'off' */ | ||
/* eslint n/no-process-exit: 'off' */ | ||
|
||
import process from 'node:process'; | ||
import { readFileSync } from 'node:fs'; | ||
|
||
import semver from 'semver'; | ||
/* eslint-disable n/prefer-global/process */ | ||
|
||
|
||
const currentVersion = process.versions.node; | ||
const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')); | ||
const requiredMajorVersion = parseInt(currentVersion.split('.')[0], 10); | ||
const minimumMajorVersion = 18; | ||
|
||
if (!semver.satisfies(currentVersion, pkg.engines.node)) { | ||
console.error(`Unsupported Node.js version (v${currentVersion})`); | ||
console.error(`Install a Node.js version within "${pkg.engines.node}" and then try again.`); | ||
process.exit(1); | ||
if (requiredMajorVersion < minimumMajorVersion) { | ||
process.stderr(`Error: Node.js v${currentVersion} is not supported.`); | ||
process.stderr(`This tool requires Node.js v${minimumMajorVersion} or higher.`); | ||
process.stderr('Please update your Node.js installation by following the instructions at https://nodejs.org/en/download'); | ||
process.exit(1) | ||
} | ||
|
||
import('./src/index.mjs').then(({ main }) => main()); | ||
import('./dist/index.js').then(({ main }) => main()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import esbuild from 'esbuild'; | ||
import process from 'node:process'; | ||
|
||
esbuild | ||
.build({ | ||
entryPoints: ['src/index.ts'], | ||
bundle: true, | ||
platform: 'node', | ||
outfile: 'dist/index.js', | ||
format: 'esm', | ||
external: [ | ||
'arg', | ||
'cosmiconfig', | ||
'ora', | ||
'package-manager-detector', | ||
'picocolors', | ||
'prompts', | ||
'tinyexec', | ||
'validate-npm-package-name', | ||
], | ||
}) | ||
.catch(() => process.exit(1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,28 @@ | ||
// @ts-ignore | ||
// @ts-expect-error -- No declaration file | ||
import stylelintConfig from 'eslint-config-stylelint'; | ||
import tseslint from 'typescript-eslint'; | ||
import vitest from '@vitest/eslint-plugin'; | ||
|
||
export default [...stylelintConfig]; | ||
export default [ | ||
...stylelintConfig, | ||
...tseslint.configs.recommended, | ||
{ | ||
files: ['tests/**'], | ||
plugins: { | ||
vitest, | ||
}, | ||
rules: { | ||
...vitest.configs.recommended.rules, | ||
}, | ||
}, | ||
|
||
{ | ||
rules: { | ||
'n/no-process-exit': 'off', | ||
"n/no-unsupported-features/node-builtins": ["error", { | ||
"version": ">=18.12.0", | ||
"ignores": ["fetch"] | ||
}] | ||
}, | ||
}, | ||
]; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question
Maybe you want
allowExperimental: true
instead of ignoringfetch
?