Skip to content

Commit

Permalink
Add API for fetching content (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospassos authored Nov 17, 2022
1 parent 5b6619a commit 6cf6887
Show file tree
Hide file tree
Showing 127 changed files with 9,501 additions and 1,813 deletions.
17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Workaround for https://github.com/eslint/eslint/issues/3458
require('@rushstack/eslint-patch/modern-module-resolution');

module.exports = {
plugins: [
'@croct',
],
extends: [
'plugin:@croct/typescript',
],
parserOptions: {
project: ['./tsconfig.json'],
},
env: {
browser: true,
},
};
89 changes: 0 additions & 89 deletions .eslintrc.json

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/branch-validations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
security-checks:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -35,7 +35,7 @@ jobs:
run: npm audit

validate:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -57,7 +57,7 @@ jobs:
run: npm run validate

lint:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -79,7 +79,7 @@ jobs:
run: npm run lint

test:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/deploy-published-releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ on:
- published

env:
BOOTSTRAP_ENDPOINT: https://api.croct.io/client/web/bootstrap
CID_ASSIGNER_ENDPOINT: https://api.croct.io/client/web/bootstrap
TRACKER_ENDPOINT: wss://api.croct.io/client/web/connect
EVALUATION_ENDPOINT: https://api.croct.io/client/web/evaluate
MAX_EXPRESSION_LENGHT: 500
EVALUATION_ENDPOINT: https://api.croct.io
CONTENT_ENDPOINT: https://api.croct.io
MAX_QUERY_LENGTH: 500

jobs:
deploy:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -44,10 +45,11 @@ jobs:
cd build
sed -i -e "s~\"version\": \"0.0.0-dev\"~\"version\": \"${GITHUB_REF##*/}\"~" package.json
sed -i -e "s~<@version@>~${GITHUB_REF##*/}~" constants.js
sed -i -e "s~<@cidAssignerEndpointUrl@>~${CID_ASSIGNER_ENDPOINT}~" constants.js
sed -i -e "s~<@trackerEndpointUrl@>~${TRACKER_ENDPOINT}~" constants.js
sed -i -e "s~<@evaluationEndpointUrl@>~${EVALUATION_ENDPOINT}~" constants.js
sed -i -e "s~<@bootstrapEndpointUrl@>~${BOOTSTRAP_ENDPOINT}~" constants.js
sed -i -e "s~parseInt('<@maxExpressionLength@>', 10)~${MAX_EXPRESSION_LENGHT}~" constants.js
sed -i -e "s~<@contentEndpointUrl@>~${CONTENT_ENDPOINT}~" constants.js
sed -i -e "s~parseInt('<@maxQueryLength@>', 10)~${MAX_QUERY_LENGTH}~" constants.js
- name: Publish pre-release to NPM
if: ${{ github.event.release.prerelease }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
build/
coverage/
7 changes: 4 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
testEnvironment: 'jsdom',
transform: {
'^.+\\.ts$': 'ts-jest',
},
preset: 'ts-jest',
testMatch: ['<rootDir>/test/**/*.test.ts'],
setupFilesAfterEnv: ['jest-extended/all'],
};
Loading

0 comments on commit 6cf6887

Please sign in to comment.