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

fix: refactored post-install to a bin call, fixed wrong naming vite t… #821

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const config = require("./packages/lint-staged-config");
const config = require("./packages/lint-staged-config/dist");

module.exports = {
...config,
Expand Down
6 changes: 0 additions & 6 deletions .ncurc.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/lint-staged-config/.releaserc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@anolilab/semantic-release-preset/npm"
"extends": "@anolilab/semantic-release-preset/pnpm"
}
7 changes: 2 additions & 5 deletions packages/lint-staged-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,12 @@ pnpm add -D husky is-ci

## Usage

If you don’t have a `.lintstagedrc.js`, we will create the file for you after installing `@anolilab/lint-staged-config`.
If you don’t have a `.lintstagedrc.js`, we can create the file for you after installing `@anolilab/lint-staged-config`, call `pnpm lint-stage-config:install`.

If you already have a `.lintstagedrc.js`, then you can extend the `.lintstagedrc.js`, with `@anolilab/lint-staged-config`.

> Note: If the script detects an existing `.lintstagedrc.js` file, it will not overwrite it.

> Note: It can happen that the postinstall script don't run, then you have to add the `.lintstagedrc.js` manually.

The content of the `.lintstagedrc.js` should look like this:

Expand Down Expand Up @@ -199,9 +198,7 @@ echo --------------------------------------------

```

Our package includes a `postinstall` script to automatically add the `pre-commit`, `common.sh`, `prepare-commit-msg hooks to your `.husky` folder.

> Note: It can be that the postinstall script don't run, then you have to add the hooks manually.
Our package includes a `lint-stage-config:install` command to add the `pre-commit`, `common.sh`, `prepare-commit-msg hooks to your `.husky` folder.

If `commitzen` is installed, the `prepare-commit-msg` hook with predefined content will be added to your `.husky` folder.

Expand Down
44 changes: 0 additions & 44 deletions packages/lint-staged-config/group/package.json

This file was deleted.

156 changes: 94 additions & 62 deletions packages/lint-staged-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,98 +31,141 @@
"email": "[email protected]"
},
"sideEffects": false,
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
},
"./group/eslint": {
"types": "./dist/groups/eslint/index.d.ts",
"require": "./dist/groups/eslint/index.js",
"import": "./dist/groups/eslint/index.mjs"
"require": {
"types": "./dist/groups/eslint/index.d.cts",
"default": "./dist/groups/eslint/index.cjs"
},
"import": {
"types": "./dist/groups/eslint/index.d.mts",
"default": "./dist/groups/eslint/index.mjs"
}
},
"./group/json": {
"types": "./dist/groups/json.d.ts",
"require": "./dist/groups/json.js",
"import": "./dist/groups/json.mjs"
"require": {
"types": "./dist/groups/json.d.cts",
"default": "./dist/groups/json.cjs"
},
"import": {
"types": "./dist/groups/json.d.mts",
"default": "./dist/groups/json.mjs"
}
},
"./group/markdown": {
"types": "./dist/groups/markdown.d.ts",
"require": "./dist/groups/markdown.js",
"import": "./dist/groups/markdown.mjs"
"require": {
"types": "./dist/groups/markdown.d.cts",
"default": "./dist/groups/markdown.cjs"
},
"import": {
"types": "./dist/groups/markdown.d.mts",
"default": "./dist/groups/markdown.mjs"
}
},
"./group/secretlint": {
"types": "./dist/groups/secretlint.d.ts",
"require": "./dist/groups/secretlint.js",
"import": "./dist/groups/secretlint.mjs"
"require": {
"types": "./dist/groups/secretlint.d.cts",
"default": "./dist/groups/secretlint.cjs"
},
"import": {
"types": "./dist/groups/secretlint.d.mts",
"default": "./dist/groups/secretlint.mjs"
}
},
"./group/stylesheets": {
"types": "./dist/groups/stylesheets.d.ts",
"require": "./dist/groups/stylesheets.js",
"import": "./dist/groups/stylesheets.mjs"
"require": {
"types": "./dist/groups/stylesheets.d.cts",
"default": "./dist/groups/stylesheets.cjs"
},
"import": {
"types": "./dist/groups/stylesheets.d.mts",
"default": "./dist/groups/stylesheets.mjs"
}
},
"./group/tests": {
"types": "./dist/groups/tests.d.ts",
"require": "./dist/groups/tests.js",
"import": "./dist/groups/tests.mjs"
"require": {
"types": "./dist/groups/tests.d.cts",
"default": "./dist/groups/tests.cjs"
},
"import": {
"types": "./dist/groups/tests.d.mts",
"default": "./dist/groups/tests.mjs"
}
},
"./group/typescript": {
"types": "./dist/groups/typescript.d.ts",
"require": "./dist/groups/typescript.js",
"import": "./dist/groups/typescript.mjs"
"require": {
"types": "./dist/groups/typescript.d.cts",
"default": "./dist/groups/typescript.cjs"
},
"import": {
"types": "./dist/groups/typescript.d.mts",
"default": "./dist/groups/typescript.mjs"
}
},
"./package.json": "./package.json"
},
"main": "dist/index.js",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"bin": {
"lint-stage-config:install": "./dist/bin.mjs"
},
"files": [
"dist",
"skip.js",
"group",
"README.md",
"CHANGELOG.md",
"LICENSE.md"
],
"scripts": {
"build": "cross-env NODE_ENV=development tsup",
"build:prod": "cross-env NODE_ENV=production tsup",
"build": "cross-env NODE_ENV=development packem build",
"build:prod": "cross-env NODE_ENV=production packem build",
"clean": "rimraf node_modules dist",
"postinstall": "node ./skip.js || node ./dist/postinstall.js",
"test": "vitest --config ./vitest.config.ts",
"test:coverage": "vitest --config ./vitest.config.ts --run --coverage"
},
"dependencies": {
"@anolilab/package-json-utils": "3.0.9",
"find-up": "5.0.0",
"@visulima/fs": "2.1.10",
"shell-quote": "^1.8.1"
},
"devDependencies": {
"@anolilab/semantic-release-preset": "8.0.3",
"@anolilab/semantic-release-pnpm": "^1.1.3",
"@anolilab/semantic-release-preset": "9.0.0",
"@total-typescript/ts-reset": "^0.5.1",
"@types/lint-staged": "^13.3.0",
"@types/shell-quote": "^1.7.5",
"@vitest/coverage-v8": "^1.1.0",
"@visulima/packem": "^1.0.0-alpha.49",
"@vitest/coverage-v8": "^1.6.0",
"cross-env": "^7.0.3",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"rimraf": "^5.0.5",
"semantic-release": "^22.0.12",
"tsup": "^8.0.1",
"type-fest": "^4.8.3",
"typescript": "5.3.3",
"vitest": "^1.1.0"
"esbuild": "^0.23.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"rimraf": "^5.0.8",
"semantic-release": "^24.0.0",
"type-fest": "^4.21.0",
"typescript": "5.5.3",
"vitest": "^1.6.0"
},
"peerDependencies": {
"eslint": "^8.49.0",
"husky": "^8.x",
"jest": "^29.7.0",
"lint-staged": "^13.x || ^14.0.0 || ^15.0.0",
"prettier": "^3.0.3",
"secretlint": "^7.0.7",
"stylelint": "^15.11.0",
"vite": "^4.4.9"
"husky": "^8.x || ^9.x",
"jest": "^27.x || ^28.x",
"lint-staged": "^13.x || ^14.x|| ^15.x",
"prettier": "^3.x",
"secretlint": "^7.x || ^8.x",
"stylelint": "^15.x || ^16.x",
"vitest": "^1.x"
},
"peerDependenciesMeta": {
"eslint": {
Expand All @@ -140,26 +183,15 @@
"stylelint": {
"optional": true
},
"vite": {
"vitest": {
"optional": true
}
},
"engines": {
"node": ">=18.* <=21.*"
"node": ">=18.* <=22.*"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"sources": [
"src/index.ts",
"src/postinstall.ts",
"src/groups/eslint/index.ts",
"src/groups/json.ts",
"src/groups/markdown.ts",
"src/groups/secretlint.ts",
"src/groups/stylesheets.ts",
"src/groups/tests.ts",
"src/groups/typescript.ts"
]
}
}
12 changes: 12 additions & 0 deletions packages/lint-staged-config/packem.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from "@visulima/packem/config";
import transformer from "@visulima/packem/transformer/esbuild";

// eslint-disable-next-line import/no-unused-modules
export default defineConfig({
rollup: {
license: {
path: "./LICENSE.md",
},
},
transformer,
});
7 changes: 0 additions & 7 deletions packages/lint-staged-config/skip.js

This file was deleted.

Loading
Loading