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

Merge static content #427

Closed
wants to merge 13 commits into from
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
API_URL=
SPARQL_ENDPOINT_URL=http://localhost:8890/sparql
API_URL=http://localhost:8080
SPARQL_ENDPOINT_URL=https://virtuoso-test-external-service-ndc-test.apps.cloudpub.testedev.istat.it/sparql
IMAGE_INLINE_SIZE_LIMIT=0
INLINE_RUNTIME_CHUNK=false
NDC_MAINTENANCE_MESSAGE=
Expand Down
35 changes: 18 additions & 17 deletions config/env.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
'use strict';
/* eslint-disable prettier/prettier */
"use strict";

const fs = require('fs');
const path = require('path');
const paths = require('./paths');
const fs = require("fs");
const path = require("path");
const paths = require("./paths");

// Make sure that including paths.js after env.js will read .env variables.
delete require.cache[require.resolve('./paths')];
delete require.cache[require.resolve("./paths")];

const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
throw new Error(
'The NODE_ENV environment variable is required but was not specified.'
"The NODE_ENV environment variable is required but was not specified."
);
}

Expand All @@ -20,7 +21,7 @@ const dotenvFiles = [
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
NODE_ENV !== "test" && `${paths.dotenv}.local`,
`${paths.dotenv}.${NODE_ENV}`,
paths.dotenv,
].filter(Boolean);
Expand All @@ -30,10 +31,10 @@ const dotenvFiles = [
// that have already been set. Variable expansion is supported in .env files.
// https://github.com/motdotla/dotenv
// https://github.com/motdotla/dotenv-expand
dotenvFiles.forEach(dotenvFile => {
dotenvFiles.forEach((dotenvFile) => {
if (fs.existsSync(dotenvFile)) {
require('dotenv-expand')(
require('dotenv').config({
require("dotenv-expand")(
require("dotenv").config({
path: dotenvFile,
})
);
Expand All @@ -50,10 +51,10 @@ dotenvFiles.forEach(dotenvFile => {
// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
// We also resolve them to make sure all tools using them work consistently.
const appDirectory = fs.realpathSync(process.cwd());
process.env.NODE_PATH = (process.env.NODE_PATH || '')
process.env.NODE_PATH = (process.env.NODE_PATH || "")
.split(path.delimiter)
.filter(folder => folder && !path.isAbsolute(folder))
.map(folder => path.resolve(appDirectory, folder))
.filter((folder) => folder && !path.isAbsolute(folder))
.map((folder) => path.resolve(appDirectory, folder))
.join(path.delimiter);

// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
Expand All @@ -62,7 +63,7 @@ const REACT_APP = /^REACT_APP_/i;

function getClientEnvironment(publicUrl) {
const raw = Object.keys(process.env)
.filter(key => REACT_APP.test(key))
.filter((key) => REACT_APP.test(key))
.reduce(
(env, key) => {
env[key] = process.env[key];
Expand All @@ -71,7 +72,7 @@ function getClientEnvironment(publicUrl) {
{
// Useful for determining whether we’re running in production mode.
// Most importantly, it switches React into the correct mode.
NODE_ENV: process.env.NODE_ENV || 'development',
NODE_ENV: process.env.NODE_ENV || "development",
// Useful for resolving the correct path to static assets in `public`.
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
// This should only be used as an escape hatch. Normally you would put
Expand All @@ -89,12 +90,12 @@ function getClientEnvironment(publicUrl) {
// react-refresh is not 100% stable at this time,
// which is why it's disabled by default.
// It is defined here so it is available in the webpackHotDevClient.
FAST_REFRESH: process.env.FAST_REFRESH !== 'false',
FAST_REFRESH: process.env.FAST_REFRESH !== "false",
}
);
// Stringify all values so we can feed into webpack DefinePlugin
const stringified = {
'process.env': Object.keys(raw).reduce((env, key) => {
"process.env": Object.keys(raw).reduce((env, key) => {
env[key] = JSON.stringify(raw[key]);
return env;
}, {}),
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"babel-plugin-named-asset-import": "^0.3.8",
"babel-preset-react-app": "10.0.1",
"bfj": "^7.0.2",
"bootstrap-italia": "^1.4.3",
"@favware/skip-dependency": "^1.2.1",

"camelcase": "^6.2.1",
"case-sensitive-paths-webpack-plugin": "2.4.0",
"css-loader": "5.2.7",
"design-react-kit": "^4.0.2",
"dotenv": "16.0.3",
"dotenv-expand": "5.1.0",
"file-loader": "6.2.0",
Expand All @@ -43,11 +43,11 @@
"postcss-preset-env": "6.7.0",
"postcss-safe-parser": "5.0.2",
"prompts": "2.4.2",
"react": "^17.0.2",
"react": "^18.0.2",
"react-app-polyfill": "^3.0.0",
"react-dom": "^17.0.2",
"react-refresh": "^0.9.0",
"react-router-dom": "^6.4.3",
"react-dom": "^18.0.2",
"react-refresh": "^0.14.0",
"react-router-dom": "^6.14.2",
"readline": "^1.3.0",
"resolve": "1.20.0",
"resolve-url-loader": "^5.0.0",
Expand Down
7 changes: 6 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
<meta name="description" content="Catalogo Nazionale Dati" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />


<title>Catalogo Nazionale Dati</title>
<script src="%PUBLIC_URL%/js/global.js" ></script>
<script src="%PUBLIC_URL%/js/progressbar.js" ></script>
<script src="%PUBLIC_URL%/js/progressbar.min.js" ></script>
<script src="%PUBLIC_URL%/js/boot.js" ></script>
<script src="%PUBLIC_URL%/env-config.js"></script>

<!-- 2022-10-27T12:35:00Z -->
Expand All @@ -38,7 +43,7 @@
<p><img src="https://analytics.istat.it/matomo.php?idsite=33&amp;rec=1" style="border:0;" alt="" /></p>
</noscript>
<!-- End Matomo Code -->

</head>

<body>
Expand Down
559 changes: 559 additions & 0 deletions public/js/boot.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions public/js/jquery.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading