Catalog npm
Back to packageRELEASE DETAILS

1.0.1

npm

@0xcompose/sspec

Solidity Smart Contract specification generation tool based on Foundry tests and slang

contractsfoundryslangsmartsolidityspecificationtesting
Published6 Jan 2025
Direct dependencies10
Transitive dependenciesNot calculated

README

Current package documentation

sspec

sspec comes from Solidity SPECification. Smart contract repositories often lack detailed or even general descriptions of what the repo and its smart contracts do. Only AIs can understand what's going on (not always). This tool was created to improve development and review simplicity.

This is a reimagining of scopelint's spec command, which generates specifications for source smart contracts based on test files and test names.

This functionality helps not only with understanding your own test suites, but also with reviewing other repositories.

Built using slang.

Installation

Install via npm or yarn:

npm i @0xcompose/sspec --save-dev
yarn add @0xcompose/sspec --dev

Foundry Test Naming Conventions

There are three valid naming conventions for unit testing (according to Foundry best practices):

  1. Testing whole contract:

    • Test file: SourceContractName.t.sol
    • Test contract: SourceContractNameTest
  2. Testing single function:

    • Test file: SourceContractName.sourceFunctionName.t.sol
    • Test contract: SourceFunctionName (in PascalCase)
  3. Testing features:

    • Test file: SourceContractName.FeatureName.t.sol
    • Test contract: FeatureName
    • Note: Feature can be anything, including integration tests

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 10

Native requirements
10 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
chai
Environment
{
  "local_name": "chai",
  "alias": false,
  "peer_metadata": null
}
^5.1.2runtime
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^11.0.1runtime
@types/chai
Environment
{
  "local_name": "@types/chai",
  "alias": false,
  "peer_metadata": null
}
^5.0.1runtime
@types/mocha
Environment
{
  "local_name": "@types/mocha",
  "alias": false,
  "peer_metadata": null
}
^10.0.10runtime
mocha-suppress-logs
Environment
{
  "local_name": "mocha-suppress-logs",
  "alias": false,
  "peer_metadata": null
}
^0.5.1runtime
@nomicfoundation/slang
Environment
{
  "local_name": "@nomicfoundation/slang",
  "alias": false,
  "peer_metadata": null
}
^0.18.3runtime
husky
Environment
{
  "local_name": "husky",
  "alias": false,
  "peer_metadata": null
}
^9.1.7development
ts-node
Environment
{
  "local_name": "ts-node",
  "alias": false,
  "peer_metadata": null
}
^10.9.2development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.7.2development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^22.10.2development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "b26f48a0a2073ec367cba70ee8541f6830db1263",
  "tarball": "https://registry.npmjs.org/@0xcompose/sspec/-/sspec-1.0.1.tgz",
  "fileCount": 128,
  "integrity": "sha512-GcPveIyhlGBOacSoNaAuVd2bLOuESuRzwLgg/oL6P4sl0yykAslGPhWh0Lbl/QXUxHEXDoU9WMSPbCc1mC7t9A==",
  "signatures": [
    {
      "sig": "MEUCID5cRFH4ab9zPWfXEeE3YrIIfz1Z7Obyf4MpW74Gs/LrAiEAiTL7CIKux0b1YU7gVR7h7nEdXYEyRdpRS+e4RKj4FZA=",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 321967
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:03 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:5aa6bba4f14fa4608dc25af2c1feb133e58f87f80139be105939bb0b6fffa45c

Other collected versions

1.0.914 Apr1.0.814 Jan1.0.714 Jan1.0.68 Jan1.0.56 Jan1.0.46 JanView all collected versions →