Skip to content

Commit

Permalink
Merge 61ff048 into 87f03ab
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Mar 14, 2023
2 parents 87f03ab + 61ff048 commit 962d39c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 24 deletions.
14 changes: 3 additions & 11 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
module.exports = (api) => {
const isTesting = api.caller((caller) => caller.name === '@babel/register');
const isBrowserify = api.caller((caller) => caller.name === 'babelify');
api.cache(true);

return {
presets: [
['@babel/preset-env', {
modules: isTesting || isBrowserify ? 'commonjs' : false,
loose: true,
targets: isTesting ? { node: 'current' } : null,
}],
['@babel/preset-react', {
runtime: 'automatic',
}],
['@babel/preset-env', { modules: false, loose: true }],
['@babel/preset-react', { runtime: 'automatic' }],
],
plugins: isTesting ? ['istanbul'] : [],
};
};
2 changes: 0 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ module.exports = {
browser: true,
},
rules: {
// I disagree
'react/jsx-filename-extension': 'off',
// I disagree
'react/require-default-props': 'off',
// Our babel config doesn't use the class properties transform
Expand Down
1 change: 0 additions & 1 deletion example/.babelrc.js

This file was deleted.

File renamed without changes.
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,22 @@
"@babel/core": "^7.8.7",
"@babel/preset-env": "^7.8.7",
"@babel/preset-react": "^7.8.3",
"@babel/register": "^7.8.6",
"@rollup/plugin-babel": "^6.0.0",
"@u-wave/react-translate-example": "file:example",
"@u-wave/translate": "^1.1.0",
"babel-plugin-istanbul": "^6.0.0",
"@vitest/coverage-c8": "^0.29.2",
"cross-env": "^7.0.2",
"eslint": "^8.3.0",
"eslint-config-airbnb": "^19.0.0",
"eslint-plugin-import": "^2.21.2",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-react-hooks": "^4.0.4",
"expect": "^29.2.0",
"mocha": "^10.0.0",
"nyc": "^15.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-test-renderer": "^18.0.0",
"rollup": "^2.0.6"
"rollup": "^2.0.6",
"vitest": "^0.29.2"
},
"homepage": "https://github.com/u-wave/react-translate#readme",
"keywords": [
Expand All @@ -54,7 +51,7 @@
"prepare": "rollup -c",
"lint": "eslint --cache .",
"test": "npm run lint && npm run tests-only",
"tests-only": "nyc mocha --require @babel/register",
"tests-only": "vitest run --coverage.enabled --coverage.reporter=lcov --coverage.reporter=text --coverage.100",
"example": "npm run --prefix example build && npm run --prefix example start"
},
"sideEffects": false
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const meta = require('./package.json');
process.env.BABEL_ENV = 'rollup';

export default {
input: './src/index.js',
input: './src/index.jsx',
output: [
{
format: 'cjs',
Expand Down
File renamed without changes.
8 changes: 6 additions & 2 deletions test/index.js → src/index.test.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import {
expect,
describe,
it,
} from 'vitest';
import React from 'react';
import PropTypes from 'prop-types';
import TestRenderer from 'react-test-renderer';
import expect from 'expect';
import Translator from '@u-wave/translate';
import {
TranslateProvider,
translate,
Interpolate,
useTranslator,
} from '../src';
} from './index';

describe('translate', () => {
const translator = new Translator({
Expand Down

0 comments on commit 962d39c

Please sign in to comment.