Skip to content

Commit 6d080a1

Browse files
feat(publish): export ESM module (#12)
* chore(deps-dev): bump aegir from 36.2.3 to 37.0.15 Bumps [aegir](https://github.com/ipfs/aegir) from 36.2.3 to 37.0.15. - [Release notes](https://github.com/ipfs/aegir/releases) - [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md) - [Commits](ipfs/aegir@v36.2.3...v37.0.15) --- updated-dependencies: - dependency-name: aegir dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * chore(dep): aegir@37 upgrade * chore: generate openapi client only once during postinstall * chore: clean up build process * chore: use aegir/chai path * chore: update aegir config * trying to get tests to succeed * attempting to create eslint rule to add extensions automatically * making progress on rule * add js extensions to generated code * fix: aegir build and test * fix: aegir build and test * remove patch-package * fix eslint * fix(lint): aegir lint succeeds * fix: typecheck workflow succeeds * fix: aegir dep-check * attempt to fix workflows Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Russell Dempsey <[email protected]>
1 parent e781f2f commit 6d080a1

30 files changed

+261
-268
lines changed

.aegir.cjs renamed to .aegir.js

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
1-
require('ts-node').register({
2-
project: 'tsconfig.json',
3-
})
4-
5-
const { MockServerController } = require('./test/MockServerController')
6-
1+
import { MockServerController } from './dist/test/MockServerController.js'
72

83
/** @type {import('aegir').PartialOptions} */
9-
module.exports = {
4+
const config = {
105
docs: {
116
publish: true,
127
entryPoint: './'
138
},
14-
tsRepo: true,
159
build: {
1610
config: {
1711
platform: 'node'
1812
},
1913
bundlesizeMax: '44KB'
2014
},
2115
test: {
16+
build: false,
17+
progress: true,
2218
cov: false,
2319
async before () {
2420
return {
@@ -29,12 +25,13 @@ module.exports = {
2925
}
3026
},
3127
/**
32-
*
33-
* @param {GlobalOptions & TestOptions} _
34-
* @param {MockServerController} controller
28+
* @param {import('aegir').GlobalOptions & import('aegir').TestOptions} _
29+
* @param { {controller: MockServerController} } beforeResult
3530
*/
3631
async after (_, {controller}) {
3732
await controller.shutdown()
3833
}
3934
}
4035
}
36+
37+
export default config

.eslintrc.json

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint", "import"],
5+
"extends": ["ipfs"],
6+
"overrides": [
7+
{
8+
"parserOptions": {
9+
"project": "tsconfig.json"
10+
},
11+
"files": [
12+
"./src/**/*.ts",
13+
"./types/**/*.ts"
14+
],
15+
"rules": {
16+
"@typescript-eslint/strict-boolean-expressions": "off"
17+
}
18+
},
19+
{
20+
"parserOptions": {
21+
"project": ["tsconfig.MockServerController.json", "tsconfig.json"]
22+
},
23+
"files": "./test/**/*.ts"
24+
},
25+
{
26+
"extends": [],
27+
"parserOptions": {
28+
"project": "tsconfig.generated.json"
29+
},
30+
"files": "./generated/fetch/src/**/*.ts",
31+
"rules": {
32+
"semi": "off",
33+
"indent": "off",
34+
"no-unused-vars": "off",
35+
"no-undef": "off",
36+
"@typescript-eslint/strict-boolean-expressions": "off"
37+
}
38+
}
39+
],
40+
"ignorePatterns": ["*.js", "dist/**/*.d.ts", "dist.generated/**/*.d.ts", "dist.generated/**/*.{j,t}s", "dist/**/*.j,t}s"]
41+
}

.github/workflows/automerge.yml

+4-46
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,8 @@
1-
# Automatically merge pull requests opened by web3-bot, as soon as (and only if) all tests pass.
2-
# This reduces the friction associated with updating with our workflows.
3-
4-
on: [ pull_request ]
51
name: Automerge
2+
on: [ pull_request ]
63

74
jobs:
8-
automerge-check:
9-
if: github.event.pull_request.user.login == 'web3-bot'
10-
runs-on: ubuntu-latest
11-
outputs:
12-
status: ${{ steps.should-automerge.outputs.status }}
13-
steps:
14-
- uses: actions/checkout@v2
15-
with:
16-
fetch-depth: 0
17-
- name: Check if we should automerge
18-
id: should-automerge
19-
run: |
20-
for commit in $(git rev-list --first-parent origin/${{ github.event.pull_request.base.ref }}..${{ github.event.pull_request.head.sha }}); do
21-
committer=$(git show --format=$'%ce' -s $commit)
22-
echo "Committer: $committer"
23-
if [[ "$committer" != "[email protected]" ]]; then
24-
echo "Commit $commit wasn't committed by web3-bot, but by $committer."
25-
echo "::set-output name=status::false"
26-
exit
27-
fi
28-
done
29-
echo "::set-output name=status::true"
305
automerge:
31-
needs: automerge-check
32-
runs-on: ubuntu-latest
33-
# The check for the user is redundant here, as this job depends on the automerge-check job,
34-
# but it prevents this job from spinning up, just to be skipped shortly after.
35-
if: github.event.pull_request.user.login == 'web3-bot' && needs.automerge-check.outputs.status == 'true'
36-
steps:
37-
- name: Wait on tests
38-
uses: lewagon/wait-on-check-action@bafe56a6863672c681c3cf671f5e10b20abf2eaa # v0.2
39-
with:
40-
ref: ${{ github.event.pull_request.head.sha }}
41-
repo-token: ${{ secrets.GITHUB_TOKEN }}
42-
wait-interval: 10
43-
running-workflow-name: 'automerge' # the name of this job
44-
- name: Merge PR
45-
uses: pascalgn/automerge-action@741c311a47881be9625932b0a0de1b0937aab1ae # v0.13.1
46-
env:
47-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
48-
MERGE_LABELS: ""
49-
MERGE_METHOD: "squash"
50-
MERGE_DELETE_BRANCH: true
6+
uses: protocol/.github/.github/workflows/automerge.yml@master
7+
with:
8+
job: 'automerge'

.github/workflows/js-test-and-release.yml

+21-41
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,26 @@ jobs:
1616
- uses: actions/setup-node@v2
1717
with:
1818
node-version: lts/*
19-
- name: Install dependencies
20-
run: npm install
21-
- name: Generate client files
22-
run: npm run gen
23-
- name: lint
24-
run: npm run --if-present lint
25-
- name: dependency check
26-
run: npm run --if-present dep-check
19+
- uses: ipfs/aegir/actions/cache-node-modules@master
20+
- run: npm run --if-present prepareAegir
21+
- run: npm run --if-present lint
22+
- run: npm run --if-present dep-check
2723

2824
test-node:
2925
needs: check
3026
runs-on: ${{ matrix.os }}
3127
strategy:
3228
matrix:
3329
os: [windows-latest, ubuntu-latest, macos-latest]
34-
node: ['lts/*']
30+
node: [16]
3531
fail-fast: true
3632
steps:
3733
- uses: actions/checkout@v2
3834
- uses: actions/setup-node@v2
3935
with:
4036
node-version: ${{ matrix.node }}
41-
- name: Install dependencies
42-
run: npm install
43-
- name: Generate client files
44-
run: npm run gen
37+
- uses: ipfs/aegir/actions/cache-node-modules@master
38+
- run: npm run --if-present prepareAegir
4539
- run: npm run --if-present test:node
4640
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
4741
with:
@@ -56,10 +50,8 @@ jobs:
5650
- uses: actions/setup-node@v2
5751
with:
5852
node-version: lts/*
59-
- name: Install dependencies
60-
run: npm install
61-
- name: Generate client files
62-
run: npm run gen
53+
- uses: ipfs/aegir/actions/cache-node-modules@master
54+
- run: npm run --if-present prepareAegir
6355
- run: npm run --if-present test:chrome
6456
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
6557
with:
@@ -74,10 +66,8 @@ jobs:
7466
- uses: actions/setup-node@v2
7567
with:
7668
node-version: lts/*
77-
- name: Install dependencies
78-
run: npm install
79-
- name: Generate client files
80-
run: npm run gen
69+
- uses: ipfs/aegir/actions/cache-node-modules@master
70+
- run: npm run --if-present prepareAegir
8171
- run: npm run --if-present test:chrome-webworker
8272
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
8373
with:
@@ -92,10 +82,8 @@ jobs:
9282
- uses: actions/setup-node@v2
9383
with:
9484
node-version: lts/*
95-
- name: Install dependencies
96-
run: npm install
97-
- name: Generate client files
98-
run: npm run gen
85+
- uses: ipfs/aegir/actions/cache-node-modules@master
86+
- run: npm run --if-present prepareAegir
9987
- run: npm run --if-present test:firefox
10088
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
10189
with:
@@ -110,10 +98,8 @@ jobs:
11098
- uses: actions/setup-node@v2
11199
with:
112100
node-version: lts/*
113-
- name: Install dependencies
114-
run: npm install
115-
- name: Generate client files
116-
run: npm run gen
101+
- uses: ipfs/aegir/actions/cache-node-modules@master
102+
- run: npm run --if-present prepareAegir
117103
- run: npm run --if-present test:firefox-webworker
118104
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
119105
with:
@@ -128,10 +114,8 @@ jobs:
128114
- uses: actions/setup-node@v2
129115
with:
130116
node-version: lts/*
131-
- name: Install dependencies
132-
run: npm install
133-
- name: Generate client files
134-
run: npm run gen
117+
- uses: ipfs/aegir/actions/cache-node-modules@master
118+
- run: npm run --if-present prepareAegir
135119
- run: npx xvfb-maybe npm run --if-present test:electron-main
136120
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
137121
with:
@@ -146,10 +130,8 @@ jobs:
146130
- uses: actions/setup-node@v2
147131
with:
148132
node-version: lts/*
149-
- name: Install dependencies
150-
run: npm install
151-
- name: Generate client files
152-
run: npm run gen
133+
- uses: ipfs/aegir/actions/cache-node-modules@master
134+
- run: npm run --if-present prepareAegir
153135
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
154136
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
155137
with:
@@ -167,10 +149,8 @@ jobs:
167149
- uses: actions/setup-node@v2
168150
with:
169151
node-version: lts/*
170-
- name: Install dependencies
171-
run: npm install
172-
- name: Generate client files
173-
run: npm run gen
152+
- uses: ipfs/aegir/actions/cache-node-modules@master
153+
- run: npm run --if-present prepareAegir
174154
- uses: ipfs/aegir/actions/docker-login@master
175155
with:
176156
docker-token: ${{ secrets.DOCKER_TOKEN }}

.github/workflows/typecheck.yml

-36
This file was deleted.

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ generated/fetch/package.json
1818
generated/fetch/tsconfig.json
1919
tsconfig-types.aegir.tsbuildinfo
2020
docs
21+
.env
22+
dist.test
23+
logs
24+
.tsbuildinfo*
25+
# generated by nektos/act cli
26+
workflow

.vscode/settings.json

+7
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,11 @@
33
"typescript.format.semicolons": "remove",
44
"javascript.format.semicolons": "remove",
55
"typescript.suggest.includeAutomaticOptionalChainCompletions": true,
6+
"cSpell.words": [
7+
"openapi",
8+
"openapitools",
9+
"postgen",
10+
"posttest",
11+
"pregen"
12+
],
613
}

generated/fetch/src/apis/PinsApi.ts

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/fetch/src/apis/index.ts

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/fetch/src/index.ts

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/fetch/src/models/Failure.ts

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/fetch/src/models/FailureError.ts

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/fetch/src/models/Pin.ts

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)