Skip to content

Commit 1fe688b

Browse files
committed
Initial commit.
0 parents  commit 1fe688b

Some content is hidden

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

60 files changed

+2434
-0
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
9+
[*.md]
10+
insert_final_newline = false
11+
trim_trailing_whitespace = false
12+
13+
[*.{js,json,ts,mts,yml,yaml}]
14+
indent_size = 2
15+
indent_style = space
16+
17+
max_line_length = 120
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Post release task for {{ env.NEW_VERSION }}
3+
assignees: Syndesi
4+
labels: Post Release
5+
---
6+
7+
Open tasks:
8+
9+
- [ ] Upload Originstamp-certificates for the [release {{ env.NEW_VERSION }}](https://github.com/ember-nexus/app-core/releases/tag/{{ env.NEW_VERSION }}).
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Release package
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
release-type:
6+
description: 'Release type (one of): patch, minor, major, prepatch, preminor, premajor, prerelease'
7+
required: true
8+
permissions:
9+
contents: write
10+
jobs:
11+
release-package:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
# see also https://github.com/Nautilus-Cyberneering/pygithub
18+
- name: Import GPG key
19+
id: import-gpg
20+
uses: crazy-max/ghaction-import-gpg@v6
21+
with:
22+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
23+
passphrase: ${{ secrets.PASSPHRASE }}
24+
git_user_signingkey: true
25+
git_commit_gpgsign: true
26+
27+
- name: GPG user IDs
28+
run: |
29+
echo "fingerprint: ${{ steps.import-gpg.outputs.fingerprint }}"
30+
echo "keyid: ${{ steps.import-gpg.outputs.keyid }}"
31+
echo "name: ${{ steps.import-gpg.outputs.name }}"
32+
echo "email: ${{ steps.import-gpg.outputs.email }}"
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
registry-url: https://registry.npmjs.org/
38+
node-version: '20'
39+
40+
- name: Git configuration
41+
run: |
42+
git config --global user.email "${{ steps.import-gpg.outputs.email }}"
43+
git config --global user.name "${{ steps.import-gpg.outputs.name }}"
44+
45+
- name: Bump release version
46+
if: startsWith(github.event.inputs.release-type, 'pre') != true
47+
run: |
48+
echo "NEW_VERSION=$(npm --no-git-tag-version --tag-version-prefix= version $RELEASE_TYPE)" >> $GITHUB_ENV
49+
echo "RELEASE_TAG=latest" >> $GITHUB_ENV
50+
env:
51+
RELEASE_TYPE: ${{ github.event.inputs.release-type }}
52+
53+
- name: Bump pre-release version
54+
if: startsWith(github.event.inputs.release-type, 'pre')
55+
run: |
56+
echo "NEW_VERSION=$(npm --no-git-tag-version --tag-version-prefix= --preid=beta version $RELEASE_TYPE
57+
echo "RELEASE_TAG=beta" >> $GITHUB_ENV
58+
env:
59+
RELEASE_TYPE: ${{ github.event.inputs.release-type }}
60+
61+
- name: Update changelog
62+
uses: superfaceai/release-changelog-action@v3
63+
with:
64+
path-to-changelog: CHANGELOG.md
65+
version: ${{ env.NEW_VERSION }}
66+
operation: release
67+
68+
- name: Commit CHANGELOG.md and package.json changes and create tag
69+
run: |
70+
git add "package.json"
71+
git add "CHANGELOG.md"
72+
git commit -m "chore: release ${{ env.NEW_VERSION }}"
73+
git tag ${{ env.NEW_VERSION }}
74+
75+
- name: Build
76+
run: |
77+
yarn install --dev
78+
yarn build
79+
80+
- name: Publish
81+
run: yarn publish --verbose --access public --tag ${{ env.RELEASE_TAG }}
82+
env:
83+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
84+
85+
- name: Create local package
86+
run: |
87+
yarn pack --filename "ember-nexus-web-registry-${{ env.NEW_VERSION }}.tar.gz"
88+
ls -lah
89+
pwd
90+
91+
- name: Push changes to repository
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
run: |
95+
git push origin && git push --tags
96+
97+
- id: get-changelog
98+
name: Get version changelog
99+
uses: superfaceai/release-changelog-action@v3
100+
with:
101+
path-to-changelog: CHANGELOG.md
102+
version: ${{ env.NEW_VERSION }}
103+
operation: read
104+
105+
- name: Update GitHub release documentation
106+
uses: softprops/action-gh-release@v2
107+
with:
108+
tag_name: ${{ env.NEW_VERSION }}
109+
body: ${{ steps.get-changelog.outputs.changelog }}
110+
prerelease: ${{ startsWith(github.event.inputs.release-type, 'pre') }}
111+
token: ${{ secrets.RELEASE_TOKEN }}
112+
files: ember-nexus-web-registry-${{ env.NEW_VERSION }}.tar.gz
113+
114+
- name: Initiate Originstamp certificate
115+
run: |
116+
curl -X POST "http://api.originstamp.com/v4/timestamp/create" \
117+
-H "Content-Type: application/json" \
118+
-H "Authorization: ${{ secrets.ORIGINSTAMP_AUTH_TOKEN }}" \
119+
-d \
120+
"{
121+
\"comment\": \"Release ${{ env.NEW_VERSION }} of ember-nexus/app-core\",
122+
\"hash\": \"${{ env.SHA }}\"
123+
}"
124+
env:
125+
SHA: ${{ github.sha }}
126+
127+
- uses: JasonEtco/create-an-issue@v2
128+
env:
129+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
130+
NEW_VERSION: ${{ env.NEW_VERSION }}
131+
with:
132+
filename: .github/ISSUE_TEMPLATE_POST_RELEASE_TASK.md

.github/workflows/ci-test.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Test
2+
3+
on:
4+
- push
5+
6+
jobs:
7+
8+
yml-lint:
9+
runs-on: ubuntu-latest
10+
name: 'YML lint'
11+
timeout-minutes: 3
12+
steps:
13+
- uses: actions/checkout@v4
14+
- run: docker pull cytopia/yamllint
15+
- run: docker run --rm -t -v $(pwd):/data cytopia/yamllint --config-file=test/.yamllint .
16+
17+
markdown-lint:
18+
runs-on: ubuntu-latest
19+
name: 'Markdown lint'
20+
timeout-minutes: 3
21+
steps:
22+
- uses: actions/checkout@v4
23+
- run: docker pull tmknom/markdownlint
24+
- run: docker run --rm -v $(pwd):/work tmknom/markdownlint '**/*.md' --config test/.markdownlintrc --ignore node_modules --ignore CHANGELOG.md --ignore var --ignore tmp
25+
26+
code-style:
27+
runs-on: ubuntu-latest
28+
name: 'Code style @ Node v${{ matrix.node-version }}'
29+
needs:
30+
- yml-lint
31+
- markdown-lint
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
node-version: ['20', '21', '22']
36+
steps:
37+
- uses: actions/setup-node@v4
38+
with:
39+
node-version: '${{ matrix.node-version }}'
40+
- uses: actions/checkout@v4
41+
- name: 'Cache node_modules'
42+
uses: actions/cache@v4
43+
with:
44+
path: ~/.npm
45+
key: ${{ runner.os }}-node-v${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
46+
restore-keys: |
47+
${{ runner.os }}-node-v${{ matrix.node-version }}-
48+
- name: Install dependencies
49+
run: yarn install --dev
50+
- name: Run syntax linter
51+
run: yarn cs
52+
53+
test-unit:
54+
runs-on: ubuntu-latest
55+
name: 'Unit tests @ Node v${{ matrix.node-version }}'
56+
needs:
57+
- yml-lint
58+
- markdown-lint
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
node-version: ['20', '21', '22']
63+
steps:
64+
- uses: actions/setup-node@v4
65+
with:
66+
node-version: '${{ matrix.node-version }}'
67+
- uses: actions/checkout@v4
68+
- name: 'Cache node_modules'
69+
uses: actions/cache@v4
70+
with:
71+
path: ~/.npm
72+
key: ${{ runner.os }}-node-v${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
73+
restore-keys: |
74+
${{ runner.os }}-node-v${{ matrix.node-version }}-
75+
- name: Install dependencies
76+
run: yarn install --dev
77+
- name: Run unit tests
78+
run: yarn test:unit
79+
80+
test-feature:
81+
runs-on: ubuntu-latest
82+
name: 'Feature tests @ Node v${{ matrix.node-version }}'
83+
needs:
84+
- yml-lint
85+
- markdown-lint
86+
strategy:
87+
fail-fast: false
88+
matrix:
89+
node-version: ['20', '21', '22']
90+
if: false
91+
steps:
92+
- uses: actions/setup-node@v4
93+
with:
94+
node-version: '${{ matrix.node-version }}'
95+
- uses: actions/checkout@v4
96+
- name: 'Cache node_modules'
97+
uses: actions/cache@v4
98+
with:
99+
path: ~/.npm
100+
key: ${{ runner.os }}-node-v${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
101+
restore-keys: |
102+
${{ runner.os }}-node-v${{ matrix.node-version }}-
103+
- name: Install dependencies
104+
run: yarn install --dev
105+
- name: Run feature tests
106+
run: yarn test:feature
107+
108+
test-unit-coverage:
109+
runs-on: ubuntu-latest
110+
name: 'Unit test coverage'
111+
needs:
112+
- test-unit
113+
if: github.ref == 'refs/heads/main'
114+
steps:
115+
- uses: actions/setup-node@v4
116+
with:
117+
node-version: '22'
118+
- uses: actions/checkout@v4
119+
- name: 'Cache node_modules'
120+
uses: actions/cache@v4
121+
with:
122+
path: ~/.npm
123+
key: ${{ runner.os }}-node-v22-${{ hashFiles('**/package.json') }}
124+
restore-keys: |
125+
${{ runner.os }}-node-v22-
126+
- name: Install dependencies
127+
run: yarn install --dev
128+
- name: Run unit tests
129+
run: yarn test:unit
130+
- name: Upload coverage reports to Codecov
131+
uses: codecov/codecov-action@v4
132+
with:
133+
fail_ci_if_error: true
134+
files: ./coverage/cobertura-coverage.xml
135+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Dependencies
7+
node_modules/
8+
yarn.lock
9+
10+
# Coverage
11+
coverage
12+
13+
# Transpiled files
14+
dist/
15+
16+
# VS Code
17+
.vscode
18+
!.vscode/tasks.js
19+
20+
# JetBrains IDEs
21+
.idea/
22+
23+
# Optional npm cache directory
24+
.npm
25+
26+
# Optional eslint cache
27+
.eslintcache
28+
29+
# Misc
30+
.DS_Store
31+
32+
*.tgz

.mocharc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"slow": 400
3+
}

.npmignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
docs
2+
test
3+
src
4+
.github
5+
node_modules
6+
coverage
7+
.editorconfig
8+
eslint.config.mjs
9+
.mocharc.json
10+
.prettierrc
11+
jest.config.ts
12+
tsconfig.browser.json
13+
tsconfig.esm.json
14+
tsconfig.json
15+
tsconfig.test.json
16+
typedoc.json
17+
webpack.config.cjs

.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.mts"],
7+
"options": {
8+
"parser": "typescript"
9+
}
10+
}
11+
]
12+
}

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## Unreleased
8+
9+
### Added
10+
- Initial code, copied from Ember Nexus Web SDK.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Ember-Nexus
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)