@cmssy/codemod 8.0.0 → 8.0.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.
Files changed (2) hide show
  1. package/dist/index.js +3 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -195,13 +195,14 @@ function stripTypeArguments(source) {
195
195
  }
196
196
  return { code, changed };
197
197
  }
198
+ var INLINE_SCHEMA = /props\s*:\s*\{/;
198
199
  function transform3(source) {
199
200
  const { code, changed } = stripTypeArguments(source);
200
201
  const notes = [];
201
202
  const usesBlockProps = /\bBlockProps\s*</.test(code);
202
- if (/\bdefineBlock\s*[<(]/.test(code) && !usesBlockProps) {
203
+ if (/\bdefineBlock\s*\(/.test(code) && INLINE_SCHEMA.test(code)) {
203
204
  notes.push(
204
- "declares a block - type its component as BlockProps<typeof props>"
205
+ "the schema is inline - export it, and type the component with BlockProps<typeof props>"
205
206
  );
206
207
  } else if (HAND_TYPED_CONTENT.test(code) && !usesBlockProps) {
207
208
  notes.push(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/codemod",
3
- "version": "8.0.0",
3
+ "version": "8.0.1",
4
4
  "description": "Rewrites cmssy imports across major versions, so a breaking release costs minutes instead of an afternoon.",
5
5
  "keywords": [
6
6
  "cmssy",