Skip to content
Merged
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
18 changes: 5 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ on:
push:
tags:
- v*
env:
CI: true

jobs:
release:
Expand All @@ -13,22 +11,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version: 22
cache: "npm"
bun-version: latest

- name: Install Dependencies
run: npm install

# Ensure a new version doesn't get published to npm if it doesn't
# pass all required checks/validation:
- name: Run Checks
run: npm run typecheck && npm run prettier:ci && npm run eslint
run: bun install

- name: Build
run: npm run build
run: bun run build

- name: Publish to npm
uses: laserware/propellant@v1.0.2
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy Documentation Site

on:
push:
branches: [ "main" ]

# Allows you to run this workflow manually from the Actions tab:
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages:
permissions:
contents: read
pages: write
Expand All @@ -32,22 +29,22 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version: 22
bun-version: latest

- name: Install dependencies
run: npm install
- name: Install Dependencies
run: bun install

- name: Build static files
- name: Build Static Files
id: build
run: npm run docs:generate
run: bun run docs:generate

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
- name: Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
path: "site"
Expand Down
25 changes: 11 additions & 14 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: Validate
on: [push]
env:
CI: true

jobs:
check:
Expand All @@ -10,20 +8,19 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version: 22
cache: "npm"
bun-version: latest

- name: Install dependencies
run: npm install
- name: Install Dependencies
run: bun install

- name: ESLint
run: npm run eslint

- name: Check Formatting
run: npm run prettier:ci
- name: Run Biome Checks
run: bun run ci

- name: Check Types
run: npm run typecheck
run: bun run check:types

- name: Run Unit Tests
run: bun test
12 changes: 12 additions & 0 deletions .run/Build.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="build" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/Check Biome.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Check Biome" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="check:biome" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/Check Types.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Check Types" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="check:types" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
5 changes: 5 additions & 0 deletions .run/Debug Docs.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Debug Docs" type="JavascriptDebugType" uri="http://localhost:5173">
<method v="2" />
</configuration>
</component>
8 changes: 8 additions & 0 deletions .run/Docs.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Docs" type="CompoundRunConfigurationType">
<toRun name="Debug Docs" type="JavascriptDebugType" />
<toRun name="Generate Docs (Watch)" type="js.build_tools.npm" />
<toRun name="Serve Docs" type="js.build_tools.npm" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/Example.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Example" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="example" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
13 changes: 13 additions & 0 deletions .run/Generate Docs (Watch).run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate Docs (Watch)" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="docs:generate" />
</scripts>
<arguments value="-- --watch" />
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/Generate Docs.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate Docs" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="docs:generate" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/Serve Docs.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Serve Docs" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="docs:serve" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/Tests.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Tests" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="test" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
8 changes: 8 additions & 0 deletions .run/Validate.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Validate" type="CompoundRunConfigurationType">
<toRun name="Check Biome" type="js.build_tools.npm" />
<toRun name="Check Types" type="js.build_tools.npm" />
<toRun name="Tests" type="js.build_tools.npm" />
<method v="2" />
</configuration>
</component>
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ Svelte wrapper over Redux.

## Usage

Install the dependency. Note that `svelte` and `@laserware/stasis` are required as a peer dependencies:
Install the dependency. Note that `svelte` is required and `@laserware/stasis` *or* `@reduxjs/toolkit` are required as peer dependencies:

```bash
npm install @laserware/sword @laserware/stasis svelte
```

Or

```bash
npm install @laserware/sword @reduxjs/toolkit svelte
```

Wrap your Svelte entry point component with `<Provider>`:

**Entry File (`src/main.ts`)**
Expand Down
54 changes: 54 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"$schema": "https://biomejs.dev/schemas/2.1.1/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"includes": ["**", "!**/*.svelte"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"lineWidth": 80,
"includes": ["**", "!package.json"]
},
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noUselessElse": "off",
"noParameterAssign": "off",
"noNonNullAssertion": "off"
},
"suspicious": {
"noExplicitAny": "off"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"overrides": [
{
"includes": ["**/src/**/*.test.ts"],
"formatter": {
"lineWidth": 100
},
"linter": {
"rules": {
"recommended": true,
"style": {
"noNonNullAssertion": "off"
}
}
}
}
]
}
Loading