Skip to content

Releases: x-name15/smile

v1.4.4: GraphQL Naming Conventions

Choose a tag to compare

@github-actions github-actions released this 30 Jul 10:37

Added

  • New GraphQL Rule: require-pascal-case-types: Added strict naming convention rule for GraphQL types (Object, Input, Interface, Enum, Union) to require PascalCase.
  • New GraphQL Rule: require-camel-case-fields: Added strict naming convention rule for GraphQL fields to require camelCase.

Chore

  • CI/CD Hardening: Added semantic-pr.yml to strictly enforce conventional commits on all Pull Requests.
  • Security Scanning: Added codeql.yml to automatically run GitHub CodeQL SAST scans on every push to main and weekly schedules.

📦 Installation

npm install -g @mrjacket/smile

View Full CHANGELOG

v1.4.3: GraphQL Runtime Validation & OpenAPI Hardening

Choose a tag to compare

@github-actions github-actions released this 30 Jul 10:20

Added

  • GraphQL Runtime Validation: Extends the Breaching Detector (smile test) to natively support GraphQL schemas. It parses .graphql SDL files, automatically generates shallow queries (using __typename) for parameter-less endpoints on the Query root type, dispatches them via POST, and verifies the response structure is free of GraphQL errors.
  • New OpenAPI Rule: valid-examples: Added strict static validation for OpenAPI examples. If you declare a schema property (e.g., type: integer) and provide an example that violates it (e.g., example: "foo"), smile will now block the build.
  • New OpenAPI Rule: require-security: Added strict static validation enforcing that every endpoint either has a security requirement defined globally/locally, or explicitly overrides it to public using security: []. Prevents accidental exposure of unprotected APIs.
  • New OpenAPI Rule: no-http-verbs-in-path: Added a REST best-practice rule that triggers warnings if paths contain verbs (e.g., /getUsers, /createOrder).

Chore

  • Dependabot Configuration: Added .github/dependabot.yml for automated dependency updates on a weekly schedule.

📦 Installation

npm install -g @mrjacket/smile

View Full CHANGELOG

v1.4.2: Full Breaching Detector & Postman Runtime Validation

Choose a tag to compare

@github-actions github-actions released this 30 Jul 09:12

Added

  • OpenAPI POST/PUT/PATCH/DELETE Validation: The Breaching Detector (smile test) now supports state-mutating requests. It automatically generates valid JSON bodies for POST/PUT/PATCH requests by analyzing the OpenAPI schema.
  • Postman Runtime Validation: The Breaching Detector can now recursively traverse Postman collections, fire requests against the live server, and dynamically infer a structural JSON Schema from the saved example to validate the real server's response.
  • Runtime Dispatcher Architecture: Refactored smokeTest.ts into a clean format-based dispatcher that delegates to openapiTester.ts and postmanTester.ts.

Changed

  • Warning Toleration: smile test now properly ignores warnings (such as 204 No Content missing a schema) and correctly exits with code 0 as long as there are no Error-level violations.

Docs

  • Destructive Warnings: Added prominent warnings to README.md, docs/getting-started.md, and docs/library.md explicitly stating that smile test now modifies databases with fake data.
  • Roadmap: Updated roadmap, pushing AsyncAPI broker validation to v1.6.0.

📦 Installation

npm install -g @mrjacket/smile

View Full CHANGELOG

v1.4.1: Hardening & Stability

Choose a tag to compare

@github-actions github-actions released this 30 Jul 08:59

Fixed

  • detectSpecFormat fallback: When a file format cannot be determined, it now returns ESpecFormat.Unknown and displays a clear error message, rather than silently falling back to parsing as OpenAPI and generating confusing parser errors.
  • Postman typings: Replaced all usages of any[] in Postman rules with the new IPostmanItem interface, ensuring type safety against malformed collection JSONs.
  • Postman interfaces moved: Moved all Postman type definitions (IPostmanCollection, IPostmanItem, etc.) to the central src/models/index.ts file and added comprehensive TSDocs.
  • Deduce interactive auto-fixer: Hardened smile deduce to abort gracefully if run against unsupported formats (like gRPC, Postman, GraphQL). Added guard checks to prevent crashes when JSON structures lack a paths object.

Tests

  • gRPC stress testing: Added sample-grpc-large.proto, a real-world multi-service fixture with nested types and enums, to ensure protobufjs rules scale gracefully.
  • OpenAPI stress testing: Added sample-openapi-large.yaml with 50 endpoints to ensure fast AST generation and linting.

📦 Installation

npm install -g @mrjacket/smile

View Full CHANGELOG

v1.4.0: gRPC and Postman Support

Choose a tag to compare

@github-actions github-actions released this 30 Jul 08:42

Added

  • gRPC (.proto) Linting: Introduced native static linting for Protocol Buffers using protobufjs (new runtime dependency).
  • gRPC Native Rules: Added require-rpc-comments, pascal-case-messages, and camel-case-fields.
  • Postman Collections Linting: Introduced native static linting for Postman Collections (v2.0.0 and v2.1.0).
  • Postman Native Rules: Added require-request-description, no-empty-folders, and require-response-example.
  • New Exported Functions: lintGrpcSpec and lintPostmanSpec are now fully exported from the library API.
  • New Fixtures: Added fixtures/sample-grpc.proto, fixtures/sample-grpc-clean.proto, fixtures/sample-postman.json, and fixtures/sample-postman-clean.json for testing.

Fixed

  • gRPC Parser bug: protobufjs was loaded without alternateCommentMode: true, causing all method comments to be silently ignored. The require-rpc-comments rule was firing on every method indiscriminately. Fixed by enabling alternateCommentMode in src/parsers/grpc.ts.
  • Interface inconsistency: src/parsers/grpc.ts and src/parsers/postman.ts were returning custom interfaces (IGrpcParsedResult, IPostmanParsedResult) instead of the standard project interface IParsedSpec. Refactored to use the shared interface for consistency.
  • TypeScript type assertion: Added proper as protobuf.Root and as IPostmanCollection casts in src/core/index.ts after standardizing parsers to IParsedSpec, fixing TS2345 errors on build.
  • npm keywords: Added missing grpc, protobuf, postman, and graphql keywords to package.json.

Tests

  • gRPC test suite expanded: lintGrpc.test.ts went from 1 test to 9 tests. Now matches the depth of OpenAPI/AsyncAPI suites: broken spec tests per rule (with specific message assertions), format detection, required fields check, and a full clean-spec passing test.
  • Postman test suite expanded: lintPostman.test.ts went from 1 test to 10 tests. Includes a negative test verifying that a well-formed request (Get Users) does NOT trigger false positives.
  • detectSpecFormat tests: Added coverage for .proto and Postman Collection detection.

Docs

  • New: docs/rules/grpc.md — full rules reference for gRPC in the same style as openapi.md (with Triggers on / Clean examples for each rule).
  • New: docs/rules/postman.md — full rules reference for Postman in the same style as openapi.md.
  • Updated: docs/README.md — added gRPC and Postman to the Rules Reference table.
  • Updated: README.md — Features list now includes gRPC, Postman, and the Plugin System. Supported formats line now includes .proto. Rules Reference links updated. Roadmap updated to remove already-shipped 1.4.0 items.

📦 Installation

npm install -g @mrjacket/smile

View Full CHANGELOG

v1.3.1: CLI Plugin Flag

Choose a tag to compare

@github-actions github-actions released this 30 Jul 08:22

Added

  • CLI Plugin Injection: Added the -p, --plugin <path> flag to the lint and test CLI commands. You can now load custom rules on the fly directly from the terminal without having to modify config.smile.json (e.g., smile lint ./api.yaml --plugin ./my-plugin.js).

Docs

  • CLI Options: Explicitly listed CLI options (--format, --quiet, --plugin, --header) in docs/getting-started.md.
  • Documentation Hub: Completely revamped docs/README.md to act as an organized hub linking all new guides (Plugins, Library API, Configuration, CI/CD).

📦 Installation

npm install -g @mrjacket/smile

View Full CHANGELOG

v1.3.0: The Plugin System

Choose a tag to compare

@github-actions github-actions released this 30 Jul 08:15

Added

  • Plugin System: Enterprise teams can now inject their own JavaScript/TypeScript custom rules dynamically at runtime via config.smile.json.
    • Plugins can be loaded via relative paths (./my-rules.js) or NPM packages (smile-plugin-enterprise).
    • Custom rules can target specific formats (e.g. openapi) or apply universally to all formats using "all".
    • Added new plugins array property to the configuration file format.

Docs

  • Plugin Guide: Created a dedicated docs/plugins.md explaining how to build and inject custom rules.
  • Boilerplate: Added a ready-to-use boilerplate plugin in examples/my-custom-plugin.js.

Chore

  • Test Fixtures Isolation: Migrated all internal .yaml test files from the examples/ folder to a dedicated fixtures/ directory. The examples/ folder is now strictly reserved for clean, production-ready boilerplate code. Evaluated and refactored the entire src/core/__tests__ suite to point to the new directory safely.

📦 Installation

npm install -g @mrjacket/smile

View Full CHANGELOG

v1.2.5: CI/CD & Flexibility Patch

Choose a tag to compare

@github-actions github-actions released this 30 Jul 07:47

Added

  • GitHub Step Summaries: smile lint and smile test now automatically detect if they are running inside GitHub Actions. If so, they will silently append a beautiful Markdown table of the results to $GITHUB_STEP_SUMMARY, giving you native visual dashboards on your PRs!
  • Inline Suppressions: Added support for # smile-ignore-next-line <ruleId> in YAML specifications. This allows developers to bypass specific rules on a case-by-case basis using AST parsing without polluting the global config.smile.json.
  • JUnit XML Reports: Added native support for JUnit format (--format junit). Both smile lint and smile test can now output XML reports that are perfectly digestible by GitLab CI, Jenkins, SonarQube, and Bitbucket.
  • Quiet Mode: Added a -q, --quiet flag to suppress all CLI spam (ASCII art, progress spinners, success messages) in CI environments, printing only errors and machine-readable formats.

Changed

  • Reporters Refactor: Refactored the internal smileReporter.ts into a cleaner, multi-file module architecture without impacting the public API.

Fixed

  • Documentation Overhaul: Conducted a massive review of the docs/ directory to ensure complete parity with the 1.2.5 codebase.
    • Created a dedicated docs/ci-cd.md guide centralizing all DevOps capabilities (GitHub Actions, GitLab CI, JUnit, Webhooks, Pre-commit).
    • Fixed outdated references to smile smoke across all files, updating them to the correct smile test command.
    • Updated library.md with accurate TypeScript types for runSmokeTest (now returning ITestResult and accepting custom HTTP headers).
    • Cleaned up getting-started.md and README.md to point seamlessly to the new CI/CD guide.

📦 Installation

npm install -g @mrjacket/smile

View Full CHANGELOG

v1.2.4: Documentation Patch

Choose a tag to compare

@github-actions github-actions released this 29 Jul 10:11

Fixed

  • Documentation Sync: Updated README.md and CLI documentation to correctly reflect the new smile deduce command name (formerly known as doctor) to ensure npm displays the correct documentation on the registry.

📦 Installation

npm install -g @mrjacket/smile

View Full CHANGELOG

v1.2.3: More Developer Experience :D

Choose a tag to compare

@github-actions github-actions released this 29 Jul 09:55

Added

  • Smile Deduce: Added an interactive smile deduce <spec> command (The Mentalist auto-fixer!). It reads your specification, finds violations (like missing summaries or operation IDs), and interactively prompts you to fix them right in your terminal. It safely manipulates your YAML files using AST parsing, preserving all # comments and formatting!
  • Markdown Reports: Added --format markdown flag for CI/CD integrations. Outputs GitHub-friendly tables that you can pipe directly into Pull Request comments.
  • Pre-commit Hook Installer: Added the smile install-hook command to generate a native, zero-dependency git pre-commit hook that automatically blocks commits if the API contract is broken.
  • Configurable Test Headers: Added testHeaders to config.smile.json. You can now store your Bearer tokens or API keys globally instead of typing -H repeatedly in smile test.

Changed

  • CLI Architecture Refactor: Moved all command files (initCommand, hookCommand, deduceCommand) into a dedicated src/cli/commands/ directory for better maintainability.

Fixed

  • Init Config Scaffold: smile init now correctly generates stubs for advanced config options (testHeaders, format, webhooks) inside the generated config.smile.json so users know they are available.

📦 Installation

npm install -g @mrjacket/smile

View Full CHANGELOG