npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

concordialang-plugin

v1.3.2

Published

Concordia Compiler Plug-in

Downloads

83,400

Readme

Build Status npm version GitHub last commit

concordialang-plugin

🔌 Concordia Compiler plug-in interface

How to create a plug-in

👉 The following procedure requires Concordia Compiler 2.0.0-alpha-19 or later

  1. Choose wisely your plug-in name, making sure that it starts with concordialang-. We recommend that it contains the target frameworks - e.g. concordialang-foo-bar if you will use the (hypothetical) frameworks "foo" and "bar".
  2. Create a new repository and clone it.
  3. Create a new file package.json (e.g., npm init).
  4. Install the packages concordialang-types and concordialang-plugin as dependencies (e.g., npm i concordialang-types concordialang-plugin).
  5. Add the property "concordiaPlugin": true to your package.json.
  6. Create a file (e.g., src/index.ts) with a class that implements the interface Plugin (see API).
  7. Make sure that the created class has a default export (i.e, export default class).
  8. Set the property "main" from your package.json to the JS file that contains the created class (e.g., "dist/index.js").
  9. Check your plug-in execution (see some tips below).
  10. Publish your package if you desire to install it by name.

Note: You can use JavaScript instead of TypeScript.

How to check your plug-in execution

  1. Create a new project with the file package.json (e.g., npm init --yes).
  2. Create a simple Concordia feature file (e.g., features/example.feature).
  3. Install Concordia Compiler (npm i -D concordialang) and run the init command (npx concordia --init).
  4. Install your plug-in from its directory (e.g., npm i -D /path/to/your-plugin)
  5. Run Concordia with your plug-in (e.g., npx concordia -p your-plugin) and see with it is executed correctly.

How to publish your plug-in

  1. Make sure you have an NPM account.
  2. Enter your project folder and run npm login.
  3. Create a property "files" into your package.json that indicates the (source code) files to distribute.
  4. Make sure the property "version" of your package file was set correctly.
  5. Run npm publish --dry-run to simulate the publishing.
  6. Make sure its all correct and then run npm publish.

Example

See fake-plugin for a simple example.

API

export interface Plugin {

    //
    // Test Generation and Execution
    //

    /**
     * Multi-platform command to start a testing server, if needed.
     *
     * 👉 Set its value only if the testing framework does need a testing server.
     *
     * @example
     *      "selenium-standalone start"
     */
    serveCommand?: string;

    /**
     * Generates source code from abstract test scripts, according to the given options.
     *
     * @param abstractTestScripts Abstract test scripts
     * @param options Options
     * @return Generation results.
     */
    generateCode?: (
        abstractTestScripts: AbstractTestScript[],
        options: TestScriptGenerationOptions
    ) => Promise< TestScriptGenerationResult >;

    /**
     * Executes test scripts, according to the given options.
     *
     * @param options Execution options.
     * @return Execution results.
     */
    executeCode?: ( options: TestScriptExecutionOptions ) => Promise< TestScriptExecutionResult >;

    /**
     * Converts a file produced by the execution of test scripts (e.g. a JSON or a XML file).
     *
     * @param filePath Input file.
     * @return Execution results.
     */
    convertReportFile?: ( filePath: string ) => Promise< TestScriptExecutionResult >;

    //
    // Events
    //

    /**
     * Event that happens before the compiler reports the test script results.
     *
     * @param result Test script execution result.
     * @param options Test script execution options.
     */
	beforeReporting?: ( result?: TestScriptExecutionResult, options?: TestScriptExecutionOptions ) => Promise< void >;

    /**
     * Event that happens after the compiler reports the test script results.
     *
     * @param result Test script execution result.
     * @param options Test script execution options.
     */
    afterReporting?: ( result?: TestScriptExecutionResult, options?: TestScriptExecutionOptions ) => Promise< void >;

}

Please see the src folder for more information about the used types.

License

AGPL © Thiago Delgado Pinto

GNU Affero General Public License version 3