1
0
Fork 0

chore: Extended prettier for config files + run

This commit is contained in:
Joost De Cock 2022-10-13 16:19:36 +02:00
parent f673e485ad
commit 322100f54c
27 changed files with 454 additions and 375 deletions

View file

@ -36,4 +36,3 @@ _social:
link: 'https://instagram.com/freesewing_org'
img: 'https://img.shields.io/badge/%F3%A0%80%A0-Follow%20us-E4405F.svg?logo=instagram&logoColor=white&logoWidth=15'
alt: 'Follow @freesewing_org on Twitter'

View file

@ -12,12 +12,11 @@ const extended = [ 'bent', 'simon', 'carlton', 'ursula' ]
const last = ['i18n']
export const buildOrder = [
// First build FreeSewing core library and config-helpers
first,
// Then build all FreeSewing plugins, but not the bundle
Object.keys(plugins).filter(id => id !== 'plugin-bundle'),
Object.keys(plugins).filter((id) => id !== 'plugin-bundle'),
// Then build the plugin bundle
['plugin-bundle'],
@ -29,11 +28,10 @@ export const buildOrder = [
extended,
// Then build all remaining designs
Object.keys(designs).filter(id => [...blocks, ...extended].indexOf(id) === -1),
Object.keys(designs).filter((id) => [...blocks, ...extended].indexOf(id) === -1),
// Finally build the rest of the packages
Object.keys(packages).filter(id => first.indexOf(id) === -1 && last.indexOf(id) === -1),
Object.keys(packages).filter((id) => first.indexOf(id) === -1 && last.indexOf(id) === -1),
last
last,
]

View file

@ -1,5 +1,4 @@
Unreleased:
Breaking:
all:
- This package is now ESM only.
@ -84,7 +83,6 @@ Unreleased:
plugin-versionfree-svg:
- This plugin no longer sets its version as an SVG attribute when rendering patterns
Fixed:
albert:
- Workaround for not finding a suitable legband radius
@ -104,7 +102,6 @@ Unreleased:
- Added seperate waistband options
- Added bow tie placement option
2.22.0:
date: 2022-08-23
@ -643,7 +640,6 @@ Unreleased:
plugin-title:
- Removed rendering of config.cut as it's not used
2.19.9:
date: 2022-01-09
@ -799,7 +795,6 @@ Unreleased:
- Fixed a regression that caused the `waistHeight` option to be ignored.
Closes [#1467](https://github.com/freesewing/freesewing/issues/1467)
2.19.3:
date: 2021-11-05
@ -811,7 +806,6 @@ Unreleased:
charlie:
- Converted the `waistbandWidth` options to snapped pct (was normal pct)
2.19.2:
date: 2021-11-02
@ -1221,7 +1215,6 @@ Unreleased:
create-freesewing-pattern:
- Don't list pattern as dependency in the example package.json
2.16.0:
date: 2021-05-24

View file

@ -1,4 +1,4 @@
author: "Joost De Cock <joost@decock.org> (https://github.com/joostdecock)"
homepage: "https://freesewing.org/"
repository: "github:freesewing/freesewing"
bugsUrl: "https://github.com/freesewing/freesewing/issues"
author: 'Joost De Cock <joost@decock.org> (https://github.com/joostdecock)'
homepage: 'https://freesewing.org/'
repository: 'github:freesewing/freesewing'
bugsUrl: 'https://github.com/freesewing/freesewing/issues'

View file

@ -81,5 +81,3 @@ plugin-bundle:
- made to measure
- diy
- fashion

View file

@ -45,5 +45,3 @@ export const degreeMeasurements = ['shoulderSlope']
/* Helper method to determine whether a measurement uses degrees */
export const isDegreeMeasurement = (measie) => degreeMeasurements.indexOf(measie) !== -1

View file

@ -1,6 +1,4 @@
module.exports = {
models: {
},
only: {
}
models: {},
only: {},
}

View file

@ -4,13 +4,21 @@ import plugins from './plugins.json' assert { type: 'json' }
import sites from './sites.json' assert { type: 'json' }
// Helper method to construct summary objects
const unpack = (obj, folder) => Object.fromEntries(
Object.keys(obj).map(name => [name, { name, folder, type: folder.slice(0, -1), description: obj[name] } ])
const unpack = (obj, folder) =>
Object.fromEntries(
Object.keys(obj).map((name) => [
name,
{ name, folder, type: folder.slice(0, -1), description: obj[name] },
])
)
// Helper method to construct summary objects for designs
const unpackDesigns = (obj, folder) => Object.fromEntries(
Object.keys(obj).map(name => [name, { name, folder, type: folder.slice(0, -1), ...obj[name] } ])
const unpackDesigns = (obj, folder) =>
Object.fromEntries(
Object.keys(obj).map((name) => [
name,
{ name, folder, type: folder.slice(0, -1), ...obj[name] },
])
)
const designs = {
@ -40,4 +48,3 @@ export const publishedSoftware = {
export const publishedTypes = ['designs', 'packages', 'plugins']
export const types = [...publishedTypes, 'sites']

View file

@ -24,4 +24,3 @@
"plugin-title": "A FreeSewing plugin to add a title to your pattern parts",
"plugin-versionfree-svg": "A FreeSewing plugin to keep version info out of your SVG to allow easy diffs across versions"
}

View file

@ -17,7 +17,7 @@ const options = {
entryPoints: ['src/index.mjs'],
format: 'esm',
outfile: 'dist/index.mjs',
external: ["@freesewing"],
external: ['@freesewing'],
metafile: process.env.VERBOSE ? true : false,
minify: process.env.NO_MINIFY ? false : true,
sourcemap: true,
@ -25,12 +25,11 @@ const options = {
// Let esbuild generate the build
let result
(async () => {
;(async () => {
result = await esbuild.build(options).catch(() => process.exit(1))
if (process.env.VERBOSE) {
const info = await esbuild.analyzeMetafile(result.metafile)
console.log(info)
}
})()

View file

@ -1,15 +1,26 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<html
lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
>
<head>
<!-- Template from https://tedgoas.github.io/Cerberus/ -->
<meta charset="utf-8"> <!-- utf-8 works for most cases -->
<meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine -->
<meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely -->
<meta name="format-detection" content="telephone=no,address=no,email=no,date=no,url=no"> <!-- Tell iOS not to automatically link certain text strings. -->
<meta name="color-scheme" content="light">
<meta name="supported-color-schemes" content="light">
<title>FreeSewing Newsletter</title> <!-- The title tag shows in email notifications, like Android 4.4. -->
<meta charset="utf-8" />
<!-- utf-8 works for most cases -->
<meta name="viewport" content="width=device-width" />
<!-- Forcing initial-scale shouldn't be necessary -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- Use the latest (edge) version of IE rendering engine -->
<meta name="x-apple-disable-message-reformatting" />
<!-- Disable auto-scale in iOS 10 Mail entirely -->
<meta name="format-detection" content="telephone=no,address=no,email=no,date=no,url=no" />
<!-- Tell iOS not to automatically link certain text strings. -->
<meta name="color-scheme" content="light" />
<meta name="supported-color-schemes" content="light" />
<title>FreeSewing Newsletter</title>
<!-- The title tag shows in email notifications, like Android 4.4. -->
<!-- What it does: Makes background images in 72ppi Outlook render at correct size. -->
<!--[if gte mso 9]>
@ -42,7 +53,6 @@
<!-- CSS Reset : BEGIN -->
<style>
/* What it does: Tells the email client that only light styles are provided but the client can transform them to dark. A duplicate of meta color-scheme meta tag above. */
:root {
color-scheme: light;
@ -66,12 +76,13 @@
}
/* What it does: Centers email on Android 4.4 */
div[style*="margin: 16px 0"] {
div[style*='margin: 16px 0'] {
margin: 0 !important;
}
/* What it does: forces Samsung Android mail clients to use the entire viewport */
#MessageViewBody, #MessageWebViewDiv{
#MessageViewBody,
#MessageWebViewDiv {
width: 100% !important;
}
@ -130,8 +141,12 @@
display: none !important;
}
h1 { line-height: 36px; }
h2 { line-height: 28px; }
h1 {
line-height: 36px;
}
h2 {
line-height: 28px;
}
/* What it does: Removes right gutter in Gmail iOS app: https://github.com/TedGoas/Cerberus/issues/89 */
/* Create one of these media queries for each additional viewport size you'd like to fix */
@ -154,13 +169,11 @@
min-width: 414px !important;
}
}
</style>
<!-- CSS Reset : END -->
<!-- Progressive Enhancements : BEGIN -->
<style>
/* What it does: Hover styles for buttons */
.button-td,
.button-a {
@ -174,17 +187,13 @@
/* Media Queries */
@media screen and (max-width: 600px) {
/* What it does: Adjust typography on small screens to improve readability */
.email-container p {
font-size: 17px !important;
}
}
</style>
<!-- Progressive Enhancements : END -->
</head>
<!--
The email background color (#ffffff) is defined in three places:
@ -192,8 +201,21 @@
2. center tag: for Gmail and Inbox mobile apps and web versions of Gmail, GSuite, Inbox, Yahoo, AOL, Libero, Comcast, freenet, Mail.ru, Orange.fr
3. mso conditional: For Windows 10 Mail
-->
<body width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #ffffff;">
<center role="article" aria-roledescription="email" lang="en" style="width: 100%; background-color: #ffffff;">
<body
width="100%"
style="
margin: 0;
padding: 0 !important;
mso-line-height-rule: exactly;
background-color: #ffffff;
"
>
<center
role="article"
aria-roledescription="email"
lang="en"
style="width: 100%; background-color: #ffffff"
>
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #ffffff;">
<tr>
@ -201,14 +223,27 @@
<![endif]-->
<!-- Visually Hidden Preheader Text : BEGIN -->
<div style="max-height:0; overflow:hidden; mso-hide:all;" aria-hidden="true">
This season's edition of the FreeSewing Newsletter, a long-read with news and updates from the FreeSewing community
<div style="max-height: 0; overflow: hidden; mso-hide: all" aria-hidden="true">
This season's edition of the FreeSewing Newsletter, a long-read with news and updates from
the FreeSewing community
</div>
<!-- Visually Hidden Preheader Text : END -->
<!-- Create white space after the desired preview text so email clients dont pull other distracting text into the inbox preview. Extend as necessary. -->
<!-- Preview Text Spacing Hack : BEGIN -->
<div style="display: none; font-size: 1px; line-height: 1px; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all; font-family: sans-serif;">
<div
style="
display: none;
font-size: 1px;
line-height: 1px;
max-height: 0px;
max-width: 0px;
opacity: 0;
overflow: hidden;
mso-hide: all;
font-family: sans-serif;
"
>
&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;&zwnj;&nbsp;
</div>
<!-- Preview Text Spacing Hack : END -->
@ -218,7 +253,7 @@
1. max-width for all clients except Desktop Windows Outlook, allowing the email to squish on narrow but never go wider than 600px.
2. MSO tags for Desktop Windows Outlook enforce a 600px width.
-->
<div style="max-width: 600px; margin: 0 auto;" class="email-container">
<div style="max-width: 600px; margin: 0 auto" class="email-container">
<!--[if mso]>
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="600">
<tr>
@ -226,14 +261,29 @@
<![endif]-->
<!-- Email Body : BEGIN -->
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto;">
<table
align="center"
role="presentation"
cellspacing="0"
cellpadding="0"
border="0"
width="100%"
style="margin: auto"
>
<!-- 1 Column Text + Button : BEGIN -->
<tr>
<td style="background-color: #ffffff;">
<td style="background-color: #ffffff">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="padding: 20px; font-family: sans-serif; font-size: 16px; line-height: 22px; color: #212529;">
<td
style="
padding: 20px;
font-family: sans-serif;
font-size: 16px;
line-height: 22px;
color: #212529;
"
>
{{{ content }}}
</td>
</tr>
@ -244,34 +294,70 @@
<!-- Clear Spacer : BEGIN -->
<tr>
<td aria-hidden="true" height="40" style="font-size: 0px; line-height: 0px;">
&nbsp;
</td>
<td aria-hidden="true" height="40" style="font-size: 0px; line-height: 0px">&nbsp;</td>
</tr>
<!-- Clear Spacer : END -->
</table>
<!-- Email Body : END -->
<!-- Email Footer : BEGIN -->
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto;">
<table
align="center"
role="presentation"
cellspacing="0"
cellpadding="0"
border="0"
width="100%"
style="margin: auto"
>
<tr>
<td style="padding: 20px; font-family: sans-serif; font-size: 12px; line-height: 15px; text-align: center; color: #495057; border-top: 1px solid #cccccc;">
<a href="https://freesewing.org/patrons/join"><b>Support FreeSewing: Become a Patron</b></a>
<td
style="
padding: 20px;
font-family: sans-serif;
font-size: 12px;
line-height: 15px;
text-align: center;
color: #495057;
border-top: 1px solid #cccccc;
"
>
<a href="https://freesewing.org/patrons/join"
><b>Support FreeSewing: Become a Patron</b></a
>
</td>
</tr>
</table>
<!-- Email Footer : END -->
<!-- Email Footer : BEGIN -->
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto;">
<table
align="center"
role="presentation"
cellspacing="0"
cellpadding="0"
border="0"
width="100%"
style="margin: auto"
>
<tr>
<td style="padding: 10px; font-family: sans-serif; font-size: 12px; line-height: 15px; text-align: center; color: #495057;">
FreeSewing<br><span class="unstyle-auto-detected-links">67 Plantin en Moretuslei<br>Antwerp / Belgium<br>info@freesewing.org</span>
<br><br>
<unsubscribe style="color: #ffffff; text-decoration: underline;">
You can <a href="{{{ unsubscribe }}}">unsubscribe</a> at any time. Or just reply and tell us you want out.
<td
style="
padding: 10px;
font-family: sans-serif;
font-size: 12px;
line-height: 15px;
text-align: center;
color: #495057;
"
>
FreeSewing<br /><span class="unstyle-auto-detected-links"
>67 Plantin en Moretuslei<br />Antwerp / Belgium<br />info@freesewing.org</span
>
<br /><br />
<unsubscribe style="color: #ffffff; text-decoration: underline">
You can <a href="{{{ unsubscribe }}}">unsubscribe</a> at any time. Or just reply and
tell us you want out.
</unsubscribe>
</td>
</tr>
@ -293,4 +379,3 @@
</center>
</body>
</html>

View file

@ -4,4 +4,3 @@ import { sharedPluginTests } from '../../../tests/plugins/shared.mjs'
// Run shared tests
sharedPluginTests(plugin)

View file

@ -20,7 +20,7 @@
"kickstart:windows": "npx lerna bootstrap && yarn wbuildall && yarn prepare && yarn tips",
"cleanall": "lerna run clean",
"test": "lerna run test",
"prettier": "npx prettier --write 'packages/**/src/*.mjs' 'packages/**/src/*.js' 'packages/i18n/src/locales/**/*.*' 'packages/**/tests/*.mjs'",
"prettier": "npx prettier --write 'config/*' 'config/**/*' 'packages/**/src/*.mjs' 'packages/i18n/src/locales/**/*.*' 'packages/**/tests/*.mjs'",
"reconfigure": "all-contributors generate && node --experimental-json-modules --no-warnings scripts/reconfigure.mjs",
"prerelease": "lerna version --no-git-tag-version --no-push && yarn reconfigure && yarn buildall",
"buildall": "lerna run cibuild_step0 && lerna run cibuild_step1 && lerna run cibuild_step2 && lerna run cibuild_step3 && lerna run cibuild_step4 && lerna run cibuild_step5 && lerna run cibuild_step6 && lerna run cibuild_step7",

View file

@ -29,5 +29,5 @@ export const __loadPatternDefaults = () => ({
debug: false,
options: {},
absoluteOptions: {},
measurements: {}
measurements: {},
})

View file

@ -18,7 +18,7 @@ describe('Snapped options', () => {
draft: ({ part, absoluteOptions }) => {
abs = absoluteOptions
return part
}
},
}
const design = new Design({ parts: [part] })
new design({ options: { test: 0.13 }, measurements, idPrefix: 'A' }).draft()

View file

@ -43,5 +43,4 @@ describe('Snippet', () => {
pattern.draft()
expect(result).to.equal(':)')
})
})

View file

@ -131,7 +131,9 @@ describe('Store', () => {
const store = new Store()
store.push('test', 1)
expect(store.logs.warning.length).to.equal(1)
expect(store.logs.warning[0]).to.equal('Store.push(value) on key `test`, but key does not hold an array')
expect(store.logs.warning[0]).to.equal(
'Store.push(value) on key `test`, but key does not hold an array'
)
})
it('Should log a warning when setting an undefined value with set()', () => {
@ -145,7 +147,9 @@ describe('Store', () => {
const store = new Store()
store.setIfUnset('test')
expect(store.logs.warning.length).to.equal(1)
expect(store.logs.warning[0]).to.equal('Store.setIfUnset(value) on key `test`, but value is undefined')
expect(store.logs.warning[0]).to.equal(
'Store.setIfUnset(value) on key `test`, but value is undefined'
)
})
it('Should unset a value', () => {

View file

@ -484,7 +484,7 @@ describe('Utils', () => {
points.to = new Point(19, 76)
paths.test = new Path().move(points.from).line(points.to)
return part
}
},
}
const design = new Design({ parts: [test] })
const pattern = new design()

View file

@ -1,3 +1,3 @@
---
thingIsDeprecated: "{thing} ist veraltet"
weRecommendThingInstead: "Wir empfehlen stattdessen {thing}"
thingIsDeprecated: '{thing} ist veraltet'
weRecommendThingInstead: 'Wir empfehlen stattdessen {thing}'

View file

@ -26,7 +26,7 @@ profileWarning: Відкликання згоди видалить усі Ваш
profileWhatAnswerOptional: 'За наявності: <b>зображення облікового запису</b>, <b>біо</b>і <b>соціальні мережі</b>'
profileWhatAnswer: "Ваша <b>електронна адреса</b>, <b>ім'я користувача</b>і <b>пароль</b>."
profileWhatQuestion: Що таке дані облікового запису?
profileWhyAnswer: 'Щоб <b>автентифікувати</b> Вас, <b>зв''язатися</b> з Вами коли це потрібно та задля покращення нашої <b>спільноти</b>.'
profileWhyAnswer: "Щоб <b>автентифікувати</b> Вас, <b>зв'язатися</b> з Вами коли це потрібно та задля покращення нашої <b>спільноти</b>."
readMore: Для отримання додаткової інформації, будь ласка, прочитайте наші умови конфіденційності.
readRights: Для отримання додаткової інформації, будь ласка, прочитайте про Ваші права.
revokeConsent: Відкликати згоду

View file

@ -6,7 +6,7 @@ txt-draft: 'Оберіть одну з викрійок, модель та на
txt-how: Як це працює
txt-join: Приєднайтеся до тисяч інших користувачів та створіть безкоштовний акаунт на freesewing.org.
txt-model: Всі наші викрійки адаптуються під задані виміри. Тому перше, що варто зробити піти взяти сантиметрову стрічку.
txt-newHere: "Якщо ви тут вперше найкраще місце для початку є наше демо:"
txt-newHere: 'Якщо ви тут вперше найкраще місце для початку є наше демо:'
txt-opensource: 'Наша платформа, наші викрійки та навіть наш вебсайт. Весь наш код доступний на GitHub. Pull requests вітаються!'
txt-patrons: FreeSewing існує завдяки фінансовій підтримці наших Патронів. Прокрутіть вниз, щоб дізнатися про нашу модель підписки.
txt-showcase: Завершені проекти від спільноти FreeSewing

View file

@ -188,10 +188,13 @@ function createDesign(name, type) {
mkdir([...design, 'tests'])
// Create package.json
templateOut([...template, 'package.json'], [...design, 'package.json'], { name, description })
templateOut([...template, 'package.json.mustache'], [...design, 'package.json'], {
name,
description,
})
// Create index.mjs
templateOut([...template, 'src', 'index.mjs'], [...design, 'src', 'index.mjs'], {
templateOut([...template, 'src', 'index.mjs.mustache'], [...design, 'src', 'index.mjs'], {
capitalized_name,
})