This commit is contained in:
Sebastian 2021-11-12 14:50:09 -03:00
parent d6beefe6e0
commit 50b9f2167c
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1
9 changed files with 54 additions and 14 deletions

View File

@ -4,7 +4,7 @@
"version": "0.0.0",
"license": "MIT",
"scripts": {
"build": "preact build --no-sw --no-esm",
"build": "preact build --no-sw --no-esm --no-inline-css",
"serve": "sirv build --port ${PORT:=8080} --cors --single",
"dev": "preact watch --port ${PORT:=8080} --no-sw --no-esm",
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
@ -71,4 +71,4 @@
"<rootDir>/tests/__mocks__/setupTests.ts"
]
}
}
}

View File

@ -0,0 +1,45 @@
/*
This file is part of GNU Taler
(C) 2021 Taler Systems S.A.
GNU Taler is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3, or (at your option) any later version.
GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
/**
*
* @author Sebastian Javier Marchano (sebasjm)
*/
import { DefinePlugin } from 'webpack';
import pack from './package.json';
import * as cp from 'child_process';
const commitHash = cp.execSync('git rev-parse --short HEAD').toString();
export default {
webpack(config, env, helpers) {
// add __VERSION__ to be use in the html
config.plugins.push(
new DefinePlugin({
'process.env.__VERSION__': JSON.stringify(env.isProd ? pack.version : `dev-${commitHash}`),
}),
);
const crittersWrapper = helpers.getPluginsByName(config, 'Critters')
if (crittersWrapper && crittersWrapper.length > 0) {
const [{ index }] = crittersWrapper
config.plugins.splice(index, 1)
}
}
}

View File

@ -12,7 +12,7 @@ export function SecretEditorScreen(): VNode {
const [secretFile, _setSecretFile] = useState<FileTypeContent | undefined>(
undefined,
);
function setSecretFile(v) {
function setSecretFile(v: FileTypeContent | undefined): void {
setSecretValue(""); // reset secret value when uploading a file
_setSecretFile(v);
}

View File

@ -45,7 +45,7 @@ export const WithoutFeedback = createExample(
challenges: [
{
cost: "USD:1",
instructions: "does P equals NP?",
instructions: "Email to me@domain.com",
type: "question",
uuid: "uuid-1",
},
@ -67,7 +67,7 @@ export const PaymentFeedback = createExample(
challenges: [
{
cost: "USD:1",
instructions: "does P equals NP?",
instructions: "Email to me@domain.com",
type: "question",
uuid: "uuid-1",
},

View File

@ -9,7 +9,7 @@ import { SolveOverviewFeedbackDisplay } from "../SolveScreen";
import { AuthMethodSolveProps } from "./index";
export function AuthMethodEmailSolve({ id }: AuthMethodSolveProps): VNode {
const [answer, setAnswer] = useState("");
const [answer, setAnswer] = useState("A-");
const [expanded, setExpanded] = useState(false);
const reducer = useAnastasisContext();

View File

@ -9,7 +9,7 @@ import { SolveOverviewFeedbackDisplay } from "../SolveScreen";
import { AuthMethodSolveProps } from "./index";
export function AuthMethodPostSolve({ id }: AuthMethodSolveProps): VNode {
const [answer, setAnswer] = useState("");
const [answer, setAnswer] = useState("A-");
const reducer = useAnastasisContext();
if (!reducer) {

View File

@ -45,7 +45,7 @@ export const WithoutFeedback = createExample(
challenges: [
{
cost: "USD:1",
instructions: "does P equals NP?",
instructions: "SMS to +54 11 2233 4455",
type: "question",
uuid: "uuid-1",
},

View File

@ -9,7 +9,7 @@ import { SolveOverviewFeedbackDisplay } from "../SolveScreen";
import { AuthMethodSolveProps } from "./index";
export function AuthMethodSmsSolve({ id }: AuthMethodSolveProps): VNode {
const [answer, setAnswer] = useState("");
const [answer, setAnswer] = useState("A-");
const [expanded, setExpanded] = useState(false);
const reducer = useAnastasisContext();

View File

@ -38,11 +38,6 @@
name="theme-color"
content="<%= htmlWebpackPlugin.options.manifest.theme_color %>"
/>
<% } %> <% for (const index in htmlWebpackPlugin.files.css) { %> <% const
file = htmlWebpackPlugin.files.css[index] %>
<style data-href="<%= file %>">
<%= compilation.assets[file.substr(htmlWebpackPlugin.files.publicPath.length)].source() %>
</style>
<% } %>
</head>
<body>