Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
229b0bc
feat: use bun and update typescript
emielwit Aug 4, 2025
7213350
refactor: migrate from commander default import to named import
emielwit Aug 4, 2025
6b58157
fix: component build working with bun
jrquak Aug 5, 2025
4ace3f4
chore: fix type errors
jrquak Aug 6, 2025
4a5ca63
chore: updates arguments
jrquak Aug 6, 2025
7b44bf1
refactor: replace ava tests with bun
jrquak Aug 6, 2025
f6cbcf7
chore: migrates CI/CD pipeline to Bun
jrquak Aug 6, 2025
d78af08
chore: update eslint
jrquak Aug 6, 2025
eeaa4c9
chore: update prettier scripts
jrquak Aug 6, 2025
cb7d2c5
chore: updates prettier execution command
jrquak Aug 6, 2025
14434b5
chore: update eslint config
jrquak Aug 7, 2025
ffcccd6
chore: run auto fix lint
jrquak Aug 7, 2025
e7d7c4b
chore: fix sort-key errors
jrquak Aug 7, 2025
adddbb4
chore: improved null handling
jrquak Aug 7, 2025
d481256
chore: validation to accept options object
jrquak Aug 7, 2025
5f8a2c1
Chore: updates linting and formatting
jrquak Aug 7, 2025
700d5f4
chore: updates node-fetch to the latest version
jrquak Aug 7, 2025
6e829ff
chore: use objects in the validate functions
jrquak Aug 7, 2025
6d54d1d
chore: updates dependencies
jrquak Aug 8, 2025
08145cc
chore: update dependencies
jrquak Aug 8, 2025
fc45b47
chore: updates dependencies and refactors eslint
jrquak Aug 11, 2025
dd9bfae
chore: refactors and improves code validation
jrquak Aug 11, 2025
3285075
chore: fixes prefab validation test errors
jrquak Aug 11, 2025
c64a23c
chore: only run tests in test folder in the runner
jrquak Aug 11, 2025
61e9add
chore: updates dependencies and test timeout
jrquak Aug 11, 2025
6dc1313
Chore: Improves error handling and testing
jrquak Aug 12, 2025
4d56b62
chore: refactors block creation to use 'case' package
jrquak Aug 12, 2025
eb947ef
fix: refactors and corrects test assertions
jrquak Aug 12, 2025
6113bb4
chore: remove interaction command
jrquak Aug 13, 2025
cf7b7ef
feat: remove deprecated cli command and update deps /n/n BREAKING CHA…
Aug 14, 2025
680956c
feat: remove deprecated cli command and update deps /n/n BREAKING CHA…
Aug 14, 2025
51db858
feat: remove deprecated cli command and update deps
Aug 14, 2025
5c7296e
fix: set entry point to js file
Aug 14, 2025
57c1cf7
chore: resolve sonarqube issues
Aug 14, 2025
173e0d3
chore: syncs typescript version between dev and prod
jrquak Aug 14, 2025
8c66b57
fix: trigger changelog
jrquak Aug 14, 2025
b27a80c
fix: add types from nodemodules
Aug 15, 2025
e9ec1cf
fix: include type deps in deps
Aug 15, 2025
fb73c52
fix: resolve linter
Aug 15, 2025
3725898
fix: revert last change
Aug 15, 2025
9abfcb9
fix: include types in deps
Aug 15, 2025
5ef170c
chore: revert last change
Aug 15, 2025
902e1f7
fix: change shebang from bun to node
jrquak Aug 15, 2025
8265209
chore: revert last change
jrquak Aug 15, 2025
77d1e0a
fix: set deps
Aug 15, 2025
41cb981
fix: use old tsconfig and transpile
Aug 15, 2025
a05e4db
fix: set source code in build directory
Aug 15, 2025
223def3
fix: set types deps in dev deps
Aug 15, 2025
2a1e791
fix: add tsnode as dependency
Aug 15, 2025
1d4ef0a
fix: set type deps as deps
Aug 15, 2025
a2abb2a
fix: use updated tsconfig settings
jrquak Aug 19, 2025
f6946c2
fix: add tsconfig build
jrquak Aug 19, 2025
6e54f67
fix: updates shebang to node
jrquak Aug 21, 2025
dd1f9ab
fix: revert shebang change
jrquak Aug 21, 2025
159e827
feat: remove custom functions from cli
Sep 24, 2025
0c225c6
chore: remove custom functions code
Sep 24, 2025
4df3712
feat: add wasm functions template
Sep 25, 2025
1dfc54f
chore: remove unused files and functions
Sep 25, 2025
bc2f90c
chore: init wasm files
Sep 25, 2025
7becd9b
feat: can init, add new and bump wasm functions
Sep 25, 2025
235aa5b
chore: correct typing and remove isolatedvm test
Sep 30, 2025
9c1dd61
feat: publish wasm functions to blockstore
Sep 30, 2025
482e44d
chore: move wasm functions structure function to functiondef
Sep 30, 2025
9e8f9e3
test: select js-template in test
Sep 30, 2025
35163cd
chore: use case lib
Sep 30, 2025
ebd9d07
chore: update deps
Sep 30, 2025
02fca16
fix: split up validation function
Oct 3, 2025
57c9dae
chore: do not retry login for native publish
Oct 3, 2025
6847ade
chore: resolve feedback
Oct 3, 2025
d9c328d
test: use absolute path for block def
Oct 3, 2025
0131ca2
chore: return empty list if dir not exists
Oct 3, 2025
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
4 changes: 1 addition & 3 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"extends": [
"@commitlint/config-angular"
]
"extends": ["@commitlint/config-angular"]
}
36 changes: 0 additions & 36 deletions .eslintrc.js

This file was deleted.

21 changes: 10 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.18.2
uses: actions/setup-node@v1
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version: '14.18.2'
- run: npm install -g yarn
- run: yarn install --frozen-lockfile --ignore-optionals
bun-version: 1.2.19
- run: bun install --frozen-lockfile
- name: Commit lint
run: yarn commitlint --from $(git rev-parse --short HEAD^1) --to $(git rev-parse --short HEAD^2)
run: bun commitlint --from $(git rev-parse --short HEAD^1) --to $(git rev-parse --short HEAD^2)
- name: Run prettier
run: yarn prettier:write
run: bun run format:check
- name: Run build
run: yarn build
run: bun run build
- name: Run linting
run: yarn lint
run: bun run lint:check
- name: Run tests
run: yarn test
run: bun run test
24 changes: 14 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
name: Release
on:
push:
branches: [master]
branches:
- master
- beta
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: Use Node.js 14.18.2
uses: actions/setup-node@v1
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
node-version: '14.18.2'
- run: npm install -g yarn
- run: yarn install --frozen-lockfile
- name: Run build
run: yarn build
bun-version: 1.2.19
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build CLI
run: bun run build
- name: Run tests
run: bun run test
- name: Release notes
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release
run: bun semantic-release
6 changes: 5 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Build files
build/
node_modules/
bun.lock
CHANGELOG.md
coverage
README.md
4 changes: 4 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"branches": [
{ "name": "master" },
{ "name": "beta", "channel": "beta", "prerelease": true }
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
Expand Down
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ To update the CLI without optional dependencies (isolated-vm)
$ npm update -g @betty-blocks/cli --no-optional
```

## Local development

Make sure you run bun version `1.2.19` or higher:
`bun --version`

To install dependencies, run:

```bash
bun install
```

## Introduction

Welcome to the GitHub repository for the Betty Blocks command-line interface (CLI).
Expand Down
8 changes: 2 additions & 6 deletions __tests__/assets/unknownEvent.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
function unknownEvent({
event,
}: {
event: unknown;
}): number {
return 1;
function unknownEvent({ event }: { event: unknown }): number {
return 1;
}
42 changes: 19 additions & 23 deletions __tests__/blocks/blockDefinitions.test.ts
Original file line number Diff line number Diff line change
@@ -1,65 +1,61 @@
import { afterEach, expect, test } from 'bun:test';
import fs from 'fs-extra';
import test, { ExecutionContext } from 'ava';
import path from 'path';

import {
blockDefinitionPath,
blockDefinitions,
createPackageJson,
newBlockDefinition,
} from '../../src/blocks/blockDefinitions';

type Context = ExecutionContext<unknown>;

console.log(process.cwd());

const supportDir = path.join(process.cwd(), '__tests__/support/blocks/');

test.afterEach(() => {
afterEach(() => {
fs.emptyDirSync(supportDir);
});

test('blockDefinitionPath', async (t: Context): Promise<void> => {
t.is(blockDefinitionPath('/blocks', 'test'), '/blocks/test.json');
test('blockDefinitionPath', async (): Promise<void> => {
expect(blockDefinitionPath('/blocks', 'test')).toBe('/blocks/test.json');
});

test('creating a new blockDefinition', async (t: Context): Promise<void> => {
test('creating a new blockDefinition', async (): Promise<void> => {
const blockName = `block${Math.random().toString()}`;

t.is(
newBlockDefinition(supportDir, blockName),
expect(newBlockDefinition(supportDir, blockName)).toBe(
`blocks/${blockName}.json created`,
);
});

test('returns 2 blocks', async (t: Context): Promise<void> => {
test('returns 2 blocks', async (): Promise<void> => {
fs.emptyDirSync(supportDir);
const newBlocks = ['test', 'block'];

newBlocks.map((block) => newBlockDefinition(supportDir, block));
newBlocks.forEach((block) => newBlockDefinition(supportDir, block));

const blocks = blockDefinitions(supportDir);
const blocks = await blockDefinitions(supportDir);
const numberOfBlocks = blocks.length;

t.assert(numberOfBlocks === 2);
expect(numberOfBlocks).toBe(2);
});

test('creating a package.json', async (t: Context): Promise<void> => {
test('creating a package.json', async (): Promise<void> => {
const packageJson = JSON.stringify(
{
name: 'test',
version: '1.0.0',
private: 'true',
dependencies: {
lodash: '^4.17.21',
case: '^1.6.3',
},
name: 'test',
private: 'true',
version: '1.0.0',
},
null,
2,
);

t.assert(
createPackageJson('test', '__tests__/blocks/rootPackage.json', [
'lodash',
]) === packageJson,
);
expect(
createPackageJson('test', '__tests__/blocks/rootPackage.json', ['case']),
).toBe(packageJson);
});
2 changes: 1 addition & 1 deletion __tests__/blocks/rootPackage.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "1.0.0",
"private": "true",
"dependencies": {
"lodash": "^4.17.21"
"case": "^1.6.3"
}
}
Loading