Skip to content

Commit 2cf7e92

Browse files
committed
Initial release
- Changelog - Release-It - README - Linting - Building
1 parent 5608745 commit 2cf7e92

File tree

13 files changed

+3730
-71
lines changed

13 files changed

+3730
-71
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

.eslintrc.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
},
5+
plugins: ['prettier', 'unicorn'],
6+
extends: ['eslint:recommended', 'plugin:prettier/recommended', 'plugin:unicorn/recommended'],
7+
8+
overrides: [
9+
{
10+
files: ['.eslintrc.js'],
11+
env: {
12+
browser: false,
13+
node: true,
14+
},
15+
rules: {
16+
'unicorn/prefer-module': 'off',
17+
},
18+
},
19+
],
20+
};

.npmignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.gitignore
2+
.pnpm-lock.yaml
3+
.prettierignore
4+
.prettierrc.js
5+
.release-it.js
6+
node_modules
7+
RELEASE.md
8+
rollup.config.js

.prettierignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# compiled output
2+
/dist/
3+
4+
# dependencies
5+
/node_modules/
6+
7+
# misc
8+
/coverage/
9+
!.*
10+
.eslintcache

.prettierrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
3+
module.exports = {
4+
singleQuote: true,
5+
printWidth: 100,
6+
};

.release-it.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
plugins: {
3+
'release-it-lerna-changelog': {
4+
infile: 'CHANGELOG.md',
5+
},
6+
},
7+
git: {
8+
commitMessage: 'v${version}',
9+
tagName: 'v${version}',
10+
},
11+
github: {
12+
release: true,
13+
releaseName: 'v${version}',
14+
tokenRef: 'GITHUB_AUTH',
15+
},
16+
npm: {
17+
publish: false,
18+
},
19+
};

README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,32 @@
1-
# JavaScriptSDK
2-
JavaScript Package to send TelemetryDeck signals
1+
# Telemetry Deck JavaScript SDK
2+
3+
Support modern evergreen browsers which support [cryptography](https://caniuse.com/cryptography).
4+
5+
## Usage
6+
7+
### For applications that use a bundler (like Webpack, Rollup, …)
8+
9+
```js
10+
import { signal } from 'telemetry-deck';
11+
12+
//
13+
signal(
14+
// required options to identify your app and the user
15+
{
16+
appID: 'YOUR_APP_ID',
17+
userIdentifier: 'ANONYMOUS',
18+
},
19+
// custom payload stored with the signal
20+
{
21+
route: 'some/page/path',
22+
}
23+
);
24+
```
25+
26+
### For situations where you just want to add a script tag and generate signals
27+
28+
[UNPKG](https://unpkg.com) is a free CDN which allows you to load files from any npm package.
29+
30+
```html
31+
<script src="https://unpkg.com/@telemtrydeck/sdk/dist/telemetrydeck.min.js">
32+
```

RELEASE.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Release
2+
3+
Releases are mostly automated using
4+
[release-it](https://github.com/release-it/release-it/) and
5+
[lerna-changelog](https://github.com/lerna/lerna-changelog/).
6+
7+
## Preparation
8+
9+
Since the majority of the actual release process is automated, the primary
10+
remaining task prior to releasing is confirming that all pull requests that
11+
have been merged since the last release have been labeled with the appropriate
12+
`lerna-changelog` labels and the titles have been updated to ensure they
13+
represent something that would make sense to our users. Some great information
14+
on why this is important can be found at
15+
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
16+
guiding principle here is that changelogs are for humans, not machines.
17+
18+
When reviewing merged PR's the labels to be used are:
19+
20+
- breaking - Used when the PR is considered a breaking change.
21+
- enhancement - Used when the PR adds a new feature or enhancement.
22+
- bug - Used when the PR fixes a bug included in a previous release.
23+
- documentation - Used when the PR adds or updates documentation.
24+
- internal - Used for internal changes that still require a mention in the
25+
changelog/release notes.
26+
27+
## Release
28+
29+
Once the prep work is completed, the actual release is straight forward:
30+
31+
- First, ensure that you have an environment variable with your GitHub token
32+
setup as `GITHUB_AUTH`. This token will be used for generating your changelog
33+
(unauthenticated requests to the GitHub API are heavily throttled) and for
34+
creating the GitHub release. Only "repo" access is needed; no "admin"
35+
or other scopes are required.
36+
37+
- Next, ensure that you have installed your projects dependencies:
38+
39+
```
40+
pnpm install
41+
```
42+
43+
- And last (but not least 😁) do your release:
44+
45+
```
46+
pnpm release
47+
```
48+
49+
[release-it](https://github.com/release-it/release-it/) manages the actual
50+
release process. It will prompt you to to choose the version number after which
51+
you will have the chance to hand tweak the changelog to be used (for the
52+
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
53+
pushing the tag and commits, etc. Finally GitHub Actions will build the commit
54+
and push the release to npm.
55+
56+
### Credits
57+
58+
Thie initial version of this document was copied from [ember-test-selectors](https://github.com/simplabs/ember-test-selectors/blob/master/RELEASE.md)

package.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "@telemetrydeck/sdk",
3+
"version": "0.1.0",
4+
"description": "JavaScript package to send TelemetryDeck signals",
5+
"main": "dist/telemetrydeck.js",
6+
"module": "src/telemetrydeck.js",
7+
"scripts": {
8+
"build": "rollup -c",
9+
"changelog": "lerna-changelog",
10+
"lint": "eslint . --cache",
11+
"lint:fix": "eslint . --fix",
12+
"release": "release-it",
13+
"test": "echo \"Error: no test specified yet\" && exit 1"
14+
},
15+
"repository": {
16+
"type": "git",
17+
"url": "git+https://github.com/TelemetryDeck/JavaScriptSDK.git"
18+
},
19+
"keywords": [
20+
"TelemetryDeck",
21+
"tracking",
22+
"analytics",
23+
"sdk"
24+
],
25+
"author": "Daniel Jilg <daniel@telemetrydeck.com>",
26+
"contributors": [
27+
"Florian Pichler <florian.pichler@simplabs.com> (https://florian.pichler.de)"
28+
],
29+
"license": "MIT",
30+
"bugs": {
31+
"url": "https://github.com/TelemetryDeck/JavaScriptSDK/issues"
32+
},
33+
"homepage": "https://github.com/TelemetryDeck/JavaScriptSDK#readme",
34+
"devDependencies": {
35+
"@rollup/plugin-json": "^4.1.0",
36+
"eslint": "^8.6.0",
37+
"eslint-config-prettier": "^8.3.0",
38+
"eslint-plugin-prettier": "^4.0.0",
39+
"eslint-plugin-unicorn": "^40.0.0",
40+
"lerna-changelog": "^2.2.0",
41+
"prettier": "^2.5.1",
42+
"release-it": "^14.12.1",
43+
"release-it-lerna-changelog": "^4.0.1",
44+
"rollup": "^2.63.0",
45+
"rollup-plugin-terser": "^7.0.2"
46+
}
47+
}

0 commit comments

Comments
 (0)