Skip to content

Commit e6b3162

Browse files
Build tooling and packaging updates (#46)
- Remove DeviceVersion exported const enum in favour of a union (breaking change due for code like `DeviceVersion.V1` but not expected to have wide impact. The values are unchanged.). - Remove UMD build. Stop offering a browser oriented bundle. - If we know of any real-world script-tag-only users then I'm open to reinstating this but I'm really dubious it's worth it. - CJS now uses dependencies rather than bundles to aid use alongside microbit-connection (avoiding duplicating nrf-intel-hex in that scenario). - Fix ES module so it works with Node's ES module support (exports in package.json, .js file extensions on imports) - Emit more modern JavaScript (ES2021, consistent with microbit-connection). - Consolidate documentation into typedoc - Move the markdown content into typedoc's build so we don't have separation and simplify - Drop the unmaintained theme - Move to GHA publishing it to GitHub pages - This is now simple enough I can imaging rolling it out to other libraries - Update linting, TypeScript etc. - Intending to port most of this to typescript-library-starter, but hopefully using NodeNext there. - Stuck on "node10" TypeScript bundleResolution for the same reason as microbit-foundation/microbit-connection#51 Other than DeviceVersion there's no code-level behaviour change but it's likely also a breaking change due to the ES2020 emit and the packaging changes so bumping version to 0.10.0. I think it should generally be easier to consume in modern projects while still working in CJS/webpack 5 type setups.
1 parent 8b4343c commit e6b3162

File tree

80 files changed

+2997
-17627
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2997
-17627
lines changed

.github/workflows/build-docs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: build-docs
2+
on:
3+
release:
4+
types: [created]
5+
push:
6+
branches:
7+
- master
8+
tags:
9+
- '**'
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Setup Pages
17+
uses: actions/configure-pages@v5
18+
- run: npm ci
19+
- name: Build docs
20+
run: npm run docs
21+
- name: Upload artifact
22+
uses: actions/upload-pages-artifact@v3
23+
with:
24+
path: ./docs/build
25+
26+
deploy:
27+
permissions:
28+
pages: write
29+
id-token: write
30+
environment:
31+
name: github-pages
32+
url: ${{ steps.deployment.outputs.page_url }}
33+
runs-on: ubuntu-latest
34+
needs: build
35+
steps:
36+
- name: Deploy to GitHub Pages
37+
id: deployment
38+
uses: actions/deploy-pages@v4

.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ jobs:
1818
registry-url: 'https://registry.npmjs.org'
1919
cache: npm
2020
- run: npm ci
21-
- run: npm run test:coverage
22-
- run: npm run build
21+
- run: npm run ci
2322
- run: npm publish
2423
if: github.event_name == 'release' && github.event.action == 'created'
2524
env:

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ lib-fesm
1313
fesm
1414
umd
1515
bundles
16-
dist
16+
dist/
1717

1818
## this is generated by `npm pack`
1919
*.tgz
2020
package
2121

22+
docs/build/
23+
2224
# This is just for personal use
2325
ignore/

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ examples
3030
## this is generated by `npm pack`
3131
*.tgz
3232
package
33+
34+
**/__tests__/**

.vscode/settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@
88
"typescript.implementationsCodeLens.enabled": true,
99
"typescript.referencesCodeLens.enabled": true,
1010
"javascript.referencesCodeLens.enabled": true,
11-
"editor.rulers": [
12-
80,100
13-
]
11+
"editor.rulers": [80, 100]
1412
}

CONTRIBUTING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
Thanks for looking here! We'd love your help. The micro:bit project is only
22
possible through contributions of companies and individuals around the world.
33

4-
This project is managed on GitHub, and the best way to contribute is to jump in
5-
and fix/file issues.
6-
7-
https://github.com/microbit-foundation/microbit-fs
4+
This project is managed [in this GitHub project](https://github.com/microbit-foundation/microbit-fs), and the best way to contribute
5+
is to jump in and fix/file issues.
86

97
If you're interested in working on any of these items, please file an issue
108
and mention @microbit-carlos.

config/global.d.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

config/jest.config.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

config/rollup.config.js

Lines changed: 0 additions & 107 deletions
This file was deleted.

config/setup-tests.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)