Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export saltSharpCountries.css and remove countryCode_Sharp entries from the meta map #3410

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gold-forks-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@salt-ds/countries": patch
---

Remove `<countryCode>_Sharp` entries in countryMetaMap. This was added incorrectly and makes using the map to convert between country codes and country names more difficult.
3 changes: 2 additions & 1 deletion packages/countries/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
},
"sideEffects": false,
"files": [
"saltCountries.css"
"saltCountries.css",
"saltSharpCountries.css"
joshwooding marked this conversation as resolved.
Show resolved Hide resolved
],
"scripts": {
"build": "yarn clean && node ./scripts/generateCountrySymbol.mjs '*.svg'",
Expand Down
512 changes: 256 additions & 256 deletions packages/countries/saltSharpCountries.css
joshwooding marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

12 changes: 5 additions & 7 deletions packages/countries/scripts/generateCountrySymbol.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ const generateSharpCssAsBg = ({ basePath, cssOutputPath, fileArg }) => {

const countryCss = fileNames
.map((fileName) => {
const svgString = fs.readFileSync(fileName, "utf-8").trim();
const svgString = fs
.readFileSync(fileName, "utf-8")
.trim()
.replaceAll(/\r?\n|\r/g, "");

const countryCode = path.parse(fileName).name.toUpperCase();

Expand Down Expand Up @@ -419,12 +422,7 @@ const generateCountryMetaMap = ({ countryMetaMap, basePath }) => {
countryName: "${countryMeta.countryName}",
},`;

const sharpEntryText = `"${code}_Sharp": {
joshwooding marked this conversation as resolved.
Show resolved Hide resolved
countryCode: "${countryMeta.countryCode}",
countryName: "${countryMeta.countryName}",
},`;

metaText = [...metaText, entryText, sharpEntryText];
metaText = [...metaText, entryText];
}

const endText = `
Expand Down
Loading
Loading