@wp-typia/block-types 0.2.2 → 0.2.4

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/README.md CHANGED
@@ -71,6 +71,21 @@ TypeScript installs surface the requirement explicitly.
71
71
  Compatibility should track that floor unless the generated project dependency
72
72
  matrix changes in the same release.
73
73
 
74
+ ## Validation coverage
75
+
76
+ `@wp-typia/block-types` now validates itself with a mixed strategy that matches
77
+ the package surface:
78
+
79
+ - runtime/export-contract tests verify the published subpath map, ESM-safe
80
+ built re-exports, and the tuple/helper values that downstream packages import
81
+ at runtime
82
+ - compile-time fixture tests verify the most-used public type surfaces through
83
+ package-style imports, including block registration facades and style/support
84
+ helpers
85
+
86
+ This keeps the package failing fast on its own instead of relying on downstream
87
+ breakage in scaffold or runtime packages.
88
+
74
89
  ## WordPress style support helpers
75
90
 
76
91
  The package now exposes two complementary surfaces:
@@ -1,7 +1,7 @@
1
- export * from "./alignment";
2
- export * from "./color";
3
- export * from "./dimensions";
4
- export * from "./layout";
5
- export * from "./spacing";
6
- export * from "./style-attributes";
7
- export * from "./typography";
1
+ export * from "./alignment.js";
2
+ export * from "./color.js";
3
+ export * from "./dimensions.js";
4
+ export * from "./layout.js";
5
+ export * from "./spacing.js";
6
+ export * from "./style-attributes.js";
7
+ export * from "./typography.js";
@@ -1,7 +1,7 @@
1
- export * from "./alignment";
2
- export * from "./color";
3
- export * from "./dimensions";
4
- export * from "./layout";
5
- export * from "./spacing";
6
- export * from "./style-attributes";
7
- export * from "./typography";
1
+ export * from "./alignment.js";
2
+ export * from "./color.js";
3
+ export * from "./dimensions.js";
4
+ export * from "./layout.js";
5
+ export * from "./spacing.js";
6
+ export * from "./style-attributes.js";
7
+ export * from "./typography.js";
@@ -1,8 +1,8 @@
1
- import type { TextAlignment } from './alignment';
2
- import type { CssColorValue } from './color';
3
- import type { AspectRatio, MinHeightKeyword, MinHeightValue } from './dimensions';
4
- import type { SpacingDimension } from './spacing';
5
- import type { FontStyle, TextDecoration, TextTransform, WritingMode } from './typography';
1
+ import type { TextAlignment } from "./alignment.js";
2
+ import type { CssColorValue } from "./color.js";
3
+ import type { AspectRatio, MinHeightKeyword, MinHeightValue } from "./dimensions.js";
4
+ import type { SpacingDimension } from "./spacing.js";
5
+ import type { FontStyle, TextDecoration, TextTransform, WritingMode } from "./typography.js";
6
6
  export type PresetColorReference = `var:preset|color|${string}`;
7
7
  export type PresetDuotoneReference = `var:preset|duotone|${string}`;
8
8
  export type PresetGradientReference = `var:preset|gradient|${string}`;
@@ -1,2 +1,2 @@
1
- export * from './registration';
2
- export * from './supports';
1
+ export * from "./registration.js";
2
+ export * from "./supports.js";
@@ -1,2 +1,2 @@
1
- export * from './registration';
2
- export * from './supports';
1
+ export * from "./registration.js";
2
+ export * from "./supports.js";
@@ -21,3 +21,11 @@ export declare const BLOCK_VARIATION_SCOPES: readonly ["block", "inserter", "tra
21
21
  export type BlockVariation<TAttributes extends BlockAttributes = BlockAttributes> = WordPressBlockVariation<TAttributes>;
22
22
  export type RegisteredBlockType<TAttributes extends BlockAttributes = BlockAttributes> = WordPressRegisteredBlockType<TAttributes>;
23
23
  export type RegisterBlockTypeResult<TAttributes extends BlockAttributes = BlockAttributes> = RegisteredBlockType<TAttributes> | undefined;
24
+ /**
25
+ * Runtime shim for scaffolded registrations.
26
+ *
27
+ * Generated projects keep strong typing around scaffold metadata while
28
+ * centralizing the compatibility cast required by the currently published
29
+ * `@wordpress/blocks` registration surface.
30
+ */
31
+ export declare function registerScaffoldBlockType<TAttributes extends BlockAttributes = BlockAttributes, TSettings extends object = object>(blockName: string, settings: TSettings): RegisterBlockTypeResult<TAttributes>;
@@ -1,5 +1,9 @@
1
+ import { registerBlockType } from '@wordpress/blocks';
1
2
  export const BLOCK_VARIATION_SCOPES = [
2
3
  'block',
3
4
  'inserter',
4
5
  'transform',
5
6
  ];
7
+ export function registerScaffoldBlockType(blockName, settings) {
8
+ return registerBlockType(blockName, settings);
9
+ }
@@ -1,6 +1,6 @@
1
- import type { BlockAlignment, BlockVerticalAlignment, JustifyContent, TextAlignment } from '../block-editor/alignment';
2
- import type { FlexWrap, LayoutType, Orientation } from '../block-editor/layout';
3
- import type { SpacingAxis, SpacingDimension } from '../block-editor/spacing';
1
+ import type { BlockAlignment, BlockVerticalAlignment, JustifyContent, TextAlignment } from "../block-editor/alignment.js";
2
+ import type { FlexWrap, LayoutType, Orientation } from "../block-editor/layout.js";
3
+ import type { SpacingAxis, SpacingDimension } from "../block-editor/spacing.js";
4
4
  /**
5
5
  * Derived from Gutenberg block support keys and commonly used block.json
6
6
  * support sections.
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./block-editor/index";
2
- export * from "./blocks/index";
1
+ export * from "./block-editor/index.js";
2
+ export * from "./blocks/index.js";
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./block-editor/index";
2
- export * from "./blocks/index";
1
+ export * from "./block-editor/index.js";
2
+ export * from "./blocks/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wp-typia/block-types",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Shared WordPress block semantic types derived from Gutenberg and unofficial declarations",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -76,6 +76,8 @@
76
76
  "scripts": {
77
77
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
78
78
  "clean": "rm -rf dist",
79
+ "test": "bun run build && bun test tests",
80
+ "test:coverage": "bun run build && bun test tests --coverage --coverage-reporter=text --coverage-reporter=lcov --coverage-dir=coverage",
79
81
  "typecheck": "tsc -p tsconfig.json --noEmit"
80
82
  },
81
83
  "author": "imjlk",