@r_masseater/vite-plus-adopt 0.27.6 → 0.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r_masseater/vite-plus-adopt",
3
- "version": "0.27.6",
3
+ "version": "0.28.1",
4
4
  "description": "Adopt h56m secret scanning, commitlint, textlint, fallow and dependency checks into Vite+ through the settings in vite.config.ts, and ship @arethetypeswrong/core for TypeScript 7.",
5
5
  "keywords": [
6
6
  "arethetypeswrong",
@@ -81,10 +81,10 @@
81
81
  "effect": "4.2.0",
82
82
  "fflate": "0.8.3",
83
83
  "size-limit": "14.3.0",
84
- "tsrs": "7.1.0-beta.tsrs5",
84
+ "tsrs": "7.1.0-beta.tsrs7",
85
85
  "validate-npm-package-name": "8.0.0",
86
- "vite": "npm:@voidzero-dev/vite-plus-core@8.3.8001",
87
- "vite-plus": "1.8.0"
86
+ "vite": "npm:@voidzero-dev/vite-plus-core@8.4.0",
87
+ "vite-plus": "1.9.0"
88
88
  },
89
89
  "peerDependencies": {
90
90
  "@andrewbranch/untar.js": ">=1.0.4",
@@ -2,8 +2,8 @@
2
2
  name: configure-checks
3
3
  description: >
4
4
  Use when configuring or running the vpa CLI of @r_masseater/vite-plus-adopt in a Vite+ repository:
5
- the h56m, commitlint, textlint, fallow and dependencyRules sections of
6
- vite.config.ts, git hooks and the @arethetypeswrong/core replacement for pack.attw. Also use when a vpa check fails.
5
+ the h56m, commitlint, textlint, fallow, dependencyRules and gitHooks sections of
6
+ vite.config.ts and the @arethetypeswrong/core replacement for pack.attw. Also use when a vpa check fails.
7
7
  metadata:
8
8
  type: core
9
9
  library: "@r_masseater/vite-plus-adopt"
@@ -51,19 +51,25 @@ Run without arguments, it runs every configured check in parallel and prints the
51
51
  });
52
52
  ```
53
53
 
54
- 3. Run `vpa` from git hooks.
54
+ 3. List the commands of each git hook in `gitHooks`.
55
55
 
56
- ```sh
57
- # .vite-hooks/pre-commit
58
- vpa --staged
59
- # .vite-hooks/commit-msg
60
- vpa --commit-msg "$1"
61
- # .vite-hooks/pre-push
62
- vpa --pre-push && vp run verify
56
+ ```ts
57
+ gitHooks: {
58
+ "pre-commit": ["vpa --staged"],
59
+ "commit-msg": ['vpa --commit-msg "$1"'],
60
+ "pre-push": ["vpa --pre-push", "vp run verify"],
61
+ "post-checkout": ['[ "$3" = 0 ] || vp install'],
62
+ "post-merge": ["vp install"],
63
+ "post-rewrite": ["vp install"],
64
+ },
63
65
  ```
64
66
 
67
+ `vpa --prepare` writes each hook to `.vite-hooks/<hook>`, where the dispatcher that `vp config` installs runs it. When `.gitattributes` uses LFS, each hook git-lfs needs starts with `git lfs <hook>`. The files are generated, so `vpa --prepare` lists them in `.git/info/exclude` and removes the ones dropped from `gitHooks`. Do not commit them.
68
+
65
69
  `vpa --pre-push` reads the refs git is about to push and fails when one points at a commit other than `HEAD`. The checks that follow it see only the checked-out tree, so a branch pushed from another checkout, such as the lower branches of a stack pushed in one `git push`, would reach the remote without its own tree being checked.
66
70
 
71
+ It then fetches the default branch and the pushed branch from `origin`. When `HEAD` lacks commits of either, it merges them and fails, so the next push checks and sends the merged tree. A conflict aborts the merge and fails.
72
+
67
73
  In a repository that uses @r_masseater/msch, `repositoryConfig` writes these sections and `msch` runs them. Change them through msch's options instead.
68
74
 
69
75
  ## Section notes