Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding base countly metric functionality #1

Merged
merged 26 commits into from
Dec 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0af3709
feat: adding base countly metric functionality
0xDanomite Dec 9, 2022
b94ca42
feat: updated metrics library stroies and removing unnecessary files
0xDanomite Dec 10, 2022
41c7d93
feature: 129 - updated stories and styling
0xDanomite Dec 12, 2022
9af6fae
feature: 129 - updated children styling
0xDanomite Dec 12, 2022
5ae69da
fix: npm install on mac
SgtPooki Dec 13, 2022
9a64394
chore: ignore storybook-static folder from build-storybook
SgtPooki Dec 13, 2022
98c8557
fix: build-storybook errors
SgtPooki Dec 13, 2022
3b5b194
fix: fleek build
SgtPooki Dec 13, 2022
b4b2f6b
chore: run aegir check-project
SgtPooki Dec 13, 2022
cd00736
chore: set lead maintainer
SgtPooki Dec 13, 2022
b065196
feat: get aegir lint & build working
SgtPooki Dec 14, 2022
b5f7b6a
chore: overwrite dist/**/*.css files on build
SgtPooki Dec 14, 2022
931bd10
chore: include dist folder in npm package
SgtPooki Dec 14, 2022
2de49e5
fix: npm run build-storybook
SgtPooki Dec 14, 2022
b725feb
fix: storybook rendering
SgtPooki Dec 14, 2022
ec17cc8
feature: pr updates and storybook edits
0xDanomite Dec 14, 2022
71334d2
feature: pr updates - removed unnecessary code/comments
0xDanomite Dec 14, 2022
fd1d952
fix(lint): build passes
SgtPooki Dec 14, 2022
40d5de4
fix: updated import path
0xDanomite Dec 15, 2022
3c8b440
fix: importing into ipfs-companion
SgtPooki Dec 15, 2022
e74dd5d
fix: esbuild testing with cssModules plugins
0xDanomite Dec 16, 2022
2cc6133
feat: update metrics
SgtPooki Dec 16, 2022
2921c2c
feat: address check_consent bug
SgtPooki Dec 16, 2022
925cb00
feat: disable auto sessions
SgtPooki Dec 17, 2022
e195fca
fix: call end_session inside endSession
SgtPooki Dec 17, 2022
f4431f5
feat: basic managed sessions
SgtPooki Dec 17, 2022
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
44 changes: 44 additions & 0 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import copyfiles from 'copyfiles'
import cssModulesPlugin from 'esbuild-css-modules-plugin'

/** @type {import('aegir').PartialOptions} */
export default {
docs: {
publish: true,
entryPoint: './docs'
},
tsRepo: true,
build: {
types: true,
config: {
format: 'esm',
external: ['electron', '#ansi-styles', 'yargs/yargs', '#supports-color'],
plugins: [
{
name: 'custom-css-copy',
async setup(build) {
/**
* This ensures that the CSS files ARE bundled in the final build and that the esbuild run (triggered by aegir)
* copies over the .css files prior to doing other things. (because tsc does not copy them over).
*
* This is essentially the solution for not being able to do something like
*/// `aegir build --tool=tsc && copyfiles -u 1 src/**/*.css dist/ && aegir build --tool=esbuild`
/***/
return new Promise((resolve, reject) => {
copyfiles(['src/**/*.css', 'dist/'], {up: 0, soft: false}, (err) => {
if (err) {
reject(err)
} else {
resolve()
}
})
});
},
},
cssModulesPlugin(),
]
},
bundlesizeMax: '44KB',
},
test: {}
}
14 changes: 14 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": [
"ipfs"
],
"env": {
"es2021": true,
"node": true
},
"parserOptions": {
"sourceType": "module"
},
"rules": {
}
}
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
commit-message:
prefix: "deps"
prefix-development: "deps(dev)"
8 changes: 8 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Automerge
on: [ pull_request ]

jobs:
automerge:
uses: protocol/.github/.github/workflows/automerge.yml@master
with:
job: 'automerge'
143 changes: 143 additions & 0 deletions .github/workflows/js-test-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: test & maybe release
on:
push:
branches:
- main # with #262 - ${{{ github.default_branch }}}
pull_request:

jobs:

check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present lint
- run: npm run --if-present dep-check

test-node:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
node: [lts/*]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:node
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: node

test-chrome:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:chrome
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: chrome

test-chrome-webworker:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:chrome-webworker
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: chrome-webworker

test-firefox:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:firefox
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: firefox

test-firefox-webworker:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:firefox-webworker
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: firefox-webworker

test-electron-main:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npx xvfb-maybe npm run --if-present test:electron-main
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: electron-main

test-electron-renderer:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: electron-renderer

release:
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-electron-main, test-electron-renderer]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main' # with #262 - 'refs/heads/${{{ github.default_branch }}}'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- uses: ipfs/aegir/actions/docker-login@master
with:
docker-token: ${{ secrets.DOCKER_TOKEN }}
docker-username: ${{ secrets.DOCKER_USERNAME }}
- run: npm run --if-present release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd highly recommend getting familiar with gitignore.io. https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,windows,linux,node is a great default for our projects


# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build
dist/

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
typings/
.npm
.eslintcache
*.tgz

storybook-static
.envrc
.tool-versions
20 changes: 20 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const path = require('path');

module.exports = {
core: {
builder: 'webpack5'
},
features: {
postcss: false,
storyStoreV7: false
},
stories: [
'../**/*.stories.@(js|jsx|ts|tsx)'
],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],
framework: '@storybook/react',
}
3 changes: 3 additions & 0 deletions .storybook/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{

}
9 changes: 9 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}
19 changes: 19 additions & 0 deletions .storybook/webpack.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @see https://storybooks.netlify.app/configurations/typescript-config/#setting-up-typescript-with-babel-loader
* @param {object} param0
* @param {string} param0.mode
* @param {import('webpack').Configuration} param0.config
* @returns {import('webpack').Configuration}
*/
module.exports = ({ config, mode }) => {
config.resolve = {
...config.resolve,
extensionAlias: {
...config.resolve.extensionAlias,
".js": [".ts", ".js", ".tsx", ".jsx"],
".mjs": [".mts", ".mjs"],
},
};

return config;
};
4 changes: 4 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This project is dual licensed under MIT and Apache-2.0.

MIT: https://www.opensource.org/licenses/mit
Apache-2.0: https://www.apache.org/licenses/license-2.0
5 changes: 5 additions & 0 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
19 changes: 19 additions & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
34 changes: 29 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
Repository Name
=======================
# @ipfs-shipyard/ignite-metrics <!-- omit in toc -->

> Repository tagline
[![codecov](https://img.shields.io/codecov/c/github/ipfs-shipyard/ignite-metrics.svg?style=flat-square)](https://codecov.io/gh/ipfs-shipyard/ignite-metrics)
[![CI](https://img.shields.io/github/workflow/status/ipfs-shipyard/ignite-metrics/test%20&%20maybe%20release/main?style=flat-square)](https://github.com/ipfs-shipyard/ignite-metrics/actions/workflows/js-test-and-release.yml)

> UI library for gathering metrics for ignite team projects

## Table of contents <!-- omit in toc -->

- [Install](#install)
- [Documentation](#documentation)
- [Lead Maintainer](#lead-maintainer)
- [Contributing](#contributing)
- [License](#license)
- [Contribute](#contribute)

## Install

```console
$ npm i @ipfs-shipyard/ignite-metrics
```

A longer repository description.

Expand All @@ -11,12 +28,19 @@ A longer repository description.

## Lead Maintainer

[Your name](https://github.com/alinktoyourname)
[Russell Dempsey](https://github.com/SgtPooki)

## Contributing

Contributions are welcome! This repository is part of the IPFS project and therefore governed by our [contributing guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md).

## License

[SPDX-License-Identifier: Apache-2.0 OR MIT](LICENSE.md)
Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

## Contribute

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Loading