Skip to content

Commit

Permalink
Merge pull request #1081 from sharetribe/cra3-update
Browse files Browse the repository at this point in the history
Testing CRA 3 update
  • Loading branch information
Gnito authored May 8, 2019
2 parents b4f5607 + 897d67b commit 1de7dfa
Show file tree
Hide file tree
Showing 18 changed files with 3,536 additions and 2,911 deletions.
35 changes: 3 additions & 32 deletions .auditrc
Original file line number Diff line number Diff line change
@@ -1,34 +1,5 @@
exports.exceptions = [
// Severity: low, moment (< 2.19.3), currently used by react-dates
"https://npmjs.com/advisories/532",

// Severity: low, lodash (< 4.17.5), used heavily in our CRA fork
"https://npmjs.com/advisories/577",

// Severity: low, merge (< 1.2.1), used by Jest (CRA fork)
"https://npmjs.com/advisories/722",

// Severity: high, webpack-dev-server (< 3.1.10), (CRA fork)
// Note: don't run webpack-dev-server on public web.
"https://npmjs.com/advisories/725",

// Severity: high, handlebars (< 4.1.2), (CRA fork)
// Note: this is about Jest i.e. tests
"https://npmjs.com/advisories/755",

// Severity: moderate, lodash (< 4.17.11), (CRA fork)
// Note: this is mainly about Jest/tests and deps used in build
"https://npmjs.com/advisories/782",

// Severity: low, braces (< 2.3.1), (CRA fork)
// Note: this is about Jest and dev server
"https://npmjs.com/advisories/786",

// Severity: moderate, js-yaml (< 3.13.0), (CRA fork)
// Note: this called in deps used in build
"https://npmjs.com/advisories/788",

// Severity: high, js-yaml (< 3.13.1), (CRA fork)
// Note: this is called in deps used in build
"https://npmjs.com/advisories/813",
// Add exceptions to audit script:
// // Severity: low, lodash (< 4.17.5), used heavily in our CRA fork
// "https://npmjs.com/advisories/577",
];
38 changes: 23 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,30 @@
"basic-auth": "^2.0.1",
"body-parser": "^1.18.3",
"classnames": "^2.2.6",
"compression": "^1.7.3",
"cookie-parser": "^1.4.3",
"compression": "^1.7.4",
"cookie-parser": "^1.4.4",
"core-js": "^2.5.7",
"decimal.js": "10.0.1",
"dotenv": "4.0.0",
"dotenv-expand": "4.0.1",
"dotenv": "6.2.0",
"dotenv-expand": "4.2.0",
"express": "^4.16.4",
"express-enforces-ssl": "^1.1.0",
"express-sitemap": "^1.8.0",
"final-form": "^4.11.0",
"final-form-arrays": "^1.1.0",
"helmet": "^3.15.0",
"helmet": "^3.18.0",
"lodash": "^4.17.11",
"mapbox-gl-multitouch": "^1.0.3",
"moment": "^2.22.2",
"object.entries": "^1.0.4",
"object.values": "^1.0.4",
"path-to-regexp": "^2.4.0",
"prop-types": "^15.6.2",
"prop-types": "^15.7.2",
"query-string": "^5.1.1",
"raf": "3.4.0",
"react": "^16.6.3",
"react-dates": "^18.2.2",
"react-dom": "^16.6.3",
"react": "^16.8.6",
"react-dates": "^18.5.0",
"react-dom": "^16.8.6",
"react-final-form": "^4.0.2",
"react-final-form-arrays": "^2.0.1",
"react-google-maps": "^9.4.5",
Expand All @@ -50,21 +50,25 @@
"sanitize.css": "^5.0.0",
"seedrandom": "^2.4.4",
"sharetribe-flex-sdk": "^1.3.0",
"sharetribe-scripts": "2.1.8",
"sharetribe-scripts": "3.0.0",
"smoothscroll-polyfill": "^0.4.0",
"source-map-support": "^0.5.9",
"url": "^0.11.0"
},
"devDependencies": {
"babel-jest": "24.7.1",
"bfj": "^6.1.1",
"chalk": "^2.4.1",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.7.0",
"enzyme-to-json": "^3.3.4",
"inquirer": "^6.2.0",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.12.0",
"enzyme-to-json": "^3.3.5",
"inquirer": "^6.3.0",
"nodemon": "^1.17.2",
"prettier": "^1.15.3"
},
"resolutions": {
"react-test-renderer": "^16.8.6"
},
"scripts": {
"audit": "yarn audit --json | node scripts/audit.js",
"clean": "rm -rf build/*",
Expand All @@ -83,7 +87,11 @@
"translate": "node scripts/translations.js"
},
"browserslist": {
"production": [">0.2%", "not dead", "not op_mini all"],
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
Expand Down
32 changes: 16 additions & 16 deletions scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ Remember to restart the application after editing the environment variables! You
name: 'createEmptyEnv',
message: `Do you want to configure required environment variables now?
${chalk.dim(
`If you don't set up variables now .env file is created based on .env-template file. The application will not work correctly without Flex client ID, Stripe publishable API key and MapBox acces token.
`If you don't set up variables now .env file is created based on .env-template file. The application will not work correctly without Flex client ID, Stripe publishable API key and MapBox acces token.
We recommend setting up the required variables before starting the application!`
)}`,
)}`,
default: true,
},
])
Expand Down Expand Up @@ -121,8 +121,8 @@ const mandatoryVariables = settings => {
name: 'REACT_APP_SHARETRIBE_SDK_CLIENT_ID',
message: `What is your Flex client ID?
${chalk.dim(
'Client ID is needed for connecting with Flex API. You can find your client ID from Flex Console.'
)}
'Client ID is needed for connecting with Flex API. You can find your client ID from Flex Console.'
)}
`,
validate: function(value) {
if (value.match(/^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$/i)) {
Expand All @@ -137,9 +137,9 @@ ${chalk.dim(
name: 'REACT_APP_STRIPE_PUBLISHABLE_KEY',
message: `What is your Stripe publishable key?
${chalk.dim(
`Stripe publishable API key is for generating tokens with Stripe API. Use test key (prefix pk_test_) for development. Remember to also add the Stripe secret key to Console before testing the payments.
`Stripe publishable API key is for generating tokens with Stripe API. Use test key (prefix pk_test_) for development. Remember to also add the Stripe secret key to Console before testing the payments.
If you don't set the Stripe key, payments won't work in the application.`
)}
)}
`,
validate: function(value) {
if (value.match(/^pk_/) || value === '') {
Expand All @@ -154,9 +154,9 @@ If you don't set the Stripe key, payments won't work in the application.`
name: 'REACT_APP_MAPBOX_ACCESS_TOKEN',
message: `What is your Mapbox access token?
${chalk.dim(
`Mapbox is the default map provider of the application. Sign up for Mapbox and go the to account page. Then click Create access token. For more information see the: Integrating to map providers documentation.
`Mapbox is the default map provider of the application. Sign up for Mapbox and go the to account page. Then click Create access token. For more information see the: Integrating to map providers documentation.
If you don't set the Mapbox key, the map components won't work in the application.`
)}
)}
`,
...mapBoxDefaultMaybe,
},
Expand All @@ -165,8 +165,8 @@ If you don't set the Mapbox key, the map components won't work in the applicatio
name: 'REACT_APP_SHARETRIBE_MARKETPLACE_CURRENCY',
message: `What is your marketplace currency?
${chalk.dim(
'The currency used in the Marketplace must be in ISO 4217 currency code. For example USD, EUR, CAD, AUD, etc. The default value is USD.'
)}
'The currency used in the Marketplace must be in ISO 4217 currency code. For example USD, EUR, CAD, AUD, etc. The default value is USD.'
)}
`,
default: function() {
return currencyDefault;
Expand Down Expand Up @@ -213,8 +213,8 @@ const advancedSettings = settings => {
name: 'REACT_APP_CANONICAL_ROOT_URL',
message: `What is your canonical root URL?
${chalk.dim(
'Canonical root URL of the marketplace is needed for social media sharing and SEO optimization. When developing the template application locally URL is usually http://localhost:3000'
)}
'Canonical root URL of the marketplace is needed for social media sharing and SEO optimization. When developing the template application locally URL is usually http://localhost:3000'
)}
`,
default: function() {
return rootUrlDefault ? rootUrlDefault : 'http://localhost:3000';
Expand All @@ -228,8 +228,8 @@ ${chalk.dim(
name: 'REACT_APP_AVAILABILITY_ENABLED',
message: `Do you want to enable availability calendar?
${chalk.dim(
'This setting enables the Availability Calendar for listings. The default value for this setting is true.'
)}
'This setting enables the Availability Calendar for listings. The default value for this setting is true.'
)}
`,
default: availabilityDefault,
when: function(answers) {
Expand All @@ -241,8 +241,8 @@ ${chalk.dim(
name: 'REACT_APP_DEFAULT_SEARCHES_ENABLED',
message: `Do you want to enable default search suggestions?
${chalk.dim(
'This setting enables the Default Search Suggestions in location autocomplete search input. The default value for this setting is true.'
)}
'This setting enables the Default Search Suggestions in location autocomplete search input. The default value for this setting is true.'
)}
`,
default: searchesDefault,
when: function(answers) {
Expand Down
2 changes: 1 addition & 1 deletion server/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const path = require('path');
const buildPath = path.resolve(__dirname, '..', 'build');
const manifestPath = path.join(buildPath, 'asset-manifest.json');
const manifest = require(manifestPath);
const mainJsPath = path.join(buildPath, manifest['main.js']);
const mainJsPath = path.join(buildPath, manifest['files']['main.js']);
const mainJs = require(mainJsPath);

module.exports = {
Expand Down
Loading

0 comments on commit 1de7dfa

Please sign in to comment.