Skip to content

Commit ef84576

Browse files
authored
v0.1.0 (langfuse#3)
* queuing * debug * mono repo setup with core and packages for fetch() and axios versions * tests * retries
1 parent a54c364 commit ef84576

File tree

117 files changed

+23335
-5610
lines changed

Some content is hidden

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

117 files changed

+23335
-5610
lines changed

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# For integration tests
2+
# LF_HOST=
3+
# LF_PUBLIC_KEY=
4+
# LF_SECRET_KEY=

.eslintrc.cjs

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
const config = {
3+
ignorePatterns: ['node_modules', 'examples', 'lib'],
4+
env: {
5+
browser: true,
6+
es6: true,
7+
},
8+
settings: {
9+
react: {
10+
version: 'detect',
11+
},
12+
},
13+
extends: ['plugin:@typescript-eslint/recommended', 'plugin:react/recommended', 'prettier'],
14+
globals: {
15+
Atomics: 'readonly',
16+
SharedArrayBuffer: 'readonly',
17+
},
18+
parser: '@typescript-eslint/parser',
19+
parserOptions: {
20+
ecmaFeatures: {
21+
jsx: true,
22+
},
23+
ecmaVersion: 2018,
24+
sourceType: 'module',
25+
},
26+
plugins: ['prettier', 'react', '@typescript-eslint'],
27+
rules: {
28+
'react/prop-types': [0],
29+
'react/no-unescaped-entities': [0],
30+
'react/jsx-no-target-blank': [0],
31+
'react/self-closing-comp': [
32+
'error',
33+
{
34+
component: true,
35+
html: true,
36+
},
37+
],
38+
'no-unused-vars': 'off',
39+
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", ignoreRestSiblings: true, }],
40+
'@typescript-eslint/prefer-ts-expect-error': 'error',
41+
'@typescript-eslint/explicit-function-return-type': 'off',
42+
'@typescript-eslint/explicit-module-boundary-types': 'off',
43+
'@typescript-eslint/no-empty-function': 'off',
44+
'@typescript-eslint/no-inferrable-types': 'off',
45+
'@typescript-eslint/ban-ts-comment': 'off',
46+
'@typescript-eslint/no-non-null-assertion': 'error',
47+
"@typescript-eslint/consistent-type-imports": [
48+
"warn",
49+
{
50+
prefer: "type-imports",
51+
fixStyle: "inline-type-imports",
52+
},
53+
],
54+
curly: 'error',
55+
'no-restricted-imports': [
56+
'error',
57+
{
58+
paths: [
59+
{
60+
name: 'dayjs',
61+
message: 'Do not directly import dayjs. Only import the dayjs exported from lib/dayjs.',
62+
},
63+
],
64+
},
65+
],
66+
},
67+
overrides: [
68+
{
69+
// enable the rule specifically for TypeScript files
70+
files: ['*Type.ts', '*Type.tsx'],
71+
rules: {
72+
'@typescript-eslint/no-explicit-any': ['off'],
73+
'@typescript-eslint/ban-types': ['off'],
74+
},
75+
},
76+
{
77+
// enable the rule specifically for TypeScript files
78+
files: ['*.ts', '*.tsx'],
79+
rules: {
80+
'@typescript-eslint/no-explicit-any': ['off'],
81+
'@typescript-eslint/explicit-function-return-type': [
82+
'error',
83+
{
84+
allowExpressions: true,
85+
},
86+
],
87+
'@typescript-eslint/explicit-module-boundary-types': [
88+
'error',
89+
{
90+
allowArgumentsExplicitlyTypedAsAny: true,
91+
},
92+
],
93+
},
94+
},
95+
{
96+
files: ['*.js'],
97+
rules: {
98+
'@typescript-eslint/no-var-requires': 'off',
99+
},
100+
},
101+
],
102+
reportUnusedDisableDirectives: true,
103+
};
104+
105+
module.exports = config;

.eslintrc.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Bug report
3+
about: Something not working as expected? Let us look into it
4+
labels: bug
5+
---
6+
7+
## Bug description
8+
9+
_Please describe._
10+
11+
## How to reproduce
12+
13+
1.
14+
2.
15+
3.
16+
17+
## Related sub-libraries
18+
19+
- [ ] All of them
20+
- [ ] langfuse
21+
- [ ] langfuse-node
22+
23+
## Additional context
24+
25+
#### _Thank you_ for your bug report – we love squashing them!
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest a feature
4+
labels: enhancement, feature
5+
---
6+
7+
## Is your feature request related to a problem?
8+
9+
_Please describe._
10+
11+
## Describe the solution you'd like
12+
13+
## Describe alternatives you've considered
14+
15+
## Related sub-libraries
16+
17+
- [ ] All of them
18+
- [ ] langfuse
19+
- [ ] langfuse-node
20+
21+
## Additional context
22+
23+
#### _Thank you_ for your feature request – we love each and every one!

.github/disabled_workflows/ci-e2e.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI - E2E
2+
3+
on:
4+
- pull_request
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
e2e:
12+
runs-on: macos-latest
13+
timeout-minutes: 15
14+
15+
steps:
16+
- uses: actions/checkout@v1
17+
- uses: actions/setup-node@v1
18+
with:
19+
node-version: 16
20+
21+
- uses: actions/cache@v2
22+
with:
23+
path: '**/node_modules'
24+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
25+
26+
- name: Install Global Dependencies
27+
run: yarn install
28+
29+
- working-directory: examples/example-expo
30+
run: ls -al && ./e2e/tools/downloadApp.sh
31+
32+
- name: Install Dependencies
33+
working-directory: examples/example-expo
34+
run: |
35+
yarn global add yalc
36+
yarn global add expo-cli
37+
yarn global add detox-cli
38+
yarn install
39+
40+
- run: brew tap wix/brew
41+
- run: brew install applesimutils
42+
- working-directory: examples/example-expo
43+
run: |
44+
open -a simulator
45+
yarn start & yarn test
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: 'Release'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
jobs:
10+
release:
11+
name: Publish
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
package:
16+
- name: posthog-react-native
17+
npm_token_secret: NPM_TOKEN_BEN_WHITE # TODO: Change to standard token once able
18+
- name: posthog-node
19+
npm_token_secret: NPM_TOKEN_BEN_WHITE # TODO: Change to standard token once able
20+
- name: posthog-web
21+
npm_token_secret: NPM_TOKEN # TODO: Change to standard token once able
22+
23+
steps:
24+
- name: Checkout the repository
25+
uses: actions/checkout@v2
26+
27+
- name: Check package version and detect an update
28+
id: check-package-version
29+
uses: PostHog/check-package-version@v2
30+
with:
31+
path: ${{ matrix.package.name }}
32+
33+
- name: Set up Node 16
34+
uses: actions/setup-node@v2
35+
if: steps.check-package-version.outputs.is-new-version == 'true'
36+
with:
37+
node-version: 16
38+
registry-url: https://registry.npmjs.org
39+
40+
- name: Install dependencies
41+
if: steps.check-package-version.outputs.is-new-version == 'true'
42+
run: yarn --frozen-lockfile
43+
44+
- name: Build
45+
if: steps.check-package-version.outputs.is-new-version == 'true'
46+
run: yarn build
47+
48+
- name: Publish the package in the npm registry
49+
id: publish-package
50+
if: steps.check-package-version.outputs.is-new-version == 'true'
51+
working-directory: ${{ matrix.package.name }}
52+
run: |
53+
tag="alpha"
54+
echo ::set-output name=tag::alpha
55+
if [[ $VERSION =~ ^[0-9]+(\.[0-9]+){2,3}$ ]]; then
56+
echo ::set-output name=tag::latest
57+
tag="latest"
58+
fi
59+
60+
npm publish --access public --tag $tag
61+
env:
62+
NODE_AUTH_TOKEN: ${{ secrets[matrix.package.npm_token_secret] }}
63+
VERSION: ${{ steps.check-package-version.outputs.committed-version }}
64+
65+
- name: Create GitHub release
66+
if: steps.check-package-version.outputs.is-new-version == 'true' && steps.publish-package.outputs.tag == 'latest'
67+
uses: actions/create-release@v1
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
with:
71+
tag_name: ${{ matrix.package.name }}-v${{ steps.check-package-version.outputs.committed-version }}
72+
release_name: ${{ matrix.package.name }}-${{ steps.check-package-version.outputs.committed-version }}

.github/pull_request_template.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## Problem
2+
3+
<!-- Who are we building for, what are their needs, why is this important? -->
4+
5+
## Changes
6+
7+
<!-- What is changed and what information would be useful to a reviewer? -->
8+
9+
## Release info Sub-libraries affected
10+
11+
### Bump level
12+
13+
<!-- Please mark what level of change this is. -->
14+
15+
- [ ] Major
16+
- [ ] Minor
17+
- [ ] Patch
18+
19+
### Libraries affected
20+
21+
<!-- Please mark which libraries will require a version bump. -->
22+
23+
- [ ] All of them
24+
- [ ] langfuse
25+
- [ ] langfuse-node
26+
27+
### Changelog notes
28+
29+
<!-- Add notes here that should be added to the changelogs. -->
30+
31+
- Added support for X

0 commit comments

Comments
 (0)