Skip to content

Commit

Permalink
dependency updates
Browse files Browse the repository at this point in the history
  • Loading branch information
benkeen committed Nov 26, 2024
1 parent 137cccd commit f65c004
Show file tree
Hide file tree
Showing 8 changed files with 516 additions and 2,539 deletions.
9 changes: 0 additions & 9 deletions .babelrc

This file was deleted.

3 changes: 3 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-react"]
}
163 changes: 97 additions & 66 deletions example/public/index.html
Original file line number Diff line number Diff line change
@@ -1,77 +1,108 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<head>
<meta charset="UTF-8" />
<title>react-country-region-selector</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/normalize.css" media="screen">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="css/stylesheet.css" media="screen">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="stylesheet"
type="text/css"
href="css/normalize.css"
media="screen"
/>
<link
href="https://fonts.googleapis.com/css?family=Open+Sans:400,700"
rel="stylesheet"
type="text/css"
/>
<link
rel="stylesheet"
type="text/css"
href="css/stylesheet.css"
media="screen"
/>

<style>
body {
background-color: #f0eee8;
}
.main-content {
font-size: 15px;
}
ol {
margin: 0;
padding: 0;
}
section {
margin: 0 0 15px;
border-bottom: 1px solid #cac6bc;
padding: 0 0 20px;
}
.counter {
font-weight: bold;
margin-right: 5px;
}
code {
font-size: 15px;
}
.toggleCode {
float: right;
background-color: #d8d5ce;
border-radius: 4px;
margin-top: 8px;
padding: 3px 6px;
cursor: pointer;
}
.toggleCode:hover {
background-color: #cac6bc;
}
body {
background-color: #f0eee8;
}
.main-content {
font-size: 15px;
}
ol {
margin: 0;
padding: 0;
}
section {
margin: 0 0 15px;
border-bottom: 1px solid #cac6bc;
padding: 0 0 20px;
}
.counter {
font-weight: bold;
margin-right: 5px;
}
code {
font-size: 15px;
}
.toggleCode {
float: right;
background-color: #d8d5ce;
border-radius: 4px;
margin-top: 8px;
padding: 3px 6px;
cursor: pointer;
}
.toggleCode:hover {
background-color: #cac6bc;
}
</style>
</head>
<body>
</head>
<body>
<section class="page-header">
<h1 class="project-name">react-country-region-selector</h1>
<h2 class="project-tagline"></h2>
<a
href="https://github.com/benkeen/react-country-region-selector"
class="btn"
>View on GitHub</a
>
<a
href="https://github.com/benkeen/react-country-region-selector/zipball/master"
class="btn"
>Download .zip</a
>
<a
href="https://github.com/benkeen/react-country-region-selector/tarball/master"
class="btn"
>Download .tar.gz</a
>
</section>

<section class="page-header">
<h1 class="project-name">react-country-region-selector</h1>
<h2 class="project-tagline"></h2>
<a href="https://github.com/benkeen/react-country-region-selector" class="btn">View on GitHub</a>
<a href="https://github.com/benkeen/react-country-region-selector/zipball/master" class="btn">Download .zip</a>
<a href="https://github.com/benkeen/react-country-region-selector/tarball/master" class="btn">Download .tar.gz</a>
</section>
<section class="main-content">
<p>
<b>This page shows a few examples</b>. The example JSX code is there to
illustrate each example, but please note you'll need to supply the
appropriate onChange methods and store the country and region values.
See the
<a href="https://github.com/benkeen/react-country-region-selector"
>readme</a
>
for complete documentation on how to add the component to your pages.
</p>

<section class="main-content">
<p>
<b>This page shows a few examples</b>. The example JSX code is there to illustrate each example, but please
note you'll need to supply the appropriate onChange methods and store the country and region values.
See the <a href="https://github.com/benkeen/react-country-region-selector">readme</a> for complete documentation
on how to add the component to your pages.
</p>
<hr size="1" />

<hr size="1" />
<div id="examples"></div>

<div id="examples"></div>

<footer class="site-footer">
<a href="https://github.com/benkeen/react-country-region-selector">react-country-region-selector</a> is maintained
by <a href="https://github.com/benkeen">Ben Keen</a>.
<a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.
</footer>
</section>

</body>
<footer class="site-footer">
<a href="https://github.com/benkeen/react-country-region-selector"
>react-country-region-selector</a
>
is maintained by <a href="https://github.com/benkeen">Ben Keen</a>.
<a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by
<a href="https://twitter.com/jasonlong">Jason Long</a>.
</footer>
</section>
</body>
</html>
39 changes: 13 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
"module": "dist/rcrs.es.js",
"types": "./index.d.ts",
"jsnext:main": "dist/rcrs.es.js",
"engines": {
"node": ">=8",
"npm": ">=5"
},
"scripts": {
"test": "cross-env CI=1 react-scripts test --env=jsdom",
"test:watch": "react-scripts test --env=jsdom",
Expand All @@ -31,37 +27,28 @@
"react-dom": ">=15"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.5",
"babel-plugin-external-helpers": "^6.22.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"@babel/core": "^7.26.0",
"@babel/eslint-parser": "^7.25.6",
"@babel/preset-env": "^7.26.0",
"@babel/preset-stage-0": "^7.8.3",
"@babel/preset-react": "^7.25.9",
"country-region-data": "^3.1.0",
"cross-env": "^5.1.4",
"enzyme": "^3.6.0",
"enzyme-adapter-react-16": "^1.5.0",
"eslint": "^5.0.1",
"eslint-config-standard": "^11.0.0",
"eslint-config-standard-react": "^6.0.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-promise": "^4.0.0",
"eslint-plugin-react": "^7.10.0",
"eslint-plugin-standard": "^3.1.0",
"eslint": "^8.57.1",
"gh-pages": "^1.2.0",
"minimalist": "^1.0.0",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-scripts": "^5.0.1",
"rollup": "^0.64.1",
"rollup-plugin-babel": "^3.0.7",
"rollup-plugin-commonjs": "^9.1.3",
"rollup-plugin-json": "^3.0.0",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-peer-deps-external": "^2.2.0",
"rollup-plugin-postcss": "^1.6.2",
"rollup-plugin-url": "^1.4.0"
"rollup": "^4.27.4",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-url": "^8.0.2"
},
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion rollup-plugin-parse-country-list.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default (options = {}) => {
module.exports = (options = {}) => {
const convertFormat = (countries) => {
return countries.map((countryData) => [
countryData.countryName,
Expand Down
33 changes: 16 additions & 17 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import external from 'rollup-plugin-peer-deps-external';
import postcss from 'rollup-plugin-postcss';
import resolve from 'rollup-plugin-node-resolve';
import url from 'rollup-plugin-url';
import json from 'rollup-plugin-json';
import parseCountryList from './rollup-plugin-parse-country-list';
import pkg from './package.json';

const babel = require('@rollup/plugin-babel');
// const commonjs = require('@rollup/plugin-commonjs');
const resolve = require('@rollup/plugin-node-resolve');
const url = require('@rollup/plugin-url');
const json = require('@rollup/plugin-json');
const terser = require('@rollup/plugin-terser');
const pkg = require('./package.json');
const argv = require('minimist')(process.argv.slice(2));
const parseCountryList = require('./rollup-plugin-parse-country-list');

// e.g. rollup -c --config-countries=GB,CA,US
let countries = [];
if (argv.hasOwnProperty('config-countries')) {
countries = argv['config-countries'].split(',');
}

export default {
module.exports = {
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'cjs',
sourcemap: true,
compact: true,
},
{
file: pkg.module,
format: 'es',
sourcemap: true,
compact: true,
},
],
plugins: [
parseCountryList({ countries }),
external(),
postcss({
modules: true,
}),
json(),
url(),
babel({
exclude: 'node_modules/**',
plugins: ['external-helpers'],
// TODO check https://github.com/rollup/plugins/tree/master/packages/babel#babelhelpers
babelHelpers: 'bundled',
}),
resolve(),
commonjs(),
// commonjs(),
terser(),
],
external: ['react', 'react-dom', 'prop-types'],
};
Loading

0 comments on commit f65c004

Please sign in to comment.