upgrade to now build from web-utils
This commit is contained in:
parent
6340cc5454
commit
d61e4fa719
@ -14,157 +14,13 @@
|
|||||||
You should have received a copy of the GNU Affero General Public License along with
|
You should have received a copy of the GNU Affero General Public License along with
|
||||||
GNU Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
GNU Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
||||||
*/
|
*/
|
||||||
/* eslint-disable no-undef */
|
import { build } from "@gnu-taler/web-util/build";
|
||||||
import esbuild from 'esbuild'
|
|
||||||
import fs from 'fs';
|
|
||||||
import path from "path"
|
|
||||||
import sass from "sass";
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-undef
|
await build({
|
||||||
const BASE = process.cwd();
|
source: {
|
||||||
|
js: ["src/index.ts"],
|
||||||
const preact = path.join(
|
assets: ["src/index.html"],
|
||||||
BASE,
|
|
||||||
"node_modules",
|
|
||||||
"preact",
|
|
||||||
"compat",
|
|
||||||
"dist",
|
|
||||||
"compat.module.js",
|
|
||||||
);
|
|
||||||
|
|
||||||
const preactCompatPlugin = {
|
|
||||||
name: "preact-compat",
|
|
||||||
setup(build) {
|
|
||||||
build.onResolve({ filter: /^(react-dom|react)$/ }, (args) => {
|
|
||||||
return {
|
|
||||||
path: preact,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
};
|
destination: "./dist/prod",
|
||||||
|
css: "sass",
|
||||||
|
});
|
||||||
let GIT_ROOT = BASE
|
|
||||||
while (!fs.existsSync(path.join(GIT_ROOT, '.git')) && GIT_ROOT !== '/') {
|
|
||||||
GIT_ROOT = path.join(GIT_ROOT, '../')
|
|
||||||
}
|
|
||||||
if (GIT_ROOT === '/') {
|
|
||||||
// eslint-disable-next-line no-undef
|
|
||||||
console.log("not found")
|
|
||||||
// eslint-disable-next-line no-undef
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
const GIT_HASH = GIT_ROOT === '/' ? undefined : git_hash()
|
|
||||||
|
|
||||||
|
|
||||||
let _package = JSON.parse(fs.readFileSync(path.join(BASE, 'package.json')));
|
|
||||||
|
|
||||||
function git_hash() {
|
|
||||||
const rev = fs.readFileSync(path.join(GIT_ROOT, '.git', 'HEAD')).toString().trim().split(/.*[: ]/).slice(-1)[0];
|
|
||||||
if (rev.indexOf('/') === -1) {
|
|
||||||
return rev;
|
|
||||||
} else {
|
|
||||||
return fs.readFileSync(path.join(GIT_ROOT, '.git', rev)).toString().trim();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const DEFAULT_SASS_FILTER = /\.(s[ac]ss|css)$/
|
|
||||||
|
|
||||||
const buildSassPlugin = {
|
|
||||||
name: "custom-build-sass",
|
|
||||||
setup(build) {
|
|
||||||
|
|
||||||
build.onLoad({ filter: DEFAULT_SASS_FILTER }, ({ path: file }) => {
|
|
||||||
const resolveDir = path.dirname(file)
|
|
||||||
const { css: contents } = sass.compile(file, { loadPaths: ["./"] })
|
|
||||||
|
|
||||||
return {
|
|
||||||
resolveDir,
|
|
||||||
loader: 'css',
|
|
||||||
contents
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
function copyFilesPlugin(options) {
|
|
||||||
if (!options.basedir) {
|
|
||||||
options.basedir = process.cwd()
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
name: "copy-files",
|
|
||||||
setup(build) {
|
|
||||||
build.onEnd(() => {
|
|
||||||
for (const fop of options) {
|
|
||||||
fs.copyFileSync(path.join(options.basedir, fop.src), path.join(options.basedir, fop.dest));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function getFilesInDirectory(startPath, regex) {
|
|
||||||
if (!fs.existsSync(startPath)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const files = fs.readdirSync(startPath);
|
|
||||||
const result = files.flatMap(file => {
|
|
||||||
const filename = path.join(startPath, file);
|
|
||||||
|
|
||||||
const stat = fs.lstatSync(filename);
|
|
||||||
if (stat.isDirectory()) {
|
|
||||||
return getFilesInDirectory(filename, regex);
|
|
||||||
}
|
|
||||||
else if (regex.test(filename)) {
|
|
||||||
return filename
|
|
||||||
}
|
|
||||||
}).filter(x => !!x)
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
const allTestFiles = getFilesInDirectory(path.join(BASE, 'src'), /test.tsx?$/)
|
|
||||||
const entryPoints = ["src/index.ts", "src/stories.tsx", ...allTestFiles];
|
|
||||||
|
|
||||||
export const buildConfig = {
|
|
||||||
entryPoints: [...entryPoints],
|
|
||||||
bundle: true,
|
|
||||||
outdir: 'dist',
|
|
||||||
minify: false,
|
|
||||||
loader: {
|
|
||||||
'.svg': 'dataurl',
|
|
||||||
'.ttf': 'file',
|
|
||||||
'.woff': 'file',
|
|
||||||
'.woff2': 'file',
|
|
||||||
'.eot': 'file',
|
|
||||||
},
|
|
||||||
target: [
|
|
||||||
'es6'
|
|
||||||
],
|
|
||||||
format: 'esm',
|
|
||||||
platform: 'browser',
|
|
||||||
sourcemap: true,
|
|
||||||
jsxFactory: 'h',
|
|
||||||
jsxFragment: 'Fragment',
|
|
||||||
define: {
|
|
||||||
'__VERSION__': `"${_package.version}"`,
|
|
||||||
'__GIT_HASH__': `"${GIT_HASH}"`,
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
preactCompatPlugin,
|
|
||||||
copyFilesPlugin([
|
|
||||||
{
|
|
||||||
src: "./src/index.html",
|
|
||||||
dest: "./dist/index.html",
|
|
||||||
},
|
|
||||||
]),
|
|
||||||
buildSassPlugin
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
await esbuild.build(buildConfig)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,17 +15,26 @@
|
|||||||
GNU Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
GNU Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { serve } from "@gnu-taler/web-util/lib/index.node";
|
import { serve } from "@gnu-taler/web-util/node";
|
||||||
import esbuild from 'esbuild';
|
import { initializeDev, getFilesInDirectory } from "@gnu-taler/web-util/build";
|
||||||
import { buildConfig } from "./build.mjs";
|
|
||||||
|
|
||||||
buildConfig.inject = ['./node_modules/@gnu-taler/web-util/lib/live-reload.mjs']
|
const allTestFiles = getFilesInDirectory("src", /.test.tsx?$/);
|
||||||
|
const devEntryPoints = ["src/stories.tsx", "src/index.ts", ...allTestFiles];
|
||||||
|
|
||||||
|
const build = initializeDev({
|
||||||
|
source: {
|
||||||
|
js: devEntryPoints,
|
||||||
|
assets: ["src/index.html"],
|
||||||
|
},
|
||||||
|
css: "sass",
|
||||||
|
destination: "./dist/dev",
|
||||||
|
});
|
||||||
|
|
||||||
|
await build();
|
||||||
|
|
||||||
serve({
|
serve({
|
||||||
folder: './dist',
|
folder: "./dist/dev",
|
||||||
port: 8080,
|
port: 8080,
|
||||||
source: './src',
|
source: "./src",
|
||||||
development: true,
|
onSourceUpdate: build,
|
||||||
onUpdate: async () => esbuild.build(buildConfig)
|
});
|
||||||
})
|
|
||||||
|
|
||||||
|
@ -17,12 +17,10 @@
|
|||||||
"@gnu-taler/anastasis-core": "workspace:*",
|
"@gnu-taler/anastasis-core": "workspace:*",
|
||||||
"@gnu-taler/taler-util": "workspace:*",
|
"@gnu-taler/taler-util": "workspace:*",
|
||||||
"@gnu-taler/web-util": "workspace:*",
|
"@gnu-taler/web-util": "workspace:*",
|
||||||
"@types/chai": "^4.3.0",
|
|
||||||
"chai": "^4.3.6",
|
|
||||||
"date-fns": "2.29.2",
|
"date-fns": "2.29.2",
|
||||||
|
"jssha": "^3.3.0",
|
||||||
"jed": "1.1.1",
|
"jed": "1.1.1",
|
||||||
"preact": "10.11.3",
|
"preact": "10.11.3",
|
||||||
"preact-render-to-string": "^5.1.19",
|
|
||||||
"preact-router": "^3.2.1",
|
"preact-router": "^3.2.1",
|
||||||
"qrcode-generator": "^1.4.4"
|
"qrcode-generator": "^1.4.4"
|
||||||
},
|
},
|
||||||
@ -40,10 +38,11 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@creativebulma/bulma-tooltip": "^1.2.0",
|
"@creativebulma/bulma-tooltip": "^1.2.0",
|
||||||
"@types/mocha": "^9.0.0",
|
"@types/mocha": "^9.0.0",
|
||||||
|
"@types/chai": "^4.3.0",
|
||||||
|
"chai": "^4.3.6",
|
||||||
"bulma": "^0.9.3",
|
"bulma": "^0.9.3",
|
||||||
"bulma-checkbox": "^1.1.1",
|
"bulma-checkbox": "^1.1.1",
|
||||||
"bulma-radio": "^1.1.1",
|
"bulma-radio": "^1.1.1",
|
||||||
"jssha": "^3.2.0",
|
|
||||||
"mocha": "^9.2.0",
|
"mocha": "^9.2.0",
|
||||||
"sass": "1.56.1",
|
"sass": "1.56.1",
|
||||||
"typescript": "^4.9.4"
|
"typescript": "^4.9.4"
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ComponentChildren, Fragment, h, VNode } from "preact";
|
import { ComponentChildren, Fragment, h, VNode } from "preact";
|
||||||
import Match from "preact-router/match";
|
import { Match } from "preact-router/match.js";
|
||||||
import { useEffect, useState } from "preact/hooks";
|
import { useEffect, useState } from "preact/hooks";
|
||||||
import { NavigationBar } from "./NavigationBar.js";
|
import { NavigationBar } from "./NavigationBar.js";
|
||||||
import { Sidebar } from "./SideBar.js";
|
import { Sidebar } from "./SideBar.js";
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
import { h, FunctionalComponent } from "preact";
|
import { h, FunctionalComponent } from "preact";
|
||||||
import { useState } from "preact/hooks";
|
import { useState } from "preact/hooks";
|
||||||
import { DurationPicker as TestedComponent } from "./DurationPicker.js";
|
import { DurationPicker as TestedComponent } from "./DurationPicker.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
component: TestedComponent,
|
component: TestedComponent,
|
||||||
|
@ -19,7 +19,8 @@
|
|||||||
* @author Sebastian Javier Marchano (sebasjm)
|
* @author Sebastian Javier Marchano (sebasjm)
|
||||||
*/
|
*/
|
||||||
import { setupI18n } from "@gnu-taler/taler-util";
|
import { setupI18n } from "@gnu-taler/taler-util";
|
||||||
import { parseGroupImport, tests } from "@gnu-taler/web-util/lib/index.browser";
|
import { parseGroupImport } from "@gnu-taler/web-util/browser";
|
||||||
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import * as pages from "./pages/home/index.stories.js";
|
import * as pages from "./pages/home/index.stories.js";
|
||||||
import { ComponentChildren, VNode, h as create } from "preact";
|
import { ComponentChildren, VNode, h as create } from "preact";
|
||||||
import { AnastasisProvider } from "./context/anastasis.js";
|
import { AnastasisProvider } from "./context/anastasis.js";
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { AuthenticationProviderStatusOk } from "@gnu-taler/anastasis-core";
|
import { AuthenticationProviderStatusOk } from "@gnu-taler/anastasis-core";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { WithoutProviderType, WithProviderType } from "./views.jsx";
|
import { WithoutProviderType, WithProviderType } from "./views.jsx";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
import useComponentState from "./state.js";
|
import useComponentState from "./state.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
describe("AddingProviderScreen states", () => {
|
describe("AddingProviderScreen states", () => {
|
||||||
it("should not load more if has reach the end", async () => {
|
it("should not load more if has reach the end", async () => {
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { AttributeEntryScreen as TestedComponent } from "./AttributeEntryScreen.js";
|
import { AttributeEntryScreen as TestedComponent } from "./AttributeEntryScreen.js";
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { AuthenticationEditorScreen as TestedComponent } from "./AuthenticationEditorScreen.js";
|
import { AuthenticationEditorScreen as TestedComponent } from "./AuthenticationEditorScreen.js";
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { BackupFinishedScreen as TestedComponent } from "./BackupFinishedScreen.js";
|
import { BackupFinishedScreen as TestedComponent } from "./BackupFinishedScreen.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Backup finish",
|
title: "Backup finish",
|
||||||
|
@ -26,7 +26,7 @@ import {
|
|||||||
} from "@gnu-taler/anastasis-core";
|
} from "@gnu-taler/anastasis-core";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { ChallengeOverviewScreen as TestedComponent } from "./ChallengeOverviewScreen.js";
|
import { ChallengeOverviewScreen as TestedComponent } from "./ChallengeOverviewScreen.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Challenge overview",
|
title: "Challenge overview",
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* @author Sebastian Javier Marchano (sebasjm)
|
* @author Sebastian Javier Marchano (sebasjm)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { ChallengePayingScreen as TestedComponent } from "./ChallengePayingScreen.js";
|
import { ChallengePayingScreen as TestedComponent } from "./ChallengePayingScreen.js";
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { ContinentSelectionScreen as TestedComponent } from "./ContinentSelectionScreen.js";
|
import { ContinentSelectionScreen as TestedComponent } from "./ContinentSelectionScreen.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Continent selection",
|
title: "Continent selection",
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { EditPoliciesScreen as TestedComponent } from "./EditPoliciesScreen.js";
|
import { EditPoliciesScreen as TestedComponent } from "./EditPoliciesScreen.js";
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { PoliciesPayingScreen as TestedComponent } from "./PoliciesPayingScreen.js";
|
import { PoliciesPayingScreen as TestedComponent } from "./PoliciesPayingScreen.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Policies paying",
|
title: "Policies paying",
|
||||||
|
@ -23,7 +23,7 @@ import { ReducerState } from "@gnu-taler/anastasis-core";
|
|||||||
import { encodeCrock, stringToBytes } from "@gnu-taler/taler-util";
|
import { encodeCrock, stringToBytes } from "@gnu-taler/taler-util";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { RecoveryFinishedScreen as TestedComponent } from "./RecoveryFinishedScreen.js";
|
import { RecoveryFinishedScreen as TestedComponent } from "./RecoveryFinishedScreen.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Recovery Finished",
|
title: "Recovery Finished",
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { ReviewPoliciesScreen as TestedComponent } from "./ReviewPoliciesScreen.js";
|
import { ReviewPoliciesScreen as TestedComponent } from "./ReviewPoliciesScreen.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Reviewing Policies",
|
title: "Reviewing Policies",
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { SecretEditorScreen as TestedComponent } from "./SecretEditorScreen.js";
|
import { SecretEditorScreen as TestedComponent } from "./SecretEditorScreen.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Secret editor",
|
title: "Secret editor",
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import {
|
import {
|
||||||
SecretSelectionScreen,
|
SecretSelectionScreen,
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { SolveScreen as TestedComponent } from "./SolveScreen.js";
|
import { SolveScreen as TestedComponent } from "./SolveScreen.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Solve Screen",
|
title: "Solve Screen",
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* @author Sebastian Javier Marchano (sebasjm)
|
* @author Sebastian Javier Marchano (sebasjm)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { StartScreen as TestedComponent } from "./StartScreen.js";
|
import { StartScreen as TestedComponent } from "./StartScreen.js";
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { reducerStatesExample } from "../../utils/index.js";
|
import { reducerStatesExample } from "../../utils/index.js";
|
||||||
import { TruthsPayingScreen as TestedComponent } from "./TruthsPayingScreen.js";
|
import { TruthsPayingScreen as TestedComponent } from "./TruthsPayingScreen.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Truths Paying",
|
title: "Truths Paying",
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* @author Sebastian Javier Marchano (sebasjm)
|
* @author Sebastian Javier Marchano (sebasjm)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../../utils/index.js";
|
import { reducerStatesExample } from "../../../utils/index.js";
|
||||||
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import {
|
|||||||
} from "@gnu-taler/anastasis-core";
|
} from "@gnu-taler/anastasis-core";
|
||||||
import { reducerStatesExample } from "../../../utils/index.js";
|
import { reducerStatesExample } from "../../../utils/index.js";
|
||||||
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Auth method: Email solve",
|
title: "Auth method: Email solve",
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* @author Sebastian Javier Marchano (sebasjm)
|
* @author Sebastian Javier Marchano (sebasjm)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../../utils/index.js";
|
import { reducerStatesExample } from "../../../utils/index.js";
|
||||||
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../../utils/index.js";
|
import { reducerStatesExample } from "../../../utils/index.js";
|
||||||
import { KnownAuthMethods, authMethods as TestedComponent } from "./index.js";
|
import { KnownAuthMethods, authMethods as TestedComponent } from "./index.js";
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* @author Sebastian Javier Marchano (sebasjm)
|
* @author Sebastian Javier Marchano (sebasjm)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../../utils/index.js";
|
import { reducerStatesExample } from "../../../utils/index.js";
|
||||||
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { reducerStatesExample } from "../../../utils/index.js";
|
import { reducerStatesExample } from "../../../utils/index.js";
|
||||||
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Auth method: Post solve",
|
title: "Auth method: Post solve",
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* @author Sebastian Javier Marchano (sebasjm)
|
* @author Sebastian Javier Marchano (sebasjm)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../../utils/index.js";
|
import { reducerStatesExample } from "../../../utils/index.js";
|
||||||
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import {
|
|||||||
} from "@gnu-taler/anastasis-core";
|
} from "@gnu-taler/anastasis-core";
|
||||||
import { reducerStatesExample } from "../../../utils/index.js";
|
import { reducerStatesExample } from "../../../utils/index.js";
|
||||||
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Auth method: Question solve",
|
title: "Auth method: Question solve",
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* @author Sebastian Javier Marchano (sebasjm)
|
* @author Sebastian Javier Marchano (sebasjm)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../../utils/index.js";
|
import { reducerStatesExample } from "../../../utils/index.js";
|
||||||
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { reducerStatesExample } from "../../../utils/index.js";
|
import { reducerStatesExample } from "../../../utils/index.js";
|
||||||
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "Auth method: SMS solve",
|
title: "Auth method: SMS solve",
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* @author Sebastian Javier Marchano (sebasjm)
|
* @author Sebastian Javier Marchano (sebasjm)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../../utils/index.js";
|
import { reducerStatesExample } from "../../../utils/index.js";
|
||||||
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
import { authMethods as TestedComponent, KnownAuthMethods } from "./index.js";
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ReducerState } from "@gnu-taler/anastasis-core";
|
import { ReducerState } from "@gnu-taler/anastasis-core";
|
||||||
import { tests } from "@gnu-taler/web-util/lib/index.browser";
|
import * as tests from "@gnu-taler/web-util/testing";
|
||||||
import { reducerStatesExample } from "../../../utils/index.js";
|
import { reducerStatesExample } from "../../../utils/index.js";
|
||||||
import { KnownAuthMethods, authMethods as TestedComponent } from "./index.js";
|
import { KnownAuthMethods, authMethods as TestedComponent } from "./index.js";
|
||||||
|
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
You should have received a copy of the GNU Affero General Public License along with
|
You should have received a copy of the GNU Affero General Public License along with
|
||||||
GNU Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
GNU Anastasis; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//@ts-ignore
|
||||||
import jssha from "jssha";
|
import jssha from "jssha";
|
||||||
|
|
||||||
const SEARCH_RANGE = 16;
|
const SEARCH_RANGE = 16;
|
||||||
|
@ -22,7 +22,7 @@ import { strings } from "./i18n/strings.js";
|
|||||||
|
|
||||||
import * as pages from "./pages/home/index.stories.js";
|
import * as pages from "./pages/home/index.stories.js";
|
||||||
|
|
||||||
import { renderStories } from "@gnu-taler/web-util/lib/index.browser";
|
import { renderStories } from "@gnu-taler/web-util/browser";
|
||||||
|
|
||||||
import "./scss/main.scss";
|
import "./scss/main.scss";
|
||||||
|
|
||||||
|
@ -1,46 +1,38 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
/* Basic Options */
|
/* Basic Options */
|
||||||
"target": "ES6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */,
|
"target": "ES5",
|
||||||
"module": "ESNext" /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
|
"module": "ES6",
|
||||||
"lib": [
|
"lib": [
|
||||||
"es2021",
|
"DOM",
|
||||||
"dom"
|
"ES2017"
|
||||||
], /* Specify library files to be included in the compilation: */
|
],
|
||||||
// "allowJs": true /* Allow javascript files to be compiled. */,
|
"allowJs": true /* Allow javascript files to be compiled. */,
|
||||||
// "checkJs": true, /* Report errors in .js files. */
|
// "checkJs": true, /* Report errors in .js files. */
|
||||||
"jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
|
"jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
|
||||||
"jsxFactory": "h" /* Specify the JSX factory function to use when targeting react JSX emit, e.g. React.createElement or h. */,
|
"jsxFactory": "h",
|
||||||
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
"jsxFragmentFactory": "Fragment",
|
||||||
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
|
||||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
||||||
// "outDir": "./", /* Redirect output structure to the directory. */
|
|
||||||
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
||||||
// "removeComments": true, /* Do not emit comments to output. */
|
|
||||||
"noEmit": true /* Do not emit outputs. */,
|
"noEmit": true /* Do not emit outputs. */,
|
||||||
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||||
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||||
/* Strict Type-Checking Options */
|
/* Strict Type-Checking Options */
|
||||||
"strict": true /* Enable all strict type-checking options. */,
|
"strict": true /* Enable all strict type-checking options. */,
|
||||||
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
|
||||||
// "strictNullChecks": true, /* Enable strict null checks. */
|
|
||||||
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
|
||||||
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
|
||||||
/* Additional Checks */
|
/* Additional Checks */
|
||||||
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
||||||
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||||
/* Module Resolution Options */
|
/* Module Resolution Options */
|
||||||
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
|
"moduleResolution": "Node16" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
|
||||||
"esModuleInterop": true /* */,
|
"esModuleInterop": true /* */,
|
||||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||||
// "types": [], /* Type declaration files to be included in compilation. */
|
// "types": [], /* Type declaration files to be included in compilation. */
|
||||||
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
"allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
|
||||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||||
/* Source Map Options */
|
/* Source Map Options */
|
||||||
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||||
@ -53,16 +45,7 @@
|
|||||||
/* Advanced Options */
|
/* Advanced Options */
|
||||||
"skipLibCheck": true /* Skip type checking of declaration files. */
|
"skipLibCheck": true /* Skip type checking of declaration files. */
|
||||||
},
|
},
|
||||||
"references": [
|
|
||||||
{
|
|
||||||
"path": "../taler-util/"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "../anastasis-core/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*",
|
"src/**/*"
|
||||||
"tests/**/*"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user