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
12 changes: 12 additions & 0 deletions .github/workflows/check-bun-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: check-bun-dependencies
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
permissions:
contents: read
pull-requests: write
jobs:
call-check-bun-dependencies:
uses: flowscripter/.github/.github/workflows/check-bun-dependencies.yml@v1
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/lint-pr-message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: lint-pr-message
on:
pull_request_target:
types:
- opened
- edited
- synchronize
permissions:
contents: read
jobs:
call-lint-pr-message:
uses: flowscripter/.github/.github/workflows/lint-pr-message.yml@v1
secrets: inherit
16 changes: 16 additions & 0 deletions .github/workflows/release-bun-executable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: release-bun-executable
on:
push:
branches: [main]
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
pages: write
jobs:
call-release-bun-executable:
uses: flowscripter/.github/.github/workflows/release-bun-executable.yml@v1
secrets: inherit
with:
executable-name: "example-host-application"
10 changes: 10 additions & 0 deletions .github/workflows/validate-bun-executable-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: validate-bun-executable-pr
on:
pull_request:
branches: [main]
permissions:
contents: read
jobs:
call-validate-bun-executable-pr:
uses: flowscripter/.github/.github/workflows/validate-bun-executable-pr.yml@v1
secrets: inherit
181 changes: 181 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Caches

.cache

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
docs/
template-bun-executable
/.releaserc
functional_tests/features/support/__pycache__
example-host-application
functional_tests/.venv
94 changes: 93 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,94 @@
# example-host-application
Example host application executable for the https://github.com/flowscripter/dynamic-plugin-framework

[![version](https://img.shields.io/github/v/release/flowscripter/example-host-application?sort=semver)](https://github.com/flowscripter/example-host-application/releases)
[![build](https://img.shields.io/github/actions/workflow/status/flowscripter/example-host-application/release-bun-executable.yml)](https://github.com/flowscripter/example-host-application/actions/workflows/release-bun-executable.yml)
[![coverage](https://codecov.io/gh/flowscripter/example-host-application/branch/main/graph/badge.svg?token=EMFT2938ZF)](https://codecov.io/gh/flowscripter/example-host-application)
[![docs](https://img.shields.io/badge/docs-API-blue)](https://flowscripter.github.io/example-host-application/index.html)
[![license: MIT](https://img.shields.io/github/license/flowscripter/example-host-application)](https://github.com/flowscripter/example-host-application/blob/main/LICENSE)

> Example host application executable for the
> [dynamic-plugin-framework](https://github.com/flowscripter/dynamic-plugin-framework)

## Binary Executable Usage

**NOTE**: The binaries are 10's of megabytes in size as the entire Bun runtime
is included.

#### MacOS

Via [Homebrew](https://brew.sh/):

`brew install flowscripter/tap/example-host-application`

#### Linux

In a terminal:

`curl -fsSL https://raw.githubusercontent.com/flowscripter/example-host-application/main/script/install.sh | sh`

#### Windows

Via [Winget](https://github.com/microsoft/winget-cli):

`winget install Flowscripter.example-host-application`

#### Manual Install

You can download and extract the binary zip files from the
[releases](https://github.com/flowscripter/example-host-application/releases)
page.

## Functional Tests

Refer to [functional_tests/README.md](functional_tests/README.md)

## Development

Install dependencies:

`bun install`

Test:

`bun test`

Run:

`bun run index.ts`

Compile binary:

`bun build index.ts --compile --outfile /tmp/example-host-application`

**NOTE**: The following tasks use Deno as it excels at these and Bun does not
currently provide such functionality:

Format:

`deno fmt`

Lint:

`deno lint index.ts src/ tests/`

Generate HTML API Documentation:

`deno doc --html --name=example-host-application index.ts`

## Documentation

### Framework API

Refer to the
[dynamic-plugin-framework](https://github.com/flowscripter/dynamic-plugin-framework)
for an overview of what this example is demonstrating.

### API

Link to auto-generated API docs:

[API Documentation](https://flowscripter.github.io/example-host-application/index.html)

## License

MIT © Flowscripter
33 changes: 33 additions & 0 deletions bun.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"lockfileVersion": 1,
"workspaces": {
"": {
"name": "@flowscripter/example-host-application",
"dependencies": {
"@flowscripter/dynamic-plugin-framework": "^1.3.18",
"@flowscripter/example-plugin-api": "^1.0.8",
},
"devDependencies": {
"@types/bun": "^1.2.10",
},
"peerDependencies": {
"typescript": "^5.8.2",
},
},
},
"packages": {
"@flowscripter/dynamic-plugin-framework": ["@flowscripter/dynamic-plugin-framework@1.3.18", "", { "peerDependencies": { "typescript": "^5.8.3" } }, "sha512-OjH8O4MWXU/Wt1so49ef6OnnHlJkHuKKya8zVLR3nkxXhHbR3jHf2VmWl+mOR6liRyN9YN5IyeCvKonnAG6jTQ=="],

"@flowscripter/example-plugin-api": ["@flowscripter/example-plugin-api@1.0.8", "", { "peerDependencies": { "typescript": "^5.8.2" } }, "sha512-hRF0DRg+8aKmnAwLDQyA7phjRbET0yD9bBYdny2csL2N5JiV/KLFdfwtJSSSL/LlMdkwtl0VKAVroVc78eWAsw=="],

"@types/bun": ["@types/bun@1.2.10", "", { "dependencies": { "bun-types": "1.2.10" } }, "sha512-eilv6WFM3M0c9ztJt7/g80BDusK98z/FrFwseZgT4bXCq2vPhXD4z8R3oddmAn+R/Nmz9vBn4kweJKmGTZj+lg=="],

"@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="],

"bun-types": ["bun-types@1.2.10", "", { "dependencies": { "@types/node": "*" } }, "sha512-b5ITZMnVdf3m1gMvJHG+gIfeJHiQPJak0f7925Hxu6ZN5VKA8AGy4GZ4lM+Xkn6jtWxg5S3ldWvfmXdvnkp3GQ=="],

"typescript": ["typescript@5.8.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ=="],

"undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="],
}
}
23 changes: 23 additions & 0 deletions functional_tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Executable Functional Tests

#### Setup

Ensure the executable is built:

bun build ../index.ts --compile --outfile /tmp/example-host-application

Install requirements:

pip3 install -r pip-requirements.txt

#### Testing

Run the functional tests:

export EXECUTABLE=/tmp/example-host-application
behave

To run with logging output from the test steps (this is the best set of
arguments I can find):

behave --no-logcapture --no-color --logging-level=DEBUG
Loading