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

Release v1.0.0 #12

Merged
merged 24 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f0fe81e
feat: Translate component wrapper. Tested. Issue: API request limit
MiracleUFO Sep 13, 2023
b44aaef
feat: getTranslation method. Issues: Google Translate API Rate limit
MiracleUFO Sep 14, 2023
a157e50
fix: npm vulnerability synk errors and scripts run for tsx
MiracleUFO Sep 15, 2023
c250475
fix: getTranslation tests
MiracleUFO Sep 16, 2023
fe5b404
fix: possible fix snyk vulnerability
MiracleUFO Sep 16, 2023
9ff5424
fix: possible fix snyk vulnerability
MiracleUFO Sep 16, 2023
ce79f63
fix: possible override fix snyk vulnerabilities
MiracleUFO Sep 16, 2023
af9549b
chore: better error handling
MiracleUFO Sep 16, 2023
726ea71
feat: allows translation of texts larger than 5K chars in getTranslat…
MiracleUFO Sep 21, 2023
552c867
feat: chunking improvement, chunk at end of sentence.
MiracleUFO Sep 22, 2023
e1f6a45
chore: rate limiting fix on development environment
MiracleUFO Sep 25, 2023
a8b7c7c
feat: complied with google api 1 req/sec rate, optimised testing
MiracleUFO Sep 26, 2023
10d7369
feat: caching
MiracleUFO Sep 27, 2023
3317598
chore: README typo
MiracleUFO Sep 29, 2023
7586298
chore: README typo
MiracleUFO Sep 29, 2023
48b4965
chore: test for if to and from props are the same
MiracleUFO Sep 30, 2023
ea0db0b
feat: <Translator /> wrapper functionality (untested)
MiracleUFO Sep 30, 2023
9cd2c89
fix: Translator infinite recursion + passing tests
MiracleUFO Oct 1, 2023
f0ac7c3
fix: snyk dependency issue
MiracleUFO Oct 2, 2023
4817609
chore: release workflow syntax fixes
MiracleUFO Oct 2, 2023
b4ce892
chore: possible fixes gh actions workflow
MiracleUFO Oct 2, 2023
2ef5cd3
chore: possible fixes gh actions workflow
MiracleUFO Oct 2, 2023
9367c7c
chore: deleted super-linter as it is clashing with eslint
MiracleUFO Oct 2, 2023
6d5a771
chore: temp-fix google api synonyms failing test
MiracleUFO Oct 2, 2023
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
3 changes: 3 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NODE_ENV=development

TRANSLATE_API_PROXY=
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module.exports = {
env: {
browser: true,
es2021: true,
jest: true,
},
settings: {
'import/resolver': {
Expand Down Expand Up @@ -40,6 +41,8 @@ module.exports = {
js: 'never',
jsx: 'never',
}],
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
'react/jsx-filename-extension': 'off',
'react/function-component-definition': [
'error',
Expand All @@ -48,5 +51,6 @@ module.exports = {
unnamedComponents: 'arrow-function',
},
],
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
};
33 changes: 33 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

# .github/workflows/lint.yml

name: Lint # name of the action (displayed in the github interface)

on: [push, pull_request]

jobs:
linting:
name: Linting
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x]

steps:
- name: Install NodeJS
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Code Checkout
uses: actions/checkout@v2

- name: Install Dependencies
run: npm ci

- name: Code Linting
run: npm run lint
env:
DEFAULT_BRANCH: "main"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ jobs:
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
31 changes: 0 additions & 31 deletions .github/workflows/super-linter.yml

This file was deleted.

16 changes: 4 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: [push, pull_request]

jobs:
build:
Expand All @@ -13,19 +9,15 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x]
node-version: [ 16.x, 18.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Install mocha
run: npm install -g mocha
- name: Install dependencies
run: npm install
- name: "Run Test"
run: mocha tests/translate-component.spec.tsx
with:
node-version: ${{ matrix.node-version }}
- name: "Run Tests"
run: npm run test
- run: npm ci
- run: npm test
117 changes: 20 additions & 97 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,109 +1,32 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Bower dependency directory (https://bower.io/)
bower_components
# dependencies
/node_modules
/.pnp
.pnp.js

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/
# dotenv environment variables file
.env.local
.env.development.local
.env.test.local
.env.production.local

# TypeScript v1 declaration files
typings/
# testing
/coverage

# TypeScript cache
*.tsbuildinfo
# production
/build
/dist

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

.dccache
# misc
.DS_Store
lib
*.tgz

npm-debug.log*
yarn-debug.log*
yarn-error.log*
7 changes: 0 additions & 7 deletions .mocharc.json

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierrc.json

This file was deleted.

6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License
The MIT License (MIT)

Copyright (c) 2022 Snyk Labs
Copyright (c) 2022 Miracle Ufodiama – https://www.miracleufo.codes – [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ 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.
SOFTWARE.
Loading