Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
extends: ["eslint:recommended", "plugin:svelte/recommended", "plugin:@typescript-eslint/recommended", "prettier"],
ignorePatterns: ["dist", "src/lib/wasm_exec.js", "*.cjs"],
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:svelte/recommended',
'plugin:@typescript-eslint/recommended',
'prettier'
],
ignorePatterns: ['dist', 'src/lib/wasm_exec.js', '*.cjs'],
overrides: [
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
parserOptions: { parser: "@typescript-eslint/parser" },
},
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: { parser: '@typescript-eslint/parser' }
}
],
settings: {
"svelte/typescript": () => require("typescript"),
'svelte/typescript': () => require('typescript')
},
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true,
},
};
node: true
}
}
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache: 'npm'
- run: npm install
- run: npm run build
- run: npm run build:package
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: "npm"
cache: 'npm'
- run: npm install
- run: npm run check
- run: npm run lint
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: "npm"
cache: 'npm'

- run: npm install

Expand Down
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
engine-strict=true
22.20.0
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11.0
22.20.0
7 changes: 6 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"printWidth": 120,
"semi": false,
"tabWidth": 2,
"printWidth": 100,
"singleQuote": true,
"trailingComma": "none",
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,28 @@ An example `tailwind.config.cjs` file:
```js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{html,js,svelte,ts}", "./node_modules/@invopop/gobl-builder/**/*.{html,js,svelte,ts}"],
content: [
'./src/**/*.{html,js,svelte,ts}',
'./node_modules/@invopop/gobl-builder/**/*.{html,js,svelte,ts}'
],
theme: {
extend: {},
extend: {}
},
plugins: [],
};
plugins: []
}
```

## Usage

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

```html
<script lang="ts">
import GOBLBuilder from "@invopop/gobl-builder";
import { EnvelopeEditor } from '@invopop/gobl-builder'
</script>

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

For further example usage, including directives for event handling, see
Expand Down
Loading