Coder Social home page Coder Social logo

spectral-bundled-ruleset's Introduction

Use npm hosted ruleset without unpkg

This repository helps you create and distribute custom rulesets that extend existing rulesets hosted on npm, without needing access to unpkg. The bundled ruleset can be used with Spectral CLI, Studio Web, and the VS Code Extension.

Steps to create a custom bundled ruleset

  1. Fork/copy this repository

  2. Add rules and extended rulesets: Modify the ruleset.ts file in this repository to import the default spectral and spectral wasp rulesets, or any other rulesets of your choice. You can also add custom rules as per the Spectral documentation here.

  3. Bundle the ruleset: Use webpack to create a bundled ruleset.mjs file in the dist directory. The webpack configuration is already defined in this repository. Run the following command: yarn build

  4. Create a Spectral file: Create a new .spectral.yml file with the following content:

description: ""
formats:
  - "oas2"
  - "oas3"
  - "oas3.0"
  - "oas3.1"
aliases: {}
rules: {}
extends:
  - "{url to the ruleset.mjs file}"
functionsDir: "functions"

Replace {url to the ruleset.mjs file} with the actual URL to your bundled ruleset.mjs file. This Spectral file can be used across different environments.

  1. To Enable in Stoplight Platform: Import the custom .spectral.yml file into a style guide in the Stoplight Platform and publish it. The published style guide can be enabled for all projects within the platform.

Note: The github repo needs to be public for this to work seamlessly as the token expires.

spectral-bundled-ruleset's People

Contributors

mnaumanali94 avatar p0lip avatar shuknk8s avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.