CodeSampleX

샘플

csstype 3.2.3: StandardProperties

검증된 샘플 — npm csstype 3.2.3: StandardProperties. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: csstype package.json declares type definitions…

sha256:116d131d8e57a2cc00650c7108f2d190e0fdacb1eb3d0c508bbe67112f628189

이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다. 통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다. MIT-0

실행 증거

선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.

증거 기준
서명된 컨트랙트 통과
검증 영수증
2
빌드한 서명 키
1
선언된 환경 linux 24 · ubuntu · glibc 2.39 x64 npm

검증 실행 환경

환경 컨트랙트 단계 실행일
node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5…
2026-08-27
node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2…
2026-09-07

케이스

HOW
목표
verify StandardProperties in pkg:npm/csstype@3.2.3
패키지
심벌
  • StandardProperties
생성일
2026-08-27T10:01:40Z

컨트랙트

  1. csstype package.json declares type definitions entry point index.d.ts and version 3.2.3
  2. csstype index.d.ts exports interface StandardProperties extending StandardLonghandProperties and StandardShorthandProperties with generic type parameters TLength and TTime
  3. csstype index.d.ts defines StandardLonghandProperties with camelCase CSS longhand properties including color, display, fontSize, and opacity
  4. csstype index.d.ts defines StandardShorthandProperties with camelCase CSS shorthand properties including margin, padding, flex, and background
  5. csstype index.d.ts defines Properties interface extending StandardProperties with vendor, obsolete, and SVG properties
  6. csstype index.d.ts defines kebab-case and fallback variants StandardPropertiesHyphen and StandardPropertiesFallback

파일

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • src/index.js
  • test/contract.js

소스 아티팩트 내려받기 (tar.gz)

소스

PROMPT.md
Clean-room public code sample — generation instructions

Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.

A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.

Goal: verify StandardProperties in pkg:npm/csstype@3.2.3
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/csstype@3.2.3
Demonstrate these symbols/APIs:
  - StandardProperties

Rules:
  - One focused purpose; the smallest project that proves the goal.
  - Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
  - Pin every dependency with a lockfile so resolution is reproducible.
  - No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
  - No personal names, emails, company names, or project identifiers of any kind.
  - No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
  - Keep it under 200 files and 256KB packed.
csx.json
{"case":{"caseId":"case:sha256:5159136fc5ef77949ffa4b0a15f5a39690a9571e5c4ea3575625db508402918a","contract":["csstype package.json declares type definitions entry point index.d.ts and version 3.2.3","csstype index.d.ts exports interface StandardProperties extending StandardLonghandProperties and StandardShorthandProperties with generic type parameters TLength and TTime","csstype index.d.ts defines StandardLonghandProperties with camelCase CSS longhand properties including color, display, fontSize, and opacity","csstype index.d.ts defines StandardShorthandProperties with camelCase CSS shorthand properties including margin, padding, flex, and background","csstype index.d.ts defines Properties interface extending StandardProperties with vendor, obsolete, and SVG properties","csstype index.d.ts defines kebab-case and fallback variants StandardPropertiesHyphen and StandardPropertiesFallback"],"goal":"verify StandardProperties in pkg:npm/csstype@3.2.3","kind":"HOW","packages":["pkg:npm/csstype@3.2.3"],"schemaVersion":1,"symbols":["StandardProperties"]},"contractCommand":["node","test/contract.js"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/csstype@3.2.3"],"schemaVersion":1,"subject":"pkg:npm/csstype@3.2.3","symbols":["StandardProperties"],"verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-csstype-standard-properties",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-csstype-standard-properties",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "csstype": "3.2.3"
      }
    },
    "node_modules/csstype": {
      "version": "3.2.3",
      "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
      "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
      "license": "MIT"
    }
  }
}
package.json
{
  "name": "sample-csstype-standard-properties",
  "version": "1.0.0",
  "private": true,
  "description": "Clean-room verification sample for csstype StandardProperties",
  "main": "src/index.js",
  "scripts": {
    "test": "node test/contract.js"
  },
  "dependencies": {
    "csstype": "3.2.3"
  },
  "license": "MIT-0"
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify StandardProperties in pkg:npm/csstype@3.2.3",
  "kind": "HOW",
  "packages": [
    "pkg:npm/csstype@3.2.3"
  ],
  "symbols": [
    "StandardProperties"
  ]
}
src/index.js
const fs = require('node:fs');
const path = require('node:path');

/**
 * Resolves the path to the csstype package directory.
 * @returns {string} Absolute path to csstype package root
 */
function getPackageRoot() {
  const pkgJsonPath = require.resolve('csstype/package.json');
  return path.dirname(pkgJsonPath);
}

/**
 * Resolves the path to the csstype TypeScript declaration file.
 * @returns {string} Absolute path to index.d.ts
 */
function getDeclarationPath() {
  return path.join(getPackageRoot(), 'index.d.ts');
}

/**
 * Reads the declaration file content of csstype.
 * @returns {string} Text content of index.d.ts
 */
function loadDeclarationContent() {
  const declPath = getDeclarationPath();
  return fs.readFileSync(declPath, 'utf8');
}

/**
 * Inspects the type definitions for StandardProperties and related interfaces.
 * @returns {object} Summary of discovered interfaces and properties
 */
function inspectStandardProperties() {
  const content = loadDeclarationContent();

  const hasStandardProperties = content.includes(
    'export interface StandardProperties<TLength = (string & {}) | 0, TTime = string & {}>'
  );
  const extendsStandardLonghand = content.includes('extends StandardLonghandProperties<TLength, TTime>');
  const extendsStandardShorthand = content.includes('StandardShorthandProperties<TLength, TTime>');

  const hasStandardLonghandInterface = content.includes(
    'export interface StandardLonghandProperties<TLength = (string & {}) | 0, TTime = string & {}>'
  );
  const hasStandardShorthandInterface = content.includes(
    'export interface StandardShorthandProperties<TLength = (string & {}) | 0, TTime = string & {}>'
  );

  const hasPropertiesInterface = content.includes(
    'export interface Properties<TLength = (string & {}) | 0, TTime = string & {}>'
  );
  const propertiesExtendsStandard = content.includes('extends StandardProperties<TLength, TTime>');

  const hasHyphenVariant = content.includes(
    'export interface StandardPropertiesHyphen<TLength = (string & {}) | 0, TTime = string & {}>'
  );
  const hasFallbackVariant = content.includes(
    'export interface StandardPropertiesFallback<TLength = (string & {}) | 0, TTime = string & {}>'
  );

  const hasLonghandProperties = {
    color: content.includes('color?: Property.Color | undefined;'),
    display: content.includes('display?: Property.Display | undefined;'),
    fontSize: content.includes('fontSize?: Property.FontSize<TLength> | undefined;'),
    opacity: content.includes('opacity?: Property.Opacity | undefined;'),
    position: content.includes('position?: Property.Position | undefined;'),
    zIndex: content.includes('zIndex?: Property.ZIndex | undefined;'),
  };

  const hasShorthandProperties = {
    background: content.includes('background?: Property.Background<TLength> | undefined;'),
    border: content.includes('border?: Property.Border<TLength> | undefined;'),
    flex: content.includes('flex?: Property.Flex<TLength> | undefined;'),
    font: content.includes('font?: Property.Font | undefined;'),
    margin: content.includes('margin?: Property.Margin<TLength> | undefined;'),
    padding: content.includes('padding?: Property.Padding<TLength> | undefined;'),
  };

  return {
    hasStandardProperties,
    extendsStandardLonghand,
    extendsStandardShorthand,
    hasStandardLonghandInterface,
    hasStandardShorthandInterface,
    hasPropertiesInterface,
    propertiesExtendsStandard,
    hasHyphenVariant,
    hasFallbackVariant,
    hasLonghandProperties,
    hasShorthandProperties,
  };
}

module.exports = {
  getPackageRoot,
  getDeclarationPath,
  loadDeclarationContent,
  inspectStandardProperties,
};
test/contract.js
const assert = require('node:assert');
const fs = require('node:fs');
const path = require('node:path');
const {
  getPackageRoot,
  getDeclarationPath,
  loadDeclarationContent,
  inspectStandardProperties,
} = require('../src/index.js');

// 1. csstype package.json declares type definitions entry point index.d.ts and version 3.2.3
const pkgJson = require('csstype/package.json');
assert.strictEqual(pkgJson.name, 'csstype', 'package name must be csstype');
assert.strictEqual(pkgJson.version, '3.2.3', 'package version must be 3.2.3');
assert.strictEqual(pkgJson.types, 'index.d.ts', 'package types entry must point to index.d.ts');

// 2. csstype index.d.ts exports interface StandardProperties extending StandardLonghandProperties and StandardShorthandProperties with generic type parameters TLength and TTime
const declPath = getDeclarationPath();
assert.strictEqual(fs.existsSync(declPath), true, 'index.d.ts must exist on disk');

const content = loadDeclarationContent();
assert.strictEqual(typeof content, 'string', 'declaration content must be string');
assert.strictEqual(
  content.includes('export interface StandardProperties<TLength = (string & {}) | 0, TTime = string & {}>'),
  true,
  'index.d.ts must export generic interface StandardProperties'
);
assert.strictEqual(
  content.includes('extends StandardLonghandProperties<TLength, TTime>'),
  true,
  'StandardProperties must extend StandardLonghandProperties'
);
assert.strictEqual(
  content.includes('StandardShorthandProperties<TLength, TTime>'),
  true,
  'StandardProperties must extend StandardShorthandProperties'
);

// 3. csstype index.d.ts defines StandardLonghandProperties with camelCase CSS longhand properties including color, display, fontSize, and opacity
assert.strictEqual(
  content.includes('export interface StandardLonghandProperties<TLength = (string & {}) | 0, TTime = string & {}>'),
  true,
  'index.d.ts must export interface StandardLonghandProperties'
);
assert.strictEqual(content.includes('color?: Property.Color | undefined;'), true, 'StandardLonghandProperties must declare color');
assert.strictEqual(content.includes('display?: Property.Display | undefined;'), true, 'StandardLonghandProperties must declare display');
assert.strictEqual(
  content.includes('fontSize?: Property.FontSize<TLength> | undefined;'),
  true,
  'StandardLonghandProperties must declare fontSize with TLength'
);
assert.strictEqual(content.includes('opacity?: Property.Opacity | undefined;'), true, 'StandardLonghandProperties must declare opacity');

// 4. csstype index.d.ts defines StandardShorthandProperties with camelCase CSS shorthand properties including margin, padding, flex, and background
assert.strictEqual(
  content.includes('export interface StandardShorthandProperties<TLength = (string & {}) | 0, TTime = string & {}>'),
  true,
  'index.d.ts must export interface StandardShorthandProperties'
);
assert.strictEqual(
  content.includes('margin?: Property.Margin<TLength> | undefined;'),
  true,
  'StandardShorthandProperties must declare margin with TLength'
);
assert.strictEqual(
  content.includes('padding?: Property.Padding<TLength> | undefined;'),
  true,
  'StandardShorthandProperties must declare padding with TLength'
);
assert.strictEqual(
  content.includes('flex?: Property.Flex<TLength> | undefined;'),
  true,
  'StandardShorthandProperties must declare flex with TLength'
);
assert.strictEqual(
  content.includes('background?: Property.Background<TLength> | undefined;'),
  true,
  'StandardShorthandProperties must declare background with TLength'
);

// 5. csstype index.d.ts defines Properties interface extending StandardProperties with vendor, obsolete, and SVG properties
assert.strictEqual(
  content.includes('export interface Properties<TLength = (string & {}) | 0, TTime = string & {}>'),
  true,
  'index.d.ts must export interface Properties'
);
assert.strictEqual(
  content.includes('extends StandardProperties<TLength, TTime>'),
  true,
  'Properties must extend StandardProperties'
);

// 6. csstype index.d.ts defines kebab-case and fallback variants StandardPropertiesHyphen and StandardPropertiesFallback
assert.strictEqual(
  content.includes('export interface StandardPropertiesHyphen<TLength = (string & {}) | 0, TTime = string & {}>'),
  true,
  'index.d.ts must export interface StandardPropertiesHyphen'
);
assert.strictEqual(
  content.includes('export interface StandardPropertiesFallback<TLength = (string & {}) | 0, TTime = string & {}>'),
  true,
  'index.d.ts must export interface StandardPropertiesFallback'
);

// 7. Verify helper module inspection matches all criteria
const inspection = inspectStandardProperties();
assert.strictEqual(inspection.hasStandardProperties, true, 'inspection should verify StandardProperties');
assert.strictEqual(inspection.extendsStandardLonghand, true, 'inspection should verify StandardLonghand extension');
assert.strictEqual(inspection.extendsStandardShorthand, true, 'inspection should verify StandardShorthand extension');
assert.strictEqual(inspection.hasStandardLonghandInterface, true, 'inspection should verify StandardLonghand interface');
assert.strictEqual(inspection.hasStandardShorthandInterface, true, 'inspection should verify StandardShorthand interface');
assert.strictEqual(inspection.hasPropertiesInterface, true, 'inspection should verify Properties interface');
assert.strictEqual(inspection.propertiesExtendsStandard, true, 'inspection should verify Properties extends StandardProperties');
assert.strictEqual(inspection.hasHyphenVariant, true, 'inspection should verify StandardPropertiesHyphen');
assert.strictEqual(inspection.hasFallbackVariant, true, 'inspection should verify StandardPropertiesFallback');
assert.strictEqual(inspection.hasLonghandProperties.color, true, 'inspection should verify color property');
assert.strictEqual(inspection.hasLonghandProperties.display, true, 'inspection should verify display property');
assert.strictEqual(inspection.hasLonghandProperties.fontSize, true, 'inspection should verify fontSize property');
assert.strictEqual(inspection.hasLonghandProperties.opacity, true, 'inspection should verify opacity property');
assert.strictEqual(inspection.hasLonghandProperties.position, true, 'inspection should verify position property');
assert.strictEqual(inspection.hasLonghandProperties.zIndex, true, 'inspection should verify zIndex property');
assert.strictEqual(inspection.hasShorthandProperties.background, true, 'inspection should verify background property');
assert.strictEqual(inspection.hasShorthandProperties.border, true, 'inspection should verify border property');
assert.strictEqual(inspection.hasShorthandProperties.flex, true, 'inspection should verify flex property');
assert.strictEqual(inspection.hasShorthandProperties.font, true, 'inspection should verify font property');
assert.strictEqual(inspection.hasShorthandProperties.margin, true, 'inspection should verify margin property');
assert.strictEqual(inspection.hasShorthandProperties.padding, true, 'inspection should verify padding property');

console.log('All contract assertions passed successfully.');

오리진 시더

익명