JSPM

bluscript

1.0.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q20073F
    • License MIT

    A domain-specific language for web development

    Package Exports

    • bluscript
    • bluscript/dist/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bluscript) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    BluScript

    Version: 1.0.1

    A lightweight Domain-Specific Language (DSL) for generating web components.

    Installation

    npm install bluscript

    Quick Start

    import { Parser, HTMLGenerator } from 'bluscript';
    
    const code = `
    LOGIN PAGE {
      FIELD: username
      FIELD: password
      AUTH: JWT
      ACTION: /login
    }
    `;
    
    const parser = new Parser(code);
    const ast = parser.parse();
    const htmlGenerator = new HTMLGenerator();
    
    ast.forEach(command => {
      if (command.type === 'LOGIN') {
        const html = htmlGenerator.generateLoginPage(command);
        console.log(html);
      }
    });

    Syntax

    LOGIN PAGE

    Creates a login form with specified fields and configuration.

    LOGIN PAGE {
      FIELD: username
      FIELD: password
      AUTH: JWT
      ACTION: /login
    }

    Parameters:

    • FIELD: Input field (can be specified multiple times)
    • AUTH: Authentication method
    • ACTION: Form submission endpoint

    Generated HTML example:

    <form action="/login" method="POST">
      <div class="form-group">
        <label for="username">Username</label>
        <input type="text" id="username" name="username" required>
      </div>
      <div class="form-group">
        <label for="password">Password</label>
        <input type="password" id="password" name="password" required>
      </div>
      <button type="submit">Login</button>
    </form>

    API Reference

    Parser

    const parser = new Parser(code);
    const ast = parser.parse();

    HTMLGenerator

    const generator = new HTMLGenerator();
    const html = generator.generateLoginPage(command);

    Contributing

    1. Fork the repository
    2. Create your feature branch (git checkout -b feature/amazing-feature)
    3. Commit your changes (git commit -m 'Add some amazing feature')
    4. Push to the branch (git push origin feature/amazing-feature)
    5. Open a Pull Request

    License

    MIT License - see the LICENSE file for details