@mehshekari/gsap-motion 3.0.0 → 3.1.0

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/NOTICE.md CHANGED
@@ -3,6 +3,65 @@
3
3
  This skill — its instructions, references, presets, examples, templates and
4
4
  scripts — is released under the MIT License. See [LICENSE](LICENSE).
5
5
 
6
+ ## Third-party code in the audit
7
+
8
+ `scripts/lib/vendor/parser.mjs` bundles two MIT-licensed packages, so the audit
9
+ can read JavaScript and TypeScript without installing anything. It is generated
10
+ from the versions its first lines name.
11
+
12
+ ### acorn
13
+
14
+ ```text
15
+ MIT License
16
+
17
+ Copyright (C) 2012-2022 by various contributors (see AUTHORS)
18
+
19
+ Permission is hereby granted, free of charge, to any person obtaining a copy
20
+ of this software and associated documentation files (the "Software"), to deal
21
+ in the Software without restriction, including without limitation the rights
22
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23
+ copies of the Software, and to permit persons to whom the Software is
24
+ furnished to do so, subject to the following conditions:
25
+
26
+ The above copyright notice and this permission notice shall be included in
27
+ all copies or substantial portions of the Software.
28
+
29
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35
+ THE SOFTWARE.
36
+ ```
37
+
38
+ ### @sveltejs/acorn-typescript
39
+
40
+ ```text
41
+ MIT License
42
+
43
+ Copyright (c) 2022 Tyreal Hu
44
+ Copyright (c) 2025 The Svelte Team
45
+
46
+ Permission is hereby granted, free of charge, to any person obtaining a copy
47
+ of this software and associated documentation files (the "Software"), to deal
48
+ in the Software without restriction, including without limitation the rights
49
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
50
+ copies of the Software, and to permit persons to whom the Software is
51
+ furnished to do so, subject to the following conditions:
52
+
53
+ The above copyright notice and this permission notice shall be included in all
54
+ copies or substantial portions of the Software.
55
+
56
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
57
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
58
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
59
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
60
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
61
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
62
+ SOFTWARE.
63
+ ```
64
+
6
65
  ## GSAP is licensed separately
7
66
 
8
67
  **GSAP is not part of this skill, and it is not MIT-licensed.** The code this
package/README.md CHANGED
@@ -28,7 +28,7 @@ The audit needs no install. Pin the version, so a new rule cannot fail your
28
28
  build without warning:
29
29
 
30
30
  ```json
31
- "lint": "eslint && npx @mehshekari/gsap-motion@3.0.0 audit src --quiet"
31
+ "lint": "eslint && npx @mehshekari/gsap-motion@3.1.0 audit src --quiet"
32
32
  ```
33
33
 
34
34
  Or install it with `npm install --save-dev --save-exact @mehshekari/gsap-motion`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mehshekari/gsap-motion",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Install the gsap-creative-animation Agent Skill, and audit GSAP animation for leaks, jank and accessibility failures — with npx.",
5
5
  "keywords": [
6
6
  "gsap",
package/skill/NOTICE.md CHANGED
@@ -3,6 +3,65 @@
3
3
  This skill — its instructions, references, presets, examples, templates and
4
4
  scripts — is released under the MIT License. See [LICENSE](LICENSE).
5
5
 
6
+ ## Third-party code in the audit
7
+
8
+ `scripts/lib/vendor/parser.mjs` bundles two MIT-licensed packages, so the audit
9
+ can read JavaScript and TypeScript without installing anything. It is generated
10
+ from the versions its first lines name.
11
+
12
+ ### acorn
13
+
14
+ ```text
15
+ MIT License
16
+
17
+ Copyright (C) 2012-2022 by various contributors (see AUTHORS)
18
+
19
+ Permission is hereby granted, free of charge, to any person obtaining a copy
20
+ of this software and associated documentation files (the "Software"), to deal
21
+ in the Software without restriction, including without limitation the rights
22
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23
+ copies of the Software, and to permit persons to whom the Software is
24
+ furnished to do so, subject to the following conditions:
25
+
26
+ The above copyright notice and this permission notice shall be included in
27
+ all copies or substantial portions of the Software.
28
+
29
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35
+ THE SOFTWARE.
36
+ ```
37
+
38
+ ### @sveltejs/acorn-typescript
39
+
40
+ ```text
41
+ MIT License
42
+
43
+ Copyright (c) 2022 Tyreal Hu
44
+ Copyright (c) 2025 The Svelte Team
45
+
46
+ Permission is hereby granted, free of charge, to any person obtaining a copy
47
+ of this software and associated documentation files (the "Software"), to deal
48
+ in the Software without restriction, including without limitation the rights
49
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
50
+ copies of the Software, and to permit persons to whom the Software is
51
+ furnished to do so, subject to the following conditions:
52
+
53
+ The above copyright notice and this permission notice shall be included in all
54
+ copies or substantial portions of the Software.
55
+
56
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
57
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
58
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
59
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
60
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
61
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
62
+ SOFTWARE.
63
+ ```
64
+
6
65
  ## GSAP is licensed separately
7
66
 
8
67
  **GSAP is not part of this skill, and it is not MIT-licensed.** The code this
package/skill/SKILL.md CHANGED
@@ -4,7 +4,7 @@ description: Senior motion engineer for GSAP. Turns a visual or interaction idea
4
4
  license: MIT. See LICENSE; GSAP itself is licensed separately, see NOTICE.md
5
5
  compatibility: Any Agent Skills client; written for Claude Code. GSAP 3.13+, where every plugin is free. React guidance targets @gsap/react 2.x, React 18/19 and the Next.js App Router. The audit scripts need Node.js 18+ and nothing else.
6
6
  metadata:
7
- version: "3.0.0"
7
+ version: "3.1.0"
8
8
  verified-gsap: "3.15"
9
9
  verified-gsap-react: "2.1"
10
10
  ---
@@ -13,10 +13,12 @@
13
13
  * Rhythm, easing choice and whether an animation earns its place are not
14
14
  * checkable and are not attempted — reference/motion-design.md owns those.
15
15
  *
16
- * This is static analysis without a parser, so it is deliberately conservative
17
- * and will still be wrong sometimes. `info` findings have the loosest match.
18
- * A wrong finding is a bug in this script; report it rather than working
19
- * around it.
16
+ * It reads each file's syntax tree — with a vendored parser, so nothing is
17
+ * installed — and follows what can be followed inside one file: aliases, a
18
+ * helper called only from a context, a timeline kept under a name. It does not
19
+ * follow calls into other files. A file it cannot parse is reported as
20
+ * `not-parsed`, never passed as clean. A wrong finding is a bug in this script;
21
+ * report it rather than working around it.
20
22
  *
21
23
  * Usage — paths resolve from the current directory, so run it from the project
22
24
  * root, wherever the skill itself is installed:
@@ -29,7 +31,7 @@
29
31
  import { existsSync } from "node:fs";
30
32
  import { resolve } from "node:path";
31
33
 
32
- import { RULES } from "./lib/rules.mjs";
34
+ import { pluginRegistrations, RULES } from "./lib/rules.mjs";
33
35
  import { collect, lineAt, load } from "./lib/source.mjs";
34
36
 
35
37
  /**
@@ -82,6 +84,7 @@ function waived(source, line, ruleId) {
82
84
  // --- Run ---------------------------------------------------------------------
83
85
 
84
86
  const findings = [];
87
+ const sources = [];
85
88
 
86
89
  for (const path of paths) {
87
90
  for (const file of collect(path)) {
@@ -93,20 +96,54 @@ for (const path of paths) {
93
96
  */
94
97
  if (!source.usesGsap && !/\bgsap\./.test(source.code)) continue;
95
98
 
96
- for (const rule of RULES) {
97
- for (const hit of rule.test(source)) {
98
- const line = lineAt(source.raw, hit.index);
99
- if (waived(source.raw, line, rule.id)) continue;
100
-
99
+ /**
100
+ * What was not checked is reported as not checked. A file that uses GSAP
101
+ * and does not parse gets no rule's verdict — a silent skip would read as
102
+ * clean.
103
+ */
104
+ if (source.parseError) {
105
+ const { line, message } = source.parseError;
106
+ if (!waived(source.raw, line, "not-parsed")) {
101
107
  findings.push({
102
- rule: rule.id,
103
- level: rule.level,
108
+ rule: "not-parsed",
109
+ level: "info",
104
110
  file: source.display,
105
111
  line,
106
- message: hit.message,
107
- hint: hit.hint,
112
+ message: `Not checked: the file could not be parsed (${message}).`,
113
+ hint: "No rule ran on this file. If it is valid JavaScript or TypeScript, the audit's parser is wrong — report it with this line.",
108
114
  });
109
115
  }
116
+ continue;
117
+ }
118
+
119
+ sources.push(source);
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Plugin registration is global: `gsap.registerPlugin(ScrollTrigger)` in one
125
+ * module registers it for every other. What the audited files register between
126
+ * them is collected before any rule runs, so a section that imports a plugin
127
+ * the app's entry registers is not reported as unregistered.
128
+ */
129
+ const registered = new Set(sources.flatMap((source) => [...pluginRegistrations(source)]));
130
+
131
+ for (const source of sources) {
132
+ source.registeredElsewhere = registered;
133
+
134
+ for (const rule of RULES) {
135
+ for (const hit of rule.test(source)) {
136
+ const line = lineAt(source.raw, hit.index);
137
+ if (waived(source.raw, line, rule.id)) continue;
138
+
139
+ findings.push({
140
+ rule: rule.id,
141
+ level: rule.level,
142
+ file: source.display,
143
+ line,
144
+ message: hit.message,
145
+ hint: hit.hint,
146
+ });
110
147
  }
111
148
  }
112
149
  }