diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 043eb20..d95d68f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,14 @@ jobs: uses: cypress-io/github-action@v6 with: build: npm install - config: baseUrl=https://stabikat.de/ - spec: cypress/e2e/spec.cy.js - # browser: firefox \ No newline at end of file + config: baseUrl=https://stabikat.de/search/ + spec: | + cypress/e2e/spec.cy.js + cypress/e2e/author.cy.js + cypress/e2e/reviews.cy.js + cypress/e2e/nested.cy.js + cypress/e2e/multi-lang-phrase.cy.js + # browser: firefox + # Lint Yaml + - name: Yaml Lint + run: npm run lint \ No newline at end of file diff --git a/README.md b/README.md index 1f67275..b67032c 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ Um direkt mit dem [Findex](https://github.com/gbv/findex-config) zu kommuniziere ```powershell $env:HTTP_PROXY = "http://proxy.spk-berlin.de:3128" +$env:HTTPS_PROXY = "HTTPS_PROXY=http://proxy-dev.spk-berlin.de:3128" $env:NO_PROXY = "b-dev20220203-vufind-6, localhost, 127.0.0.1, 10.0.0.0/8, 172.16.200.0/24, 194.94.132.0/22, .sbb.spk-berlin.de, .staatsbibliothek-berlin.de, .dev.sbb.berlin, smb.museum, .pk.de" ``` @@ -72,14 +73,13 @@ Oder via Browser GUI modus: npx cypress open ``` -Caveat: Sollte ein eine Browser spezifische Warnung erscheinen, verhindern Windows Systemeinstellungen die automatisierte Nutzung des gewählten Browsers. - Für die Reproduktion der CI Testläufe gegen den produktiven Stabikat von ausserhalb des Hausnetzes: ```powerhshell CYPRESS_BASE_URL=https://stabikat.de/search/ npx cypress run -s cypress/e2e/simple.cy.js ``` +Caveat: Sollte ein eine Browser spezifische Warnung erscheinen, verhindern Windows Systemeinstellungen die automatisierte Nutzung des gewählten Browsers. ```powershell Cypress detected policy settings on your computer that may cause issues. @@ -91,4 +91,12 @@ The following policies were detected that may prevent Cypress from automating Ch For more information, see https://on.cypress.io/bad-browser-policy ``` -In diese Fällen müssen Tests in `Electron` ausgeführt werden. \ No newline at end of file +In diese Fällen müssen Tests in `Electron` ausgeführt werden. + +### Yaml Prüfung + +Um die yaml Dateien im `vufind/` Ordner auf Syntaxfehler zu überprüfen: + +```powershell +npm run lint +``` \ No newline at end of file diff --git a/cypress/e2e/author.cy.js b/cypress/e2e/author.cy.js new file mode 100644 index 0000000..a7abc8f --- /dev/null +++ b/cypress/e2e/author.cy.js @@ -0,0 +1,112 @@ +describe('Author Search', () => { + // see #14 + describe('glaser karin' , () => { + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'glaser karin', + type: 'Author' + } + }) + }) + + // erster Treffer von Autorin + it('first hit should be by the author', () => { + cy.get('#result0') + .find('.resultlist-data') + .contains('Karin Glaser') + }) + }) + + describe('阎连科', () => { + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: '阎连科', + type: 'Author' + } + }) + }) + + // see #22 + it('CJK author search should return translations', () => { + cy.get('.record-list') + .contains('Yan, Lianke') + }) + }) + + describe('"Corte, Justine del"', () => { + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: '"Corte, Justine del"', + type: 'allFields' + } + }) + }) + + it('strict search should only contain works by that author', () => { + cy.get('.resultlist-data') + .should('have.length.gte', 3) + .and('contain','Corte, Justine del') + }) + }) + + describe('Samuel Scheidt' , () => { + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Samuel Scheidt', + type: 'Author', + limit: '5' + } + }) + }) + + // (DP): 182 (or 90?)works by author but 200 hits. + // within top 20 6 works unrelated to search 14 by author + // Top 5 in author search should all be by author + // see #28 + it.skip('TOP 5 should all be by author', () => { + cy.get('.resultlist-data') + .find('[href*=Author]') + .each(($el, index, $lis) => { + cy.wrap($el) + .contains('Scheidt, Samuel') + }) + .then(($lis) => { + cy.wrap($lis) + .should('have.length', '5') + }) + + }) + }) + + describe('oliver heaviside' , () => { + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'oliver heaviside', + type: 'allFields' + } + }) + }) + + it('should appear in each of top 20', () => { + cy.get('.resultlist') + .each(($el, index, $lis) => { + cy.wrap($el) + .contains('Heaviside', {matchCase: false}) + }) + .then(($lis) => { + cy.wrap($lis) + .should('have.length', '20') + }) + }) + }) +}) \ No newline at end of file diff --git a/cypress/e2e/multi-lang-phrase.cy.js b/cypress/e2e/multi-lang-phrase.cy.js new file mode 100644 index 0000000..430002e --- /dev/null +++ b/cypress/e2e/multi-lang-phrase.cy.js @@ -0,0 +1,38 @@ +describe('Foreign language phrase search', () => { + // See #6 + // Thematische Suche#L30 + it('en all fields query matches en not ar', () => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Egyptian Language', + type: 'AllFields' + } + }) + cy.get('.resultlist') + // PPN JST063665204 + .contains('The Egyptian Language') + cy.get('.resultlist') + // PPN DOAJ008736839 + .should('not.contain', 'المعانی الثانیة للأمر فی النص المصری القدیم دراسة بلاغیة مقارنة ') + + }) + + // see #27 + it.skip('en subject query matches en and ar', () => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Egyptian Language', + type: 'Subject' + } + }) + cy.get('.resultlist') + // PPN JST063665204 + .contains('The Egyptian Language') + cy.get('.resultlist') + // PPN DOAJ008736839 + .contains('المعانی الثانیة للأمر فی النص المصری القدیم دراسة بلاغیة مقارنة ') + + }) +}) \ No newline at end of file diff --git a/cypress/e2e/nested.cy.js b/cypress/e2e/nested.cy.js new file mode 100644 index 0000000..93a45a3 --- /dev/null +++ b/cypress/e2e/nested.cy.js @@ -0,0 +1,82 @@ +describe('Nested Work', () => { + // see #8 + describe('African American Review', () => { + // Title search and online access false to limit noise + // check if exact match first list item is the journal parent and subsequent entries are child works + // a more elaborate test would compare the value of '.record-number' within the same family + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'African American Review', + type: 'Title', + "filter[]": '~remote_bool:"false"' + } + }) + }) + + // see #25 + it.skip('should appear before child work', () => { + cy.get('#result0') + .find('.media-type') + .contains(' Zeitschrift (gedruckt) ') + cy.get('#result1') + .find('.media-type') + .contains(' Band einer Zeitschrift/Zeitung ') + }) + }) + + describe('Nachrichten Organ Bergbau Hüttenbetrieb', () => { + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Nachrichten Organ Bergbau Hüttenbetrieb', + type: 'allFields' + } + }) + }) + + // (DP): 3 hits no child works as far as I can see + // PPN: 168000709 + it('first hit should be parent work', () => { + cy.get('[href*="168000709"]') + .should('exist') + }) + }) + + describe('Journal of Comparative Law 2021', () => { + // (DP): parent work not in top 20 + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Journal of Comparative Law 2021', + type: 'allFields' + } + }) + }) + + + // PPN: 1755480725 + it('first hit should be 2021 child work based on search term', () => { + cy.get('#result0') + .find('[href*="1755480725"]') + .should('exist') + }) + + // see #25 + it.skip('parent work should appear in initial results', () => { + cy.get('[href*="521689139"]') + .should('exist') + }) + + // This asssumes de default view + it('first hit should be child volume based on search term', () => { + cy.get('#result0') + .find('.media-type') + .should('contain', 'Band einer Zeitschrift/Zeitung') + .and('not.contain', 'Serial Volume') + }) + }) +}) \ No newline at end of file diff --git a/cypress/e2e/reviews.cy.js b/cypress/e2e/reviews.cy.js new file mode 100644 index 0000000..f772ee1 --- /dev/null +++ b/cypress/e2e/reviews.cy.js @@ -0,0 +1,109 @@ +describe('Review after reviewed', () => { + // see #12 + // we should add more language specific searches here + describe('36 Strategems', () => { + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: '36 strategeme harro von senger', + type: 'AllFields', + limit: '5' + } + }) + }) + + // affirm existent of primary work title via PP + it('should be among top 5 hits', () => { + cy.get('[href*="020460147"]') + .should('exist') + }) + + // see #26 + it.skip('first hit should not be a review', () => { + cy.get('#result0') + .contains('Strategeme') + .should('not.contain', 'Rezension') + .should('not.contain', 'Book Reviews') + }) + }) + + describe('Liberty manik', () => { + // Note Title search 20 hits, AllFields (23) but allfields already tested above + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Liberty manik', + type: 'Title' + } + }) + }) + + // TODO(DP): unclear what the top hit should be + it('should see matching search results', () => { + cy.get('[href*="1019346698"]') + .should('exist') + }) + + // TODO(DP): failing + it('first hit should not be a review', () => { + cy.get('#result0') + .contains('Manik') + .should('not.contain', 'Rezension') + .should('not.contain', 'Book Reviews') + }) + }) + + describe('Die Organisierte Welt Internationale Beziehungen und Organisationsforschung', () => { + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Die Organisierte Welt Internationale Beziehungen und Organisationsforschung', + type: 'AllFields' + } + }) + }) + + // PPN 608988723 + it('first hit matches Title', () => { + cy.get('#result0') + .find('[href*="608988723"]') + .should('exist') + }) + + it('second hit should be a review', () => { + cy.get('#result1') + .contains('Rezension') + }) + }) + + describe('Young, Iris Marion (2002): Inclusion and Democracy. Oxford: Oxford University Press', () => { + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Young, Iris Marion (2002): Inclusion and Democracy. Oxford: Oxford University Press', + type: 'AllFields', + limit: '10' + } + }) + }) + + // PPN 315776242 + // see #26 + it.skip('first hit matches exact title', () => { + cy.get('#result0') + .find('[href*="315776242"]') + .should('exist') + }) + + it('second hit should be a review', () => { + cy.get('#result1') + .should('exist') + .contains('Review') + }) + }) + +}) \ No newline at end of file diff --git a/cypress/e2e/simple.cy.js b/cypress/e2e/simple.cy.js index 80b08ea..69588b1 100644 --- a/cypress/e2e/simple.cy.js +++ b/cypress/e2e/simple.cy.js @@ -29,67 +29,4 @@ describe('simple GUI spec', () => { }) }) - - describe('Foreign language phrase search', () => { - // See #6 - // Thematische Suche#L30 - it('en all fields query matches en not ar', () => { - cy.visit({ - url: '/Results', - qs: { - lookfor: 'Egyptian Language', - type: 'AllFields' - } - }) - cy.get('.resultlist') - // PPN JST063665204 - .contains('The Egyptian Language') - cy.get('.resultlist') - // PPN DOAJ008736839 - .should('not.contain', 'المعانی الثانیة للأمر فی النص المصری القدیم دراسة بلاغیة مقارنة ') - - }) - - it('en subject query matches en and ar', () => { - cy.visit({ - url: '/Results', - qs: { - lookfor: 'Egyptian Language', - type: 'Subject' - } - }) - cy.get('.resultlist') - // PPN JST063665204 - .contains('The Egyptian Language') - cy.get('.resultlist') - // PPN DOAJ008736839 - .contains('المعانی الثانیة للأمر فی النص المصری القدیم دراسة بلاغیة مقارنة ') - - }) - }) - - // see #8 - // Title search and online access false to limit noise - // check if exact match first list item is the journal parent and subsequent entries are child works - // a more elaborate test would compare the value of '.record-number' within the same family - // - describe('Parent Work', () => { - it('should appear before child work', () => { - cy.visit({ - url: '/Results', - qs: { - lookfor: 'African American Review', - type: 'Title', - "filter[]": '~remote_bool:"false"' - } - }) - cy.get('#result0') - .find('.media-type') - .contains(' Zeitschrift (gedruckt) ') - cy.get('#result1') - .find('.media-type') - .contains(' Band einer Zeitschrift/Zeitung ') - - }) - }) }) \ No newline at end of file diff --git a/notes/Ranking_Stabikat.xlsx b/notes/Ranking_Stabikat.xlsx index a7055aa..5c274da 100644 Binary files a/notes/Ranking_Stabikat.xlsx and b/notes/Ranking_Stabikat.xlsx differ diff --git a/notes/Ziele.md b/notes/Ziele.md index a4b0a54..4f7c3c3 100644 --- a/notes/Ziele.md +++ b/notes/Ziele.md @@ -29,7 +29,7 @@ - [ ] Index - [x] Ranking - [ ] Nutzer konfigurierbar - - [ ] DONE + - [x] DONE 6. Rezensionen runterranken, - [ ] Query - [ ] Index diff --git a/package-lock.json b/package-lock.json index bb5e84d..46b508d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "MIT", "devDependencies": { "cypress": "^13.6.2", + "yaml-lint": "^1.7.0", "yamljs": "^0.3.0" } }, @@ -71,6 +72,41 @@ "ms": "^2.1.1" } }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@types/node": { "version": "18.18.8", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.8.tgz", @@ -192,6 +228,15 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/asn1": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", @@ -312,6 +357,18 @@ "concat-map": "0.0.1" } }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -478,6 +535,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -538,6 +606,12 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/consola": { + "version": "2.15.3", + "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", + "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", + "dev": true + }, "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -674,6 +748,18 @@ "node": ">=0.4.0" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -712,6 +798,15 @@ "node": ">=8.6" } }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -797,6 +892,31 @@ "node >=0.6.0" ] }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", + "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/fd-slicer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", @@ -821,6 +941,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -874,6 +1006,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, "node_modules/get-intrinsic": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", @@ -942,6 +1083,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/global-dirs": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", @@ -957,6 +1110,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -1075,6 +1248,15 @@ } ] }, + "node_modules/ignore": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", + "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", @@ -1121,6 +1303,15 @@ "is-ci": "bin.js" } }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -1130,6 +1321,18 @@ "node": ">=8" } }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-installed-globally": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", @@ -1146,6 +1349,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", @@ -1197,6 +1409,24 @@ "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", "dev": true }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/js-yaml/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "node_modules/jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -1373,6 +1603,28 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -1430,6 +1682,21 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/nconf": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/nconf/-/nconf-0.12.1.tgz", + "integrity": "sha512-p2cfF+B3XXacQdswUYWZ0w6Vld0832A/tuqjLBu3H1sfUcby4N2oVbGhyuCkZv+t3iY3aiFEj7gZGqax9Q2c1w==", + "dev": true, + "dependencies": { + "async": "^3.0.0", + "ini": "^2.0.0", + "secure-keys": "^1.0.0", + "yargs": "^16.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -1514,6 +1781,15 @@ "node": ">=8" } }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -1526,6 +1802,18 @@ "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", "dev": true }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -1608,6 +1896,26 @@ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", "dev": true }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/request-progress": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", @@ -1617,6 +1925,15 @@ "throttleit": "^1.0.0" } }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -1636,6 +1953,16 @@ "node": ">=8" } }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, "node_modules/rfdc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", @@ -1657,6 +1984,29 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", @@ -1692,6 +2042,12 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, + "node_modules/secure-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/secure-keys/-/secure-keys-1.0.0.tgz", + "integrity": "sha512-nZi59hW3Sl5P3+wOO89eHBAAGwmCPd2aE1+dLZV5MO+ItQctIvAqihzaAXIQhvtH4KJPxM080HsnqltR2y8cWg==", + "dev": true + }, "node_modules/semver": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", @@ -1763,6 +2119,15 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/slice-ansi": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", @@ -1882,6 +2247,18 @@ "node": ">=8.17.0" } }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/tough-cookie": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", @@ -2037,12 +2414,36 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "node_modules/yaml-lint": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/yaml-lint/-/yaml-lint-1.7.0.tgz", + "integrity": "sha512-zeBC/kskKQo4zuoGQ+IYjw6C9a/YILr2SXoEZA9jM0COrSwvwVbfTiFegT8qYBSBgOwLMWGL8sY137tOmFXGnQ==", + "dev": true, + "dependencies": { + "consola": "^2.15.3", + "globby": "^11.1.0", + "js-yaml": "^4.1.0", + "nconf": "^0.12.0" + }, + "bin": { + "yamllint": "dist/cli.js" + } + }, "node_modules/yamljs": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/yamljs/-/yamljs-0.3.0.tgz", @@ -2057,6 +2458,33 @@ "yaml2json": "bin/yaml2json" } }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", diff --git a/package.json b/package.json index de132b1..b155e47 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "Specs for relevance of stabikat search", "main": "index.js", "scripts": { - "test": "cypress run" + "test": "cypress run", + "lint": "yamllint vufind/*.yaml" }, "repository": { "type": "git", @@ -23,6 +24,7 @@ "homepage": "https://github.com/duncdrum/sbb-relevance-test#readme", "devDependencies": { "cypress": "^13.6.2", + "yaml-lint": "^1.7.0", "yamljs": "^0.3.0" } }