Added start and build scripts for windows (#81)

This commit is contained in:
czifumasa
2022-01-13 17:26:01 +01:00
committed by GitHub
parent 0b8084e3bc
commit ab66492a86
6 changed files with 43 additions and 18 deletions

View File

@@ -2,5 +2,6 @@
"singleQuote": true,
"bracketSpacing": false,
"arrowParens": "always",
"trailingComma": "all"
"trailingComma": "all",
"endOfLine": "crlf"
}

22
package-lock.json generated
View File

@@ -5,7 +5,6 @@
"requires": true,
"packages": {
"": {
"name": "topola-viewer",
"version": "1.0.0",
"dependencies": {
"@artsy/fresnel": "^1.3.1",
@@ -63,6 +62,7 @@
"gh-pages": "^3.1.0",
"prettier": "^2.2.1",
"react-scripts": "^4.0.3",
"run-script-os": "^1.1.6",
"start-server-and-test": "^1.12.1",
"tslint-config-prettier": "^1.18.0",
"typescript": "^4.2.3"
@@ -6501,6 +6501,7 @@
"version": "3.10.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.10.0.tgz",
"integrity": "sha512-MQx/7TLgmmDVamSyfE+O+5BHvG1aUGj/gHhLn1wVtm2B5u1eVIPvh7vkfjwWKNCjrTJB8+He99IntSQ1qP+vYQ==",
"devOptional": true,
"hasInstallScript": true,
"funding": {
"type": "opencollective",
@@ -19909,6 +19910,16 @@
"aproba": "^1.1.1"
}
},
"node_modules/run-script-os": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/run-script-os/-/run-script-os-1.1.6.tgz",
"integrity": "sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==",
"dev": true,
"bin": {
"run-os": "index.js",
"run-script-os": "index.js"
}
},
"node_modules/rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
@@ -30689,7 +30700,8 @@
"core-js": {
"version": "3.10.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.10.0.tgz",
"integrity": "sha512-MQx/7TLgmmDVamSyfE+O+5BHvG1aUGj/gHhLn1wVtm2B5u1eVIPvh7vkfjwWKNCjrTJB8+He99IntSQ1qP+vYQ=="
"integrity": "sha512-MQx/7TLgmmDVamSyfE+O+5BHvG1aUGj/gHhLn1wVtm2B5u1eVIPvh7vkfjwWKNCjrTJB8+He99IntSQ1qP+vYQ==",
"devOptional": true
},
"core-js-compat": {
"version": "3.10.0",
@@ -41382,6 +41394,12 @@
"aproba": "^1.1.1"
}
},
"run-script-os": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/run-script-os/-/run-script-os-1.1.6.tgz",
"integrity": "sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==",
"dev": true
},
"rxjs": {
"version": "6.6.7",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",

View File

@@ -58,13 +58,18 @@
"gh-pages": "^3.1.0",
"prettier": "^2.2.1",
"react-scripts": "^4.0.3",
"run-script-os": "^1.1.6",
"start-server-and-test": "^1.12.1",
"tslint-config-prettier": "^1.18.0",
"typescript": "^4.2.3"
},
"scripts": {
"start": "REACT_APP_CHANGELOG=`cat CHANGELOG.md` REACT_APP_GIT_SHA=`git rev-parse --short HEAD` REACT_APP_GIT_TIME=`git log -1 --format=%ci` react-scripts start",
"build": "REACT_APP_CHANGELOG=`cat CHANGELOG.md` REACT_APP_GIT_SHA=`git rev-parse --short HEAD` REACT_APP_GIT_TIME=`git log -1 --format=%ci` react-scripts build",
"start": "run-script-os",
"start:default": "REACT_APP_CHANGELOG=`cat CHANGELOG.md` REACT_APP_GIT_SHA=`git rev-parse --short HEAD` REACT_APP_GIT_TIME=`git log -1 --format=%ci` react-scripts start",
"start:windows": "react-scripts start",
"build": "run-script-os",
"build:default": "REACT_APP_CHANGELOG=`cat CHANGELOG.md` REACT_APP_GIT_SHA=`git rev-parse --short HEAD` REACT_APP_GIT_TIME=`git log -1 --format=%ci` react-scripts build",
"build:windows": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"prettier": "prettier --write src/**/*.{ts,tsx,json} && prettier --write src/*.{ts,tsx,json}",
"predeploy": "npm run build",

View File

@@ -19,16 +19,16 @@ export async function getChangelog(maxVersions: number, seenVersion?: string) {
? Date.parse(seenVersion.slice(0, 10))
: 0;
const changes = process.env
.REACT_APP_CHANGELOG!.split('##')
.slice(1, maxVersions + 1)
.map((notes) => {
const date = Date.parse(notes.split('\n')[0].trim());
return {date, notes: '####' + notes};
})
.filter((release) => release.date > seenVersionDate)
.map((release) => release.notes)
.join('\n');
const changes =
process.env.REACT_APP_CHANGELOG?.split('##')
.slice(1, maxVersions + 1)
.map((notes) => {
const date = Date.parse(notes.split('\n')[0].trim());
return {date, notes: '####' + notes};
})
.filter((release) => release.date > seenVersionDate)
.map((release) => release.notes)
.join('\n') || '';
const parsedChanges = await unified()
.use(remarkParse)

View File

@@ -680,14 +680,15 @@ function famToGedcom(fam: JsonFam): GedcomEntry {
tree: [],
});
}
(fam.children || []).forEach(child =>
(fam.children || []).forEach((child) =>
record.tree.push({
level: 1,
pointer: child,
tag: 'CHILD',
data: '',
tree: [],
}));
}),
);
if (fam.marriage) {
record.tree.push({
level: 1,

View File

@@ -19,7 +19,7 @@ function GedcomLink(props: {url: string; text: string}) {
}
function formatBuildDate(dateString: string) {
return dateString.slice(0, 16);
return dateString?.slice(0, 16) || '';
}
function Contents() {