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

@djanta/djantajs-compiler-core

v1.0.7

Published

djanta.io initiative that help developer for auto generate the platform dependent .djanta-rc.json

Downloads

7

Readme

djantajs-compiler-core

npm npm downloads Build Status Coverage Status Maintainability Test Coverage Known Vulnerabilities

djantaJS initiative that help developer for auto generate the platform dependent .djanta-rc.json.

Getting Started

The djantajs core annotation compile provide the main entry point which'll be use all across you contribution to extract and compilet your bundle annotation

Install

npm i @djanta/djantajs-compiler-core --save[-S]

Once the plugin has been installed, it may be able to require any of provided tools as follow:

let { Compiler, Handler, Serializable, Annotation } = require('@djanta/djantajs-compiler-core')

or as follow to import the module context:

let compiler = require('@djanta/djantajs-compiler-core')

Usage

How to implement a specific annotation

This component has provided the easiest way to implement your own annotation component. Therefore, you'll simply need to implelent the given interface

let { Annotation, Serializable } = require('@djanta/djantajs-compiler-core');
/**
 * Default class level documentation
 * @type MySerializableAnnotation
 */
module.exports = class MySerializableAnnotation extends Serializable {
  /**
   * The possible target retention
   *
   * (Annotation.DEFINITION, Annotation.CONSTRUCTOR, Annotation.PROPERTY, Annotation.METHOD)
   *
   * @type {Array}
   */
  static get targets () {
    return [Annotation.DEFINITION];
  }
    
  /**
   * The class default qualified contrustor.
   * @param {{}} data the annotation input data extracted from the target source
   * @param {string} filePath the source file where the annotation data has been extracted from
   */
  constructor (data, filePath) {
    super(data, filePath)
  }
  
  /**
   * This method is mandatory and must return the given annotation litteral name
   * @return {string} Returns the annotation name.
   */
  get annotationName () {
    return 'MySerializableAnnotation';
  }
  
  /**
   * User provided property with aim to set the <code>name</code> property throught the annotation
   * @param {string} name the given annotation name.
   */
  set name (name) {
    this._name = name;
  }
  
  /**
   * Returns the annotation <code>name</code> property set throught the annotation
   * @return {string} Returns the <code>name</code> property set via the annotation
   */
  get name () {
    return this._name;
  }
  
  /**
   * Mandatory rendered method which must return the annottion serialized context
   * @return {*} Returns the annotation serialized context.
   */
  get serialize () {
    let self = this;
    return {
      name: self.name,
      comment: 'Anything i want here or read from class property'
    };
  }
};

Expected instance properties (Options)

options.annotationName

Type: Property Default value: `` Required: true

A string value that will difine the logical annotation name.

options.serialize

Type: Property Default value: `` Required: true

The serialize property not an instance method will be called at the rendering.

Expected class static properties (Options)

targets

Type: Array Default value: [Annotation.DEFINITION, Annotation.CONSTRUCTOR, Annotation.PROPERTY, Annotation.METHOD] required: true

An array string value which'll be used to locate your annotation retention.

Usage Examples

Implementation

Here's the usage of the MySerializableAnnotation

/**
 * @MySerializableAnnotation(name='MyFirstAnnotation')
 */
module.exports = class ImDeveloper {
  /**
   * Qualified default class constructor
   * @Constructor
   */
   constructor () {}
}

Rendering result

{
  "name": "MyFirstAnnotation",
  "comment": "Anything i want here or read from class property"
}

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Therefore, please follow the nested instructions

  • Fork repository
  • Update source code
  • Update README.md and the changelog.md

Versioning

This package will be maintained under the Semantic Versioning guidelines as much as possible. Releases will be numbered with the following format:

<major>.<minor>.<patch>

License

MIT