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

[INTER-538] Revisit pre-release #59

Merged
merged 16 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.DS_Store
/node_modules
/build
**/dist
build
dist
docs
**/.svelte-kit
/package
.env
Expand Down
16 changes: 3 additions & 13 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
extends: ['@fingerprintjs/eslint-config-dx-team'],
plugins: ['svelte3'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript'),
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
},
env: {
browser: true,
es2017: true,
node: true,
},
};
}
2 changes: 1 addition & 1 deletion .github/workflows/coverage-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
pull-requests: write
uses: fingerprintjs/dx-team-toolkit/.github/workflows/coverage-diff.yml@v1
with:
testScript: yarn test
testScript: pnpm test --
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
uses: fingerprintjs/dx-team-toolkit/.github/workflows/release-typescript-project.yml@v1
with:
distFolderNeedForRelease: true
appId: ${{ vars.APP_ID }}
secrets:
GH_RELEASE_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
.idea
src/lib/options.ts
docs
coverage
13 changes: 0 additions & 13 deletions .prettierrc

This file was deleted.

8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import config from '@fingerprintjs/prettier-config-dx-team'

export default {
...config,
svelteSortOrder: 'options-scripts-markup-styles',
plugins: ['prettier-plugin-svelte'],
overrides: [{ files: '*.svelte', options: { parser: 'svelte' } }],
}
87 changes: 4 additions & 83 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -10,101 +10,22 @@
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{
"type": "build",
"scope": "deps",
"release": "patch"
},
{
"type": "docs",
"scope": "README",
"release": "patch"
}
]
"config": "@fingerprintjs/conventional-changelog-dx-team",
"releaseRules": "@fingerprintjs/conventional-changelog-dx-team/release-rules"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalCommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "feature",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "revert",
"section": "Reverts"
},
{
"type": "docs",
"scope": "README",
"section": "Documentation"
},
{
"type": "build",
"scope": "deps",
"section": "Build System"
},
{
"type": "docs",
"section": "Documentation",
"hidden": true
},
{
"type": "style",
"section": "Styles",
"hidden": true
},
{
"type": "chore",
"section": "Miscellaneous Chores",
"hidden": true
},
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": true
},
{
"type": "test",
"section": "Tests",
"hidden": true
},
{
"type": "build",
"section": "Build System",
"hidden": true
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": true
}
]
}
"config": "@fingerprintjs/conventional-changelog-dx-team"
}
],
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/exec",
{
"prepareCmd": "yarn run sync-pkg-version && yarn run package"
"prepareCmd": "pnpm sync-pkg-version && pnpm package"
}
],
[
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Working with code

We prefer using [yarn](https://yarnpkg.com/) for installing dependencies and running scripts.
We prefer using [pnpm](https://pnpmpkg.com/) for installing dependencies and running scripts.

The main branch is locked for the push action. For proposing changes, use the standard [pull request approach](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). It's recommended to discuss fixes or new functionality in the Issues, first.

Expand All @@ -11,13 +11,13 @@ The main branch is locked for the push action. For proposing changes, use the st
This project was generated with [svelte-kit](https://kit.svelte.dev/).
Library code can be found in the [src/lib](./src/lib) directory.

Run `yarn package:watch` to rebuild the library on each update.
Run `pnpm package:watch` to rebuild the library on each update.

In the [examples](./examples) directory you can find example apps, to run them, navigate to the given directory and execute `yarn dev`. The app will run on [localhost:3000](http://localhost:3000) and reload automatically on changes.
In the [examples](./examples) directory you can find example apps, to run them, navigate to the given directory and execute `pnpm dev`. The app will run on [localhost:3000](http://localhost:3000) and reload automatically on changes.

### Running unit tests

Run `yarn test` to execute the unit tests via [Jest](https://jestjs.io/).
Run `pnpm test` to execute the unit tests via [Jest](https://jestjs.io/).

### Committing changes

Expand All @@ -32,7 +32,7 @@ The library is automatically released and published to NPM on every push to the
We use [typedoc](https://typedoc.org/) to generate docs. To generate docs run:

```shell
yarn docs
pnpm docs
```

The docs will be generated into [./docs](./docs) directory.
Expand Down
38 changes: 11 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,22 @@
<p align="center">
<a href="https://fingerprint.com">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/fingerprintjs/fingerprintjs-pro-svelte/main/resources/logo_light.svg" />
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/fingerprintjs/fingerprintjs-pro-svelte/main/resources/logo_dark.svg" />
<img src="https://raw.githubusercontent.com/fingerprintjs/fingerprintjs-pro-svelte/main/resources/logo_dark.svg" alt="Fingerprint" width="312px" />
<source media="(prefers-color-scheme: dark)" srcset="https://fingerprintjs.github.io/home/resources/logo_light.svg" />
<source media="(prefers-color-scheme: light)" srcset="https://fingerprintjs.github.io/home/resources/logo_dark.svg" />
<img src="https://fingerprintjs.github.io/home/resources/logo_dark.svg" alt="Fingerprint logo" width="312px" />
</picture>
</a>

</p>
<p align="center">
<a href="https://github.com/fingerprintjs/fingerprintjs-pro-svelte/actions/workflows/release.yml">
<img src="https://github.com/fingerprintjs/fingerprintjs-pro-svelte/actions/workflows/release.yml/badge.svg" alt="Release status">
</a>
<a href="https://github.com/fingerprintjs/fingerprintjs-pro-svelte/actions/workflows/test.yml">
<img src="https://github.com/fingerprintjs/fingerprintjs-pro-svelte/actions/workflows/test.yml/badge.svg" alt="Tests status">
</a>
<a href="https://www.npmjs.com/package/@fingerprintjs/fingerprintjs-pro-svelte">
<img src="https://img.shields.io/npm/v/@fingerprintjs/fingerprintjs-pro-svelte.svg" alt="Current NPM version">
</a>
<a href="https://www.npmjs.com/package/@fingerprintjs/fingerprintjs-pro-svelte">
<img src="https://img.shields.io/npm/dm/@fingerprintjs/fingerprintjs-pro-svelte.svg" alt="Monthly downloads from NPM">
</a>
<a href="https://fingerprintjs.github.io/fingerprintjs-pro-svelte/coverage/">
<img src="https://fingerprintjs.github.io/fingerprintjs-pro-svelte/coverage/badges.svg" alt="coverage">
</a>
<a href="https://opensource.org/licenses/MIT">
<img src="https://img.shields.io/:license-mit-blue.svg" alt="MIT license">
</a>
<a href="https://discord.gg/39EpE2neBg">
<img src="https://img.shields.io/discord/852099967190433792?style=logo&label=Discord&logo=Discord&logoColor=white" alt="Discord server">
</a>
<a href="https://fingerprintjs.github.io/fingerprintjs-pro-svelte/">
<img src="https://img.shields.io/badge/-Documentation-green" alt="Discord server">
</a>
<a href="https://github.com/fingerprintjs/fingerprintjs-pro-svelte/actions/workflows/release.yml"><img src="https://github.com/fingerprintjs/fingerprintjs-pro-svelte/actions/workflows/release.yml/badge.svg" alt="Release status"></a>
<a href="https://github.com/fingerprintjs/fingerprintjs-pro-svelte/actions/workflows/test.yml"><img src="https://github.com/fingerprintjs/fingerprintjs-pro-svelte/actions/workflows/test.yml/badge.svg" alt="Tests status"></a>
<a href="https://www.npmjs.com/package/@fingerprintjs/fingerprintjs-pro-svelte"><img src="https://img.shields.io/npm/v/@fingerprintjs/fingerprintjs-pro-svelte.svg" alt="Current NPM version"></a>
<a href="https://www.npmjs.com/package/@fingerprintjs/fingerprintjs-pro-svelte"><img src="https://img.shields.io/npm/dm/@fingerprintjs/fingerprintjs-pro-svelte.svg" alt="Monthly downloads from NPM"></a>
<a href="https://fingerprintjs.github.io/fingerprintjs-pro-svelte/coverage/"><img src="https://fingerprintjs.github.io/fingerprintjs-pro-svelte/coverage/badges.svg" alt="coverage"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/:license-mit-blue.svg" alt="MIT license"></a>
<a href="https://discord.gg/39EpE2neBg"><img src="https://img.shields.io/discord/852099967190433792?style=logo&label=Discord&logo=Discord&logoColor=white" alt="Discord server"></a>
<a href="https://fingerprintjs.github.io/fingerprintjs-pro-svelte/"><img src="https://img.shields.io/badge/-Documentation-green" alt="Discord server"></a>
</p>

# FingerprintJS Pro Svelte
Expand Down
10 changes: 5 additions & 5 deletions __tests__/TestApp.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script lang="ts">
/* eslint-disable @typescript-eslint/no-explicit-any */

import { useVisitorData } from '../src/lib';
export let immediate = false;
export let ignoreCache = false;
export let getDataOptions: any = {};
import { useVisitorData } from '../src/lib'
export let immediate = false
export let ignoreCache = false
export let getDataOptions: any = {}

const { getData, data, isLoading, error } = useVisitorData({ extendedResult: true, ignoreCache }, { immediate });
const { getData, data, isLoading, error } = useVisitorData({ extendedResult: true, ignoreCache }, { immediate })
</script>

<div>
Expand Down
12 changes: 6 additions & 6 deletions __tests__/TestAppWrapper.svelte
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<script lang="ts">
/* eslint-disable @typescript-eslint/no-explicit-any */

import FpjsProvider from '../src/lib/providers/FpjsProvider.svelte';
import TestApp from './TestApp.svelte';
import FpjsProvider from '../src/lib/providers/FpjsProvider.svelte'
import TestApp from './TestApp.svelte'

export let ignoreCache = false;
export let immediate = false;
export let getDataOptions: any = {};
export let ignoreCache = false
export let immediate = false
export let getDataOptions: any = {}

const options = {
loadOptions: {
apiKey: process.env.API_KEY as string,
},
};
}
</script>

<div>
Expand Down
Loading
Loading