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

@invopop/gobl-builder

v0.134.0

Published

<img src="https://github.com/invopop/gobl/blob/main/gobl_logo_black_rgb.svg?raw=true" width="80" alt="GOBL Logo">

Downloads

486

Readme

gobl.builder

GOBL Builder is an interactive, low code tool for building GOBL documents.

This repository contains GOBLBuilder, a Svelte component used to render a self-contained UI with menu bar, toolbar, code editor and bottom drawer for showing errors, warnings and more. The component is packaged publically on NPM, to be imported and used from Svelte projects.

A standalone wrapper for GOBLBuilder is included in this repository in src (not part of the packaged library). It's available at https://build.gobl.org.

Requirements

At the moment, the component library relies on Tailwind CSS for styling. This might change in the future.

Installation

GOBL Builder is released as @invopop/gobl-builder on NPM. To add it to your Svelte project:

npm add -D @invopop/gobl-builder

Assuming your project already is configured to use Tailwind CSS, configure its template paths to include the component library and Flowbite (its dependency). An example tailwind.config.cjs file:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ["./src/**/*.{html,js,svelte,ts}", "./node_modules/@invopop/gobl-builder/**/*.{html,js,svelte,ts}"],
  theme: {
    extend: {},
  },
  plugins: [],
};

Usage

Import and use the GOBLBuilder Svelte component. For example, using TypeScript:

<script lang="ts">
  import GOBLBuilder from "@invopop/gobl-builder";
</script>

<GOBLBuilder data="" jsonSchemaURL="https://gobl.org/draft-0/bill/invoice" />

For further example usage, including directives for event handling, see src/routes/+page.svelte.

Development

Below sections cover development of the component library itself. See above sections for instructions on using GOBL Builder in your own project.

Installation

Clone this repository from GitHub, then run from within its directory:

npm install

For an optimal developer experience, use an IDE with plugin support for Svelte, TypeScript, ESLint and Prettier. For VS Code, recommended plugins are included in .vscode/extensions.json.

Run in watch mode

npm run dev

This script uses vite to run a development web server with HMR. It compiles TypeScript to JavaScript and serves the demo wrapper on http://localhost:3000.

Build package

npm run build:package

This script uses svelte-package to build a component library, written to the package directory (ref).

Build standalone demo

npm run build

This uses vite to build and write an optimized for production of the standalone demo to the build directory.

Preview production build

npm run preview

This uses vite to serve a previously built build folder on http://localhost:4173.

GOBL WASM binary

GOBL Builder makes use of gobl cli for validating, calculating and building GOBL documents. This is done using the @invopop/gobl-worker package that prepares a Worker and uses the WASM binary distributed on cdn.gobl.org.

To upgrade the version of the GOBL worker currently in use, simply update the package.json file to reflect the new version.

License

GOBL Builder is licensed under the Apache-2.0 License.


© 2024 Invopop, S.L.