-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add: currency/api lib * fix: writeToFile rates * rebase * fix: writeToFile rates * add: next-currency-cache functions * add: setRates cron job * fix: next/currency-cache to ts config * fix: linter unknow instead of any * fix: linter unknow instead of any * fix: uncomment important code * fix: tests for currency/api and currency-cache * rebase fix: writeToFile rates add: currency/api lib fix: writeToFile rates add: next-currency-cache functions add: setRates cron job fix: linter unknow instead of any fix: linter unknow instead of any fix: uncomment important code fix: tests for currency/api and currency-cache * add env variables changes and @shared/server to get env info * fix: fix tests for currency-cache * tsconfig add * add: CurrencyProvider and provider settings * fix: tsconfig.base.json * add: currency-dropdown ui/components and icons * fix: global settings props * 🔧 chore(sentry.client.config.ts): remove unused code and simplify SENTRY_DSN assignment * fix: usecontext back in eventpasses * fix: currency provider in preview * 🔧 chore(package.json): remove esbuild dependency to simplify the project dependencies 📦 feat(project.json): add project.json file to configure a local registry target for nx using verdaccio executor * fix: currency settings and revalidateTag * fix: isJestRunning for setRates tests * test: without loading * correct old version * fix: currencyProvider * fix: comment test rates * fix: test without eventpasses * fix: remove all formatCurrency * fix: remove all formatCurrency * fix: remove all formatCurrency in SinglePass * fix: remove getREates from currencyProvider * fix: put back tsconfig about storybook * fix: getRates in currency provider with rfetch * fix: PassTotal uncommented * fix: PassTotal without loading * fix: check if it's a test and return false rates * 📦 chore(env-nextjs.mock.js): add mock file for @t3-oss/env-nextjs module to be used in Storybook 📦 chore(main.ts): add alias for @t3-oss/env-nextjs module to use the mock file in Storybook 📦 chore(preview.tsx): remove unnecessary import of CurrencyProvider and add CurrencyDecorator to wrap stories with CurrencyProvider 🐛 fix(index.tsx): replace fetchRates function with getRates function from @next/currency-cache module to improve code readability and maintainability * fix: check if fetchFromLocalFile is problem * fix: display args to check * fix: display all key value of objects * fix: display all key values * fix: send only the concerned rate to formatCurrency * fix: toUserCurrency to take only the rate of the user currency * 🐛 fix(index.ts): fix file path to use __dirname instead of process.cwd() to correctly locate rates directory 🔥 chore(index.ts): remove commented out code for fetching from local JSON files and return default rates instead 🔥 chore(examples.tsx): remove unused import of Link from '@next/navigation' * fix: rates in lib and absolute path for __dirname * fix: swcrc file for currency/types * fix: storybook story * 🔧 chore(jest.preset.js): add support for import.meta in jest configuration to avoid issues with import.meta 🔧 chore(jest.config.ts): remove unnecessary transform configuration for ts-jest in jest configuration 📦 chore(package.json): add ts-jest-mock-import-meta package as a dependency for jest configuration * fix: fix tests with import.meta and new EUR.json * fix: no frozen lockfile * fix: no frozen lockfile * 🔥 refactor(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics 🔧 chore(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port 🔥 refactor(types): remove unused .babelrc file 🔧 chore(types): update project.json and tsconfig.json paths for currency/types library 🔧 chore(createEventPassesSlice.ts): update import path for Money from @currency/types ✨ feat(cache): add .swcrc and package.json files 🔧 chore(cache): update project.json and tsconfig.json paths for next/cache library 🔧 chore(cache): update import path for Cache in next-currency-cache.spec.ts and next-currency-cache.ts 🔧 chore(currency): update tsconfig.json and tsconfig.lib.json files 🔧 chore(nft-thirdweb-api.ts): remove unused 'use server' statement 🔧 chore(tsconfig.base.json): remove unused import path for @next/cache/server * 🐛 fix(nft-thirdweb-api.ts): add error handling for undefined SDK to prevent potential crashes 🔥 chore(payment-webhooks.spec.ts): remove unused payment webhooks test file * 🔧 chore(.swcrc): remove unnecessary regex pattern from exclude list to improve code coverage 🔧 chore(jest.config.ts): update regex pattern to include .ts files in transform to improve code coverage 🔧 chore(payment-admin.ts): cast eventSlug and organizerSlug to string to avoid potential null or undefined values 🔧 chore(package.json): add @types/text-encoding dependency to fix ReferenceError: TextDecoder is not defined 🔧 chore(jest.setup.ts): import and assign TextEncoder and TextDecoder from text-encoding to fix ReferenceError: TextDecoder is not defined * 🐛 fix(payment-admin.ts): throw an error if refund status is null to prevent unexpected behavior 🐛 fix(payment-webhooks.ts): remove unused line_items variable to improve code readability * 🔧 fix(layout.tsx): remove unused import and update import path for Analytics component 🔧 fix(layout.tsx): update import path for siteConfig in Analytics component 🔧 fix(layout.tsx): add Metadata type import and define metadata object for page title 🔧 fix(next.config.js): remove unused appDir configuration * 🔧 chore(tsconfig.base.json): optimize paths configuration for better readability and maintainability * 🔧 chore(preview-apps.yml): remove 'staging' branch from branches-ignore list to enable preview apps for staging branch 🔒 chore(preview-apps.yml): add VERCEL_ORG_ID environment variable to enable deployment to Vercel preview apps --------- Co-authored-by: sebpalluel <[email protected]>
- Loading branch information
1 parent
5647996
commit 1a9ff58
Showing
90 changed files
with
2,450 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
createEnv: (env) => env.runtimeEnv, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { getRates } from '@next/currency-cache'; | ||
import { NextRequest, NextResponse } from 'next/server'; | ||
|
||
export async function GET(req: NextRequest) { | ||
try { | ||
const rates = await getRates(); | ||
|
||
return new NextResponse(JSON.stringify(rates), { | ||
status: 200, | ||
headers: { | ||
'content-type': 'application/json', | ||
}, | ||
}); | ||
} catch (error) { | ||
console.error(error); | ||
|
||
return new NextResponse( | ||
JSON.stringify({ error: 'Failed to fetch rates' }), | ||
{ | ||
status: 500, | ||
headers: { | ||
'content-type': 'application/json', | ||
}, | ||
} | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": ["../../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# currency-api | ||
|
||
This library was generated with [Nx](https://nx.dev). | ||
|
||
## Building | ||
|
||
Run `nx build currency-api` to build the library. | ||
|
||
## Running unit tests | ||
|
||
Run `nx test currency-api` to execute the unit tests via [Jest](https://jestjs.io). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: 'currency-api', | ||
preset: '../../../jest.preset.js', | ||
testEnvironment: 'node', | ||
moduleFileExtensions: ['ts', 'js', 'html'], | ||
coverageDirectory: '../../../coverage/libs/currency/api', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "@currency/api", | ||
"version": "0.0.1", | ||
"dependencies": { | ||
"tslib": "^2.3.0" | ||
}, | ||
"type": "commonjs", | ||
"main": "./src/index.js", | ||
"typings": "./src/index.d.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "currency-api", | ||
"$schema": "../../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "libs/currency/api/src", | ||
"projectType": "library", | ||
"targets": { | ||
"build": { | ||
"executor": "@nx/js:tsc", | ||
"outputs": ["{options.outputPath}"], | ||
"options": { | ||
"outputPath": "dist/libs/currency/api", | ||
"main": "libs/currency/api/src/index.ts", | ||
"tsConfig": "libs/currency/api/tsconfig.lib.json", | ||
"assets": ["libs/currency/api/*.md"] | ||
} | ||
}, | ||
"lint": { | ||
"executor": "@nx/linter:eslint", | ||
"outputs": ["{options.outputFile}"], | ||
"options": { | ||
"lintFilePatterns": [ | ||
"libs/currency/api/**/*.ts", | ||
"libs/currency/api/package.json" | ||
] | ||
} | ||
}, | ||
"test": { | ||
"executor": "@nx/jest:jest", | ||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"], | ||
"options": { | ||
"jestConfig": "libs/currency/api/jest.config.ts", | ||
"passWithNoTests": true | ||
}, | ||
"configurations": { | ||
"ci": { | ||
"ci": true, | ||
"codeCoverage": true | ||
} | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} |
Oops, something went wrong.