@joaoptgrilo/dev-config
Advanced tools
| # Script: publish-package.ps1 | ||
| # Purpose: Commits, pushes, and publishes the @joaoptgrilo/dev-config package to NPM. | ||
| # --- 1. Read the version for confirmation --- | ||
| $packageJsonPath = ".\package.json" | ||
| if (-not (Test-Path $packageJsonPath)) { | ||
| Write-Host "❌ ERROR: package.json not found in the current directory." | ||
| exit 1 | ||
| } | ||
| $packageJson = Get-Content $packageJsonPath -Raw | ConvertFrom-Json | ||
| $version = $packageJson.version | ||
| Write-Host "The package version is currently set to: $version" | ||
| Write-Host "Please ensure this is the correct version you intend to publish." | ||
| # --- 2. Safety Gate: User Confirmation --- | ||
| $confirmation = Read-Host "Are you sure you want to commit all changes and publish version $version to NPM? (y/n)" | ||
| if ($confirmation -ne 'y') { | ||
| Write-Host "Publish cancelled by user." | ||
| exit | ||
| } | ||
| # --- 3. Git Operations --- | ||
| Write-Host "Staging all changes..." | ||
| git add . | ||
| $commitMessage = "feat(package): add exports field and publish version $version" | ||
| Write-Host "Committing with message: `"$commitMessage`"" | ||
| git commit -m $commitMessage | ||
| Write-Host "Pushing changes to remote..." | ||
| git push | ||
| # --- 4. NPM Publish Operation --- | ||
| Write-Host "Publishing version $version to NPM..." | ||
| # The --access public flag is necessary for scoped packages (@scope/name) | ||
| npm publish --access public | ||
| Write-Host "✅ Success! Version $version has been published to NPM." |
| { | ||
| "extends": "./tsconfig/base.json", | ||
| "compilerOptions": { | ||
| "types": ["node"] | ||
| }, | ||
| "include": ["eslint.config.js", "playwright/**/*.ts"] | ||
| } |
+53
-55
| { | ||
| "name": "@joaoptgrilo/dev-config", | ||
| "version": "3.0.5", | ||
| "description": "A sharable suite of configurations for my personal TypeScript projects, including ESLint, Prettier, and TSConfig.", | ||
| "author": "João Grilo", | ||
| "license": "MIT", | ||
| "main": "eslint.config.mjs", | ||
| "type": "module", | ||
| "files": [ | ||
| ".cspell.json", | ||
| ".prettierrc.json", | ||
| ".vscode/extensions.json", | ||
| ".vscode/settings.json", | ||
| "eslint.config.mjs", | ||
| "playwright/base.config.ts", | ||
| "playwright/tsconfig.json", | ||
| "tsconfig/base.json" | ||
| ], | ||
| "peerDependencies": { | ||
| "@playwright/test": "\u003e=1.0.0", | ||
| "eslint": "\u003e=8.0.0", | ||
| "prettier": "\u003e=3.0.0", | ||
| "typescript": "\u003e=5.0.0", | ||
| "globals": "\u003e=15.0.0", | ||
| "@eslint-react/eslint-plugin": "\u003e=1.0.0", | ||
| "eslint-plugin-react": "\u003e=7.0.0", | ||
| "@next/eslint-plugin-next": "\u003e=14.0.0", | ||
| "@stylistic/eslint-plugin": "\u003e=1.0.0", | ||
| "eslint-plugin-perfectionist": "\u003e=2.0.0" | ||
| }, | ||
| "dependencies": { | ||
| "@eslint/js": "^8.57.0", | ||
| "@next/eslint-plugin-next": "^14.2.3", | ||
| "typescript-eslint": "^7.8.0", | ||
| "globals": "^15.0.0", | ||
| "@eslint-react/eslint-plugin": "^1.0.0", | ||
| "eslint-plugin-react": "^7.34.1", | ||
| "@stylistic/eslint-plugin": "^1.7.0", | ||
| "eslint-plugin-perfectionist": "^2.10.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^24.1.0", | ||
| "prettier": "^3.3.3", | ||
| "publint": "^0.2.12" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "exports": { | ||
| ".": "./eslint.config.mjs", | ||
| "./prettier": "./.prettierrc.json", | ||
| "./package.json": "./package.json", | ||
| "./tsconfig/base": "./tsconfig/base.json", | ||
| "./eslint": "./eslint.config.mjs", | ||
| "./playwright": "./playwright/base.config.ts" | ||
| } | ||
| "name": "@joaoptgrilo/dev-config", | ||
| "version": "4.0.0", | ||
| "private": false, | ||
| "description": "Sharable configurations for TypeScript, ESLint, Prettier, and more.", | ||
| "main": "eslint.config.mjs", | ||
| "type": "module", | ||
| "exports": { | ||
| ".": "./eslint.config.mjs", | ||
| "./eslint": "./eslint.config.mjs", | ||
| "./prettier": "./.prettierrc.json", | ||
| "./tsconfig/base": "./tsconfig/base.json", | ||
| "./playwright": "./playwright/base.config.ts", | ||
| "./package.json": "./package.json" | ||
| }, | ||
| "scripts": { | ||
| "lint": "eslint .", | ||
| "format": "prettier --write ." | ||
| }, | ||
| "peerDependencies": { | ||
| "@eslint-react/eslint-plugin": "^1.5.0", | ||
| "@next/eslint-plugin-next": "^14.0.0", | ||
| "@stylistic/eslint-plugin": "^2.0.0", | ||
| "eslint": ">=9.0.0", | ||
| "eslint-plugin-perfectionist": "^2.0.0", | ||
| "eslint-plugin-react": "^7.34.0", | ||
| "globals": ">=15.0.0", | ||
| "typescript-eslint": ">=8.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@eslint-react/eslint-plugin": "^1.6.0", | ||
| "@next/eslint-plugin-next": "^14.2.5", | ||
| "@stylistic/eslint-plugin": "^2.3.0", | ||
| "@types/node": "^20.14.12", | ||
| "eslint": "^9.8.0", | ||
| "eslint-plugin-perfectionist": "^2.11.0", | ||
| "eslint-plugin-react": "^7.35.0", | ||
| "globals": "^15.8.0", | ||
| "prettier": "^3.3.3", | ||
| "typescript": "^5.5.4", | ||
| "typescript-eslint": "^8.0.0-alpha.54" | ||
| }, | ||
| "keywords": [ | ||
| "eslint", | ||
| "config", | ||
| "typescript", | ||
| "prettier" | ||
| ], | ||
| "author": "Joao Grilo", | ||
| "license": "MIT", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/joaoptgrilo/dev-config.git" | ||
| } | ||
| } |
10484
4.85%12
20%238
3.03%