Skip to content

Commit

Permalink
feat: update prettier to latest config standard
Browse files Browse the repository at this point in the history
  • Loading branch information
rellafella committed Feb 17, 2025
1 parent 9d88591 commit c2bb52e
Show file tree
Hide file tree
Showing 12 changed files with 295 additions and 287 deletions.
52 changes: 1 addition & 51 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,58 +1,8 @@
# Prettier Ignore
# Does not inherit from .gitignore

# @envsa/repo-config boilerplate
# =====
# Craft
# =====
.env
.env.*
!.env.example
vendor/
/web/assets/*

# ======
# Builds
# ======
node_modules/
**/*.min.js

# =====
# Tests
# =====
/test-results/
/playwright-report/
/playwright/.cache/

# ====
# Misc
# ====
.cache
.DS_Store
_junk/
tmp/
temp/
.project
.settings
*.esproj
*.sublime-workspace
*.sublime-project
*.tmproj
*.tmproject
config.codekit3
prepros-6.config
# Also respects .gitignore

# @envsa/prettier-config boilerplate
pnpm-lock.yaml
package-lock.json
composer.lock
config/project/**/*
storage/config-deltas/**/*
storage/**/*
web/cpresources/**/*
web/web.config
*.svg
.ddev/

# Customizations
bin/
51 changes: 1 addition & 50 deletions packages/prettier-config/init/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,57 +1,8 @@
# Prettier Ignore
# Does not inherit from .gitignore

# @envsa/repo-config boilerplate
# =====
# Craft
# =====
.env
.env.*
!.env.example
vendor/
/web/assets/*

# ======
# Builds
# ======
node_modules/
**/*.min.js

# =====
# Tests
# =====
/test-results/
/playwright-report/
/playwright/.cache/

# ====
# Misc
# ====
.cache
.DS_Store
_junk/
tmp/
temp/
.project
.settings
*.esproj
*.sublime-workspace
*.sublime-project
*.tmproj
*.tmproject
config.codekit3
prepros-6.config
# Also respects .gitignore

# @envsa/prettier-config boilerplate
pnpm-lock.yaml
package-lock.json
composer.lock
config/project/**/*
storage/config-deltas/**/*
storage/**/*
web/cpresources/**/*
web/web.config
*.svg
.ddev/

# Customizations
1 change: 1 addition & 0 deletions packages/prettier-config/init/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"prettier.documentSelectors": [
"**/.eslintignore",
"**/.node-version",
"**/.npmrc",
"**/.prettierignore",
Expand Down
17 changes: 2 additions & 15 deletions packages/prettier-config/init/prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
import sharedConfig from '@envsa/prettier-config';
import { prettierConfig } from '@envsa/prettier-config';

/** @type {import("prettier").Config} */
const localConfig = {
// Config overrides
// overrides: [
// ...sharedConfig.overrides,
// {
// // Per-file overrides overrides
// },
// ],
};
export default {
...sharedConfig,
...localConfig,
};
export default prettierConfig();
104 changes: 57 additions & 47 deletions packages/prettier-config/package.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,71 @@
{
"name": "@envsa/prettier-config",
"version": "8.2.0",
"type": "module",
"description": "Prettier configuration for @envsa/shared-config.",
"repository": {
"type": "git",
"url": "[email protected]:envsa/shared-config.git",
"directory": "packages/prettier-config"
},
"bugs": {
"url": "https://github.com/envsa/shared-config/issues",
"email": "[email protected]"
},
"author": {
"name": "Liam Rella",
"email": "[email protected]",
"url": "https://github.com/rellafella"
},
"license": "MIT",
"engines": {
"node": ">=22.0.0",
"pnpm": ">=10.0.0"
},
"bin": {
"prettier-config": "bin/cli.js"
},
"main": "prettier.config.js",
"files": [
"bin/*",
"init/*"
],
"keywords": [
"shared-config",
"prettier-config",
"prettier",
"cli"
],
"scripts": {
"build": "../../scripts/build.ts && mdat readme",
"cli": "node ./bin/cli.js",
"prepublishOnly": "pnpm run build"
},
"peerDependencies": {
"prettier": "^3.3.1"
},
"name": "@envsa/prettier-config",
"version": "8.2.0",
"description": "Prettier configuration for @envsa/shared-config.",
"keywords": [
"shared-config",
"prettier-config",
"prettier",
"cli"
],
"homepage": "https://github.com/envsa/shared-config/packages/prettier-config",
"bugs": {
"url": "https://github.com/envsa/shared-config/issues",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "[email protected]:envsa/shared-config.git",
"directory": "packages/prettier-config"
},
"license": "MIT",
"author": {
"name": "Liam Rella",
"email": "[email protected]",
"url": "https://github.com/rellafella"
},
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"bin": {
"envsa-prettier": "bin/cli.js"
},
"files": [
"bin/*",
"dist/*",
"init/*"
],
"scripts": {
"build": "tsc && ../../scripts/build.ts",
"cli": "node ./bin/cli.js",
"prepublishOnly": "pnpm run build"
},
"dependencies": {
"@pinojs/json-colorizer": "^4.0.0",
"@prettier/plugin-php": "^0.22.2",
"@prettier/plugin-xml": "^3.4.1",
"@zackad/prettier-plugin-twig": "^0.13.0",
"cosmiconfig": "^9.0.0",
"deepmerge-ts": "^7.1.4",
"execa": "^9.5.2",
"find-workspaces": "^0.3.1",
"fs-extra": "^11.2.0",
"prettier-plugin-pkg": "^0.18.1",
"prettier": "^3.3.1",
"prettier-plugin-packagejson": "^2.5.8",
"prettier-plugin-sh": "^0.14.0",
"prettier-plugin-svelte": "^3.3.2",
"prettier-plugin-tailwindcss": "^0.6.9"
"prettier-plugin-tailwindcss": "^0.6.9",
"sort-package-json": "^2.14.0"
},
"engines": {
"node": ">=22.0.0",
"pnpm": ">=10.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
74 changes: 0 additions & 74 deletions packages/prettier-config/prettier.config.js

This file was deleted.

30 changes: 3 additions & 27 deletions packages/prettier-config/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
#!/usr/bin/env node
import { buildCommands } from '$root/src/command-builder.ts';
import { buildCommands } from '../../../src/command-builder.js'
import { commandDefinition } from './command.js'

// TODO bad idea?
// At least test the ruby situation
const sharedOptions = [
'--log-level=warn',
'--plugin=@prettier/plugin-php',
'--plugin=@prettier/plugin-xml',
'--plugin=prettier-plugin-pkg',
'--plugin=prettier-plugin-sh',
'--plugin=prettier-plugin-svelte',
'--plugin=prettier-plugin-tailwindcss',
];

await buildCommands('prettier-config', '[Prettier]', 'blue', {
check: {
command: 'prettier',
defaultArguments: ['.'],
options: [...sharedOptions, '--check'],
},
fix: {
command: 'prettier',
defaultArguments: ['.'],
options: [...sharedOptions, '--write'],
},
init: {},
printConfig: {},
});
await buildCommands(commandDefinition)
Loading

0 comments on commit c2bb52e

Please sign in to comment.