From 51e5b03e1f1a8aa52735df3bed792015afd31f29 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Mon, 25 Mar 2024 08:49:16 +0000 Subject: [PATCH 01/52] Move Javascript into external file --- static/javascript/launch.js | 437 +++++++++++++++++++++++++++++++++++ templates/launch.html | 441 +----------------------------------- 2 files changed, 438 insertions(+), 440 deletions(-) create mode 100644 static/javascript/launch.js diff --git a/static/javascript/launch.js b/static/javascript/launch.js new file mode 100644 index 00000000..01e9538e --- /dev/null +++ b/static/javascript/launch.js @@ -0,0 +1,437 @@ +// uuidv4: from https://github.com/kelektiv/node-uuid +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.uuidv4=e()}}(function(){return function e(n,r,o){function t(f,u){if(!r[f]){if(!n[f]){var a="function"==typeof require&&require;if(!u&&a)return a(f,!0);if(i)return i(f,!0);var d=new Error("Cannot find module '"+f+"'");throw d.code="MODULE_NOT_FOUND",d}var p=r[f]={exports:{}};n[f][0].call(p.exports,function(e){var r=n[f][1][e];return t(r?r:e)},p,p.exports,e,n,r,o)}return r[f].exports}for(var i="function"==typeof require&&require,f=0;f>>((3&n)<<3)&255;return i}}},{}],3:[function(e,n,r){function o(e,n,r){var o=n&&r||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null),e=e||{};var f=e.random||(e.rng||t)();if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,n)for(var u=0;u<16;++u)n[o+u]=f[u];return n||i(f)}var t=e("./lib/rng"),i=e("./lib/bytesToUuid");n.exports=o},{"./lib/bytesToUuid":1,"./lib/rng":2}]},{},[3])(3)}); + +// store fetch so it only needs to be re-done if the survey changes +let supplementaryDataSets = null; + +function clearSurveyMetadataFields() { + document.querySelector('#survey_metadata_fields').innerHTML = "" + showSupplementaryData(false); +} + +function setSurveyType(event) { + localStorage.setItem("survey_type", event.value) + setLaunchType("remote"); +} + +function setCirSchema(event) { + localStorage.setItem("cir_schema", event.value) + setLaunchType("cir"); +} + +function setSchemaUrl(event) { + localStorage.setItem("schema_url", event.value) + setLaunchType("url"); +} + +function setLaunchType(launchType) { + const schemaName = document.querySelector("#schema_name") + const schemaUrl = document.querySelector("#schema-url") + const cirSchemas = document.querySelector("#cir-schemas") + console.log(schemaName) + const remoteSchemaSurveyType = document.querySelector("#remote-schema-survey-type") + + if(launchType === "cir" || launchType === "remote" || launchType === "url"){ + if (schemaName.selectedIndex) { + clearSurveyMetadataFields(); + showSubmitFlushButtons(false); + schemaName.selectedIndex = 0 + localStorage.removeItem("schema_name") + } + + if (launchType === "cir") { + schemaUrl.value = "" + localStorage.removeItem("schema_url") + } + else if (launchType === "url") { + cirSchemas.selectedIndex = 0 + localStorage.removeItem("cir_schema") + } + } + if (launchType === "name") { + schemaUrl.value = "" + cirSchemas.selectedIndex = 0 + remoteSchemaSurveyType.selectedIndex = 0 + localStorage.removeItem("schema_url") + localStorage.removeItem("cir_schema") + localStorage.removeItem("survey_type") + document.querySelector("#language_code").disabled = false; + } +} + +function showSupplementaryData(show) { + if (show) { + document.querySelector(".supplementary-data").classList.remove("supplementary-data--hidden"); + } + else{ + document.querySelector(".supplementary-data").classList.add("supplementary-data--hidden"); + } +} + +function showCIRMetadata(show) { + if (show) { + document.querySelector(".cir-metadata").classList.remove("cir-metadata--hidden"); + } + else { + document.querySelector(".cir-metadata").classList.add("cir-metadata--hidden"); + } +} + +function showSubmitFlushButtons(show, justSubmit = false) { + if (show) { + document.querySelector("#submit-btn").classList.remove("btn--hidden"); + if (!justSubmit) { + document.querySelector("#flush-btn").classList.remove("btn--hidden"); + } + } else { + document.querySelector("#submit-btn").classList.add("btn--hidden"); + if (!justSubmit) { + document.querySelector("#flush-btn").classList.add("btn--hidden"); + } + } +} + +function includeSurveyMetadataFields(schema_name, survey_type) { + let launchPattern = document.querySelector("#launch_pattern").value + let eqIdValue = schema_name.split('_')[0] + let formTypeValue = schema_name.split("_").slice(1).join("_") + + if (launchPattern === "v1") { + document.querySelector('#survey_metadata_fields').innerHTML = `

${survey_type} Survey Metadata

+
+ + +
+
+ + +
` + } else { + document.querySelector('#survey_metadata_fields').innerHTML = `

${survey_type} Survey Metadata

+
+ + +
` + } + + showSupplementaryData(true); + document.querySelector('#survey_metadata_fields').classList.remove("supplementary-data--hidden"); + +} + +function loadMetadataForSchemaName() { + let schemaName = document.querySelector("#schema_name").value; + localStorage.setItem("schema_name", schemaName); + + if (schemaName !== "Select Schema") { + const surveyType = document.querySelector(`#schema_name option[value="${schemaName}"]`).dataset.surveyType; + loadSurveyMetadata(schemaName, surveyType); + loadSchemaMetadata(schemaName, null); + } +} + +function loadMetadataForRemoteSchema() { + let schemaUrl = document.querySelector("#schema-url").value + let surveyType = document.querySelector("#remote-schema-survey-type") + + let cirSchemaDropdown = document.querySelector("#cir-schemas") + let cirInstrumentId = cirSchemaDropdown.selectedIndex ? cirSchemaDropdown.value : null + + let schemaName = null + + if (schemaUrl && !schemaUrl.endsWith(".json")) { + alert("Schema URL is not valid URL must end with '.json'") + return false + } + + if (!surveyType.selectedIndex) { + alert("Select a Survey Type.") + return false + } + + if (!schemaUrl && !cirInstrumentId) { + alert("Enter a Schema URL or select a CIR Schema.") + return false + } + + if (schemaUrl){ + schemaName = schemaUrl.split("/").slice(-1)[0].split(".json")[0] + document.querySelector("#language_code").disabled = false; + } + else { + let cirSchema = cirSchemaDropdown.options[cirSchemaDropdown.selectedIndex] + schemaName = cirSchema.getAttribute("data-form-type") + let language = cirSchema.getAttribute("data-language") + + showCIRMetdata(cirInstrumentId, cirSchema); + + // cir schemas are for a specific language, so populate and disable choosing it + populateDropDownWithValue("#language_code", language) + document.querySelector("#language_code").disabled = true; + } + + loadSurveyMetadata(schemaName, surveyType.value) + loadSchemaMetadata(schemaName, schemaUrl, cirInstrumentId) + showSubmitFlushButtons(true); +} + +function loadSurveyMetadata(schema_name, survey_type) { + if (survey_type.toLowerCase() === "test" || survey_type.toLowerCase() === "social") { + clearSurveyMetadataFields() + } else { + includeSurveyMetadataFields(schema_name, survey_type) + } +} + +async function getDataAsync(queryParam) { + return new Promise((resolve, reject) => { + let xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function() { + if (this.readyState === 4) { + if (this.status === 200) { + resolve(JSON.parse(this.responseText)) + } else { + alert(`Request failed. ${this.responseText}`) + reject(`Request failed. ${this.responseText}`) + } + } + }; + xhttp.open("GET", queryParam, true); + xhttp.send(); + }) +} + +function getLabelFor(fieldName){ + return `` +} + +function getInputField(fieldName, type, defaultValue=null, isReadOnly=false, onChangeCallback=null){ + const value = defaultValue ? `value="${defaultValue}"` : '' + const readOnly = isReadOnly ? 'readonly' : '' + if (readOnly) { + return `` + } + return `` +} + +async function loadSDSDatasetMetadata(survey_id, period_id) { + if (survey_id && period_id) { + const sds_dataset_metadata_url = `/supplementary-data?survey_id=${survey_id}&period_id=${period_id}` + return await getDataAsync(sds_dataset_metadata_url) + } + return null +} + +function handleNoSupplementaryData() { + showSupplementaryData(false); + showSubmitFlushButtons(false); +} + +function showCIRMetdata(cirInstrumentId, cirSchema) { + showCIRMetadata(true); + let ciMetadata = { + "id": cirInstrumentId, + "ci_version": cirSchema.getAttribute("data-version"), + "title": cirSchema.getAttribute("data-title"), + "description": cirSchema.getAttribute("data-description"), + } + document.querySelector("#cir_metadata").innerHTML = Object.keys(ciMetadata).map( + key => `
${getLabelFor(key)}${getInputField(key, "text", ciMetadata[key], true)}
` + ).join('') +} + +function updateSDSDropdown() { + const surveyId = document.getElementById("survey_id")?.value; + const periodId = document.getElementById("period_id")?.value; + loadSDSDatasetMetadata(surveyId, periodId) + .then(sds_metadata_response => { + if (sds_metadata_response?.length) { + supplementaryDataSets = sds_metadata_response + showSupplementaryData(true); + showSubmitFlushButtons(true); + document.querySelector("#sds_dataset_id").innerHTML = sds_metadata_response.map(dataset => + ``) + .join(""); + loadSupplementaryDataInfo(); + } else if (document.querySelector("#sds_dataset_id")) { + document.querySelector("#sds_dataset_id").innerHTML = ""; + handleNoSupplementaryData(); + } + }) + .catch(_ => { + handleNoSupplementaryData(); + }) +} + +function loadSchemaMetadata(schemaName, schemaUrl, cirInstrumentId) { + let survey_data_url = `/survey-data?` + + if (cirInstrumentId) { + survey_data_url += `&cir_instrument_id=${cirInstrumentId}` + } + else { + showCIRMetadata(false); + if (schemaName) + survey_data_url += `&schema_name=${schemaName}` + if (schemaUrl) + survey_data_url += `&schema_url=${schemaUrl}` + } + showSupplementaryData(false); + getDataAsync(survey_data_url) + .then(schema_response => { + document.querySelector("#survey_metadata").innerHTML = ""; + document.querySelector("#survey_metadata").innerHTML = ""; + + if (schema_response.metadata.length > 0) { + document.querySelector("#survey_metadata").innerHTML = schema_response.metadata.map(metadataField => { + + const fieldName = metadataField["name"] + const defaultValue = metadataField['default']; + + return `
${getLabelFor(fieldName)}${ + (() => { + if (metadataField['type'] === "boolean") { + return getInputField(fieldName, "checkbox"); + } + else if (metadataField['type'] === "uuid") { + return ( + `${getInputField(fieldName, "text", uuidv4())}` + + `` + + `` + ); + } + else if (fieldName === "survey_id" || fieldName === "period_id") { + return getInputField(fieldName, "text", fieldName === "survey_id" ? schema_response.survey_id : defaultValue, false, "updateSDSDropdown()"); + } + else if (fieldName === "sds_dataset_id") { + return `` + } + else { + return getInputField(fieldName, "text", defaultValue) + } + })() + }
` + }).join("") + updateSDSDropdown() + } else { + document.querySelector("#survey_metadata").innerHTML = "No metadata required for this survey"; + } + showSubmitFlushButtons(true); + }) + .catch(_ => { + document.querySelector("#survey_metadata").innerHTML = "Failed to load Survey Metadata"; + }) +} + +function loadSupplementaryDataInfo () { + const selectedDatasetId = document.getElementById("sds_dataset_id")?.value; + const selectedDataset = supplementaryDataSets?.find(d => d["dataset_id"] === selectedDatasetId) + if (selectedDataset) { + const sdsDatasetMetadataKeys = ["title", "sds_schema_version", "total_reporting_units", "schema_version", "sds_dataset_version"]; + + document.querySelector("#supplementary_data").innerHTML = sdsDatasetMetadataKeys.map( + key => `
${getLabelFor(key)}${getInputField(key, "text", selectedDataset[key], true)}
` + ).join('') + } +} + +function uuid(el_id) { + document.querySelector(`#${el_id}`).value = uuidv4(); +} + +function numericId() { + let result = ''; + let chars = '0123456789'; + for (let i = 16; i > 0; --i) { + result += chars[Math.round(Math.random() * (chars.length - 1))]; + } + document.querySelector(`#response_id`).value = result; +} + +function setResponseExpiry(days_offset=7) { + let dt = new Date(); + dt.setDate(dt.getDate()+days_offset) + document.querySelector('#response_expires_at').value=dt.toISOString().replace(/(\.\d*)/, '').replace(/Z/, '+00:00'); +} + +function validateForm() { + validateResponseExpiresAt(); + removeUnwantedMetadata() +} +function validateResponseExpiresAt() { + let responseExpiresAt = Date.parse(document.querySelector('#response_expires_at').value) + if (isNaN(responseExpiresAt)) { + document.querySelector('#response_expires_at').remove() + } +} + +// Inputs without a name will not be submitted +function removeUnwantedMetadata() { + const inputs = document.getElementsByTagName("input"); + for (let input of inputs) { + if (!input.value) { + input.removeAttribute('name'); + } + } +} + +function retrieveResponseId() { + let responseId = localStorage.getItem("response_id"); + let responseIdButton = document.querySelector("#response-id-btn"); + + if (responseId) { + responseIdButton.classList.remove("btn--hidden"); + } + else { + responseIdButton.classList.add("btn--hidden"); + } +} + +function loadResponseId() { + document.querySelector("#response_id").value = localStorage.getItem("response_id"); +} + +function saveResponseId() { + localStorage.setItem("response_id", document.querySelector("#response_id").value); +} + +function clearLocalStorage() { + localStorage.removeItem("response_id"); + localStorage.removeItem("schema_name"); + localStorage.removeItem("survey_type"); + localStorage.removeItem("cir_schema"); + localStorage.removeItem("schema_url"); + location.reload(); +} + +function populateDropDownWithValue(selector, value) { + const availableOptions = [...document.querySelector(selector).options].map(x => x.value) + + if (availableOptions.includes(value)) { + document.querySelector(selector).value = value; + } +} + +function onLoad() { + uuid('collection_exercise_sid'); + uuid('case_id'); + numericId(); + setResponseExpiry(); + retrieveResponseId(); + + if (schemaName = localStorage.getItem("schema_name")){ + populateDropDownWithValue("#schema_name", schemaName) + loadMetadataForSchemaName(); + } + else { + if(surveyType = localStorage.getItem("survey_type")) { + populateDropDownWithValue("#remote-schema-survey-type", surveyType) + } + if(cirSchema = localStorage.getItem("cir_schema")) { + populateDropDownWithValue("#cir-schemas", cirSchema) + } + if(schemaUrl = localStorage.getItem("schema_url")) { + document.querySelector("#schema-url").value = schemaUrl + } + } +} \ No newline at end of file diff --git a/templates/launch.html b/templates/launch.html index 42e13767..19fb3033 100644 --- a/templates/launch.html +++ b/templates/launch.html @@ -174,445 +174,6 @@

Runner Data

+ - - {{ end }} From f3002b9d4a2daeaab96682f49ddbcbd5a882fdc2 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Mon, 25 Mar 2024 12:15:51 +0000 Subject: [PATCH 02/52] Format static files --- static/css/main.css | 109 ++--- static/javascript/launch.js | 813 ++++++++++++++++++++++-------------- 2 files changed, 557 insertions(+), 365 deletions(-) diff --git a/static/css/main.css b/static/css/main.css index 5c9d3000..ad5267c6 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -1,93 +1,94 @@ - body { - font-family: "Lato", "Helvetica Neue", Arial, sans-serif; - color: #222; + font-family: "Lato", "Helvetica Neue", Arial, sans-serif; + color: #222; } label { - display:inline-block; - font-weight: 600; - margin-bottom: 0.25rem; - width:200px; - font-size:0.9rem; + display: inline-block; + font-weight: 600; + margin-bottom: 0.25rem; + width: 200px; + font-size: 0.9rem; } .field-container { - margin: 0 0 0.2rem 0; + margin: 0 0 0.2rem 0; } .field-container--inline { - display: inline-block; + display: inline-block; } -.btn--hidden, .supplementary-data--hidden, .cir-metadata--hidden { - display:none; +.btn--hidden, +.supplementary-data--hidden, +.cir-metadata--hidden { + display: none; } .field-container__span { - position: relative; + position: relative; } .btn--small { - font-size: 0.9rem !important; - padding:0.50rem 2rem !important; - margin: 0.1rem !important; + font-size: 0.9rem !important; + padding: 0.5rem 2rem !important; + margin: 0.1rem !important; } -input[type=text] { - padding:0.3rem; - width:350px; - font-size:0.9rem; - box-sizing: border-box; +input[type="text"] { + padding: 0.3rem; + width: 350px; + font-size: 0.9rem; + box-sizing: border-box; } select { - width:350px; - font-size:0.9rem; - padding:0.35rem; - -webkit-appearance:none; - appearance:none; - border-radius:0; - border:1px solid #dfdfdf; - background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMyIDMyIiBoZWlnaHQ9IjMycHgiIGlkPSLQodC70L7QuV8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMiAzMiIgd2lkdGg9IjMycHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxwYXRoIGQ9Ik0yNC4yODUsMTEuMjg0TDE2LDE5LjU3MWwtOC4yODUtOC4yODhjLTAuMzk1LTAuMzk1LTEuMDM0LTAuMzk1LTEuNDI5LDAgIGMtMC4zOTQsMC4zOTUtMC4zOTQsMS4wMzUsMCwxLjQzbDguOTk5LDkuMDAybDAsMGwwLDBjMC4zOTQsMC4zOTUsMS4wMzQsMC4zOTUsMS40MjgsMGw4Ljk5OS05LjAwMiAgYzAuMzk0LTAuMzk1LDAuMzk0LTEuMDM2LDAtMS40MzFDMjUuMzE5LDEwLjg4OSwyNC42NzksMTAuODg5LDI0LjI4NSwxMS4yODR6IiBmaWxsPSIjMTIxMzEzIiBpZD0iRXhwYW5kX01vcmUiLz48Zy8+PGcvPjxnLz48Zy8+PGcvPjxnLz48L3N2Zz4=); - background-position: center right 5px; - background-repeat:no-repeat; - background-size:22px; - cursor: pointer; + width: 350px; + font-size: 0.9rem; + padding: 0.35rem; + -webkit-appearance: none; + appearance: none; + border-radius: 0; + border: 1px solid #dfdfdf; + background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMyIDMyIiBoZWlnaHQ9IjMycHgiIGlkPSLQodC70L7QuV8xIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMiAzMiIgd2lkdGg9IjMycHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxwYXRoIGQ9Ik0yNC4yODUsMTEuMjg0TDE2LDE5LjU3MWwtOC4yODUtOC4yODhjLTAuMzk1LTAuMzk1LTEuMDM0LTAuMzk1LTEuNDI5LDAgIGMtMC4zOTQsMC4zOTUtMC4zOTQsMS4wMzUsMCwxLjQzbDguOTk5LDkuMDAybDAsMGwwLDBjMC4zOTQsMC4zOTUsMS4wMzQsMC4zOTUsMS40MjgsMGw4Ljk5OS05LjAwMiAgYzAuMzk0LTAuMzk1LDAuMzk0LTEuMDM2LDAtMS40MzFDMjUuMzE5LDEwLjg4OSwyNC42NzksMTAuODg5LDI0LjI4NSwxMS4yODR6IiBmaWxsPSIjMTIxMzEzIiBpZD0iRXhwYW5kX01vcmUiLz48Zy8+PGcvPjxnLz48Zy8+PGcvPjxnLz48L3N2Zz4=); + background-position: center right 5px; + background-repeat: no-repeat; + background-size: 22px; + cursor: pointer; } select[multiple] { - background:none; + background: none; } select:disabled { - cursor: default; + cursor: default; } .field-container__img { - width:26px; - height:auto; - display:block; - position:absolute; - top: -2px; - right: 2px; - cursor:pointer; + width: 26px; + height: auto; + display: block; + position: absolute; + top: -2px; + right: 2px; + cursor: pointer; } .btn { - background:#6099c6; - color:white; - border:0; - border-radius:3px; - padding:0.75rem 2rem; - text-align: center; - font-size: 1rem; - margin: 0.5rem; - cursor: pointer; + background: #6099c6; + color: white; + border: 0; + border-radius: 3px; + padding: 0.75rem 2rem; + text-align: center; + font-size: 1rem; + margin: 0.5rem; + cursor: pointer; } .btn:disabled { - background: #cccccc; - color: grey; - cursor: default; + background: #cccccc; + color: grey; + cursor: default; } diff --git a/static/javascript/launch.js b/static/javascript/launch.js index 01e9538e..6b98a5d6 100644 --- a/static/javascript/launch.js +++ b/static/javascript/launch.js @@ -1,103 +1,246 @@ // uuidv4: from https://github.com/kelektiv/node-uuid -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.uuidv4=e()}}(function(){return function e(n,r,o){function t(f,u){if(!r[f]){if(!n[f]){var a="function"==typeof require&&require;if(!u&&a)return a(f,!0);if(i)return i(f,!0);var d=new Error("Cannot find module '"+f+"'");throw d.code="MODULE_NOT_FOUND",d}var p=r[f]={exports:{}};n[f][0].call(p.exports,function(e){var r=n[f][1][e];return t(r?r:e)},p,p.exports,e,n,r,o)}return r[f].exports}for(var i="function"==typeof require&&require,f=0;f>>((3&n)<<3)&255;return i}}},{}],3:[function(e,n,r){function o(e,n,r){var o=n&&r||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null),e=e||{};var f=e.random||(e.rng||t)();if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,n)for(var u=0;u<16;++u)n[o+u]=f[u];return n||i(f)}var t=e("./lib/rng"),i=e("./lib/bytesToUuid");n.exports=o},{"./lib/bytesToUuid":1,"./lib/rng":2}]},{},[3])(3)}); +!(function (e) { + if ("object" == typeof exports && "undefined" != typeof module) + module.exports = e(); + else if ("function" == typeof define && define.amd) define([], e); + else { + var n; + (n = + "undefined" != typeof window + ? window + : "undefined" != typeof global + ? global + : "undefined" != typeof self + ? self + : this), + (n.uuidv4 = e()); + } +})(function () { + return (function e(n, r, o) { + function t(f, u) { + if (!r[f]) { + if (!n[f]) { + var a = "function" == typeof require && require; + if (!u && a) return a(f, !0); + if (i) return i(f, !0); + var d = new Error("Cannot find module '" + f + "'"); + throw ((d.code = "MODULE_NOT_FOUND"), d); + } + var p = (r[f] = { exports: {} }); + n[f][0].call( + p.exports, + function (e) { + var r = n[f][1][e]; + return t(r ? r : e); + }, + p, + p.exports, + e, + n, + r, + o, + ); + } + return r[f].exports; + } + for ( + var i = "function" == typeof require && require, f = 0; + f < o.length; + f++ + ) + t(o[f]); + return t; + })( + { + 1: [ + function (e, n, r) { + function o(e, n) { + var r = n || 0, + o = t; + return [ + o[e[r++]], + o[e[r++]], + o[e[r++]], + o[e[r++]], + "-", + o[e[r++]], + o[e[r++]], + "-", + o[e[r++]], + o[e[r++]], + "-", + o[e[r++]], + o[e[r++]], + "-", + o[e[r++]], + o[e[r++]], + o[e[r++]], + o[e[r++]], + o[e[r++]], + o[e[r++]], + ].join(""); + } + for (var t = [], i = 0; i < 256; ++i) + t[i] = (i + 256).toString(16).substr(1); + n.exports = o; + }, + {}, + ], + 2: [ + function (e, n, r) { + var o = + ("undefined" != typeof crypto && + crypto.getRandomValues && + crypto.getRandomValues.bind(crypto)) || + ("undefined" != typeof msCrypto && + "function" == typeof window.msCrypto.getRandomValues && + msCrypto.getRandomValues.bind(msCrypto)); + if (o) { + var t = new Uint8Array(16); + n.exports = function () { + return o(t), t; + }; + } else { + var i = new Array(16); + n.exports = function () { + for (var e, n = 0; n < 16; n++) + 0 === (3 & n) && (e = 4294967296 * Math.random()), + (i[n] = (e >>> ((3 & n) << 3)) & 255); + return i; + }; + } + }, + {}, + ], + 3: [ + function (e, n, r) { + function o(e, n, r) { + var o = (n && r) || 0; + "string" == typeof e && + ((n = "binary" === e ? new Array(16) : null), (e = null)), + (e = e || {}); + var f = e.random || (e.rng || t)(); + if (((f[6] = (15 & f[6]) | 64), (f[8] = (63 & f[8]) | 128), n)) + for (var u = 0; u < 16; ++u) n[o + u] = f[u]; + return n || i(f); + } + var t = e("./lib/rng"), + i = e("./lib/bytesToUuid"); + n.exports = o; + }, + { "./lib/bytesToUuid": 1, "./lib/rng": 2 }, + ], + }, + {}, + [3], + )(3); +}); // store fetch so it only needs to be re-done if the survey changes let supplementaryDataSets = null; function clearSurveyMetadataFields() { - document.querySelector('#survey_metadata_fields').innerHTML = "" - showSupplementaryData(false); + document.querySelector("#survey_metadata_fields").innerHTML = ""; + showSupplementaryData(false); } function setSurveyType(event) { - localStorage.setItem("survey_type", event.value) - setLaunchType("remote"); + localStorage.setItem("survey_type", event.value); + setLaunchType("remote"); } function setCirSchema(event) { - localStorage.setItem("cir_schema", event.value) - setLaunchType("cir"); + localStorage.setItem("cir_schema", event.value); + setLaunchType("cir"); } function setSchemaUrl(event) { - localStorage.setItem("schema_url", event.value) - setLaunchType("url"); + localStorage.setItem("schema_url", event.value); + setLaunchType("url"); } function setLaunchType(launchType) { - const schemaName = document.querySelector("#schema_name") - const schemaUrl = document.querySelector("#schema-url") - const cirSchemas = document.querySelector("#cir-schemas") - console.log(schemaName) - const remoteSchemaSurveyType = document.querySelector("#remote-schema-survey-type") - - if(launchType === "cir" || launchType === "remote" || launchType === "url"){ - if (schemaName.selectedIndex) { - clearSurveyMetadataFields(); - showSubmitFlushButtons(false); - schemaName.selectedIndex = 0 - localStorage.removeItem("schema_name") - } - - if (launchType === "cir") { - schemaUrl.value = "" - localStorage.removeItem("schema_url") - } - else if (launchType === "url") { - cirSchemas.selectedIndex = 0 - localStorage.removeItem("cir_schema") - } + const schemaName = document.querySelector("#schema_name"); + const schemaUrl = document.querySelector("#schema-url"); + const cirSchemas = document.querySelector("#cir-schemas"); + console.log(schemaName); + const remoteSchemaSurveyType = document.querySelector( + "#remote-schema-survey-type", + ); + + if (launchType === "cir" || launchType === "remote" || launchType === "url") { + if (schemaName.selectedIndex) { + clearSurveyMetadataFields(); + showSubmitFlushButtons(false); + schemaName.selectedIndex = 0; + localStorage.removeItem("schema_name"); } - if (launchType === "name") { - schemaUrl.value = "" - cirSchemas.selectedIndex = 0 - remoteSchemaSurveyType.selectedIndex = 0 - localStorage.removeItem("schema_url") - localStorage.removeItem("cir_schema") - localStorage.removeItem("survey_type") - document.querySelector("#language_code").disabled = false; + + if (launchType === "cir") { + schemaUrl.value = ""; + localStorage.removeItem("schema_url"); + } else if (launchType === "url") { + cirSchemas.selectedIndex = 0; + localStorage.removeItem("cir_schema"); } + } + if (launchType === "name") { + schemaUrl.value = ""; + cirSchemas.selectedIndex = 0; + remoteSchemaSurveyType.selectedIndex = 0; + localStorage.removeItem("schema_url"); + localStorage.removeItem("cir_schema"); + localStorage.removeItem("survey_type"); + document.querySelector("#language_code").disabled = false; + } } function showSupplementaryData(show) { - if (show) { - document.querySelector(".supplementary-data").classList.remove("supplementary-data--hidden"); - } - else{ - document.querySelector(".supplementary-data").classList.add("supplementary-data--hidden"); - } + if (show) { + document + .querySelector(".supplementary-data") + .classList.remove("supplementary-data--hidden"); + } else { + document + .querySelector(".supplementary-data") + .classList.add("supplementary-data--hidden"); + } } function showCIRMetadata(show) { - if (show) { - document.querySelector(".cir-metadata").classList.remove("cir-metadata--hidden"); - } - else { - document.querySelector(".cir-metadata").classList.add("cir-metadata--hidden"); - } + if (show) { + document + .querySelector(".cir-metadata") + .classList.remove("cir-metadata--hidden"); + } else { + document + .querySelector(".cir-metadata") + .classList.add("cir-metadata--hidden"); + } } function showSubmitFlushButtons(show, justSubmit = false) { - if (show) { - document.querySelector("#submit-btn").classList.remove("btn--hidden"); - if (!justSubmit) { - document.querySelector("#flush-btn").classList.remove("btn--hidden"); - } - } else { - document.querySelector("#submit-btn").classList.add("btn--hidden"); - if (!justSubmit) { - document.querySelector("#flush-btn").classList.add("btn--hidden"); - } + if (show) { + document.querySelector("#submit-btn").classList.remove("btn--hidden"); + if (!justSubmit) { + document.querySelector("#flush-btn").classList.remove("btn--hidden"); } + } else { + document.querySelector("#submit-btn").classList.add("btn--hidden"); + if (!justSubmit) { + document.querySelector("#flush-btn").classList.add("btn--hidden"); + } + } } function includeSurveyMetadataFields(schema_name, survey_type) { - let launchPattern = document.querySelector("#launch_pattern").value - let eqIdValue = schema_name.split('_')[0] - let formTypeValue = schema_name.split("_").slice(1).join("_") + let launchPattern = document.querySelector("#launch_pattern").value; + let eqIdValue = schema_name.split("_")[0]; + let formTypeValue = schema_name.split("_").slice(1).join("_"); - if (launchPattern === "v1") { - document.querySelector('#survey_metadata_fields').innerHTML = `

${survey_type} Survey Metadata

+ if (launchPattern === "v1") { + document.querySelector("#survey_metadata_fields").innerHTML = + `

${survey_type} Survey Metadata

@@ -105,333 +248,381 @@ function includeSurveyMetadataFields(schema_name, survey_type) {
-
` - } else { - document.querySelector('#survey_metadata_fields').innerHTML = `

${survey_type} Survey Metadata

+
`; + } else { + document.querySelector("#survey_metadata_fields").innerHTML = + `

${survey_type} Survey Metadata

-
` - } - - showSupplementaryData(true); - document.querySelector('#survey_metadata_fields').classList.remove("supplementary-data--hidden"); + `; + } + showSupplementaryData(true); + document + .querySelector("#survey_metadata_fields") + .classList.remove("supplementary-data--hidden"); } function loadMetadataForSchemaName() { - let schemaName = document.querySelector("#schema_name").value; - localStorage.setItem("schema_name", schemaName); + let schemaName = document.querySelector("#schema_name").value; + localStorage.setItem("schema_name", schemaName); - if (schemaName !== "Select Schema") { - const surveyType = document.querySelector(`#schema_name option[value="${schemaName}"]`).dataset.surveyType; - loadSurveyMetadata(schemaName, surveyType); - loadSchemaMetadata(schemaName, null); - } + if (schemaName !== "Select Schema") { + const surveyType = document.querySelector( + `#schema_name option[value="${schemaName}"]`, + ).dataset.surveyType; + loadSurveyMetadata(schemaName, surveyType); + loadSchemaMetadata(schemaName, null); + } } function loadMetadataForRemoteSchema() { - let schemaUrl = document.querySelector("#schema-url").value - let surveyType = document.querySelector("#remote-schema-survey-type") + let schemaUrl = document.querySelector("#schema-url").value; + let surveyType = document.querySelector("#remote-schema-survey-type"); - let cirSchemaDropdown = document.querySelector("#cir-schemas") - let cirInstrumentId = cirSchemaDropdown.selectedIndex ? cirSchemaDropdown.value : null + let cirSchemaDropdown = document.querySelector("#cir-schemas"); + let cirInstrumentId = cirSchemaDropdown.selectedIndex + ? cirSchemaDropdown.value + : null; - let schemaName = null + let schemaName = null; - if (schemaUrl && !schemaUrl.endsWith(".json")) { - alert("Schema URL is not valid URL must end with '.json'") - return false - } + if (schemaUrl && !schemaUrl.endsWith(".json")) { + alert("Schema URL is not valid URL must end with '.json'"); + return false; + } - if (!surveyType.selectedIndex) { - alert("Select a Survey Type.") - return false - } + if (!surveyType.selectedIndex) { + alert("Select a Survey Type."); + return false; + } - if (!schemaUrl && !cirInstrumentId) { - alert("Enter a Schema URL or select a CIR Schema.") - return false - } + if (!schemaUrl && !cirInstrumentId) { + alert("Enter a Schema URL or select a CIR Schema."); + return false; + } - if (schemaUrl){ - schemaName = schemaUrl.split("/").slice(-1)[0].split(".json")[0] - document.querySelector("#language_code").disabled = false; - } - else { - let cirSchema = cirSchemaDropdown.options[cirSchemaDropdown.selectedIndex] - schemaName = cirSchema.getAttribute("data-form-type") - let language = cirSchema.getAttribute("data-language") + if (schemaUrl) { + schemaName = schemaUrl.split("/").slice(-1)[0].split(".json")[0]; + document.querySelector("#language_code").disabled = false; + } else { + let cirSchema = cirSchemaDropdown.options[cirSchemaDropdown.selectedIndex]; + schemaName = cirSchema.getAttribute("data-form-type"); + let language = cirSchema.getAttribute("data-language"); - showCIRMetdata(cirInstrumentId, cirSchema); + showCIRMetdata(cirInstrumentId, cirSchema); - // cir schemas are for a specific language, so populate and disable choosing it - populateDropDownWithValue("#language_code", language) - document.querySelector("#language_code").disabled = true; - } + // cir schemas are for a specific language, so populate and disable choosing it + populateDropDownWithValue("#language_code", language); + document.querySelector("#language_code").disabled = true; + } - loadSurveyMetadata(schemaName, surveyType.value) - loadSchemaMetadata(schemaName, schemaUrl, cirInstrumentId) - showSubmitFlushButtons(true); + loadSurveyMetadata(schemaName, surveyType.value); + loadSchemaMetadata(schemaName, schemaUrl, cirInstrumentId); + showSubmitFlushButtons(true); } function loadSurveyMetadata(schema_name, survey_type) { - if (survey_type.toLowerCase() === "test" || survey_type.toLowerCase() === "social") { - clearSurveyMetadataFields() - } else { - includeSurveyMetadataFields(schema_name, survey_type) - } + if ( + survey_type.toLowerCase() === "test" || + survey_type.toLowerCase() === "social" + ) { + clearSurveyMetadataFields(); + } else { + includeSurveyMetadataFields(schema_name, survey_type); + } } async function getDataAsync(queryParam) { - return new Promise((resolve, reject) => { - let xhttp = new XMLHttpRequest(); - xhttp.onreadystatechange = function() { - if (this.readyState === 4) { - if (this.status === 200) { - resolve(JSON.parse(this.responseText)) - } else { - alert(`Request failed. ${this.responseText}`) - reject(`Request failed. ${this.responseText}`) - } - } - }; - xhttp.open("GET", queryParam, true); - xhttp.send(); - }) + return new Promise((resolve, reject) => { + let xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function () { + if (this.readyState === 4) { + if (this.status === 200) { + resolve(JSON.parse(this.responseText)); + } else { + alert(`Request failed. ${this.responseText}`); + reject(`Request failed. ${this.responseText}`); + } + } + }; + xhttp.open("GET", queryParam, true); + xhttp.send(); + }); } -function getLabelFor(fieldName){ - return `` +function getLabelFor(fieldName) { + return ``; } -function getInputField(fieldName, type, defaultValue=null, isReadOnly=false, onChangeCallback=null){ - const value = defaultValue ? `value="${defaultValue}"` : '' - const readOnly = isReadOnly ? 'readonly' : '' - if (readOnly) { - return `` - } - return `` +function getInputField( + fieldName, + type, + defaultValue = null, + isReadOnly = false, + onChangeCallback = null, +) { + const value = defaultValue ? `value="${defaultValue}"` : ""; + const readOnly = isReadOnly ? "readonly" : ""; + if (readOnly) { + return ``; + } + return ``; } async function loadSDSDatasetMetadata(survey_id, period_id) { - if (survey_id && period_id) { - const sds_dataset_metadata_url = `/supplementary-data?survey_id=${survey_id}&period_id=${period_id}` - return await getDataAsync(sds_dataset_metadata_url) - } - return null + if (survey_id && period_id) { + const sds_dataset_metadata_url = `/supplementary-data?survey_id=${survey_id}&period_id=${period_id}`; + return await getDataAsync(sds_dataset_metadata_url); + } + return null; } function handleNoSupplementaryData() { - showSupplementaryData(false); - showSubmitFlushButtons(false); + showSupplementaryData(false); + showSubmitFlushButtons(false); } function showCIRMetdata(cirInstrumentId, cirSchema) { - showCIRMetadata(true); - let ciMetadata = { - "id": cirInstrumentId, - "ci_version": cirSchema.getAttribute("data-version"), - "title": cirSchema.getAttribute("data-title"), - "description": cirSchema.getAttribute("data-description"), - } - document.querySelector("#cir_metadata").innerHTML = Object.keys(ciMetadata).map( - key => `
${getLabelFor(key)}${getInputField(key, "text", ciMetadata[key], true)}
` - ).join('') + showCIRMetadata(true); + let ciMetadata = { + id: cirInstrumentId, + ci_version: cirSchema.getAttribute("data-version"), + title: cirSchema.getAttribute("data-title"), + description: cirSchema.getAttribute("data-description"), + }; + document.querySelector("#cir_metadata").innerHTML = Object.keys(ciMetadata) + .map( + (key) => + `
${getLabelFor(key)}${getInputField(key, "text", ciMetadata[key], true)}
`, + ) + .join(""); } function updateSDSDropdown() { - const surveyId = document.getElementById("survey_id")?.value; - const periodId = document.getElementById("period_id")?.value; - loadSDSDatasetMetadata(surveyId, periodId) - .then(sds_metadata_response => { - if (sds_metadata_response?.length) { - supplementaryDataSets = sds_metadata_response - showSupplementaryData(true); - showSubmitFlushButtons(true); - document.querySelector("#sds_dataset_id").innerHTML = sds_metadata_response.map(dataset => - ``) - .join(""); - loadSupplementaryDataInfo(); - } else if (document.querySelector("#sds_dataset_id")) { - document.querySelector("#sds_dataset_id").innerHTML = ""; - handleNoSupplementaryData(); - } - }) - .catch(_ => { - handleNoSupplementaryData(); - }) + const surveyId = document.getElementById("survey_id")?.value; + const periodId = document.getElementById("period_id")?.value; + loadSDSDatasetMetadata(surveyId, periodId) + .then((sds_metadata_response) => { + if (sds_metadata_response?.length) { + supplementaryDataSets = sds_metadata_response; + showSupplementaryData(true); + showSubmitFlushButtons(true); + document.querySelector("#sds_dataset_id").innerHTML = + sds_metadata_response + .map( + (dataset) => + ``, + ) + .join(""); + loadSupplementaryDataInfo(); + } else if (document.querySelector("#sds_dataset_id")) { + document.querySelector("#sds_dataset_id").innerHTML = ""; + handleNoSupplementaryData(); + } + }) + .catch((_) => { + handleNoSupplementaryData(); + }); } function loadSchemaMetadata(schemaName, schemaUrl, cirInstrumentId) { - let survey_data_url = `/survey-data?` - - if (cirInstrumentId) { - survey_data_url += `&cir_instrument_id=${cirInstrumentId}` - } - else { - showCIRMetadata(false); - if (schemaName) - survey_data_url += `&schema_name=${schemaName}` - if (schemaUrl) - survey_data_url += `&schema_url=${schemaUrl}` - } - showSupplementaryData(false); - getDataAsync(survey_data_url) - .then(schema_response => { - document.querySelector("#survey_metadata").innerHTML = ""; - document.querySelector("#survey_metadata").innerHTML = ""; - - if (schema_response.metadata.length > 0) { - document.querySelector("#survey_metadata").innerHTML = schema_response.metadata.map(metadataField => { - - const fieldName = metadataField["name"] - const defaultValue = metadataField['default']; - - return `
${getLabelFor(fieldName)}${ - (() => { - if (metadataField['type'] === "boolean") { - return getInputField(fieldName, "checkbox"); - } - else if (metadataField['type'] === "uuid") { - return ( - `${getInputField(fieldName, "text", uuidv4())}` + - `` + - `` - ); - } - else if (fieldName === "survey_id" || fieldName === "period_id") { - return getInputField(fieldName, "text", fieldName === "survey_id" ? schema_response.survey_id : defaultValue, false, "updateSDSDropdown()"); - } - else if (fieldName === "sds_dataset_id") { - return `` - } - else { - return getInputField(fieldName, "text", defaultValue) - } - })() - }
` - }).join("") - updateSDSDropdown() - } else { - document.querySelector("#survey_metadata").innerHTML = "No metadata required for this survey"; - } - showSubmitFlushButtons(true); - }) - .catch(_ => { - document.querySelector("#survey_metadata").innerHTML = "Failed to load Survey Metadata"; - }) -} - -function loadSupplementaryDataInfo () { - const selectedDatasetId = document.getElementById("sds_dataset_id")?.value; - const selectedDataset = supplementaryDataSets?.find(d => d["dataset_id"] === selectedDatasetId) - if (selectedDataset) { - const sdsDatasetMetadataKeys = ["title", "sds_schema_version", "total_reporting_units", "schema_version", "sds_dataset_version"]; - - document.querySelector("#supplementary_data").innerHTML = sdsDatasetMetadataKeys.map( - key => `
${getLabelFor(key)}${getInputField(key, "text", selectedDataset[key], true)}
` - ).join('') - } + let survey_data_url = `/survey-data?`; + + if (cirInstrumentId) { + survey_data_url += `&cir_instrument_id=${cirInstrumentId}`; + } else { + showCIRMetadata(false); + if (schemaName) survey_data_url += `&schema_name=${schemaName}`; + if (schemaUrl) survey_data_url += `&schema_url=${schemaUrl}`; + } + showSupplementaryData(false); + getDataAsync(survey_data_url) + .then((schema_response) => { + document.querySelector("#survey_metadata").innerHTML = ""; + document.querySelector("#survey_metadata").innerHTML = ""; + + if (schema_response.metadata.length > 0) { + document.querySelector("#survey_metadata").innerHTML = + schema_response.metadata + .map((metadataField) => { + const fieldName = metadataField["name"]; + const defaultValue = metadataField["default"]; + + return `
${getLabelFor(fieldName)}${(() => { + if (metadataField["type"] === "boolean") { + return getInputField(fieldName, "checkbox"); + } else if (metadataField["type"] === "uuid") { + return ( + `${getInputField(fieldName, "text", uuidv4())}` + + `` + + `` + ); + } else if ( + fieldName === "survey_id" || + fieldName === "period_id" + ) { + return getInputField( + fieldName, + "text", + fieldName === "survey_id" + ? schema_response.survey_id + : defaultValue, + false, + "updateSDSDropdown()", + ); + } else if (fieldName === "sds_dataset_id") { + return ``; + } else { + return getInputField(fieldName, "text", defaultValue); + } + })()}
`; + }) + .join(""); + updateSDSDropdown(); + } else { + document.querySelector("#survey_metadata").innerHTML = + "No metadata required for this survey"; + } + showSubmitFlushButtons(true); + }) + .catch((_) => { + document.querySelector("#survey_metadata").innerHTML = + "Failed to load Survey Metadata"; + }); +} + +function loadSupplementaryDataInfo() { + const selectedDatasetId = document.getElementById("sds_dataset_id")?.value; + const selectedDataset = supplementaryDataSets?.find( + (d) => d["dataset_id"] === selectedDatasetId, + ); + if (selectedDataset) { + const sdsDatasetMetadataKeys = [ + "title", + "sds_schema_version", + "total_reporting_units", + "schema_version", + "sds_dataset_version", + ]; + + document.querySelector("#supplementary_data").innerHTML = + sdsDatasetMetadataKeys + .map( + (key) => + `
${getLabelFor(key)}${getInputField(key, "text", selectedDataset[key], true)}
`, + ) + .join(""); + } } function uuid(el_id) { - document.querySelector(`#${el_id}`).value = uuidv4(); + document.querySelector(`#${el_id}`).value = uuidv4(); } function numericId() { - let result = ''; - let chars = '0123456789'; - for (let i = 16; i > 0; --i) { - result += chars[Math.round(Math.random() * (chars.length - 1))]; - } - document.querySelector(`#response_id`).value = result; + let result = ""; + let chars = "0123456789"; + for (let i = 16; i > 0; --i) { + result += chars[Math.round(Math.random() * (chars.length - 1))]; + } + document.querySelector(`#response_id`).value = result; } -function setResponseExpiry(days_offset=7) { - let dt = new Date(); - dt.setDate(dt.getDate()+days_offset) - document.querySelector('#response_expires_at').value=dt.toISOString().replace(/(\.\d*)/, '').replace(/Z/, '+00:00'); +function setResponseExpiry(days_offset = 7) { + let dt = new Date(); + dt.setDate(dt.getDate() + days_offset); + document.querySelector("#response_expires_at").value = dt + .toISOString() + .replace(/(\.\d*)/, "") + .replace(/Z/, "+00:00"); } function validateForm() { - validateResponseExpiresAt(); - removeUnwantedMetadata() + validateResponseExpiresAt(); + removeUnwantedMetadata(); } function validateResponseExpiresAt() { - let responseExpiresAt = Date.parse(document.querySelector('#response_expires_at').value) - if (isNaN(responseExpiresAt)) { - document.querySelector('#response_expires_at').remove() - } + let responseExpiresAt = Date.parse( + document.querySelector("#response_expires_at").value, + ); + if (isNaN(responseExpiresAt)) { + document.querySelector("#response_expires_at").remove(); + } } // Inputs without a name will not be submitted function removeUnwantedMetadata() { - const inputs = document.getElementsByTagName("input"); - for (let input of inputs) { - if (!input.value) { - input.removeAttribute('name'); - } + const inputs = document.getElementsByTagName("input"); + for (let input of inputs) { + if (!input.value) { + input.removeAttribute("name"); } + } } function retrieveResponseId() { - let responseId = localStorage.getItem("response_id"); - let responseIdButton = document.querySelector("#response-id-btn"); + let responseId = localStorage.getItem("response_id"); + let responseIdButton = document.querySelector("#response-id-btn"); - if (responseId) { - responseIdButton.classList.remove("btn--hidden"); - } - else { - responseIdButton.classList.add("btn--hidden"); - } + if (responseId) { + responseIdButton.classList.remove("btn--hidden"); + } else { + responseIdButton.classList.add("btn--hidden"); + } } function loadResponseId() { - document.querySelector("#response_id").value = localStorage.getItem("response_id"); + document.querySelector("#response_id").value = + localStorage.getItem("response_id"); } function saveResponseId() { - localStorage.setItem("response_id", document.querySelector("#response_id").value); + localStorage.setItem( + "response_id", + document.querySelector("#response_id").value, + ); } function clearLocalStorage() { - localStorage.removeItem("response_id"); - localStorage.removeItem("schema_name"); - localStorage.removeItem("survey_type"); - localStorage.removeItem("cir_schema"); - localStorage.removeItem("schema_url"); - location.reload(); + localStorage.removeItem("response_id"); + localStorage.removeItem("schema_name"); + localStorage.removeItem("survey_type"); + localStorage.removeItem("cir_schema"); + localStorage.removeItem("schema_url"); + location.reload(); } function populateDropDownWithValue(selector, value) { - const availableOptions = [...document.querySelector(selector).options].map(x => x.value) + const availableOptions = [...document.querySelector(selector).options].map( + (x) => x.value, + ); - if (availableOptions.includes(value)) { - document.querySelector(selector).value = value; - } + if (availableOptions.includes(value)) { + document.querySelector(selector).value = value; + } } function onLoad() { - uuid('collection_exercise_sid'); - uuid('case_id'); - numericId(); - setResponseExpiry(); - retrieveResponseId(); - - if (schemaName = localStorage.getItem("schema_name")){ - populateDropDownWithValue("#schema_name", schemaName) - loadMetadataForSchemaName(); + uuid("collection_exercise_sid"); + uuid("case_id"); + numericId(); + setResponseExpiry(); + retrieveResponseId(); + + if ((schemaName = localStorage.getItem("schema_name"))) { + populateDropDownWithValue("#schema_name", schemaName); + loadMetadataForSchemaName(); + } else { + if ((surveyType = localStorage.getItem("survey_type"))) { + populateDropDownWithValue("#remote-schema-survey-type", surveyType); } - else { - if(surveyType = localStorage.getItem("survey_type")) { - populateDropDownWithValue("#remote-schema-survey-type", surveyType) - } - if(cirSchema = localStorage.getItem("cir_schema")) { - populateDropDownWithValue("#cir-schemas", cirSchema) - } - if(schemaUrl = localStorage.getItem("schema_url")) { - document.querySelector("#schema-url").value = schemaUrl - } + if ((cirSchema = localStorage.getItem("cir_schema"))) { + populateDropDownWithValue("#cir-schemas", cirSchema); + } + if ((schemaUrl = localStorage.getItem("schema_url"))) { + document.querySelector("#schema-url").value = schemaUrl; } -} \ No newline at end of file + } +} From 4551fd728020b94c9094b4688b91eb97715ac715 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Mon, 25 Mar 2024 12:27:45 +0000 Subject: [PATCH 03/52] Format template files --- templates/launch.html | 372 +++++++++++++++++++++++------------------- templates/layout.html | 20 +-- 2 files changed, 212 insertions(+), 180 deletions(-) diff --git a/templates/launch.html b/templates/launch.html index 19fb3033..e9a7234e 100644 --- a/templates/launch.html +++ b/templates/launch.html @@ -1,179 +1,211 @@ {{ define "title" }}Launch a Survey{{ end }} - {{ define "body" }} - - -

Launch a survey

-
- - Launch Pattern -
- - -
- - Launch by Schema Name -
- - + + + +
+ Launch by Schema Name +
+ + +
+

----------

+ Launch Remote Schemas +
+ + + -
- -

----------

- - Launch Remote Schemas -
- - - - -
- -
- - - - -
- -
- - - + +
+
+ + + - -
- -
- -
- -

----------

- -
-
- - - -

Survey Metadata

-
-

--- Metadata fields will be loaded when you select a version and load a schema ---

-
- -
-

Supplementary Data

-
-
-
- -

Required Data

- -
- - - - - -
- -
- - - - - -
- - -
- - - - - -
- -
- - - - - -
- - -

Runner Data

-
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - - -
- -
- - + + +
+ +
+

----------

+
+ +

Survey Metadata

+
+

--- Metadata fields will be loaded when you select a version and load a schema ---

+
+
+

Supplementary Data

+
+
+

Required Data

+
+ + + + + +
+
+ + + + + +
+ +
+ + + + + +
+
+ + + + + +
+

Runner Data

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+ + + {{ end }} diff --git a/templates/layout.html b/templates/layout.html index 11aaf4af..9c6a926e 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -1,12 +1,12 @@ {{ define "layout" }} - - - - - - {{ template "title" }} - - - {{ template "body" . }} - + + + + + + {{ template "title" }} + + + {{ template "body" . }} + {{ end }} From 564f427acb4b49982c554294402daa008ea5815b Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Mon, 25 Mar 2024 15:37:04 +0000 Subject: [PATCH 04/52] Format Go file --- clients/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/http.go b/clients/http.go index 0e82706f..6c34cb84 100644 --- a/clients/http.go +++ b/clients/http.go @@ -10,6 +10,6 @@ var httpClient = &http.Client{ } // GetHTTPClient returns a single HttpClient for use across the app -func GetHTTPClient() (*http.Client) { +func GetHTTPClient() *http.Client { return httpClient -} \ No newline at end of file +} From dca8f18b7b14e2f77c84976f44560b7c19d841e2 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 27 Mar 2024 10:45:59 +0000 Subject: [PATCH 05/52] Update HTML files to pass linting --- templates/launch.html | 14 +++++++++----- templates/layout.html | 4 +++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/templates/launch.html b/templates/launch.html index e9a7234e..bf71fe38 100644 --- a/templates/launch.html +++ b/templates/launch.html @@ -3,7 +3,7 @@

Launch a survey

Launch Pattern @@ -108,7 +108,8 @@

Required Data

+ src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGhlaWdodD0iNTEycHgiIGlkPSJMYXllcl8xIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgd2lkdGg9IjUxMnB4IiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48Zz48cGF0aCBkPSJNMjU2LDM4NC4xYy03MC43LDAtMTI4LTU3LjMtMTI4LTEyOC4xYzAtNzAuOCw1Ny4zLTEyOC4xLDEyOC0xMjguMVY4NGw5Niw2NGwtOTYsNTUuN3YtNTUuOCAgIGMtNTkuNiwwLTEwOC4xLDQ4LjUtMTA4LjEsMTA4LjFjMCw1OS42LDQ4LjUsMTA4LjEsMTA4LjEsMTA4LjFTMzY0LjEsMzE2LDM2NC4xLDI1NkgzODRDMzg0LDMyNywzMjYuNywzODQuMSwyNTYsMzg0LjF6Ii8+PC9nPjwvc3ZnPg==" + alt="Reload symbol">
@@ -120,7 +121,8 @@

Required Data

class="qa-response_id"> + src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGhlaWdodD0iNTEycHgiIGlkPSJMYXllcl8xIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgd2lkdGg9IjUxMnB4IiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48Zz48cGF0aCBkPSJNMjU2LDM4NC4xYy03MC43LDAtMTI4LTU3LjMtMTI4LTEyOC4xYzAtNzAuOCw1Ny4zLTEyOC4xLDEyOC0xMjguMVY4NGw5Niw2NGwtOTYsNTUuN3YtNTUuOCAgIGMtNTkuNiwwLTEwOC4xLDQ4LjUtMTA4LjEsMTA4LjFjMCw1OS42LDQ4LjUsMTA4LjEsMTA4LjEsMTA4LjFTMzY0LjEsMzE2LDM2NC4xLDI1NkgzODRDMzg0LDMyNywzMjYuNywzODQuMSwyNTYsMzg0LjF6Ii8+PC9nPjwvc3ZnPg==" + alt="Reload symbol">
Required Data class="qa-collection-sid"> + src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGhlaWdodD0iNTEycHgiIGlkPSJMYXllcl8xIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgd2lkdGg9IjUxMnB4IiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48Zz48cGF0aCBkPSJNMjU2LDM4NC4xYy03MC43LDAtMTI4LTU3LjMtMTI4LTEyOC4xYzAtNzAuOCw1Ny4zLTEyOC4xLDEyOC0xMjguMVY4NGw5Niw2NGwtOTYsNTUuN3YtNTUuOCAgIGMtNTkuNiwwLTEwOC4xLDQ4LjUtMTA4LjEsMTA4LjFjMCw1OS42LDQ4LjUsMTA4LjEsMTA4LjEsMTA4LjFTMzY0LjEsMzE2LDM2NC4xLDI1NkgzODRDMzg0LDMyNywzMjYuNywzODQuMSwyNTYsMzg0LjF6Ii8+PC9nPjwvc3ZnPg==" + alt="Reload symbol">
@@ -149,7 +152,8 @@

Required Data

class="qa-response-expires-at"> + src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGhlaWdodD0iNTEycHgiIGlkPSJMYXllcl8xIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgd2lkdGg9IjUxMnB4IiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48Zz48cGF0aCBkPSJNMjU2LDM4NC4xYy03MC43LDAtMTI4LTU3LjMtMTI4LTEyOC4xYzAtNzAuOCw1Ny4zLTEyOC4xLDEyOC0xMjguMVY4NGw5Niw2NGwtOTYsNTUuN3YtNTUuOCAgIGMtNTkuNiwwLTEwOC4xLDQ4LjUtMTA4LjEsMTA4LjFjMCw1OS42LDQ4LjUsMTA4LjEsMTA4LjEsMTA4LjFTMzY0LjEsMzE2LDM2NC4xLDI1NkgzODRDMzg0LDMyNywzMjYuNywzODQuMSwyNTYsMzg0LjF6Ii8+PC9nPjwvc3ZnPg==" + alt="Reload symbol">

Runner Data

diff --git a/templates/layout.html b/templates/layout.html index 9c6a926e..02fd73b6 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -1,8 +1,10 @@ {{ define "layout" }} - + + + {{ template "title" }} From 2feca0e1d198dc0384e271d6de973d6588b712ea Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 27 Mar 2024 10:47:00 +0000 Subject: [PATCH 06/52] Update go files to pass linting --- authentication/auth.go | 30 +++++++++++++++--------------- launch.go | 19 ++++++++++++++----- surveys/surveys.go | 8 ++++---- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/authentication/auth.go b/authentication/auth.go index ee1b31fe..50e7b38d 100644 --- a/authentication/auth.go +++ b/authentication/auth.go @@ -6,10 +6,11 @@ import ( "crypto/x509" "encoding/pem" "fmt" - "io/ioutil" + "io" "math/rand" "net/http" "net/url" + "os" "time" "github.com/ONSdigital/eq-questionnaire-launcher/clients" @@ -59,7 +60,7 @@ type PrivateKeyResult struct { func loadEncryptionKey() (*PublicKeyResult, *KeyLoadError) { encryptionKeyPath := settings.Get("JWT_ENCRYPTION_KEY_PATH") - keyData, err := ioutil.ReadFile(encryptionKeyPath) + keyData, err := os.ReadFile(encryptionKeyPath) if err != nil { return nil, &KeyLoadError{Op: "read", Err: "Failed to read encryption key from file: " + encryptionKeyPath} } @@ -82,7 +83,7 @@ func loadEncryptionKey() (*PublicKeyResult, *KeyLoadError) { func loadSigningKey() (*PrivateKeyResult, *KeyLoadError) { signingKeyPath := settings.Get("JWT_SIGNING_KEY_PATH") - keyData, err := ioutil.ReadFile(signingKeyPath) + keyData, err := os.ReadFile(signingKeyPath) if err != nil { return nil, &KeyLoadError{Op: "read", Err: "Failed to read signing key from file: " + signingKeyPath} } @@ -251,7 +252,7 @@ func launcherSchemaFromURL(url string) (launcherSchema surveys.LauncherSchema, e return launcherSchema, fmt.Sprintf("Failed to load Schema from %s", url) } - responseBody, err := ioutil.ReadAll(resp.Body) + responseBody, err := io.ReadAll(resp.Body) resp.Body.Close() if err != nil { panic(err) @@ -311,7 +312,7 @@ func validateSchema(payload []byte) (error string) { return err.Error() } - responseBody, err := ioutil.ReadAll(resp.Body) + responseBody, err := io.ReadAll(resp.Body) resp.Body.Close() if err != nil { return err.Error() @@ -421,10 +422,9 @@ func GenerateTokenFromDefaults(schemaURL string, accountServiceURL string, accou return "", validationError } - claims := make(map[string]interface{}) urlValues["account_service_url"] = []string{accountServiceURL} urlValues["account_service_log_out_url"] = []string{accountServiceLogOutURL} - claims = generateClaims(urlValues, launcherSchema) + claims := generateClaims(urlValues, launcherSchema) requiredMetadata, error := getRequiredSchemaMetadata(launcherSchema) if error != "" { @@ -469,10 +469,9 @@ func GenerateTokenFromDefaultsV2(schemaURL string, accountServiceURL string, url return "", fmt.Sprintf("getSchema failed err: %v", error) } - claims := make(map[string]interface{}) urlValues["account_service_url"] = []string{accountServiceURL} - claims = generateClaimsV2(urlValues, schema) + claims := generateClaimsV2(urlValues, schema) requiredSchemaMetadata, error := getRequiredSchemaMetadata(launcherSchema) if error != "" { @@ -566,7 +565,7 @@ func GenerateTokenFromPost(postValues url.Values, launchVersion2 bool) (string, return "", fmt.Sprintf("getSchema failed err: %v", error) } - claims := make(map[string]interface{}) + var claims map[string]interface{} if launchVersion2 { claims = generateClaimsV2(postValues, schema) @@ -642,9 +641,10 @@ func GetSurveyData(launcherSchema surveys.LauncherSchema) (QuestionnaireSchema, missingClaims := getMissingMandatoryClaims(claims, mandatoryClaims) - for _, v := range missingClaims { - schema.Metadata = append(schema.Metadata, v) - } + //for _, v := range missingClaims { + // schema.Metadata = append(schema.Metadata, v) + //} + schema.Metadata = append(schema.Metadata, missingClaims...) return schema, "" } @@ -686,7 +686,7 @@ func getSchema(launcherSchema surveys.LauncherSchema) (QuestionnaireSchema, stri return schema, fmt.Sprintf("Failed to load Schema from %s", url) } - responseBody, err := ioutil.ReadAll(resp.Body) + responseBody, err := io.ReadAll(resp.Body) resp.Body.Close() if err != nil { log.Print(err) @@ -702,7 +702,7 @@ func getSchema(launcherSchema surveys.LauncherSchema) (QuestionnaireSchema, stri } func getMandatatoryClaims(surveyType string, defaults map[string]string) []Metadata { - claims := make([]Metadata, 0) + var claims []Metadata if isSocialSurvey(surveyType) { claims = []Metadata{ {"qid", "false", defaults["qid"]}, diff --git a/launch.go b/launch.go index 6207c2bb..f4e23008 100644 --- a/launch.go +++ b/launch.go @@ -64,7 +64,10 @@ type page struct { } func getStatusPage(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("OK")) + _, err := w.Write([]byte("OK")) + if err != nil { + return + } } func getLaunchHandler(w http.ResponseWriter, r *http.Request) { @@ -102,7 +105,10 @@ func getSurveyDataHandler(w http.ResponseWriter, r *http.Request) { surveyDataJSON, _ := json.Marshal(surveyData) - w.Write([]byte(surveyDataJSON)) + _, err2 := w.Write([]byte(surveyDataJSON)) + if err2 != nil { + return + } } func getSupplementaryDataHandler(w http.ResponseWriter, r *http.Request) { @@ -116,7 +122,10 @@ func getSupplementaryDataHandler(w http.ResponseWriter, r *http.Request) { } datasetJSON, _ := json.Marshal(datasets) - w.Write([]byte(datasetJSON)) + _, err = w.Write([]byte(datasetJSON)) + if err != nil { + return + } } func getAccountServiceURL(r *http.Request) string { @@ -160,7 +169,7 @@ func redirectURL(w http.ResponseWriter, r *http.Request) { } else if launchVersion != "" { http.Redirect(w, r, hostURL+"/session?token="+token, 301) } else { - http.Error(w, fmt.Sprintf("Invalid Action"), 500) + http.Error(w, "Invalid Action", 500) } } @@ -209,7 +218,7 @@ func quickLauncherHandler(w http.ResponseWriter, r *http.Request) { if schemaURL != "" { http.Redirect(w, r, hostURL+"/session?token="+token, 302) } else { - http.Error(w, fmt.Sprintf("Not Found"), 404) + http.Error(w, "Not Found", 404) } } diff --git a/surveys/surveys.go b/surveys/surveys.go index 0577b4b8..9d6e839b 100644 --- a/surveys/surveys.go +++ b/surveys/surveys.go @@ -3,18 +3,18 @@ package surveys import ( "encoding/json" "errors" + "golang.org/x/text/cases" + "golang.org/x/text/language" "io" "log" "fmt" - "sort" - "strings" - "github.com/AreaHQ/jsonhal" "github.com/ONSdigital/eq-questionnaire-launcher/clients" "github.com/ONSdigital/eq-questionnaire-launcher/oidc" "github.com/ONSdigital/eq-questionnaire-launcher/settings" "golang.org/x/oauth2" + "sort" ) // LauncherSchema is a representation of a schema in the Launcher @@ -86,7 +86,7 @@ func GetAvailableSchemas() map[string][]LauncherSchema { schemasBySurveyType := map[string][]LauncherSchema{} for _, schema := range allSchemas { - schemasBySurveyType[strings.Title(schema.SurveyType)] = append(schemasBySurveyType[strings.Title(schema.SurveyType)], schema) + schemasBySurveyType[cases.Title(language.Und).String(schema.SurveyType)] = append(schemasBySurveyType[cases.Title(language.Und).String(schema.SurveyType)], schema) } return schemasBySurveyType From 4526f74432fe5506d2d37ac1a77c3bac79b1b545 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 27 Mar 2024 13:47:10 +0000 Subject: [PATCH 07/52] Add linting to actions --- .github/workflows/pull_request.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d99b1e1b..f5606d4c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -24,6 +24,8 @@ jobs: - name: Install dependencies if: steps.cache-dependencies.outputs.cache-hit != 'true' run: go get + - name: Install npm deps + run: npm install - name: Build run: CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo docker-push: @@ -52,3 +54,28 @@ jobs: gcloud auth configure-docker ${{ secrets.GAR_LOCATION }} echo "Pushing to GAR with tag $TAG" docker push ${{ secrets.GAR_LOCATION }}/${{ secrets.GAR_PROJECT_ID }}/docker-images/eq-questionnaire-launcher:$TAG + lint: + needs: [build] + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install npm deps + run: npm install + - name: Templates linting + run: make lint-templates + - name: Static linting + run: make lint-static + golangci: + needs: [build] + name: lint + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.21' + cache: false + - name: golangci-lint + uses: golangci/golangci-lint-action@v4 + with: + version: v1.54 From f73e68b1c1e0c7769e482953783561716e4df63e Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 27 Mar 2024 13:47:57 +0000 Subject: [PATCH 08/52] Update README to include makefile commands and how to install go linting tool --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index bad050bb..c782049a 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,29 @@ Documentation on the `v2` structure can be found [here](https://github.com/ONSdi e.g."http://localhost:8000/quick-launch?schema_url=http://localhost:7777/1_0001.json&version=v1" ``` +### Commands for Formatting & Linting +Install dependencies using `npm install` for formatting and linting + +| Command | Task | +|-------------------------|---------------------------------------------------------| +| `make format-static` | Formats all static files (Javascipt and CSS) | +| `make format-templates` | Formats all HTML files and shows the changes to be made | +| `make format-go` | Formats all the Golang files | +| `make format` | Formats all files listed above | +| `make lint-static` | Lints all static files and reports any issues | +| `make lint-templates` | Lints all HTML files and reports any issues | +| `make lint-go` | Lints all Golang files using an external tool | +| `make lint` | Lints all files listed above | + +**Note**: Before being able to run `lint-go`, you will need to install the external tool `golangci-lint`. The command to +install the tool is `brew install golangci-lint` and to upgrade it use `brew upgrade golangci-lint`. Visit +https://golangci-lint.run/welcome/install/#local-installation to see additional ways to install the tool. + +To configure Prettier & djLint use the `package.json` (Using the prettier keyword) and `.djlintrc` respectively. To +ignore rules set by the linter use the `.prettierignore` file and add to the `ignore` option in the `.djlintrc` file. + + + ### Notes * There are no unit tests yet * JWT spec based on http://ons-schema-definitions.readthedocs.io/en/latest/jwt_profile.html From 901d149a42f3359f62f232acbac184c05c4faba9 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 27 Mar 2024 13:53:51 +0000 Subject: [PATCH 09/52] Add dependencies --- .djlintrc | 3 + .prettierignore | 2 + Makefile | 21 + package-lock.json | 1158 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 19 + 5 files changed, 1203 insertions(+) create mode 100644 .djlintrc create mode 100644 .prettierignore create mode 100644 Makefile create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.djlintrc b/.djlintrc new file mode 100644 index 00000000..a4777f51 --- /dev/null +++ b/.djlintrc @@ -0,0 +1,3 @@ +{ + "ignore": "H006" +} \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..254f4a31 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +#Ignore any html files +**/*.html diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..0ced1786 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +lint: lint-static lint-templates + +format: format-go format-static format-templates + +format-go: + go fmt ./... + +lint-go: + golangci-lint run + +lint-static: + npx prettier --check "static/**/*.{js,css}" + +format-static: + npx prettier "static/**/*.{js,css}" --write + +lint-templates: + djlint templates --lint + +format-templates: + djlint templates/*.html --reformat \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..a85a0815 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1158 @@ +{ + "name": "eq-questionnaire-launcher", + "version": "2.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "eq-questionnaire-launcher", + "version": "2.0.0", + "devDependencies": { + "djlint": "^1.34.1", + "eslint": "^8.57.0", + "prettier": "^3.2.5" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "dev": true + }, + "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/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "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/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/djlint": { + "version": "1.34.1", + "resolved": "https://registry.npmjs.org/djlint/-/djlint-1.34.1.tgz", + "integrity": "sha512-2j/gwMJ0EoEtwkguBPjDmK4/yxh+YaPYA3LPuW9Hewyi26DtoV3Sag6hN81gamJwby9TmmKnnLX7WtX4bkqRkw==", + "dev": true, + "hasInstallScript": true + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "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-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-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "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/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "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/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "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/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "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/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..a9de60ae --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "eq-questionnaire-launcher", + "version": "2.0.0", + "description": "ONS Digital eQ Questionnaire Launcher Dev Tool", + "author": { + "name": "ONS Digital", + "url": "http://onsdigital.github.io/" + }, + "repository": { + "type": "git", + "url": "https://github.com/ONSdigital/eq-questionnaire-launcher" + }, + "devDependencies": { + "djlint": "^1.34.1", + "eslint": "^8.57.0", + "prettier": "^3.2.5" + }, + "prettier": {} +} From ba2d4fa307aa3d352118963506718684d1b855c1 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 27 Mar 2024 14:03:12 +0000 Subject: [PATCH 10/52] Test linting in actions --- static/javascript/launch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/javascript/launch.js b/static/javascript/launch.js index 6b98a5d6..8b1a47fb 100644 --- a/static/javascript/launch.js +++ b/static/javascript/launch.js @@ -553,7 +553,7 @@ function validateResponseExpiresAt() { } // Inputs without a name will not be submitted -function removeUnwantedMetadata() { +function removeUnwantedMetadata() { const inputs = document.getElementsByTagName("input"); for (let input of inputs) { if (!input.value) { From fcb647a1986e4f6ce8ac5cce684ec3e29548cf13 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 27 Mar 2024 14:25:05 +0000 Subject: [PATCH 11/52] Update pull_request.yml file --- .github/workflows/pull_request.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index f5606d4c..8fb3822d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -55,19 +55,6 @@ jobs: echo "Pushing to GAR with tag $TAG" docker push ${{ secrets.GAR_LOCATION }}/${{ secrets.GAR_PROJECT_ID }}/docker-images/eq-questionnaire-launcher:$TAG lint: - needs: [build] - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Install npm deps - run: npm install - - name: Templates linting - run: make lint-templates - - name: Static linting - run: make lint-static - golangci: - needs: [build] - name: lint runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -79,3 +66,11 @@ jobs: uses: golangci/golangci-lint-action@v4 with: version: v1.54 + - run: make lint-go + - uses: actions/checkout@v3 + - name: Install npm deps + run: npm install + - name: Templates linting + run: make lint-templates + - name: Static linting + run: make lint-static From 60bdc32798020034690a12c07164231ac602f887 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 27 Mar 2024 14:30:41 +0000 Subject: [PATCH 12/52] Testing golang linter in actions --- launch.go | 2 +- static/javascript/launch.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/launch.go b/launch.go index f4e23008..11eacffa 100644 --- a/launch.go +++ b/launch.go @@ -218,7 +218,7 @@ func quickLauncherHandler(w http.ResponseWriter, r *http.Request) { if schemaURL != "" { http.Redirect(w, r, hostURL+"/session?token="+token, 302) } else { - http.Error(w, "Not Found", 404) + http.Error(w, fmt.Sprintf("Not Found"), 404) } } diff --git a/static/javascript/launch.js b/static/javascript/launch.js index 8b1a47fb..6b98a5d6 100644 --- a/static/javascript/launch.js +++ b/static/javascript/launch.js @@ -553,7 +553,7 @@ function validateResponseExpiresAt() { } // Inputs without a name will not be submitted -function removeUnwantedMetadata() { +function removeUnwantedMetadata() { const inputs = document.getElementsByTagName("input"); for (let input of inputs) { if (!input.value) { From ca66014f43fd17778b03d35a4375beba4df56202 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 27 Mar 2024 14:41:32 +0000 Subject: [PATCH 13/52] Update pull_request file --- .github/workflows/pull_request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 8fb3822d..d30d9b9c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -62,11 +62,10 @@ jobs: with: go-version: '1.21' cache: false - - name: golangci-lint + - name: Golang linting uses: golangci/golangci-lint-action@v4 with: version: v1.54 - - run: make lint-go - uses: actions/checkout@v3 - name: Install npm deps run: npm install From e84826fdc247dc6a309e063737f12611a68c454b Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 27 Mar 2024 14:56:21 +0000 Subject: [PATCH 14/52] Update task name in pull_request.yaml and fix intensional mistake in go file --- .github/workflows/pull_request.yml | 2 +- Makefile | 2 +- launch.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d30d9b9c..090bd3b0 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -62,7 +62,7 @@ jobs: with: go-version: '1.21' cache: false - - name: Golang linting + - name: Go linting uses: golangci/golangci-lint-action@v4 with: version: v1.54 diff --git a/Makefile b/Makefile index 0ced1786..ea8c154c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -lint: lint-static lint-templates +lint: lint-go lint-templates lint-static format: format-go format-static format-templates diff --git a/launch.go b/launch.go index 11eacffa..f4e23008 100644 --- a/launch.go +++ b/launch.go @@ -218,7 +218,7 @@ func quickLauncherHandler(w http.ResponseWriter, r *http.Request) { if schemaURL != "" { http.Redirect(w, r, hostURL+"/session?token="+token, 302) } else { - http.Error(w, fmt.Sprintf("Not Found"), 404) + http.Error(w, "Not Found", 404) } } From cf164a9678707263c1add0b286268c109d8574c3 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Thu, 28 Mar 2024 15:13:05 +0000 Subject: [PATCH 15/52] Add ESlint to Makefile command --- Makefile | 1 + lint.sh | 4 ---- static/javascript/launch.js | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) delete mode 100755 lint.sh diff --git a/Makefile b/Makefile index ea8c154c..50487dbe 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ lint-go: lint-static: npx prettier --check "static/**/*.{js,css}" + npx eslint static/javascript/*.js format-static: npx prettier "static/**/*.{js,css}" --write diff --git a/lint.sh b/lint.sh deleted file mode 100755 index 0284869a..00000000 --- a/lint.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -go get -u golang.org/x/lint/golint -$GOPATH/bin/golint -set_exit_status $(go list ./... | grep -v '/vendor/') - diff --git a/static/javascript/launch.js b/static/javascript/launch.js index 6b98a5d6..bdabf01a 100644 --- a/static/javascript/launch.js +++ b/static/javascript/launch.js @@ -543,6 +543,7 @@ function validateForm() { validateResponseExpiresAt(); removeUnwantedMetadata(); } + function validateResponseExpiresAt() { let responseExpiresAt = Date.parse( document.querySelector("#response_expires_at").value, From d415270ec4cbe71d9f81bfe753d6c68cd361f49f Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Thu, 28 Mar 2024 15:13:35 +0000 Subject: [PATCH 16/52] Add ESlint config file --- .eslintrc.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..f7201e0e --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,15 @@ +{ + "env": { + "browser": true, + "es2021": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "rules": { + "no-unused-vars": "off", + "no-undef": "off" + } +} From 9d4713164068b8f16a1f9275df3321794a854ba0 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 2 Apr 2024 15:52:44 +0100 Subject: [PATCH 17/52] Remove commented code --- authentication/auth.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/authentication/auth.go b/authentication/auth.go index 50e7b38d..518c28a8 100644 --- a/authentication/auth.go +++ b/authentication/auth.go @@ -641,9 +641,6 @@ func GetSurveyData(launcherSchema surveys.LauncherSchema) (QuestionnaireSchema, missingClaims := getMissingMandatoryClaims(claims, mandatoryClaims) - //for _, v := range missingClaims { - // schema.Metadata = append(schema.Metadata, v) - //} schema.Metadata = append(schema.Metadata, missingClaims...) return schema, "" From 5642a852d7131b0d7a5208676bea7ea3c3c0327e Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 3 Apr 2024 13:47:46 +0100 Subject: [PATCH 18/52] Refactor files --- .eslintrc.json | 15 ----------- .github/workflows/pull_request.yml | 41 ++++++++++++++++-------------- .nvmrc | 1 + Makefile | 2 +- README.md | 9 +++---- launch.go | 3 +++ package.json | 17 ++++++++++++- 7 files changed, 47 insertions(+), 41 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 .nvmrc diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index f7201e0e..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "rules": { - "no-unused-vars": "off", - "no-undef": "off" - } -} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 090bd3b0..e3a251e2 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -25,9 +25,31 @@ jobs: if: steps.cache-dependencies.outputs.cache-hit != 'true' run: go get - name: Install npm deps + uses: actions/setup-node@v3 + with: + node-version-file: ".nvmrc" + cache: "npm" run: npm install - name: Build run: CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo + lint: + needs: [build] + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.21' + cache: false + - name: Go linting + uses: golangci/golangci-lint-action@v4 + with: + version: v1.54 + - uses: actions/checkout@v3 + - name: Templates linting + run: make lint-templates + - name: Static linting + run: make lint-static docker-push: runs-on: ubuntu-22.04 steps: @@ -54,22 +76,3 @@ jobs: gcloud auth configure-docker ${{ secrets.GAR_LOCATION }} echo "Pushing to GAR with tag $TAG" docker push ${{ secrets.GAR_LOCATION }}/${{ secrets.GAR_PROJECT_ID }}/docker-images/eq-questionnaire-launcher:$TAG - lint: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: '1.21' - cache: false - - name: Go linting - uses: golangci/golangci-lint-action@v4 - with: - version: v1.54 - - uses: actions/checkout@v3 - - name: Install npm deps - run: npm install - - name: Templates linting - run: make lint-templates - - name: Static linting - run: make lint-static diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..790e1105 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20.10.0 diff --git a/Makefile b/Makefile index 50487dbe..ab7d9d94 100644 --- a/Makefile +++ b/Makefile @@ -19,4 +19,4 @@ lint-templates: djlint templates --lint format-templates: - djlint templates/*.html --reformat \ No newline at end of file + djlint templates/*.html --reformat diff --git a/README.md b/README.md index c782049a..78836bb5 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,10 @@ e.g."http://localhost:8000/quick-launch?schema_url=http://localhost:7777/1_0001. ``` ### Commands for Formatting & Linting -Install dependencies using `npm install` for formatting and linting +Install dependencies using `npm install` for formatting and linting. **Note**: Before being able to run `lint-go`, +you will need to install the external tool `golangci-lint`. The command to install the tool is +`brew install golangci-lint` and to upgrade it use `brew upgrade golangci-lint`. Visit +https://golangci-lint.run/welcome/install/#local-installation to see additional ways to install the tool. | Command | Task | |-------------------------|---------------------------------------------------------| @@ -74,10 +77,6 @@ Install dependencies using `npm install` for formatting and linting | `make lint-go` | Lints all Golang files using an external tool | | `make lint` | Lints all files listed above | -**Note**: Before being able to run `lint-go`, you will need to install the external tool `golangci-lint`. The command to -install the tool is `brew install golangci-lint` and to upgrade it use `brew upgrade golangci-lint`. Visit -https://golangci-lint.run/welcome/install/#local-installation to see additional ways to install the tool. - To configure Prettier & djLint use the `package.json` (Using the prettier keyword) and `.djlintrc` respectively. To ignore rules set by the linter use the `.prettierignore` file and add to the `ignore` option in the `.djlintrc` file. diff --git a/launch.go b/launch.go index f4e23008..e5c509ad 100644 --- a/launch.go +++ b/launch.go @@ -66,6 +66,7 @@ type page struct { func getStatusPage(w http.ResponseWriter, r *http.Request) { _, err := w.Write([]byte("OK")) if err != nil { + http.Error(w, fmt.Sprintf("Write err: %v", err), 500) return } } @@ -107,6 +108,7 @@ func getSurveyDataHandler(w http.ResponseWriter, r *http.Request) { _, err2 := w.Write([]byte(surveyDataJSON)) if err2 != nil { + http.Error(w, fmt.Sprintf("Write err: %v", err2), 500) return } } @@ -124,6 +126,7 @@ func getSupplementaryDataHandler(w http.ResponseWriter, r *http.Request) { _, err = w.Write([]byte(datasetJSON)) if err != nil { + http.Error(w, fmt.Sprintf("Write err: %v", err), 500) return } } diff --git a/package.json b/package.json index a9de60ae..980e57cb 100644 --- a/package.json +++ b/package.json @@ -15,5 +15,20 @@ "eslint": "^8.57.0", "prettier": "^3.2.5" }, - "prettier": {} + "prettier": {}, + "eslintConfig": { + "env": { + "browser": true, + "es2021": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "rules": { + "no-unused-vars": "off", + "no-undef": "off" + } + } } From b4d146d62ed48b0febf4c88d0cc5b840e0420a19 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 3 Apr 2024 13:57:06 +0100 Subject: [PATCH 19/52] fix yaml file --- .github/workflows/pull_request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index e3a251e2..73cf4465 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -25,7 +25,7 @@ jobs: if: steps.cache-dependencies.outputs.cache-hit != 'true' run: go get - name: Install npm deps - uses: actions/setup-node@v3 + uses: actions/setup-node@v3 actions/checkout@v3 with: node-version-file: ".nvmrc" cache: "npm" @@ -33,7 +33,6 @@ jobs: - name: Build run: CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo lint: - needs: [build] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 From 5667fcf69c9bc6af9e92721042b52c2b061d1f0a Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 3 Apr 2024 14:02:15 +0100 Subject: [PATCH 20/52] Separate node and go from build in yaml file --- .github/workflows/pull_request.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 73cf4465..b2d4092e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -6,7 +6,7 @@ on: - main jobs: - build: + go-dependencies: runs-on: ubuntu-22.04 steps: - name: Install Go @@ -24,15 +24,20 @@ jobs: - name: Install dependencies if: steps.cache-dependencies.outputs.cache-hit != 'true' run: go get - - name: Install npm deps - uses: actions/setup-node@v3 actions/checkout@v3 + - name: Build + run: CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo + node-dependencies: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version-file: ".nvmrc" cache: "npm" + - name: Install npm deps run: npm install - - name: Build - run: CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo lint: + needs: [node-dependencies, go-dependencies] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 From 850667b0a8b85351e9695d95ec723d19abb278df Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 3 Apr 2024 14:08:45 +0100 Subject: [PATCH 21/52] test yaml file changes --- .github/workflows/pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index b2d4092e..4207c1ff 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -50,10 +50,10 @@ jobs: with: version: v1.54 - uses: actions/checkout@v3 - - name: Templates linting - run: make lint-templates - name: Static linting run: make lint-static + - name: Templates linting + run: make lint-templates docker-push: runs-on: ubuntu-22.04 steps: From 93c6b6b3a57a30d13cfd837cd5cc426e3f582d8a Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 3 Apr 2024 14:13:48 +0100 Subject: [PATCH 22/52] Testing actions --- .github/workflows/pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 4207c1ff..520b8d03 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -32,12 +32,12 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version-file: ".nvmrc" + node-version-file : ".nvmrc" cache: "npm" - name: Install npm deps run: npm install lint: - needs: [node-dependencies, go-dependencies] + needs: [go-dependencies, node-dependencies] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 From 755a10b7711980a5c26909e10f47c4d7544defed Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 3 Apr 2024 14:18:01 +0100 Subject: [PATCH 23/52] Testing changes to actions file --- .github/workflows/pull_request.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 520b8d03..92c1743d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -6,7 +6,7 @@ on: - main jobs: - go-dependencies: + build: runs-on: ubuntu-22.04 steps: - name: Install Go @@ -26,18 +26,7 @@ jobs: run: go get - name: Build run: CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo - node-dependencies: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version-file : ".nvmrc" - cache: "npm" - - name: Install npm deps - run: npm install lint: - needs: [go-dependencies, node-dependencies] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -49,12 +38,15 @@ jobs: uses: golangci/golangci-lint-action@v4 with: version: v1.54 + - name: Install npm deps + run: npm install - uses: actions/checkout@v3 - - name: Static linting - run: make lint-static - name: Templates linting run: make lint-templates + - name: Static linting + run: make lint-static docker-push: + needs: [lint] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 From aa12031abba248c2e481e6aa1e6adea482ceccb8 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 3 Apr 2024 14:42:26 +0100 Subject: [PATCH 24/52] Update actions yaml file --- .github/workflows/pull_request.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 92c1743d..5b17d616 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -38,6 +38,10 @@ jobs: uses: golangci/golangci-lint-action@v4 with: version: v1.54 + - uses: actions/setup-node@v3 + with: + node-version-file: ".nvmrc" + cache: "npm" - name: Install npm deps run: npm install - uses: actions/checkout@v3 @@ -46,7 +50,6 @@ jobs: - name: Static linting run: make lint-static docker-push: - needs: [lint] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 From 27fa38c677f2c3c50a95446c7de824305451995e Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Wed, 3 Apr 2024 15:45:52 +0100 Subject: [PATCH 25/52] Update README --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 78836bb5..875c72c5 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,16 @@ e.g."http://localhost:8000/quick-launch?schema_url=http://localhost:7777/1_0001. ``` ### Commands for Formatting & Linting -Install dependencies using `npm install` for formatting and linting. **Note**: Before being able to run `lint-go`, +Ensure you are using the correct version of node using: +``` shell +nvm install +nvm use +``` +To install npm dependencies for formatting and linting use: +``` shell +npm install +``` + **Note**: Before being able to run `lint-go`, you will need to install the external tool `golangci-lint`. The command to install the tool is `brew install golangci-lint` and to upgrade it use `brew upgrade golangci-lint`. Visit https://golangci-lint.run/welcome/install/#local-installation to see additional ways to install the tool. @@ -77,11 +86,6 @@ https://golangci-lint.run/welcome/install/#local-installation to see additional | `make lint-go` | Lints all Golang files using an external tool | | `make lint` | Lints all files listed above | -To configure Prettier & djLint use the `package.json` (Using the prettier keyword) and `.djlintrc` respectively. To -ignore rules set by the linter use the `.prettierignore` file and add to the `ignore` option in the `.djlintrc` file. - - - ### Notes * There are no unit tests yet * JWT spec based on http://ons-schema-definitions.readthedocs.io/en/latest/jwt_profile.html From db126ebfd1741ffbb85d1c441c577740305eafa3 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Fri, 5 Apr 2024 10:38:33 +0100 Subject: [PATCH 26/52] Change version for golangci-lint tool in actions --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 5b17d616..fe023845 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -37,7 +37,7 @@ jobs: - name: Go linting uses: golangci/golangci-lint-action@v4 with: - version: v1.54 + version: v1.57 - uses: actions/setup-node@v3 with: node-version-file: ".nvmrc" From 15b8ad8b2ae7341f2703df0260b4c0135e0d7673 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Fri, 5 Apr 2024 11:18:06 +0100 Subject: [PATCH 27/52] Intentional mistake to test new GHA changes --- launch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launch.go b/launch.go index e5c509ad..d9d7b592 100644 --- a/launch.go +++ b/launch.go @@ -172,7 +172,7 @@ func redirectURL(w http.ResponseWriter, r *http.Request) { } else if launchVersion != "" { http.Redirect(w, r, hostURL+"/session?token="+token, 301) } else { - http.Error(w, "Invalid Action", 500) + http.Error(w, fmt.Sprintf("Invalid Action"), 500) } } From 3f8fee7e13bc7fdb9f69069dc494ac336158b318 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Fri, 5 Apr 2024 11:21:31 +0100 Subject: [PATCH 28/52] Revert intensional mistake --- launch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launch.go b/launch.go index d9d7b592..d122c384 100644 --- a/launch.go +++ b/launch.go @@ -172,7 +172,7 @@ func redirectURL(w http.ResponseWriter, r *http.Request) { } else if launchVersion != "" { http.Redirect(w, r, hostURL+"/session?token="+token, 301) } else { - http.Error(w, fmt.Sprintf("Invalid Action"), 500) + http.Error(w,"Invalid Action", 500) } } From 9724fd1d035d4a94ef716af4d64edfed4511e28e Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 09:14:16 +0100 Subject: [PATCH 29/52] Update variable names for errors and update message --- launch.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/launch.go b/launch.go index d122c384..824b3016 100644 --- a/launch.go +++ b/launch.go @@ -64,9 +64,9 @@ type page struct { } func getStatusPage(w http.ResponseWriter, r *http.Request) { - _, err := w.Write([]byte("OK")) - if err != nil { - http.Error(w, fmt.Sprintf("Write err: %v", err), 500) + _, writeError := w.Write([]byte("OK")) + if writeError != nil { + http.Error(w, fmt.Sprintf("Write failed to write data as part of an HTTP reply: %v", writeError), 500) return } } @@ -106,9 +106,9 @@ func getSurveyDataHandler(w http.ResponseWriter, r *http.Request) { surveyDataJSON, _ := json.Marshal(surveyData) - _, err2 := w.Write([]byte(surveyDataJSON)) - if err2 != nil { - http.Error(w, fmt.Sprintf("Write err: %v", err2), 500) + _, writeError := w.Write([]byte(surveyDataJSON)) + if writeError != nil { + http.Error(w, fmt.Sprintf("Write failed to write data as part of an HTTP reply: %v", writeError), 500) return } } @@ -124,9 +124,9 @@ func getSupplementaryDataHandler(w http.ResponseWriter, r *http.Request) { } datasetJSON, _ := json.Marshal(datasets) - _, err = w.Write([]byte(datasetJSON)) - if err != nil { - http.Error(w, fmt.Sprintf("Write err: %v", err), 500) + _, writeError := w.Write([]byte(datasetJSON)) + if writeError != nil { + http.Error(w, fmt.Sprintf("Write failed to write data as part of an HTTP reply: %v", writeError), 500) return } } From 3a50cc15684f778556493a61f934115ac68be7d4 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 10:27:57 +0100 Subject: [PATCH 30/52] Testing actions --- .eslintrc.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..b08702ee --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,15 @@ +{ + "env": { + "browser": true, + "es2021": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "rules": { + "no-unused-vars": "off", + "no-undef": "off" + } +} \ No newline at end of file From 22d3b65466bb691785f1aefce919b0be7b23a0e1 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 10:32:27 +0100 Subject: [PATCH 31/52] Testing actions with new ESlint config files --- .eslintrc.json | 15 --------------- eslint.config.js | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 15 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.js diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index b08702ee..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "rules": { - "no-unused-vars": "off", - "no-undef": "off" - } -} \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..eedd5051 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,17 @@ +export default [ + { + "env": { + "browser": true, + "es2021": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "rules": { + "no-unused-vars": "off", + "no-undef": "off" + } + } +]; \ No newline at end of file From c41a2a2218f22a94c4e9b27e77fa10a42e2f74b3 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 10:39:31 +0100 Subject: [PATCH 32/52] Testing changes to GHA --- .github/workflows/pull_request.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index fe023845..0a2e93a1 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -6,7 +6,7 @@ on: - main jobs: - build: + go-dependencies: runs-on: ubuntu-22.04 steps: - name: Install Go @@ -26,6 +26,16 @@ jobs: run: go get - name: Build run: CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo + node-dependencies: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version-file: ".nvmrc" + cache: "npm" + - name: Install npm deps + run: npm install lint: runs-on: ubuntu-22.04 steps: @@ -38,13 +48,11 @@ jobs: uses: golangci/golangci-lint-action@v4 with: version: v1.57 + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version-file: ".nvmrc" cache: "npm" - - name: Install npm deps - run: npm install - - uses: actions/checkout@v3 - name: Templates linting run: make lint-templates - name: Static linting From 04180e5517f5ec0ac30436c032a84537a10693ea Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 10:42:13 +0100 Subject: [PATCH 33/52] Revert pull_request.yaml file --- .github/workflows/pull_request.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 0a2e93a1..2257b42e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -6,7 +6,7 @@ on: - main jobs: - go-dependencies: + build: runs-on: ubuntu-22.04 steps: - name: Install Go @@ -26,16 +26,6 @@ jobs: run: go get - name: Build run: CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo - node-dependencies: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version-file: ".nvmrc" - cache: "npm" - - name: Install npm deps - run: npm install lint: runs-on: ubuntu-22.04 steps: @@ -48,11 +38,12 @@ jobs: uses: golangci/golangci-lint-action@v4 with: version: v1.57 - - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version-file: ".nvmrc" cache: "npm" + - name: Install npm deps + run: npm install - name: Templates linting run: make lint-templates - name: Static linting From ad3370000264d964ce764bf82ba16383dec39b08 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 10:48:34 +0100 Subject: [PATCH 34/52] Update actions file --- .github/workflows/pull_request.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 2257b42e..1684a781 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -26,6 +26,13 @@ jobs: run: go get - name: Build run: CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version-file: ".nvmrc" + cache: "npm" + - name: Install npm deps + run: npm install lint: runs-on: ubuntu-22.04 steps: From 830138c3f6cf7eb51367f44ea5650ee223eed3e5 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 10:49:50 +0100 Subject: [PATCH 35/52] Fix missing need step --- .github/workflows/pull_request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1684a781..21b26c2c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -34,6 +34,7 @@ jobs: - name: Install npm deps run: npm install lint: + needs: [build] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 From 4b24689cf97dc6b81a6e932d9fddfa8b07ce43a6 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 10:51:19 +0100 Subject: [PATCH 36/52] Remove additional install step --- .github/workflows/pull_request.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 21b26c2c..b60094f2 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -50,8 +50,6 @@ jobs: with: node-version-file: ".nvmrc" cache: "npm" - - name: Install npm deps - run: npm install - name: Templates linting run: make lint-templates - name: Static linting From b1d5e262bf5f5804c9a6e52e618796ede46237a3 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 10:57:47 +0100 Subject: [PATCH 37/52] Revert pull_request.yaml file --- .github/workflows/pull_request.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index b60094f2..fe023845 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -26,15 +26,7 @@ jobs: run: go get - name: Build run: CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version-file: ".nvmrc" - cache: "npm" - - name: Install npm deps - run: npm install lint: - needs: [build] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -50,6 +42,9 @@ jobs: with: node-version-file: ".nvmrc" cache: "npm" + - name: Install npm deps + run: npm install + - uses: actions/checkout@v3 - name: Templates linting run: make lint-templates - name: Static linting From 4192acad0df6b76c69a04f95a1ef97c11631b5a1 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 11:19:18 +0100 Subject: [PATCH 38/52] Add scripts to package.json --- Makefile | 13 ++++++------- package.json | 11 +++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index ab7d9d94..692bb502 100644 --- a/Makefile +++ b/Makefile @@ -3,20 +3,19 @@ lint: lint-go lint-templates lint-static format: format-go format-static format-templates format-go: - go fmt ./... + npm run format-go lint-go: - golangci-lint run + npm run lint-go lint-static: - npx prettier --check "static/**/*.{js,css}" - npx eslint static/javascript/*.js + npm run lint-static format-static: - npx prettier "static/**/*.{js,css}" --write + npm run format-static lint-templates: - djlint templates --lint + npm run lint-templates format-templates: - djlint templates/*.html --reformat + npm run format-templates diff --git a/package.json b/package.json index 980e57cb..18191ab7 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,17 @@ "type": "git", "url": "https://github.com/ONSdigital/eq-questionnaire-launcher" }, + "scripts": { + "lint": "npm run lint-go && npm run lint:static && npm run lint:static", + "lint-go": "golangci-lint run", + "lint-static": "prettier --check \"static/**/*.{js,css}\" && eslint \"static/javascript/*.js\"", + "lint-templates": "djlint templates --lint", + "format": "npm run format-go && npm run format-static && npm run format-templates", + "format-go":"go fmt ./...", + "format-static": "prettier \"static/**/*.{js,css}\" --write", + "format-templates": "djlint templates/*.html --reformat" + + }, "devDependencies": { "djlint": "^1.34.1", "eslint": "^8.57.0", From 814d5322594a1954467a7c2f421ef62a51d9ee6f Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 11:22:56 +0100 Subject: [PATCH 39/52] Update scripts in package.json --- eslint.config.js | 17 ----------------- package.json | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 eslint.config.js diff --git a/eslint.config.js b/eslint.config.js deleted file mode 100644 index eedd5051..00000000 --- a/eslint.config.js +++ /dev/null @@ -1,17 +0,0 @@ -export default [ - { - "env": { - "browser": true, - "es2021": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "rules": { - "no-unused-vars": "off", - "no-undef": "off" - } - } -]; \ No newline at end of file diff --git a/package.json b/package.json index 18191ab7..8b7b58a6 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/ONSdigital/eq-questionnaire-launcher" }, "scripts": { - "lint": "npm run lint-go && npm run lint:static && npm run lint:static", + "lint": "npm run lint-go && npm run lint-static && npm run lint-templates", "lint-go": "golangci-lint run", "lint-static": "prettier --check \"static/**/*.{js,css}\" && eslint \"static/javascript/*.js\"", "lint-templates": "djlint templates --lint", From 5685f86417160888f49896bb4d6a12ac6c40be56 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 11:33:27 +0100 Subject: [PATCH 40/52] Testing actions with new eslint config file --- Makefile | 13 +++++++------ eslint.config.js | 18 ++++++++++++++++++ package.json | 11 ----------- 3 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 eslint.config.js diff --git a/Makefile b/Makefile index 692bb502..ab7d9d94 100644 --- a/Makefile +++ b/Makefile @@ -3,19 +3,20 @@ lint: lint-go lint-templates lint-static format: format-go format-static format-templates format-go: - npm run format-go + go fmt ./... lint-go: - npm run lint-go + golangci-lint run lint-static: - npm run lint-static + npx prettier --check "static/**/*.{js,css}" + npx eslint static/javascript/*.js format-static: - npm run format-static + npx prettier "static/**/*.{js,css}" --write lint-templates: - npm run lint-templates + djlint templates --lint format-templates: - npm run format-templates + djlint templates/*.html --reformat diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..5f7963e4 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,18 @@ +// eslint.config.js +module.exports = [ + { + "env": { + "browser": true, + "es2021": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "rules": { + "no-unused-vars": "off", + "no-undef": "off" + } + } +]; \ No newline at end of file diff --git a/package.json b/package.json index 8b7b58a6..980e57cb 100644 --- a/package.json +++ b/package.json @@ -10,17 +10,6 @@ "type": "git", "url": "https://github.com/ONSdigital/eq-questionnaire-launcher" }, - "scripts": { - "lint": "npm run lint-go && npm run lint-static && npm run lint-templates", - "lint-go": "golangci-lint run", - "lint-static": "prettier --check \"static/**/*.{js,css}\" && eslint \"static/javascript/*.js\"", - "lint-templates": "djlint templates --lint", - "format": "npm run format-go && npm run format-static && npm run format-templates", - "format-go":"go fmt ./...", - "format-static": "prettier \"static/**/*.{js,css}\" --write", - "format-templates": "djlint templates/*.html --reformat" - - }, "devDependencies": { "djlint": "^1.34.1", "eslint": "^8.57.0", From f1632760b5b7a4bb8844402c8491cd1ff504d81a Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 11:37:01 +0100 Subject: [PATCH 41/52] Testing changes to GHA actions --- .github/workflows/pull_request.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index fe023845..2257b42e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -44,7 +44,6 @@ jobs: cache: "npm" - name: Install npm deps run: npm install - - uses: actions/checkout@v3 - name: Templates linting run: make lint-templates - name: Static linting From faf88275c1e8ac03f09064a029cbb093f7db62d3 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 11:39:39 +0100 Subject: [PATCH 42/52] Update eslint config file --- eslint.config.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 5f7963e4..c97364c0 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,10 +1,6 @@ // eslint.config.js module.exports = [ { - "env": { - "browser": true, - "es2021": true - }, "extends": "eslint:recommended", "parserOptions": { "ecmaVersion": "latest", From b0e88d4ea93c120b99559e2084babb2a1d47dc7d Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 11:42:15 +0100 Subject: [PATCH 43/52] Removing config file --- eslint.config.js | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 eslint.config.js diff --git a/eslint.config.js b/eslint.config.js deleted file mode 100644 index c97364c0..00000000 --- a/eslint.config.js +++ /dev/null @@ -1,14 +0,0 @@ -// eslint.config.js -module.exports = [ - { - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "rules": { - "no-unused-vars": "off", - "no-undef": "off" - } - } -]; \ No newline at end of file From 18b2c449cd00fe8e6268d3052132d8741fe0521b Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 11:54:55 +0100 Subject: [PATCH 44/52] Testing if actions works with intensional mistake --- static/javascript/launch.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/static/javascript/launch.js b/static/javascript/launch.js index bdabf01a..eada9dd7 100644 --- a/static/javascript/launch.js +++ b/static/javascript/launch.js @@ -278,6 +278,38 @@ function loadMetadataForSchemaName() { } function loadMetadataForRemoteSchema() { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + let schemaUrl = document.querySelector("#schema-url").value; let surveyType = document.querySelector("#remote-schema-survey-type"); From 206f6e7f8fe06a2bd149341566849e5ddd3df095 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Tue, 9 Apr 2024 11:58:45 +0100 Subject: [PATCH 45/52] Fix intensional mistake as actions worked as expected --- static/javascript/launch.js | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/static/javascript/launch.js b/static/javascript/launch.js index eada9dd7..bdabf01a 100644 --- a/static/javascript/launch.js +++ b/static/javascript/launch.js @@ -278,38 +278,6 @@ function loadMetadataForSchemaName() { } function loadMetadataForRemoteSchema() { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - let schemaUrl = document.querySelector("#schema-url").value; let surveyType = document.querySelector("#remote-schema-survey-type"); From b2d4ee501d336cf46afb1ae55553f2a5267d23a1 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Thu, 11 Apr 2024 17:34:20 +0100 Subject: [PATCH 46/52] Install python to use djLint correctly using pipenv and remove node version of djLint --- .github/workflows/pull_request.yml | 4 + .python-version | 1 + Makefile | 4 +- Pipfile | 12 ++ Pipfile.lock | 268 +++++++++++++++++++++++++++++ package-lock.json | 8 - package.json | 1 - 7 files changed, 287 insertions(+), 11 deletions(-) create mode 100644 .python-version create mode 100644 Pipfile create mode 100644 Pipfile.lock diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 2257b42e..6ea645e2 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -44,6 +44,10 @@ jobs: cache: "npm" - name: Install npm deps run: npm install + - name: Install pipenv + run: pip install pipenv==2023.8.22 + - name: Install virtual environment + run: pipenv install --dev - name: Templates linting run: make lint-templates - name: Static linting diff --git a/.python-version b/.python-version new file mode 100644 index 00000000..0c7d5f5f --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.11.4 diff --git a/Makefile b/Makefile index ab7d9d94..755186da 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ format-static: npx prettier "static/**/*.{js,css}" --write lint-templates: - djlint templates --lint + pipenv run djlint templates --lint format-templates: - djlint templates/*.html --reformat + pipenv run djlint templates/*.html --reformat diff --git a/Pipfile b/Pipfile new file mode 100644 index 00000000..4d7d5502 --- /dev/null +++ b/Pipfile @@ -0,0 +1,12 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +djlint = "*" + +[dev-packages] + +[requires] +python_version = "3.11" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 00000000..242fd7ca --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,268 @@ +{ + "_meta": { + "hash": { + "sha256": "fe050ffcdff8292053b5efeb1baffa17431af52532dde29b1ed4b001a55baeaa" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.11" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "click": { + "hashes": [ + "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", + "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de" + ], + "markers": "python_version >= '3.7'", + "version": "==8.1.7" + }, + "colorama": { + "hashes": [ + "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", + "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'", + "version": "==0.4.6" + }, + "cssbeautifier": { + "hashes": [ + "sha256:9f7064362aedd559c55eeecf6b6bed65e05f33488dcbe39044f0403c26e1c006" + ], + "version": "==1.15.1" + }, + "djlint": { + "hashes": [ + "sha256:96ff1c464fb6f061130ebc88663a2ea524d7ec51f4b56221a2b3f0320a3cfce8", + "sha256:db93fa008d19eaadb0454edf1704931d14469d48508daba2df9941111f408346" + ], + "index": "pypi", + "markers": "python_full_version >= '3.8.0' and python_full_version < '4.0.0'", + "version": "==1.34.1" + }, + "editorconfig": { + "hashes": [ + "sha256:24857fa1793917dd9ccf0c7810a07e05404ce9b823521c7dce22a4fb5d125f80" + ], + "version": "==0.12.4" + }, + "html-tag-names": { + "hashes": [ + "sha256:04924aca48770f36b5a41c27e4d917062507be05118acb0ba869c97389084297", + "sha256:eeb69ef21078486b615241f0393a72b41352c5219ee648e7c61f5632d26f0420" + ], + "markers": "python_version >= '3.7' and python_version < '4.0'", + "version": "==0.1.2" + }, + "html-void-elements": { + "hashes": [ + "sha256:784cf39db03cdeb017320d9301009f8f3480f9d7b254d0974272e80e0cb5e0d2", + "sha256:931b88f84cd606fee0b582c28fcd00e41d7149421fb673e1e1abd2f0c4f231f0" + ], + "markers": "python_version >= '3.7' and python_version < '4.0'", + "version": "==0.1.0" + }, + "jsbeautifier": { + "hashes": [ + "sha256:ebd733b560704c602d744eafc839db60a1ee9326e30a2a80c4adb8718adc1b24" + ], + "version": "==1.15.1" + }, + "json5": { + "hashes": [ + "sha256:0c638399421da959a20952782800e5c1a78c14e08e1dc9738fa10d8ec14d58c8", + "sha256:4ca101fd5c7cb47960c055ef8f4d0e31e15a7c6c48c3b6f1473fc83b6c462a13" + ], + "markers": "python_version >= '3.8'", + "version": "==0.9.24" + }, + "pathspec": { + "hashes": [ + "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08", + "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712" + ], + "markers": "python_version >= '3.8'", + "version": "==0.12.1" + }, + "pyyaml": { + "hashes": [ + "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5", + "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc", + "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df", + "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741", + "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206", + "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27", + "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595", + "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62", + "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98", + "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696", + "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290", + "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9", + "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d", + "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6", + "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867", + "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47", + "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486", + "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6", + "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3", + "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007", + "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938", + "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0", + "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c", + "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735", + "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d", + "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28", + "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4", + "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba", + "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8", + "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef", + "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5", + "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd", + "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3", + "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0", + "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515", + "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c", + "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c", + "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924", + "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34", + "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43", + "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859", + "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673", + "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54", + "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a", + "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b", + "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab", + "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa", + "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c", + "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585", + "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d", + "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f" + ], + "markers": "python_version >= '3.6'", + "version": "==6.0.1" + }, + "regex": { + "hashes": [ + "sha256:0694219a1d54336fd0445ea382d49d36882415c0134ee1e8332afd1529f0baa5", + "sha256:086dd15e9435b393ae06f96ab69ab2d333f5d65cbe65ca5a3ef0ec9564dfe770", + "sha256:094ba386bb5c01e54e14434d4caabf6583334090865b23ef58e0424a6286d3dc", + "sha256:09da66917262d9481c719599116c7dc0c321ffcec4b1f510c4f8a066f8768105", + "sha256:0ecf44ddf9171cd7566ef1768047f6e66975788258b1c6c6ca78098b95cf9a3d", + "sha256:0fda75704357805eb953a3ee15a2b240694a9a514548cd49b3c5124b4e2ad01b", + "sha256:11a963f8e25ab5c61348d090bf1b07f1953929c13bd2309a0662e9ff680763c9", + "sha256:150c39f5b964e4d7dba46a7962a088fbc91f06e606f023ce57bb347a3b2d4630", + "sha256:1b9d811f72210fa9306aeb88385b8f8bcef0dfbf3873410413c00aa94c56c2b6", + "sha256:1e0eabac536b4cc7f57a5f3d095bfa557860ab912f25965e08fe1545e2ed8b4c", + "sha256:22a86d9fff2009302c440b9d799ef2fe322416d2d58fc124b926aa89365ec482", + "sha256:22f3470f7524b6da61e2020672df2f3063676aff444db1daa283c2ea4ed259d6", + "sha256:263ef5cc10979837f243950637fffb06e8daed7f1ac1e39d5910fd29929e489a", + "sha256:283fc8eed679758de38fe493b7d7d84a198b558942b03f017b1f94dda8efae80", + "sha256:29171aa128da69afdf4bde412d5bedc335f2ca8fcfe4489038577d05f16181e5", + "sha256:298dc6354d414bc921581be85695d18912bea163a8b23cac9a2562bbcd5088b1", + "sha256:2aae8101919e8aa05ecfe6322b278f41ce2994c4a430303c4cd163fef746e04f", + "sha256:2f4e475a80ecbd15896a976aa0b386c5525d0ed34d5c600b6d3ebac0a67c7ddf", + "sha256:34e4af5b27232f68042aa40a91c3b9bb4da0eeb31b7632e0091afc4310afe6cb", + "sha256:37f8e93a81fc5e5bd8db7e10e62dc64261bcd88f8d7e6640aaebe9bc180d9ce2", + "sha256:3a17d3ede18f9cedcbe23d2daa8a2cd6f59fe2bf082c567e43083bba3fb00347", + "sha256:3b1de218d5375cd6ac4b5493e0b9f3df2be331e86520f23382f216c137913d20", + "sha256:43f7cd5754d02a56ae4ebb91b33461dc67be8e3e0153f593c509e21d219c5060", + "sha256:4558410b7a5607a645e9804a3e9dd509af12fb72b9825b13791a37cd417d73a5", + "sha256:4719bb05094d7d8563a450cf8738d2e1061420f79cfcc1fa7f0a44744c4d8f73", + "sha256:4bfc2b16e3ba8850e0e262467275dd4d62f0d045e0e9eda2bc65078c0110a11f", + "sha256:518440c991f514331f4850a63560321f833979d145d7d81186dbe2f19e27ae3d", + "sha256:51f4b32f793812714fd5307222a7f77e739b9bc566dc94a18126aba3b92b98a3", + "sha256:531ac6cf22b53e0696f8e1d56ce2396311254eb806111ddd3922c9d937151dae", + "sha256:5cd05d0f57846d8ba4b71d9c00f6f37d6b97d5e5ef8b3c3840426a475c8f70f4", + "sha256:5dd58946bce44b53b06d94aa95560d0b243eb2fe64227cba50017a8d8b3cd3e2", + "sha256:60080bb3d8617d96f0fb7e19796384cc2467447ef1c491694850ebd3670bc457", + "sha256:636ba0a77de609d6510235b7f0e77ec494d2657108f777e8765efc060094c98c", + "sha256:67d3ccfc590e5e7197750fcb3a2915b416a53e2de847a728cfa60141054123d4", + "sha256:68191f80a9bad283432385961d9efe09d783bcd36ed35a60fb1ff3f1ec2efe87", + "sha256:7502534e55c7c36c0978c91ba6f61703faf7ce733715ca48f499d3dbbd7657e0", + "sha256:7aa47c2e9ea33a4a2a05f40fcd3ea36d73853a2aae7b4feab6fc85f8bf2c9704", + "sha256:7d2af3f6b8419661a0c421584cfe8aaec1c0e435ce7e47ee2a97e344b98f794f", + "sha256:7e316026cc1095f2a3e8cc012822c99f413b702eaa2ca5408a513609488cb62f", + "sha256:88ad44e220e22b63b0f8f81f007e8abbb92874d8ced66f32571ef8beb0643b2b", + "sha256:88d1f7bef20c721359d8675f7d9f8e414ec5003d8f642fdfd8087777ff7f94b5", + "sha256:89723d2112697feaa320c9d351e5f5e7b841e83f8b143dba8e2d2b5f04e10923", + "sha256:8a0ccf52bb37d1a700375a6b395bff5dd15c50acb745f7db30415bae3c2b0715", + "sha256:8c2c19dae8a3eb0ea45a8448356ed561be843b13cbc34b840922ddf565498c1c", + "sha256:905466ad1702ed4acfd67a902af50b8db1feeb9781436372261808df7a2a7bca", + "sha256:9852b76ab558e45b20bf1893b59af64a28bd3820b0c2efc80e0a70a4a3ea51c1", + "sha256:98a2636994f943b871786c9e82bfe7883ecdaba2ef5df54e1450fa9869d1f756", + "sha256:9aa1a67bbf0f957bbe096375887b2505f5d8ae16bf04488e8b0f334c36e31360", + "sha256:9eda5f7a50141291beda3edd00abc2d4a5b16c29c92daf8d5bd76934150f3edc", + "sha256:a6d1047952c0b8104a1d371f88f4ab62e6275567d4458c1e26e9627ad489b445", + "sha256:a9b6d73353f777630626f403b0652055ebfe8ff142a44ec2cf18ae470395766e", + "sha256:a9cc99d6946d750eb75827cb53c4371b8b0fe89c733a94b1573c9dd16ea6c9e4", + "sha256:ad83e7545b4ab69216cef4cc47e344d19622e28aabec61574b20257c65466d6a", + "sha256:b014333bd0217ad3d54c143de9d4b9a3ca1c5a29a6d0d554952ea071cff0f1f8", + "sha256:b43523d7bc2abd757119dbfb38af91b5735eea45537ec6ec3a5ec3f9562a1c53", + "sha256:b521dcecebc5b978b447f0f69b5b7f3840eac454862270406a39837ffae4e697", + "sha256:b77e27b79448e34c2c51c09836033056a0547aa360c45eeeb67803da7b0eedaf", + "sha256:b7a635871143661feccce3979e1727c4e094f2bdfd3ec4b90dfd4f16f571a87a", + "sha256:b7fca9205b59c1a3d5031f7e64ed627a1074730a51c2a80e97653e3e9fa0d415", + "sha256:ba1b30765a55acf15dce3f364e4928b80858fa8f979ad41f862358939bdd1f2f", + "sha256:ba99d8077424501b9616b43a2d208095746fb1284fc5ba490139651f971d39d9", + "sha256:c25a8ad70e716f96e13a637802813f65d8a6760ef48672aa3502f4c24ea8b400", + "sha256:c3c4a78615b7762740531c27cf46e2f388d8d727d0c0c739e72048beb26c8a9d", + "sha256:c40281f7d70baf6e0db0c2f7472b31609f5bc2748fe7275ea65a0b4601d9b392", + "sha256:c7ad32824b7f02bb3c9f80306d405a1d9b7bb89362d68b3c5a9be53836caebdb", + "sha256:cb3fe77aec8f1995611f966d0c656fdce398317f850d0e6e7aebdfe61f40e1cd", + "sha256:cc038b2d8b1470364b1888a98fd22d616fba2b6309c5b5f181ad4483e0017861", + "sha256:cc37b9aeebab425f11f27e5e9e6cf580be7206c6582a64467a14dda211abc232", + "sha256:cc6bb9aa69aacf0f6032c307da718f61a40cf970849e471254e0e91c56ffca95", + "sha256:d126361607b33c4eb7b36debc173bf25d7805847346dd4d99b5499e1fef52bc7", + "sha256:d15b274f9e15b1a0b7a45d2ac86d1f634d983ca40d6b886721626c47a400bf39", + "sha256:d166eafc19f4718df38887b2bbe1467a4f74a9830e8605089ea7a30dd4da8887", + "sha256:d498eea3f581fbe1b34b59c697512a8baef88212f92e4c7830fcc1499f5b45a5", + "sha256:d6f7e255e5fa94642a0724e35406e6cb7001c09d476ab5fce002f652b36d0c39", + "sha256:d78bd484930c1da2b9679290a41cdb25cc127d783768a0369d6b449e72f88beb", + "sha256:d865984b3f71f6d0af64d0d88f5733521698f6c16f445bb09ce746c92c97c586", + "sha256:d902a43085a308cef32c0d3aea962524b725403fd9373dea18110904003bac97", + "sha256:d94a1db462d5690ebf6ae86d11c5e420042b9898af5dcf278bd97d6bda065423", + "sha256:da695d75ac97cb1cd725adac136d25ca687da4536154cdc2815f576e4da11c69", + "sha256:db2a0b1857f18b11e3b0e54ddfefc96af46b0896fb678c85f63fb8c37518b3e7", + "sha256:df26481f0c7a3f8739fecb3e81bc9da3fcfae34d6c094563b9d4670b047312e1", + "sha256:e14b73607d6231f3cc4622809c196b540a6a44e903bcfad940779c80dffa7be7", + "sha256:e2610e9406d3b0073636a3a2e80db05a02f0c3169b5632022b4e81c0364bcda5", + "sha256:e692296c4cc2873967771345a876bcfc1c547e8dd695c6b89342488b0ea55cd8", + "sha256:e693e233ac92ba83a87024e1d32b5f9ab15ca55ddd916d878146f4e3406b5c91", + "sha256:e81469f7d01efed9b53740aedd26085f20d49da65f9c1f41e822a33992cb1590", + "sha256:e8c7e08bb566de4faaf11984af13f6bcf6a08f327b13631d41d62592681d24fe", + "sha256:ed19b3a05ae0c97dd8f75a5d8f21f7723a8c33bbc555da6bbe1f96c470139d3c", + "sha256:efb2d82f33b2212898f1659fb1c2e9ac30493ac41e4d53123da374c3b5541e64", + "sha256:f44dd4d68697559d007462b0a3a1d9acd61d97072b71f6d1968daef26bc744bd", + "sha256:f72cbae7f6b01591f90814250e636065850c5926751af02bb48da94dfced7baa", + "sha256:f7bc09bc9c29ebead055bcba136a67378f03d66bf359e87d0f7c759d6d4ffa31", + "sha256:ff100b203092af77d1a5a7abe085b3506b7eaaf9abf65b73b7d6905b6cb76988" + ], + "markers": "python_version >= '3.7'", + "version": "==2023.12.25" + }, + "six": { + "hashes": [ + "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", + "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", + "version": "==1.16.0" + }, + "tqdm": { + "hashes": [ + "sha256:1ee4f8a893eb9bef51c6e35730cebf234d5d0b6bd112b0271e10ed7c24a02bd9", + "sha256:6cd52cdf0fef0e0f543299cfc96fec90d7b8a7e88745f411ec33eb44d5ed3531" + ], + "markers": "python_version >= '3.7'", + "version": "==4.66.2" + } + }, + "develop": {} +} diff --git a/package-lock.json b/package-lock.json index a85a0815..4ea5f6d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,6 @@ "name": "eq-questionnaire-launcher", "version": "2.0.0", "devDependencies": { - "djlint": "^1.34.1", "eslint": "^8.57.0", "prettier": "^3.2.5" } @@ -321,13 +320,6 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "node_modules/djlint": { - "version": "1.34.1", - "resolved": "https://registry.npmjs.org/djlint/-/djlint-1.34.1.tgz", - "integrity": "sha512-2j/gwMJ0EoEtwkguBPjDmK4/yxh+YaPYA3LPuW9Hewyi26DtoV3Sag6hN81gamJwby9TmmKnnLX7WtX4bkqRkw==", - "dev": true, - "hasInstallScript": true - }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", diff --git a/package.json b/package.json index 980e57cb..d6cd1dbe 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "url": "https://github.com/ONSdigital/eq-questionnaire-launcher" }, "devDependencies": { - "djlint": "^1.34.1", "eslint": "^8.57.0", "prettier": "^3.2.5" }, From 68ca837ad9992e8d887dedce3628aff515de174b Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Thu, 11 Apr 2024 17:41:48 +0100 Subject: [PATCH 47/52] Point to python version in pull_request.yaml --- .github/workflows/pull_request.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 6ea645e2..6e9735dd 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -44,6 +44,8 @@ jobs: cache: "npm" - name: Install npm deps run: npm install + - run: | + echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV - name: Install pipenv run: pip install pipenv==2023.8.22 - name: Install virtual environment From 6493d49b3e486666f0b83cd04676521ef63e5760 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Thu, 11 Apr 2024 17:43:39 +0100 Subject: [PATCH 48/52] Test to try to fix actions --- .github/workflows/pull_request.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 6e9735dd..0317d961 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -44,6 +44,10 @@ jobs: cache: "npm" - name: Install npm deps run: npm install + - uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: 'pipenv' - run: | echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV - name: Install pipenv From 5c3a6048d43ed7ce84ce61a8b38ef96b657e4da9 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Thu, 11 Apr 2024 17:51:31 +0100 Subject: [PATCH 49/52] Pin djLint and update README to add details on djLint installation --- Pipfile | 2 +- Pipfile.lock | 4 ++-- README.md | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Pipfile b/Pipfile index 4d7d5502..a60f7d5b 100644 --- a/Pipfile +++ b/Pipfile @@ -4,7 +4,7 @@ verify_ssl = true name = "pypi" [packages] -djlint = "*" +djlint = "1.34.1" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 242fd7ca..7c59a725 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "fe050ffcdff8292053b5efeb1baffa17431af52532dde29b1ed4b001a55baeaa" + "sha256": "2a721ed226b679ac75082a34b36aabcacd92bcc9b771557ae47f95263138a6a3" }, "pipfile-spec": 6, "requires": { @@ -252,7 +252,7 @@ "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.16.0" }, "tqdm": { diff --git a/README.md b/README.md index 875c72c5..5c8f7189 100644 --- a/README.md +++ b/README.md @@ -66,10 +66,15 @@ Ensure you are using the correct version of node using: nvm install nvm use ``` -To install npm dependencies for formatting and linting use: +To install ESLint and Prettier for formatting and linting of static files use: ``` shell npm install ``` +Install djLint for formatting and linting template files using: +```shell +pipenv install +``` + **Note**: Before being able to run `lint-go`, you will need to install the external tool `golangci-lint`. The command to install the tool is `brew install golangci-lint` and to upgrade it use `brew upgrade golangci-lint`. Visit From be95b718f46ad33a2a3903889c70e61f50745b48 Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Fri, 12 Apr 2024 12:29:14 +0100 Subject: [PATCH 50/52] Move from Pipenv to Poetry and update relevant docs --- .github/workflows/pull_request.yml | 15 +- Makefile | 4 +- Pipfile | 12 -- Pipfile.lock | 268 ----------------------- README.md | 4 +- poetry.lock | 331 +++++++++++++++++++++++++++++ pyproject.toml | 16 ++ 7 files changed, 360 insertions(+), 290 deletions(-) delete mode 100644 Pipfile delete mode 100644 Pipfile.lock create mode 100644 poetry.lock create mode 100644 pyproject.toml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 0317d961..923f2095 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -44,16 +44,19 @@ jobs: cache: "npm" - name: Install npm deps run: npm install + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 1.8.2 + virtualenvs-create: true - uses: actions/setup-python@v4 with: python-version: ${{ env.PYTHON_VERSION }} - cache: 'pipenv' - - run: | - echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV - - name: Install pipenv - run: pip install pipenv==2023.8.22 + cache: 'poetry' - name: Install virtual environment - run: pipenv install --dev + run: | + sudo apt-get install libsnappy-dev + poetry install - name: Templates linting run: make lint-templates - name: Static linting diff --git a/Makefile b/Makefile index 755186da..6928d74c 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ format-static: npx prettier "static/**/*.{js,css}" --write lint-templates: - pipenv run djlint templates --lint + poetry run djlint templates --lint format-templates: - pipenv run djlint templates/*.html --reformat + poetry run djlint templates/*.html --reformat diff --git a/Pipfile b/Pipfile deleted file mode 100644 index a60f7d5b..00000000 --- a/Pipfile +++ /dev/null @@ -1,12 +0,0 @@ -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[packages] -djlint = "1.34.1" - -[dev-packages] - -[requires] -python_version = "3.11" diff --git a/Pipfile.lock b/Pipfile.lock deleted file mode 100644 index 7c59a725..00000000 --- a/Pipfile.lock +++ /dev/null @@ -1,268 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "2a721ed226b679ac75082a34b36aabcacd92bcc9b771557ae47f95263138a6a3" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3.11" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "click": { - "hashes": [ - "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", - "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de" - ], - "markers": "python_version >= '3.7'", - "version": "==8.1.7" - }, - "colorama": { - "hashes": [ - "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", - "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'", - "version": "==0.4.6" - }, - "cssbeautifier": { - "hashes": [ - "sha256:9f7064362aedd559c55eeecf6b6bed65e05f33488dcbe39044f0403c26e1c006" - ], - "version": "==1.15.1" - }, - "djlint": { - "hashes": [ - "sha256:96ff1c464fb6f061130ebc88663a2ea524d7ec51f4b56221a2b3f0320a3cfce8", - "sha256:db93fa008d19eaadb0454edf1704931d14469d48508daba2df9941111f408346" - ], - "index": "pypi", - "markers": "python_full_version >= '3.8.0' and python_full_version < '4.0.0'", - "version": "==1.34.1" - }, - "editorconfig": { - "hashes": [ - "sha256:24857fa1793917dd9ccf0c7810a07e05404ce9b823521c7dce22a4fb5d125f80" - ], - "version": "==0.12.4" - }, - "html-tag-names": { - "hashes": [ - "sha256:04924aca48770f36b5a41c27e4d917062507be05118acb0ba869c97389084297", - "sha256:eeb69ef21078486b615241f0393a72b41352c5219ee648e7c61f5632d26f0420" - ], - "markers": "python_version >= '3.7' and python_version < '4.0'", - "version": "==0.1.2" - }, - "html-void-elements": { - "hashes": [ - "sha256:784cf39db03cdeb017320d9301009f8f3480f9d7b254d0974272e80e0cb5e0d2", - "sha256:931b88f84cd606fee0b582c28fcd00e41d7149421fb673e1e1abd2f0c4f231f0" - ], - "markers": "python_version >= '3.7' and python_version < '4.0'", - "version": "==0.1.0" - }, - "jsbeautifier": { - "hashes": [ - "sha256:ebd733b560704c602d744eafc839db60a1ee9326e30a2a80c4adb8718adc1b24" - ], - "version": "==1.15.1" - }, - "json5": { - "hashes": [ - "sha256:0c638399421da959a20952782800e5c1a78c14e08e1dc9738fa10d8ec14d58c8", - "sha256:4ca101fd5c7cb47960c055ef8f4d0e31e15a7c6c48c3b6f1473fc83b6c462a13" - ], - "markers": "python_version >= '3.8'", - "version": "==0.9.24" - }, - "pathspec": { - "hashes": [ - "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08", - "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712" - ], - "markers": "python_version >= '3.8'", - "version": "==0.12.1" - }, - "pyyaml": { - "hashes": [ - "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5", - "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc", - "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df", - "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741", - "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206", - "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27", - "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595", - "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62", - "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98", - "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696", - "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290", - "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9", - "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d", - "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6", - "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867", - "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47", - "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486", - "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6", - "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3", - "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007", - "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938", - "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0", - "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c", - "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735", - "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d", - "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28", - "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4", - "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba", - "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8", - "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef", - "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5", - "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd", - "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3", - "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0", - "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515", - "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c", - "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c", - "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924", - "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34", - "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43", - "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859", - "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673", - "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54", - "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a", - "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b", - "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab", - "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa", - "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c", - "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585", - "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d", - "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f" - ], - "markers": "python_version >= '3.6'", - "version": "==6.0.1" - }, - "regex": { - "hashes": [ - "sha256:0694219a1d54336fd0445ea382d49d36882415c0134ee1e8332afd1529f0baa5", - "sha256:086dd15e9435b393ae06f96ab69ab2d333f5d65cbe65ca5a3ef0ec9564dfe770", - "sha256:094ba386bb5c01e54e14434d4caabf6583334090865b23ef58e0424a6286d3dc", - "sha256:09da66917262d9481c719599116c7dc0c321ffcec4b1f510c4f8a066f8768105", - "sha256:0ecf44ddf9171cd7566ef1768047f6e66975788258b1c6c6ca78098b95cf9a3d", - "sha256:0fda75704357805eb953a3ee15a2b240694a9a514548cd49b3c5124b4e2ad01b", - "sha256:11a963f8e25ab5c61348d090bf1b07f1953929c13bd2309a0662e9ff680763c9", - "sha256:150c39f5b964e4d7dba46a7962a088fbc91f06e606f023ce57bb347a3b2d4630", - "sha256:1b9d811f72210fa9306aeb88385b8f8bcef0dfbf3873410413c00aa94c56c2b6", - "sha256:1e0eabac536b4cc7f57a5f3d095bfa557860ab912f25965e08fe1545e2ed8b4c", - "sha256:22a86d9fff2009302c440b9d799ef2fe322416d2d58fc124b926aa89365ec482", - "sha256:22f3470f7524b6da61e2020672df2f3063676aff444db1daa283c2ea4ed259d6", - "sha256:263ef5cc10979837f243950637fffb06e8daed7f1ac1e39d5910fd29929e489a", - "sha256:283fc8eed679758de38fe493b7d7d84a198b558942b03f017b1f94dda8efae80", - "sha256:29171aa128da69afdf4bde412d5bedc335f2ca8fcfe4489038577d05f16181e5", - "sha256:298dc6354d414bc921581be85695d18912bea163a8b23cac9a2562bbcd5088b1", - "sha256:2aae8101919e8aa05ecfe6322b278f41ce2994c4a430303c4cd163fef746e04f", - "sha256:2f4e475a80ecbd15896a976aa0b386c5525d0ed34d5c600b6d3ebac0a67c7ddf", - "sha256:34e4af5b27232f68042aa40a91c3b9bb4da0eeb31b7632e0091afc4310afe6cb", - "sha256:37f8e93a81fc5e5bd8db7e10e62dc64261bcd88f8d7e6640aaebe9bc180d9ce2", - "sha256:3a17d3ede18f9cedcbe23d2daa8a2cd6f59fe2bf082c567e43083bba3fb00347", - "sha256:3b1de218d5375cd6ac4b5493e0b9f3df2be331e86520f23382f216c137913d20", - "sha256:43f7cd5754d02a56ae4ebb91b33461dc67be8e3e0153f593c509e21d219c5060", - "sha256:4558410b7a5607a645e9804a3e9dd509af12fb72b9825b13791a37cd417d73a5", - "sha256:4719bb05094d7d8563a450cf8738d2e1061420f79cfcc1fa7f0a44744c4d8f73", - "sha256:4bfc2b16e3ba8850e0e262467275dd4d62f0d045e0e9eda2bc65078c0110a11f", - "sha256:518440c991f514331f4850a63560321f833979d145d7d81186dbe2f19e27ae3d", - "sha256:51f4b32f793812714fd5307222a7f77e739b9bc566dc94a18126aba3b92b98a3", - "sha256:531ac6cf22b53e0696f8e1d56ce2396311254eb806111ddd3922c9d937151dae", - "sha256:5cd05d0f57846d8ba4b71d9c00f6f37d6b97d5e5ef8b3c3840426a475c8f70f4", - "sha256:5dd58946bce44b53b06d94aa95560d0b243eb2fe64227cba50017a8d8b3cd3e2", - "sha256:60080bb3d8617d96f0fb7e19796384cc2467447ef1c491694850ebd3670bc457", - "sha256:636ba0a77de609d6510235b7f0e77ec494d2657108f777e8765efc060094c98c", - "sha256:67d3ccfc590e5e7197750fcb3a2915b416a53e2de847a728cfa60141054123d4", - "sha256:68191f80a9bad283432385961d9efe09d783bcd36ed35a60fb1ff3f1ec2efe87", - "sha256:7502534e55c7c36c0978c91ba6f61703faf7ce733715ca48f499d3dbbd7657e0", - "sha256:7aa47c2e9ea33a4a2a05f40fcd3ea36d73853a2aae7b4feab6fc85f8bf2c9704", - "sha256:7d2af3f6b8419661a0c421584cfe8aaec1c0e435ce7e47ee2a97e344b98f794f", - "sha256:7e316026cc1095f2a3e8cc012822c99f413b702eaa2ca5408a513609488cb62f", - "sha256:88ad44e220e22b63b0f8f81f007e8abbb92874d8ced66f32571ef8beb0643b2b", - "sha256:88d1f7bef20c721359d8675f7d9f8e414ec5003d8f642fdfd8087777ff7f94b5", - "sha256:89723d2112697feaa320c9d351e5f5e7b841e83f8b143dba8e2d2b5f04e10923", - "sha256:8a0ccf52bb37d1a700375a6b395bff5dd15c50acb745f7db30415bae3c2b0715", - "sha256:8c2c19dae8a3eb0ea45a8448356ed561be843b13cbc34b840922ddf565498c1c", - "sha256:905466ad1702ed4acfd67a902af50b8db1feeb9781436372261808df7a2a7bca", - "sha256:9852b76ab558e45b20bf1893b59af64a28bd3820b0c2efc80e0a70a4a3ea51c1", - "sha256:98a2636994f943b871786c9e82bfe7883ecdaba2ef5df54e1450fa9869d1f756", - "sha256:9aa1a67bbf0f957bbe096375887b2505f5d8ae16bf04488e8b0f334c36e31360", - "sha256:9eda5f7a50141291beda3edd00abc2d4a5b16c29c92daf8d5bd76934150f3edc", - "sha256:a6d1047952c0b8104a1d371f88f4ab62e6275567d4458c1e26e9627ad489b445", - "sha256:a9b6d73353f777630626f403b0652055ebfe8ff142a44ec2cf18ae470395766e", - "sha256:a9cc99d6946d750eb75827cb53c4371b8b0fe89c733a94b1573c9dd16ea6c9e4", - "sha256:ad83e7545b4ab69216cef4cc47e344d19622e28aabec61574b20257c65466d6a", - "sha256:b014333bd0217ad3d54c143de9d4b9a3ca1c5a29a6d0d554952ea071cff0f1f8", - "sha256:b43523d7bc2abd757119dbfb38af91b5735eea45537ec6ec3a5ec3f9562a1c53", - "sha256:b521dcecebc5b978b447f0f69b5b7f3840eac454862270406a39837ffae4e697", - "sha256:b77e27b79448e34c2c51c09836033056a0547aa360c45eeeb67803da7b0eedaf", - "sha256:b7a635871143661feccce3979e1727c4e094f2bdfd3ec4b90dfd4f16f571a87a", - "sha256:b7fca9205b59c1a3d5031f7e64ed627a1074730a51c2a80e97653e3e9fa0d415", - "sha256:ba1b30765a55acf15dce3f364e4928b80858fa8f979ad41f862358939bdd1f2f", - "sha256:ba99d8077424501b9616b43a2d208095746fb1284fc5ba490139651f971d39d9", - "sha256:c25a8ad70e716f96e13a637802813f65d8a6760ef48672aa3502f4c24ea8b400", - "sha256:c3c4a78615b7762740531c27cf46e2f388d8d727d0c0c739e72048beb26c8a9d", - "sha256:c40281f7d70baf6e0db0c2f7472b31609f5bc2748fe7275ea65a0b4601d9b392", - "sha256:c7ad32824b7f02bb3c9f80306d405a1d9b7bb89362d68b3c5a9be53836caebdb", - "sha256:cb3fe77aec8f1995611f966d0c656fdce398317f850d0e6e7aebdfe61f40e1cd", - "sha256:cc038b2d8b1470364b1888a98fd22d616fba2b6309c5b5f181ad4483e0017861", - "sha256:cc37b9aeebab425f11f27e5e9e6cf580be7206c6582a64467a14dda211abc232", - "sha256:cc6bb9aa69aacf0f6032c307da718f61a40cf970849e471254e0e91c56ffca95", - "sha256:d126361607b33c4eb7b36debc173bf25d7805847346dd4d99b5499e1fef52bc7", - "sha256:d15b274f9e15b1a0b7a45d2ac86d1f634d983ca40d6b886721626c47a400bf39", - "sha256:d166eafc19f4718df38887b2bbe1467a4f74a9830e8605089ea7a30dd4da8887", - "sha256:d498eea3f581fbe1b34b59c697512a8baef88212f92e4c7830fcc1499f5b45a5", - "sha256:d6f7e255e5fa94642a0724e35406e6cb7001c09d476ab5fce002f652b36d0c39", - "sha256:d78bd484930c1da2b9679290a41cdb25cc127d783768a0369d6b449e72f88beb", - "sha256:d865984b3f71f6d0af64d0d88f5733521698f6c16f445bb09ce746c92c97c586", - "sha256:d902a43085a308cef32c0d3aea962524b725403fd9373dea18110904003bac97", - "sha256:d94a1db462d5690ebf6ae86d11c5e420042b9898af5dcf278bd97d6bda065423", - "sha256:da695d75ac97cb1cd725adac136d25ca687da4536154cdc2815f576e4da11c69", - "sha256:db2a0b1857f18b11e3b0e54ddfefc96af46b0896fb678c85f63fb8c37518b3e7", - "sha256:df26481f0c7a3f8739fecb3e81bc9da3fcfae34d6c094563b9d4670b047312e1", - "sha256:e14b73607d6231f3cc4622809c196b540a6a44e903bcfad940779c80dffa7be7", - "sha256:e2610e9406d3b0073636a3a2e80db05a02f0c3169b5632022b4e81c0364bcda5", - "sha256:e692296c4cc2873967771345a876bcfc1c547e8dd695c6b89342488b0ea55cd8", - "sha256:e693e233ac92ba83a87024e1d32b5f9ab15ca55ddd916d878146f4e3406b5c91", - "sha256:e81469f7d01efed9b53740aedd26085f20d49da65f9c1f41e822a33992cb1590", - "sha256:e8c7e08bb566de4faaf11984af13f6bcf6a08f327b13631d41d62592681d24fe", - "sha256:ed19b3a05ae0c97dd8f75a5d8f21f7723a8c33bbc555da6bbe1f96c470139d3c", - "sha256:efb2d82f33b2212898f1659fb1c2e9ac30493ac41e4d53123da374c3b5541e64", - "sha256:f44dd4d68697559d007462b0a3a1d9acd61d97072b71f6d1968daef26bc744bd", - "sha256:f72cbae7f6b01591f90814250e636065850c5926751af02bb48da94dfced7baa", - "sha256:f7bc09bc9c29ebead055bcba136a67378f03d66bf359e87d0f7c759d6d4ffa31", - "sha256:ff100b203092af77d1a5a7abe085b3506b7eaaf9abf65b73b7d6905b6cb76988" - ], - "markers": "python_version >= '3.7'", - "version": "==2023.12.25" - }, - "six": { - "hashes": [ - "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", - "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.16.0" - }, - "tqdm": { - "hashes": [ - "sha256:1ee4f8a893eb9bef51c6e35730cebf234d5d0b6bd112b0271e10ed7c24a02bd9", - "sha256:6cd52cdf0fef0e0f543299cfc96fec90d7b8a7e88745f411ec33eb44d5ed3531" - ], - "markers": "python_version >= '3.7'", - "version": "==4.66.2" - } - }, - "develop": {} -} diff --git a/README.md b/README.md index 5c8f7189..71642fe2 100644 --- a/README.md +++ b/README.md @@ -70,9 +70,9 @@ To install ESLint and Prettier for formatting and linting of static files use: ``` shell npm install ``` -Install djLint for formatting and linting template files using: +Firstly, ensure you have Python & Poetry installed and then install djLint for formatting and linting template files using: ```shell -pipenv install +poetry install ``` **Note**: Before being able to run `lint-go`, diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 00000000..04bc9273 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,331 @@ +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. + +[[package]] +name = "click" +version = "8.1.7" +description = "Composable command line interface toolkit" +optional = false +python-versions = ">=3.7" +files = [ + {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, + {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "cssbeautifier" +version = "1.15.1" +description = "CSS unobfuscator and beautifier." +optional = false +python-versions = "*" +files = [ + {file = "cssbeautifier-1.15.1.tar.gz", hash = "sha256:9f7064362aedd559c55eeecf6b6bed65e05f33488dcbe39044f0403c26e1c006"}, +] + +[package.dependencies] +editorconfig = ">=0.12.2" +jsbeautifier = "*" +six = ">=1.13.0" + +[[package]] +name = "djlint" +version = "1.34.1" +description = "HTML Template Linter and Formatter" +optional = false +python-versions = ">=3.8.0,<4.0.0" +files = [ + {file = "djlint-1.34.1-py3-none-any.whl", hash = "sha256:96ff1c464fb6f061130ebc88663a2ea524d7ec51f4b56221a2b3f0320a3cfce8"}, + {file = "djlint-1.34.1.tar.gz", hash = "sha256:db93fa008d19eaadb0454edf1704931d14469d48508daba2df9941111f408346"}, +] + +[package.dependencies] +click = ">=8.0.1,<9.0.0" +colorama = ">=0.4.4,<0.5.0" +cssbeautifier = ">=1.14.4,<2.0.0" +html-tag-names = ">=0.1.2,<0.2.0" +html-void-elements = ">=0.1.0,<0.2.0" +jsbeautifier = ">=1.14.4,<2.0.0" +json5 = ">=0.9.11,<0.10.0" +pathspec = ">=0.12.0,<0.13.0" +PyYAML = ">=6.0,<7.0" +regex = ">=2023.0.0,<2024.0.0" +tqdm = ">=4.62.2,<5.0.0" + +[[package]] +name = "editorconfig" +version = "0.12.4" +description = "EditorConfig File Locator and Interpreter for Python" +optional = false +python-versions = "*" +files = [ + {file = "EditorConfig-0.12.4.tar.gz", hash = "sha256:24857fa1793917dd9ccf0c7810a07e05404ce9b823521c7dce22a4fb5d125f80"}, +] + +[[package]] +name = "html-tag-names" +version = "0.1.2" +description = "List of known HTML tag names" +optional = false +python-versions = ">=3.7,<4.0" +files = [ + {file = "html-tag-names-0.1.2.tar.gz", hash = "sha256:04924aca48770f36b5a41c27e4d917062507be05118acb0ba869c97389084297"}, + {file = "html_tag_names-0.1.2-py3-none-any.whl", hash = "sha256:eeb69ef21078486b615241f0393a72b41352c5219ee648e7c61f5632d26f0420"}, +] + +[[package]] +name = "html-void-elements" +version = "0.1.0" +description = "List of HTML void tag names." +optional = false +python-versions = ">=3.7,<4.0" +files = [ + {file = "html-void-elements-0.1.0.tar.gz", hash = "sha256:931b88f84cd606fee0b582c28fcd00e41d7149421fb673e1e1abd2f0c4f231f0"}, + {file = "html_void_elements-0.1.0-py3-none-any.whl", hash = "sha256:784cf39db03cdeb017320d9301009f8f3480f9d7b254d0974272e80e0cb5e0d2"}, +] + +[[package]] +name = "jsbeautifier" +version = "1.15.1" +description = "JavaScript unobfuscator and beautifier." +optional = false +python-versions = "*" +files = [ + {file = "jsbeautifier-1.15.1.tar.gz", hash = "sha256:ebd733b560704c602d744eafc839db60a1ee9326e30a2a80c4adb8718adc1b24"}, +] + +[package.dependencies] +editorconfig = ">=0.12.2" +six = ">=1.13.0" + +[[package]] +name = "json5" +version = "0.9.24" +description = "A Python implementation of the JSON5 data format." +optional = false +python-versions = ">=3.8" +files = [ + {file = "json5-0.9.24-py3-none-any.whl", hash = "sha256:4ca101fd5c7cb47960c055ef8f4d0e31e15a7c6c48c3b6f1473fc83b6c462a13"}, + {file = "json5-0.9.24.tar.gz", hash = "sha256:0c638399421da959a20952782800e5c1a78c14e08e1dc9738fa10d8ec14d58c8"}, +] + +[[package]] +name = "pathspec" +version = "0.12.1" +description = "Utility library for gitignore style pattern matching of file paths." +optional = false +python-versions = ">=3.8" +files = [ + {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, + {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, +] + +[[package]] +name = "pyyaml" +version = "6.0.1" +description = "YAML parser and emitter for Python" +optional = false +python-versions = ">=3.6" +files = [ + {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, + {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, + {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, + {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, + {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, + {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, + {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, + {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, + {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, + {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, + {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, + {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"}, + {file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"}, + {file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, + {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, + {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, + {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, + {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, + {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, + {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, + {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, +] + +[[package]] +name = "regex" +version = "2023.12.25" +description = "Alternative regular expression module, to replace re." +optional = false +python-versions = ">=3.7" +files = [ + {file = "regex-2023.12.25-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0694219a1d54336fd0445ea382d49d36882415c0134ee1e8332afd1529f0baa5"}, + {file = "regex-2023.12.25-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b014333bd0217ad3d54c143de9d4b9a3ca1c5a29a6d0d554952ea071cff0f1f8"}, + {file = "regex-2023.12.25-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d865984b3f71f6d0af64d0d88f5733521698f6c16f445bb09ce746c92c97c586"}, + {file = "regex-2023.12.25-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1e0eabac536b4cc7f57a5f3d095bfa557860ab912f25965e08fe1545e2ed8b4c"}, + {file = "regex-2023.12.25-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c25a8ad70e716f96e13a637802813f65d8a6760ef48672aa3502f4c24ea8b400"}, + {file = "regex-2023.12.25-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a9b6d73353f777630626f403b0652055ebfe8ff142a44ec2cf18ae470395766e"}, + {file = "regex-2023.12.25-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9cc99d6946d750eb75827cb53c4371b8b0fe89c733a94b1573c9dd16ea6c9e4"}, + {file = "regex-2023.12.25-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:88d1f7bef20c721359d8675f7d9f8e414ec5003d8f642fdfd8087777ff7f94b5"}, + {file = "regex-2023.12.25-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:cb3fe77aec8f1995611f966d0c656fdce398317f850d0e6e7aebdfe61f40e1cd"}, + {file = "regex-2023.12.25-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:7aa47c2e9ea33a4a2a05f40fcd3ea36d73853a2aae7b4feab6fc85f8bf2c9704"}, + {file = "regex-2023.12.25-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:df26481f0c7a3f8739fecb3e81bc9da3fcfae34d6c094563b9d4670b047312e1"}, + {file = "regex-2023.12.25-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:c40281f7d70baf6e0db0c2f7472b31609f5bc2748fe7275ea65a0b4601d9b392"}, + {file = "regex-2023.12.25-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:d94a1db462d5690ebf6ae86d11c5e420042b9898af5dcf278bd97d6bda065423"}, + {file = "regex-2023.12.25-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ba1b30765a55acf15dce3f364e4928b80858fa8f979ad41f862358939bdd1f2f"}, + {file = "regex-2023.12.25-cp310-cp310-win32.whl", hash = "sha256:150c39f5b964e4d7dba46a7962a088fbc91f06e606f023ce57bb347a3b2d4630"}, + {file = "regex-2023.12.25-cp310-cp310-win_amd64.whl", hash = "sha256:09da66917262d9481c719599116c7dc0c321ffcec4b1f510c4f8a066f8768105"}, + {file = "regex-2023.12.25-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:1b9d811f72210fa9306aeb88385b8f8bcef0dfbf3873410413c00aa94c56c2b6"}, + {file = "regex-2023.12.25-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d902a43085a308cef32c0d3aea962524b725403fd9373dea18110904003bac97"}, + {file = "regex-2023.12.25-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d166eafc19f4718df38887b2bbe1467a4f74a9830e8605089ea7a30dd4da8887"}, + {file = "regex-2023.12.25-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c7ad32824b7f02bb3c9f80306d405a1d9b7bb89362d68b3c5a9be53836caebdb"}, + {file = "regex-2023.12.25-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:636ba0a77de609d6510235b7f0e77ec494d2657108f777e8765efc060094c98c"}, + {file = "regex-2023.12.25-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fda75704357805eb953a3ee15a2b240694a9a514548cd49b3c5124b4e2ad01b"}, + {file = "regex-2023.12.25-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f72cbae7f6b01591f90814250e636065850c5926751af02bb48da94dfced7baa"}, + {file = "regex-2023.12.25-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:db2a0b1857f18b11e3b0e54ddfefc96af46b0896fb678c85f63fb8c37518b3e7"}, + {file = "regex-2023.12.25-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:7502534e55c7c36c0978c91ba6f61703faf7ce733715ca48f499d3dbbd7657e0"}, + {file = "regex-2023.12.25-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:e8c7e08bb566de4faaf11984af13f6bcf6a08f327b13631d41d62592681d24fe"}, + {file = "regex-2023.12.25-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:283fc8eed679758de38fe493b7d7d84a198b558942b03f017b1f94dda8efae80"}, + {file = "regex-2023.12.25-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:f44dd4d68697559d007462b0a3a1d9acd61d97072b71f6d1968daef26bc744bd"}, + {file = "regex-2023.12.25-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:67d3ccfc590e5e7197750fcb3a2915b416a53e2de847a728cfa60141054123d4"}, + {file = "regex-2023.12.25-cp311-cp311-win32.whl", hash = "sha256:68191f80a9bad283432385961d9efe09d783bcd36ed35a60fb1ff3f1ec2efe87"}, + {file = "regex-2023.12.25-cp311-cp311-win_amd64.whl", hash = "sha256:7d2af3f6b8419661a0c421584cfe8aaec1c0e435ce7e47ee2a97e344b98f794f"}, + {file = "regex-2023.12.25-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8a0ccf52bb37d1a700375a6b395bff5dd15c50acb745f7db30415bae3c2b0715"}, + {file = "regex-2023.12.25-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c3c4a78615b7762740531c27cf46e2f388d8d727d0c0c739e72048beb26c8a9d"}, + {file = "regex-2023.12.25-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ad83e7545b4ab69216cef4cc47e344d19622e28aabec61574b20257c65466d6a"}, + {file = "regex-2023.12.25-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7a635871143661feccce3979e1727c4e094f2bdfd3ec4b90dfd4f16f571a87a"}, + {file = "regex-2023.12.25-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d498eea3f581fbe1b34b59c697512a8baef88212f92e4c7830fcc1499f5b45a5"}, + {file = "regex-2023.12.25-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:43f7cd5754d02a56ae4ebb91b33461dc67be8e3e0153f593c509e21d219c5060"}, + {file = "regex-2023.12.25-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:51f4b32f793812714fd5307222a7f77e739b9bc566dc94a18126aba3b92b98a3"}, + {file = "regex-2023.12.25-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ba99d8077424501b9616b43a2d208095746fb1284fc5ba490139651f971d39d9"}, + {file = "regex-2023.12.25-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:4bfc2b16e3ba8850e0e262467275dd4d62f0d045e0e9eda2bc65078c0110a11f"}, + {file = "regex-2023.12.25-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8c2c19dae8a3eb0ea45a8448356ed561be843b13cbc34b840922ddf565498c1c"}, + {file = "regex-2023.12.25-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:60080bb3d8617d96f0fb7e19796384cc2467447ef1c491694850ebd3670bc457"}, + {file = "regex-2023.12.25-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b77e27b79448e34c2c51c09836033056a0547aa360c45eeeb67803da7b0eedaf"}, + {file = "regex-2023.12.25-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:518440c991f514331f4850a63560321f833979d145d7d81186dbe2f19e27ae3d"}, + {file = "regex-2023.12.25-cp312-cp312-win32.whl", hash = "sha256:e2610e9406d3b0073636a3a2e80db05a02f0c3169b5632022b4e81c0364bcda5"}, + {file = "regex-2023.12.25-cp312-cp312-win_amd64.whl", hash = "sha256:cc37b9aeebab425f11f27e5e9e6cf580be7206c6582a64467a14dda211abc232"}, + {file = "regex-2023.12.25-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:da695d75ac97cb1cd725adac136d25ca687da4536154cdc2815f576e4da11c69"}, + {file = "regex-2023.12.25-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d126361607b33c4eb7b36debc173bf25d7805847346dd4d99b5499e1fef52bc7"}, + {file = "regex-2023.12.25-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4719bb05094d7d8563a450cf8738d2e1061420f79cfcc1fa7f0a44744c4d8f73"}, + {file = "regex-2023.12.25-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5dd58946bce44b53b06d94aa95560d0b243eb2fe64227cba50017a8d8b3cd3e2"}, + {file = "regex-2023.12.25-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22a86d9fff2009302c440b9d799ef2fe322416d2d58fc124b926aa89365ec482"}, + {file = "regex-2023.12.25-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2aae8101919e8aa05ecfe6322b278f41ce2994c4a430303c4cd163fef746e04f"}, + {file = "regex-2023.12.25-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:e692296c4cc2873967771345a876bcfc1c547e8dd695c6b89342488b0ea55cd8"}, + {file = "regex-2023.12.25-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:263ef5cc10979837f243950637fffb06e8daed7f1ac1e39d5910fd29929e489a"}, + {file = "regex-2023.12.25-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:d6f7e255e5fa94642a0724e35406e6cb7001c09d476ab5fce002f652b36d0c39"}, + {file = "regex-2023.12.25-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:88ad44e220e22b63b0f8f81f007e8abbb92874d8ced66f32571ef8beb0643b2b"}, + {file = "regex-2023.12.25-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:3a17d3ede18f9cedcbe23d2daa8a2cd6f59fe2bf082c567e43083bba3fb00347"}, + {file = "regex-2023.12.25-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d15b274f9e15b1a0b7a45d2ac86d1f634d983ca40d6b886721626c47a400bf39"}, + {file = "regex-2023.12.25-cp37-cp37m-win32.whl", hash = "sha256:ed19b3a05ae0c97dd8f75a5d8f21f7723a8c33bbc555da6bbe1f96c470139d3c"}, + {file = "regex-2023.12.25-cp37-cp37m-win_amd64.whl", hash = "sha256:a6d1047952c0b8104a1d371f88f4ab62e6275567d4458c1e26e9627ad489b445"}, + {file = "regex-2023.12.25-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:b43523d7bc2abd757119dbfb38af91b5735eea45537ec6ec3a5ec3f9562a1c53"}, + {file = "regex-2023.12.25-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:efb2d82f33b2212898f1659fb1c2e9ac30493ac41e4d53123da374c3b5541e64"}, + {file = "regex-2023.12.25-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b7fca9205b59c1a3d5031f7e64ed627a1074730a51c2a80e97653e3e9fa0d415"}, + {file = "regex-2023.12.25-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:086dd15e9435b393ae06f96ab69ab2d333f5d65cbe65ca5a3ef0ec9564dfe770"}, + {file = "regex-2023.12.25-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e81469f7d01efed9b53740aedd26085f20d49da65f9c1f41e822a33992cb1590"}, + {file = "regex-2023.12.25-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:34e4af5b27232f68042aa40a91c3b9bb4da0eeb31b7632e0091afc4310afe6cb"}, + {file = "regex-2023.12.25-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9852b76ab558e45b20bf1893b59af64a28bd3820b0c2efc80e0a70a4a3ea51c1"}, + {file = "regex-2023.12.25-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ff100b203092af77d1a5a7abe085b3506b7eaaf9abf65b73b7d6905b6cb76988"}, + {file = "regex-2023.12.25-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:cc038b2d8b1470364b1888a98fd22d616fba2b6309c5b5f181ad4483e0017861"}, + {file = "regex-2023.12.25-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:094ba386bb5c01e54e14434d4caabf6583334090865b23ef58e0424a6286d3dc"}, + {file = "regex-2023.12.25-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:5cd05d0f57846d8ba4b71d9c00f6f37d6b97d5e5ef8b3c3840426a475c8f70f4"}, + {file = "regex-2023.12.25-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:9aa1a67bbf0f957bbe096375887b2505f5d8ae16bf04488e8b0f334c36e31360"}, + {file = "regex-2023.12.25-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:98a2636994f943b871786c9e82bfe7883ecdaba2ef5df54e1450fa9869d1f756"}, + {file = "regex-2023.12.25-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:37f8e93a81fc5e5bd8db7e10e62dc64261bcd88f8d7e6640aaebe9bc180d9ce2"}, + {file = "regex-2023.12.25-cp38-cp38-win32.whl", hash = "sha256:d78bd484930c1da2b9679290a41cdb25cc127d783768a0369d6b449e72f88beb"}, + {file = "regex-2023.12.25-cp38-cp38-win_amd64.whl", hash = "sha256:b521dcecebc5b978b447f0f69b5b7f3840eac454862270406a39837ffae4e697"}, + {file = "regex-2023.12.25-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:f7bc09bc9c29ebead055bcba136a67378f03d66bf359e87d0f7c759d6d4ffa31"}, + {file = "regex-2023.12.25-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e14b73607d6231f3cc4622809c196b540a6a44e903bcfad940779c80dffa7be7"}, + {file = "regex-2023.12.25-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9eda5f7a50141291beda3edd00abc2d4a5b16c29c92daf8d5bd76934150f3edc"}, + {file = "regex-2023.12.25-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc6bb9aa69aacf0f6032c307da718f61a40cf970849e471254e0e91c56ffca95"}, + {file = "regex-2023.12.25-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:298dc6354d414bc921581be85695d18912bea163a8b23cac9a2562bbcd5088b1"}, + {file = "regex-2023.12.25-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2f4e475a80ecbd15896a976aa0b386c5525d0ed34d5c600b6d3ebac0a67c7ddf"}, + {file = "regex-2023.12.25-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:531ac6cf22b53e0696f8e1d56ce2396311254eb806111ddd3922c9d937151dae"}, + {file = "regex-2023.12.25-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:22f3470f7524b6da61e2020672df2f3063676aff444db1daa283c2ea4ed259d6"}, + {file = "regex-2023.12.25-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:89723d2112697feaa320c9d351e5f5e7b841e83f8b143dba8e2d2b5f04e10923"}, + {file = "regex-2023.12.25-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0ecf44ddf9171cd7566ef1768047f6e66975788258b1c6c6ca78098b95cf9a3d"}, + {file = "regex-2023.12.25-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:905466ad1702ed4acfd67a902af50b8db1feeb9781436372261808df7a2a7bca"}, + {file = "regex-2023.12.25-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:4558410b7a5607a645e9804a3e9dd509af12fb72b9825b13791a37cd417d73a5"}, + {file = "regex-2023.12.25-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:7e316026cc1095f2a3e8cc012822c99f413b702eaa2ca5408a513609488cb62f"}, + {file = "regex-2023.12.25-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3b1de218d5375cd6ac4b5493e0b9f3df2be331e86520f23382f216c137913d20"}, + {file = "regex-2023.12.25-cp39-cp39-win32.whl", hash = "sha256:11a963f8e25ab5c61348d090bf1b07f1953929c13bd2309a0662e9ff680763c9"}, + {file = "regex-2023.12.25-cp39-cp39-win_amd64.whl", hash = "sha256:e693e233ac92ba83a87024e1d32b5f9ab15ca55ddd916d878146f4e3406b5c91"}, + {file = "regex-2023.12.25.tar.gz", hash = "sha256:29171aa128da69afdf4bde412d5bedc335f2ca8fcfe4489038577d05f16181e5"}, +] + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "tqdm" +version = "4.66.2" +description = "Fast, Extensible Progress Meter" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tqdm-4.66.2-py3-none-any.whl", hash = "sha256:1ee4f8a893eb9bef51c6e35730cebf234d5d0b6bd112b0271e10ed7c24a02bd9"}, + {file = "tqdm-4.66.2.tar.gz", hash = "sha256:6cd52cdf0fef0e0f543299cfc96fec90d7b8a7e88745f411ec33eb44d5ed3531"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[package.extras] +dev = ["pytest (>=6)", "pytest-cov", "pytest-timeout", "pytest-xdist"] +notebook = ["ipywidgets (>=6)"] +slack = ["slack-sdk"] +telegram = ["requests"] + +[metadata] +lock-version = "2.0" +python-versions = "^3.11.4" +content-hash = "ee9f4319d7561602ba148b6384c4befbdc6fa2309e0ebed607eb3075a09f4b83" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..0742f9d0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,16 @@ +[tool.poetry] +name = "Launcher" +version = "1.0.0" +description = "ONS Digital eQ Questionnaire Launcher" +authors = ["ONSDigital"] +package-mode = false + +[tool.poetry.dependencies] +python="^3.11.4" + +[tool.poetry.group.dev.dependencies] +djlint = "^1.34.1" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" \ No newline at end of file From 003627b405a75b9021fbbb2295b79ee42e4918da Mon Sep 17 00:00:00 2001 From: VirajP1002 Date: Fri, 12 Apr 2024 12:31:43 +0100 Subject: [PATCH 51/52] Test actions fails correctly with new changes to pull_request.yaml file --- templates/launch.html | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/templates/launch.html b/templates/launch.html index bf71fe38..68f81972 100644 --- a/templates/launch.html +++ b/templates/launch.html @@ -199,6 +199,35 @@

Runner Data

class="qa-btn-submit-dev btn btn--hidden" id="submit-btn" onclick="saveResponseId()" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Date: Fri, 12 Apr 2024 12:33:43 +0100 Subject: [PATCH 52/52] Fix intensional mistake as actions worked as expected --- templates/launch.html | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/templates/launch.html b/templates/launch.html index 68f81972..bf71fe38 100644 --- a/templates/launch.html +++ b/templates/launch.html @@ -199,35 +199,6 @@

Runner Data

class="qa-btn-submit-dev btn btn--hidden" id="submit-btn" onclick="saveResponseId()" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -