chore: Fixing linter warnings
This commit is contained in:
parent
d3a87ad7d1
commit
f9e3236253
37 changed files with 46 additions and 694 deletions
|
@ -34,7 +34,7 @@ export default function (part) {
|
||||||
let body16_17d = 152.51537318250902 * options.size
|
let body16_17d = 152.51537318250902 * options.size
|
||||||
let body17_18d = 255.15294373571314 * options.size
|
let body17_18d = 255.15294373571314 * options.size
|
||||||
let body18_19d = 71.90453921693678 * options.size
|
let body18_19d = 71.90453921693678 * options.size
|
||||||
let body19_01d = 61.33021195137026 * options.size
|
//let body19_01d = 61.33021195137026 * options.size
|
||||||
|
|
||||||
let body01cp1d = 32.13103487929059 * options.size
|
let body01cp1d = 32.13103487929059 * options.size
|
||||||
let body01cp2d = 23.72518967258217 * options.size
|
let body01cp2d = 23.72518967258217 * options.size
|
||||||
|
|
|
@ -56,7 +56,7 @@ export default function (part) {
|
||||||
let diff = 0
|
let diff = 0
|
||||||
let angle = 0
|
let angle = 0
|
||||||
do {
|
do {
|
||||||
if (length?.o) angle = diff*( length.o > length.i ? -.1 : .1 )
|
if (length.o) angle = diff*( length.o > length.i ? -.1 : .1 )
|
||||||
|
|
||||||
points.dartBottomRight = points.dartBottomRight.rotate( angle, points.waistSide )
|
points.dartBottomRight = points.dartBottomRight.rotate( angle, points.waistSide )
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
export default function (part) {
|
export default function (part) {
|
||||||
let {
|
const {
|
||||||
utils,
|
|
||||||
store,
|
store,
|
||||||
sa,
|
sa,
|
||||||
Point,
|
Point,
|
||||||
|
@ -10,7 +9,6 @@ export default function (part) {
|
||||||
Snippet,
|
Snippet,
|
||||||
snippets,
|
snippets,
|
||||||
options,
|
options,
|
||||||
measurements,
|
|
||||||
complete,
|
complete,
|
||||||
paperless,
|
paperless,
|
||||||
macro,
|
macro,
|
||||||
|
|
|
@ -1,16 +1,13 @@
|
||||||
export default function (part) {
|
export default function (part) {
|
||||||
let {
|
const {
|
||||||
utils,
|
|
||||||
store,
|
store,
|
||||||
sa,
|
sa,
|
||||||
Point,
|
|
||||||
points,
|
points,
|
||||||
Path,
|
Path,
|
||||||
paths,
|
paths,
|
||||||
Snippet,
|
Snippet,
|
||||||
snippets,
|
snippets,
|
||||||
options,
|
options,
|
||||||
measurements,
|
|
||||||
complete,
|
complete,
|
||||||
paperless,
|
paperless,
|
||||||
macro,
|
macro,
|
||||||
|
|
|
@ -1,18 +1,10 @@
|
||||||
export default function (part) {
|
export default function (part) {
|
||||||
let {
|
const {
|
||||||
utils,
|
|
||||||
store,
|
|
||||||
sa,
|
|
||||||
Point,
|
|
||||||
points,
|
points,
|
||||||
Path,
|
Path,
|
||||||
paths,
|
paths,
|
||||||
Snippet,
|
|
||||||
snippets,
|
snippets,
|
||||||
options,
|
options,
|
||||||
measurements,
|
|
||||||
complete,
|
|
||||||
paperless,
|
|
||||||
macro,
|
macro,
|
||||||
} = part.shorthand()
|
} = part.shorthand()
|
||||||
|
|
||||||
|
@ -227,7 +219,6 @@ export default function (part) {
|
||||||
.rotate(-2.5, points.shoulderDartOutside)
|
.rotate(-2.5, points.shoulderDartOutside)
|
||||||
.shiftFractionTowards(points.shoulderDartOutside, 0.2)
|
.shiftFractionTowards(points.shoulderDartOutside, 0.2)
|
||||||
|
|
||||||
let lInside = shoulderInsideSeam.length()
|
|
||||||
let iteration = 1
|
let iteration = 1
|
||||||
let diff = 0
|
let diff = 0
|
||||||
do {
|
do {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { version } from '../package.json'
|
import { version } from '../package.json'
|
||||||
import freesewing from '@freesewing/core'
|
|
||||||
import configHelpers from '@freesewing/config-helpers'
|
import configHelpers from '@freesewing/config-helpers'
|
||||||
const { elastics, pctBasedOn } = configHelpers
|
const { elastics, pctBasedOn } = configHelpers
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { version } from '../package.json'
|
import { version } from '../package.json'
|
||||||
import freesewing from '@freesewing/core'
|
|
||||||
import configHelpers from '@freesewing/config-helpers'
|
import configHelpers from '@freesewing/config-helpers'
|
||||||
const { elastics, pctBasedOn } = configHelpers
|
const { elastics, pctBasedOn } = configHelpers
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { version } from '../package.json'
|
import { version } from '../package.json'
|
||||||
import freesewing from '@freesewing/core'
|
|
||||||
import configHelpers from '@freesewing/config-helpers'
|
import configHelpers from '@freesewing/config-helpers'
|
||||||
const { smallsteps, pctBasedOn } = configHelpers
|
const { smallsteps, pctBasedOn } = configHelpers
|
||||||
|
|
||||||
|
|
|
@ -1,270 +1,4 @@
|
||||||
export default function (part) {
|
const method = part => part
|
||||||
const {
|
|
||||||
options,
|
|
||||||
Point,
|
|
||||||
Path,
|
|
||||||
points,
|
|
||||||
paths,
|
|
||||||
measurements,
|
|
||||||
// Snippet,
|
|
||||||
// snippets,
|
|
||||||
store,
|
|
||||||
utils,
|
|
||||||
complete,
|
|
||||||
sa,
|
|
||||||
paperless,
|
|
||||||
macro,
|
|
||||||
} = part.shorthand()
|
|
||||||
|
|
||||||
// Design pattern here
|
export default method
|
||||||
|
|
||||||
// Create points
|
|
||||||
return part
|
|
||||||
points.backWaistMid = new Point(measurements.seat / 4, 0)
|
|
||||||
points.backWaistBandLeft = new Point(
|
|
||||||
store.get('sideSeamWaist').x / options.backToFrontWidth,
|
|
||||||
store.get('sideSeamWaist').y
|
|
||||||
)
|
|
||||||
points.backLegOpeningLeft = new Point(
|
|
||||||
store.get('sideSeamHip').x / options.backToFrontWidth,
|
|
||||||
store.get('sideSeamHip').y
|
|
||||||
)
|
|
||||||
|
|
||||||
// back height is given by (estimated) cross seam, minus front and gusset lengths
|
|
||||||
// this does not account for vertical stretch yet
|
|
||||||
const backHeight = store.get('crossSeam') - store.get('frontHeight') - options.gussetLength * measurements.seat
|
|
||||||
|
|
||||||
// calculate the actual back height, using yScale above and yScaleReduced below leg opening
|
|
||||||
const backHeightAbove = store.get('frontHeightAbove') // part above has same height front and back
|
|
||||||
|
|
||||||
let backHeightBelow
|
|
||||||
backHeightBelow = store.get('yScale')*(backHeight - backHeightAbove/store.get('yScaleReduced'))
|
|
||||||
|
|
||||||
const backHeightReduced = backHeightBelow + backHeightAbove
|
|
||||||
|
|
||||||
points.backGussetLeft = new Point(
|
|
||||||
measurements.seat / 4 -
|
|
||||||
((measurements.waist * options.gussetWidth * store.get('xScale')) / options.gussetRatio) *
|
|
||||||
options.backToFrontWidth,
|
|
||||||
backHeightReduced
|
|
||||||
)
|
|
||||||
points.backGussetMid = new Point(
|
|
||||||
measurements.seat / 4,
|
|
||||||
backHeightReduced
|
|
||||||
)
|
|
||||||
|
|
||||||
points.backGussetRight = points.backGussetLeft.flipX(points.backWaistMid)
|
|
||||||
points.backLegOpeningRight = points.backLegOpeningLeft.flipX(points.backWaistMid)
|
|
||||||
points.backWaistBandRight = points.backWaistBandLeft.flipX(points.backWaistMid)
|
|
||||||
|
|
||||||
points.backWaistBandMid = points.backWaistBandLeft
|
|
||||||
.shiftFractionTowards(points.backWaistBandRight, 0.5)
|
|
||||||
.shift(270, measurements.waistToUpperLeg * options.backDip)
|
|
||||||
|
|
||||||
/* Middle point for label */
|
|
||||||
points.backMidMid = points.backLegOpeningLeft.shiftFractionTowards(
|
|
||||||
points.backLegOpeningRight,
|
|
||||||
0.5
|
|
||||||
)
|
|
||||||
|
|
||||||
// Create control points
|
|
||||||
|
|
||||||
/* Control point for waistband dip */
|
|
||||||
points.backWaistBandLeftCp1 = points.backWaistBandMid.shift(0,points.backWaistBandMid.dx(points.backWaistBandLeft) / 3 )
|
|
||||||
|
|
||||||
/* Flip points to right side */
|
|
||||||
points.backWaistBandRightCp1 = points.backWaistBandLeftCp1.flipX(points.backWaistMid)
|
|
||||||
|
|
||||||
// Shape back coverage
|
|
||||||
|
|
||||||
/* Only have to do this on one side */
|
|
||||||
points.backLegOpeningCorner = utils.beamsIntersect(
|
|
||||||
points.backLegOpeningLeft,
|
|
||||||
points.backLegOpeningLeft.shift(180, points.backGussetLeft.dy(points.backLegOpeningLeft)),
|
|
||||||
points.backGussetLeft,
|
|
||||||
points.backGussetLeft.shift(270, points.backGussetLeft.dy(points.backLegOpeningLeft))
|
|
||||||
)
|
|
||||||
|
|
||||||
if (options.backExposure >= 0) {
|
|
||||||
/* If back exposure is high, like a thong style */
|
|
||||||
/* This controls the hip bit */
|
|
||||||
points.backLegOpeningLeftCp1 = points.backLegOpeningLeft.shiftFractionTowards(
|
|
||||||
points.backLegOpeningCorner,
|
|
||||||
options.backExposure
|
|
||||||
)
|
|
||||||
/* This controls the center bit */
|
|
||||||
points.backGussetLeftCp1 = points.backGussetLeft.shiftFractionTowards(
|
|
||||||
points.backWaistBandMid,
|
|
||||||
options.backExposure
|
|
||||||
)
|
|
||||||
points.backGussetLeft = points.backGussetLeft.shiftFractionTowards(
|
|
||||||
points.backGussetMid,
|
|
||||||
options.backExposure
|
|
||||||
) // This narrows the back of the gusset
|
|
||||||
points.backGussetRight = points.backGussetLeft.flipX(points.backWaistMid)
|
|
||||||
} else {
|
|
||||||
/* If back exposure is low and flares out to cover more */
|
|
||||||
store.set('adjustedBackExposure',options.backExposure * store.get('adjustedLegOpening')) // flare depends on leg opening
|
|
||||||
/* This controls the hip bit */
|
|
||||||
points.backLegOpeningLeftCp1 = points.backLegOpeningLeft.shift(
|
|
||||||
-45,store.get('adjustedBackExposure') * points.backWaistBandMid.dx(points.backWaistBandLeft))
|
|
||||||
/* This controls the taper to gusset */
|
|
||||||
points.backGussetLeftCp1 = points.backGussetLeft.shift(115, store.get('adjustedBackExposure') * points.backWaistBandMid.dx(points.backWaistBandLeft))
|
|
||||||
|
|
||||||
/* center of the flare and its control points are on a line parallel to the backGussetLeft to backLegOpeningLeft line
|
|
||||||
* first, define the points on that line */
|
|
||||||
points.backFlare = points.backGussetLeft.shiftFractionTowards(points.backLegOpeningLeft, 0.5)
|
|
||||||
// points.backFlareCp1 = points.backGussetLeft.shiftFractionTowards(points.backLegOpeningLeft, 0.5 - store.get('adjustedBackExposure'))
|
|
||||||
points.backFlareCp1 = points.backGussetLeft.shiftFractionTowards(points.backLegOpeningLeft, 0.7)
|
|
||||||
points.backFlareCp2 = points.backGussetLeft.shiftFractionTowards(points.backLegOpeningLeft, 0.3)
|
|
||||||
/* then shift all three points outward */
|
|
||||||
points.backFlareLeft = points.backFlare.shift(
|
|
||||||
215,(points.backWaistBandMid.dx(points.backWaistBandLeft)) * store.get('adjustedBackExposure') * 2 )
|
|
||||||
points.backFlareLeftCp1 = points.backFlareCp1.shift(
|
|
||||||
215,(points.backWaistBandMid.dx(points.backWaistBandLeft)) * store.get('adjustedBackExposure') * 2 )
|
|
||||||
points.backFlareLeftCp2 = points.backFlareCp2.shift(
|
|
||||||
215,(points.backWaistBandMid.dx(points.backWaistBandLeft)) * store.get('adjustedBackExposure') * 2 )
|
|
||||||
|
|
||||||
|
|
||||||
/* Flip points to the right */
|
|
||||||
|
|
||||||
points.backFlareRight = points.backFlareLeft.flipX(points.backWaistBandMid)
|
|
||||||
points.backFlareRightCp1 = points.backFlareLeftCp1.flipX(points.backWaistMid)
|
|
||||||
points.backFlareRightCp2 = points.backFlareLeftCp2.flipX(points.backWaistMid)
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Flip points to the right */
|
|
||||||
|
|
||||||
points.backLegOpeningRightCp1 = points.backLegOpeningLeftCp1.flipX(points.backWaistMid)
|
|
||||||
points.backGussetRightCp1 = points.backGussetLeftCp1.flipX(points.backWaistMid)
|
|
||||||
|
|
||||||
// Draw paths
|
|
||||||
|
|
||||||
if (options.backExposure >= 0) {
|
|
||||||
paths.seam = new Path()
|
|
||||||
.move(points.backWaistBandMid)
|
|
||||||
.curve(points.backWaistBandLeftCp1, points.backWaistBandLeft, points.backWaistBandLeft) // Waist band dip
|
|
||||||
.line(points.backLegOpeningLeft)
|
|
||||||
.curve(points.backLegOpeningLeftCp1, points.backGussetLeftCp1, points.backGussetLeft)
|
|
||||||
.line(points.backGussetMid)
|
|
||||||
.line(points.backGussetRight)
|
|
||||||
.curve(points.backGussetRightCp1, points.backLegOpeningRightCp1, points.backLegOpeningRight)
|
|
||||||
.line(points.backWaistBandRight)
|
|
||||||
.curve(points.backWaistBandRight, points.backWaistBandRightCp1, points.backWaistBandMid) // Waist band dip
|
|
||||||
.close()
|
|
||||||
.attr('class', 'fabric')
|
|
||||||
} else {
|
|
||||||
paths.seam = new Path()
|
|
||||||
.move(points.backWaistBandMid)
|
|
||||||
.curve(points.backWaistBandLeftCp1, points.backWaistBandLeft, points.backWaistBandLeft) // Waist band dip
|
|
||||||
.line(points.backLegOpeningLeft)
|
|
||||||
.curve(points.backLegOpeningLeftCp1, points.backFlareLeftCp1, points.backFlareLeft)
|
|
||||||
.curve(points.backFlareLeftCp2, points.backGussetLeftCp1, points.backGussetLeft)
|
|
||||||
.line(points.backGussetMid)
|
|
||||||
.line(points.backGussetRight)
|
|
||||||
.curve(points.backGussetRightCp1, points.backFlareRightCp2, points.backFlareRight)
|
|
||||||
.curve(points.backFlareRightCp1, points.backLegOpeningRightCp1, points.backLegOpeningRight)
|
|
||||||
.line(points.backWaistBandRight)
|
|
||||||
.curve(points.backWaistBandRight, points.backWaistBandRightCp1, points.backWaistBandMid) // Waist band dip
|
|
||||||
.close()
|
|
||||||
.attr('class', 'fabric')
|
|
||||||
}
|
|
||||||
|
|
||||||
// Store points for use in other parts
|
|
||||||
|
|
||||||
/* Store gusset points for use in gusset */
|
|
||||||
|
|
||||||
store.set('backGussetLeft', points.backGussetLeft)
|
|
||||||
store.set('backGussetRight', points.backGussetRight)
|
|
||||||
|
|
||||||
/* Store lengths for use in elastic */
|
|
||||||
|
|
||||||
paths.backLegOpening = (options.backExposure >= 0)
|
|
||||||
? new Path()
|
|
||||||
.move(points.backGussetRight)
|
|
||||||
.curve(points.backGussetRightCp1, points.backLegOpeningRightCp1, points.backLegOpeningRight)
|
|
||||||
.setRender(false)
|
|
||||||
: new Path()
|
|
||||||
.move(points.backGussetRight)
|
|
||||||
.curve(points.backGussetRightCp1, points.backFlareRightCp2, points.backFlareRight)
|
|
||||||
.curve(points.backFlareRightCp1, points.backLegOpeningRightCp1, points.backLegOpeningRight)
|
|
||||||
.setRender(false)
|
|
||||||
store.set('backLegOpeningLength',paths.backLegOpening.length())
|
|
||||||
|
|
||||||
paths.backWaistBand = new Path()
|
|
||||||
.move(points.backWaistBandRight)
|
|
||||||
.curve(points.backWaistBandRightCp1, points.backWaistBandLeftCp1, points.backWaistBandLeft)
|
|
||||||
.setRender(false)
|
|
||||||
store.set('backWaistBandLength',paths.backWaistBand.length())
|
|
||||||
|
|
||||||
// Complete?
|
|
||||||
if (complete) {
|
|
||||||
if (sa) {
|
|
||||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
macro('title', {
|
|
||||||
at: points.backMidMid,
|
|
||||||
nr: 2,
|
|
||||||
title: 'back',
|
|
||||||
})
|
|
||||||
|
|
||||||
macro('grainline', {
|
|
||||||
from: points.backGussetMid,
|
|
||||||
to: points.backGussetMid.shiftFractionTowards(points.backWaistBandMid, 0.4),
|
|
||||||
})
|
|
||||||
|
|
||||||
points.scaleboxAnchor = points.scalebox = points.backMidMid.shift(90, -50)
|
|
||||||
macro('miniscale', { at: points.scalebox })
|
|
||||||
|
|
||||||
// Paperless?
|
|
||||||
if (paperless) {
|
|
||||||
macro('hd', {
|
|
||||||
from: points.backWaistBandRight,
|
|
||||||
to: points.backWaistBandLeft,
|
|
||||||
y: points.backWaistBandRight.y + sa - 15,
|
|
||||||
})
|
|
||||||
macro('hd', {
|
|
||||||
from: points.backLegOpeningRight,
|
|
||||||
to: points.backLegOpeningLeft,
|
|
||||||
y: points.backLegOpeningRight.y + sa - 15,
|
|
||||||
})
|
|
||||||
macro('hd', {
|
|
||||||
from: points.backGussetLeft,
|
|
||||||
to: points.backGussetRight,
|
|
||||||
y: points.backGussetLeft.y + sa + 15,
|
|
||||||
})
|
|
||||||
macro('vd', {
|
|
||||||
from: points.backWaistBandMid,
|
|
||||||
to: points.backGussetMid,
|
|
||||||
x: points.backWaistBandMid.x + sa + 15,
|
|
||||||
})
|
|
||||||
if (options.backExposure >= 0) {
|
|
||||||
macro('pd', {
|
|
||||||
path: new Path()
|
|
||||||
.move(points.backGussetRight)
|
|
||||||
.curve(
|
|
||||||
points.backGussetRightCp1,
|
|
||||||
points.backLegOpeningRightCp1,
|
|
||||||
points.backLegOpeningRight
|
|
||||||
),
|
|
||||||
d: 15,
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
macro('pd', {
|
|
||||||
path: new Path()
|
|
||||||
.move(points.backGussetRight)
|
|
||||||
.curve(points.backGussetRightCp1, points.backFlareRightCp2, points.backFlareRight)
|
|
||||||
.curve(
|
|
||||||
points.backFlareRightCp1,
|
|
||||||
points.backLegOpeningRightCp1,
|
|
||||||
points.backLegOpeningRight
|
|
||||||
),
|
|
||||||
d: 15,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return part
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,80 +1,4 @@
|
||||||
export default function (part) {
|
const method = part => part
|
||||||
let { options, Point, Path, points, paths, measurements, store, complete, sa, paperless, macro } =
|
|
||||||
part.shorthand()
|
|
||||||
return part
|
|
||||||
var yScaleDoubleLayer
|
|
||||||
yScaleDoubleLayer = (1 + store.get('yScale'))/2 // double layer of fabric stretches half as much
|
|
||||||
|
|
||||||
// Create points
|
export default method
|
||||||
points.frontGussetLeft = new Point(store.get('frontGussetLeft').x, 0)
|
|
||||||
points.backGussetLeft = new Point(
|
|
||||||
store.get('backGussetLeft').x,
|
|
||||||
measurements.seat * options.gussetLength * yScaleDoubleLayer
|
|
||||||
)
|
|
||||||
points.frontGussetRight = new Point(store.get('frontGussetRight').x, 0)
|
|
||||||
points.backGussetRight = new Point(
|
|
||||||
store.get('backGussetRight').x,
|
|
||||||
measurements.seat * options.gussetLength * yScaleDoubleLayer
|
|
||||||
)
|
|
||||||
|
|
||||||
// Create control points
|
|
||||||
points.gussetCp1 = points.frontGussetLeft
|
|
||||||
.shiftFractionTowards(points.backGussetLeft, 0.5)
|
|
||||||
.shift(180, points.frontGussetRight.x / -15)
|
|
||||||
|
|
||||||
// Flip points to right side
|
|
||||||
points.gussetCp2 = points.gussetCp1.flipX(store.get('frontGussetMid'))
|
|
||||||
|
|
||||||
// Create point for title
|
|
||||||
points.frontMidMid = points.gussetCp1.shiftFractionTowards(points.gussetCp2, 0.5)
|
|
||||||
|
|
||||||
/* Store lengths for use in elastic */
|
|
||||||
paths.gussetLegOpening = new Path()
|
|
||||||
.move(points.backGussetRight)
|
|
||||||
.curve(points.backGussetRight, points.gussetCp2, points.frontGussetRight)
|
|
||||||
.setRender(false)
|
|
||||||
store.set('gussetSideLength', paths.gussetLegOpening.length())
|
|
||||||
|
|
||||||
// Draw paths
|
|
||||||
paths.seam = new Path()
|
|
||||||
.move(points.frontGussetLeft)
|
|
||||||
.curve(points.gussetCp1, points.backGussetLeft, points.backGussetLeft)
|
|
||||||
.line(points.backGussetRight)
|
|
||||||
.curve(points.backGussetRight, points.gussetCp2, points.frontGussetRight)
|
|
||||||
.line(points.frontGussetLeft) // Without this, doesn't generate seam allowance
|
|
||||||
.close()
|
|
||||||
.attr('class', 'fabric')
|
|
||||||
|
|
||||||
// Complete?
|
|
||||||
if (complete) {
|
|
||||||
if (sa) {
|
|
||||||
paths.sa = paths.seam.offset(sa).attr('class', 'fabric sa')
|
|
||||||
}
|
|
||||||
macro('title', {
|
|
||||||
at: points.frontMidMid,
|
|
||||||
nr: 3,
|
|
||||||
title: 'gusset',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// Paperless?
|
|
||||||
if (paperless) {
|
|
||||||
macro('hd', {
|
|
||||||
from: points.frontGussetLeft,
|
|
||||||
to: points.frontGussetRight,
|
|
||||||
y: points.frontGussetLeft.y + sa + 15,
|
|
||||||
})
|
|
||||||
macro('hd', {
|
|
||||||
from: points.backGussetLeft,
|
|
||||||
to: points.backGussetRight,
|
|
||||||
y: points.backGussetLeft.y + sa + 15,
|
|
||||||
})
|
|
||||||
macro('vd', {
|
|
||||||
from: points.frontGussetRight,
|
|
||||||
to: points.backGussetRight,
|
|
||||||
x: points.frontGussetRight.x + sa + 15,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return part
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,19 +1,11 @@
|
||||||
export default function (part) {
|
export default function (part) {
|
||||||
let {
|
const {
|
||||||
options,
|
|
||||||
Point,
|
|
||||||
Path,
|
|
||||||
points,
|
points,
|
||||||
paths,
|
paths,
|
||||||
measurements,
|
|
||||||
Snippet,
|
Snippet,
|
||||||
snippets,
|
snippets,
|
||||||
store,
|
store,
|
||||||
utils,
|
utils,
|
||||||
complete,
|
|
||||||
sa,
|
|
||||||
paperless,
|
|
||||||
macro,
|
|
||||||
} = part.shorthand()
|
} = part.shorthand()
|
||||||
|
|
||||||
points.waist2 = points.backWaistBandMid
|
points.waist2 = points.backWaistBandMid
|
||||||
|
|
|
@ -1,17 +1,10 @@
|
||||||
export default function (part) {
|
export default function (part) {
|
||||||
let {
|
const {
|
||||||
options,
|
|
||||||
Point,
|
|
||||||
Path,
|
|
||||||
points,
|
points,
|
||||||
paths,
|
paths,
|
||||||
measurements,
|
|
||||||
Snippet,
|
Snippet,
|
||||||
snippets,
|
snippets,
|
||||||
store,
|
store,
|
||||||
utils,
|
|
||||||
complete,
|
|
||||||
sa,
|
|
||||||
paperless,
|
paperless,
|
||||||
macro,
|
macro,
|
||||||
} = part.shorthand()
|
} = part.shorthand()
|
||||||
|
|
|
@ -1,23 +1,17 @@
|
||||||
export default function (part) {
|
export default function (part) {
|
||||||
let {
|
const {
|
||||||
options,
|
|
||||||
Point,
|
Point,
|
||||||
Path,
|
Path,
|
||||||
points,
|
points,
|
||||||
paths,
|
paths,
|
||||||
measurements,
|
|
||||||
Snippet,
|
Snippet,
|
||||||
snippets,
|
snippets,
|
||||||
store,
|
store,
|
||||||
utils,
|
utils,
|
||||||
complete,
|
|
||||||
sa,
|
|
||||||
paperless,
|
|
||||||
macro,
|
|
||||||
} = part.shorthand()
|
} = part.shorthand()
|
||||||
|
|
||||||
// draw markers to indicate elastic distribution
|
// draw markers to indicate elastic distribution
|
||||||
if ((store.get('numLegMarkersFront') < 1) & (store.get('numLegMarkersGusset') > 0)) {
|
if ((store.get('numLegMarkersFront') < 1) && (store.get('numLegMarkersGusset') > 0)) {
|
||||||
// draw first marker, on gusset
|
// draw first marker, on gusset
|
||||||
// use (1 - frac) because the path is drawn from back to front
|
// use (1 - frac) because the path is drawn from back to front
|
||||||
points.leg1L = paths.gussetLegOpening.shiftFractionAlong(1 - store.get('legMarker1Frac'))
|
points.leg1L = paths.gussetLegOpening.shiftFractionAlong(1 - store.get('legMarker1Frac'))
|
||||||
|
@ -27,7 +21,7 @@ export default function (part) {
|
||||||
snippets.leg1R = new Snippet('notch', points.leg1R)
|
snippets.leg1R = new Snippet('notch', points.leg1R)
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
(store.get('numLegMarkersFront') < 2) &
|
(store.get('numLegMarkersFront') < 2) &&
|
||||||
(store.get('numLegMarkersFront') + store.get('numLegMarkersGusset') > 1)
|
(store.get('numLegMarkersFront') + store.get('numLegMarkersGusset') > 1)
|
||||||
) {
|
) {
|
||||||
// draw second marker, on gusset
|
// draw second marker, on gusset
|
||||||
|
@ -39,7 +33,7 @@ export default function (part) {
|
||||||
snippets.leg2R = new Snippet('notch', points.leg2R)
|
snippets.leg2R = new Snippet('notch', points.leg2R)
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
(store.get('numLegMarkersFront') < 3) &
|
(store.get('numLegMarkersFront') < 3) &&
|
||||||
(store.get('numLegMarkersFront') + store.get('numLegMarkersGusset') > 3)
|
(store.get('numLegMarkersFront') + store.get('numLegMarkersGusset') > 3)
|
||||||
) {
|
) {
|
||||||
// draw third marker, on gusset
|
// draw third marker, on gusset
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import path from 'path'
|
|
||||||
import chalk from 'chalk'
|
|
||||||
import { banner } from './banner.mjs'
|
import { banner } from './banner.mjs'
|
||||||
import {
|
import {
|
||||||
checkNodeVersion,
|
checkNodeVersion,
|
||||||
|
@ -20,34 +18,6 @@ export const cli = async () => {
|
||||||
const choices = await getChoices()
|
const choices = await getChoices()
|
||||||
|
|
||||||
// Create environment from template
|
// Create environment from template
|
||||||
const result = createEnvironment(choices)
|
createEnvironment(choices)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
|
|
||||||
const dest = await createLibrary(params)
|
|
||||||
|
|
||||||
console.log(`
|
|
||||||
🎉 ${strings[params.language]['cfp.patternCreated']} ${chalk.bold(dest)}
|
|
||||||
|
|
||||||
${strings[params.language]['cfp.runTheseCommands']}:
|
|
||||||
|
|
||||||
👉 ${chalk.cyan(`cd ${path.join(params.shortName, 'example')} && ${params.manager} start`)}
|
|
||||||
|
|
||||||
${strings[params.language]['cfp.startWebpack']}
|
|
||||||
|
|
||||||
${strings[params.language]['cfp.devDocsAvailableAt']}
|
|
||||||
${chalk.bold('https://freesewing.dev/')}
|
|
||||||
|
|
||||||
${strings[params.language]['cfp.talkToUs']}
|
|
||||||
${chalk.bold('https://discord.freesewing.org/')}
|
|
||||||
|
|
||||||
`
|
|
||||||
)
|
|
||||||
|
|
||||||
return dest
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { config } from './config.mjs'
|
import { config } from './config.mjs'
|
||||||
import { mkdir, readFile, writeFile, copyFile } from 'node:fs/promises'
|
import { mkdir, readFile, writeFile, copyFile } from 'node:fs/promises'
|
||||||
import { join, resolve, dirname, extname } from 'path'
|
import { join, dirname } from 'path'
|
||||||
import mustache from 'mustache'
|
import mustache from 'mustache'
|
||||||
import rdir from 'recursive-readdir'
|
import rdir from 'recursive-readdir'
|
||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import Logo from 'shared/components/logos/freesewing.js'
|
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import ThemePicker from 'shared/components/theme-picker.js'
|
import ThemePicker from 'shared/components/theme-picker.js'
|
||||||
import LocalePicker from 'shared/components/locale-picker.js'
|
import LocalePicker from 'shared/components/locale-picker.js'
|
||||||
import CloseIcon from 'shared/components/icons/close.js'
|
import CloseIcon from 'shared/components/icons/close.js'
|
||||||
import MenuIcon from 'shared/components/icons/menu.js'
|
import MenuIcon from 'shared/components/icons/menu.js'
|
||||||
import DocsIcon from 'shared/components/icons/docs.js'
|
import DocsIcon from 'shared/components/icons/docs.js'
|
||||||
import HelpIcon from 'shared/components/icons/help.js'
|
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
|
|
||||||
const Right = props => (
|
const Right = props => (
|
||||||
|
|
|
@ -1,59 +1,7 @@
|
||||||
import React from 'react'
|
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import Link from 'next/link'
|
|
||||||
// Shared components
|
|
||||||
import Logo from 'shared/components/logos/freesewing.js'
|
|
||||||
import Aside from 'shared/components/navigation/aside'
|
import Aside from 'shared/components/navigation/aside'
|
||||||
import get from 'lodash.get'
|
|
||||||
import { BeforeNav } from './lab'
|
import { BeforeNav } from './lab'
|
||||||
|
|
||||||
const PageTitle = ({ app, slug, title }) => {
|
|
||||||
if (title) return <h1>{title}</h1>
|
|
||||||
if (slug) return <h1>{get(app.navigation, slug.split('/')).__title}</h1>
|
|
||||||
|
|
||||||
return <h1>FIXME: This page has no title</h1>
|
|
||||||
}
|
|
||||||
|
|
||||||
const Breadcrumbs = ({ app, slug=false, title }) => {
|
|
||||||
if (!slug) return null
|
|
||||||
const crumbs = []
|
|
||||||
const chunks = slug.split('/')
|
|
||||||
for (const i in chunks) {
|
|
||||||
const j = parseInt(i)+parseInt(1)
|
|
||||||
const page = get(app.navigation, chunks.slice(0,j))
|
|
||||||
if (page) crumbs.push([page.__linktitle, '/'+chunks.slice(0,j).join('/'), (j < chunks.length)])
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ul className="flex flex-row flex-wrap gap-2 font-bold">
|
|
||||||
<li>
|
|
||||||
<Link href="/">
|
|
||||||
<a title="To the homepage" className="text-base-content">
|
|
||||||
<Logo size={24} fill="currentColor" stroke={false}/>
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
{crumbs.map(crumb => (
|
|
||||||
<React.Fragment key={crumb[1]}>
|
|
||||||
<li className="text-base-content">»</li>
|
|
||||||
<li>
|
|
||||||
{crumb[2]
|
|
||||||
? (
|
|
||||||
<Link href={crumb[1]}>
|
|
||||||
<a title={crumb[0]} className="text-secondary hover:text-secondary-focus">
|
|
||||||
{crumb[0]}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
: <span className="text-base-content">{crumb[0]}</span>
|
|
||||||
}
|
|
||||||
</li>
|
|
||||||
</React.Fragment>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const DefaultLayout = ({ app, title=false, children=[] }) => {
|
const DefaultLayout = ({ app, title=false, children=[] }) => {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const slug = router.asPath.slice(1)
|
const slug = router.asPath.slice(1)
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { useRouter } from 'next/router'
|
|
||||||
import Link from 'next/link'
|
|
||||||
import Aside from 'shared/components/navigation/aside'
|
import Aside from 'shared/components/navigation/aside'
|
||||||
|
|
||||||
const DocsLayout = ({ app, title=false, children=[] }) => (
|
const DocsLayout = ({ app, title=false, children=[] }) => (
|
||||||
|
|
|
@ -3,15 +3,12 @@ import { useState } from 'react'
|
||||||
import useLocalStorage from 'shared/hooks/useLocalStorage.js'
|
import useLocalStorage from 'shared/hooks/useLocalStorage.js'
|
||||||
// Locale and translation
|
// Locale and translation
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import { useTranslation } from 'next-i18next'
|
|
||||||
import { capitalize } from 'shared/utils.mjs'
|
|
||||||
import useTheme from 'shared/hooks/useTheme'
|
import useTheme from 'shared/hooks/useTheme'
|
||||||
|
|
||||||
function useApp(full = true) {
|
function useApp(full = true) {
|
||||||
|
|
||||||
// Load translation method
|
// Load translation method
|
||||||
const locale = useRouter().locale
|
const locale = useRouter().locale
|
||||||
const { t } = useTranslation(['app'])
|
|
||||||
|
|
||||||
// Persistent state
|
// Persistent state
|
||||||
const [account, setAccount] = useLocalStorage('account', { username: false })
|
const [account, setAccount] = useLocalStorage('account', { username: false })
|
||||||
|
|
|
@ -3,9 +3,6 @@ import useApp from 'site/hooks/useApp.js'
|
||||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
import Layout from 'site/components/layouts/docs'
|
import Layout from 'site/components/layouts/docs'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import ConfigIcon from 'shared/components/icons/settings'
|
|
||||||
import CogIcon from 'shared/components/icons/cog'
|
|
||||||
import HeartIcon from 'shared/components/icons/heart'
|
|
||||||
import FsIcon from 'shared/components/icons/freesewing'
|
import FsIcon from 'shared/components/icons/freesewing'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import Popout from 'shared/components/popout'
|
import Popout from 'shared/components/popout'
|
||||||
|
@ -13,8 +10,6 @@ import LocaleIcon from 'shared/components/icons/i18n.js'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import themes from 'shared/themes/index.js'
|
import themes from 'shared/themes/index.js'
|
||||||
|
|
||||||
const gh = `<a class="text-secondary hover:text-secondary-focus"
|
|
||||||
href="https://github.com/freesewing/freesewing">freesewing/freesewing</a>`
|
|
||||||
const fsd = `<a class="text-secondary hover:text-secondary-focus"
|
const fsd = `<a class="text-secondary hover:text-secondary-focus"
|
||||||
href="https://freesewing.dev">freesewing.dev</a>`
|
href="https://freesewing.dev">freesewing.dev</a>`
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
import Layout from 'site/components/layouts/docs'
|
import Layout from 'site/components/layouts/docs'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import DiscordIcon from 'shared/components/icons/discord'
|
import DiscordIcon from 'shared/components/icons/discord'
|
||||||
import Popout from 'shared/components/popout'
|
|
||||||
import GithubIcon from 'shared/components/icons/github'
|
import GithubIcon from 'shared/components/icons/github'
|
||||||
import CcIcon from 'shared/components/icons/community'
|
import CcIcon from 'shared/components/icons/community'
|
||||||
import HeartIcon from 'shared/components/icons/heart'
|
import HeartIcon from 'shared/components/icons/heart'
|
||||||
|
@ -35,13 +34,6 @@ const translations = {
|
||||||
vrijwilligers de lopende zaken bespreken. Ook de plannen voor de toekomst en groot en klein
|
vrijwilligers de lopende zaken bespreken. Ook de plannen voor de toekomst en groot en klein
|
||||||
nieuws over FreeSewing en de gemeenschap komen aan bod.`
|
nieuws over FreeSewing en de gemeenschap komen aan bod.`
|
||||||
},
|
},
|
||||||
cc: {
|
|
||||||
en: `Every two weeks, there's the FreeSewing contributor call, which is when we discuss
|
|
||||||
ongoing issues, future plans, and news big and small about FreeSewing and its community.`,
|
|
||||||
nl: `Elke twee weken is er de FreeSewing contributor call (Engelstalig), waar de FreeSewing
|
|
||||||
vrijwilligers de lopende zaken bespreken. Ook de plannen voor de toekomst en groot en klein
|
|
||||||
nieuws over FreeSewing en de gemeenschap komen aan bod.`
|
|
||||||
},
|
|
||||||
docs: {
|
docs: {
|
||||||
en: `Our documentation for developers hosted on ${fsd}. You can find guides and how-to's
|
en: `Our documentation for developers hosted on ${fsd}. You can find guides and how-to's
|
||||||
there, as well as reference documantation for FreeSewing's core API.
|
there, as well as reference documantation for FreeSewing's core API.
|
||||||
|
|
|
@ -7,9 +7,6 @@ import mustache from 'mustache'
|
||||||
import { execSync } from 'child_process'
|
import { execSync } from 'child_process'
|
||||||
// Software
|
// Software
|
||||||
import designs from '../config/software/designs.json'
|
import designs from '../config/software/designs.json'
|
||||||
import packages from '../config/software//packages.json'
|
|
||||||
import plugins from '../config/software//plugins.json'
|
|
||||||
import sites from '../config/software//sites.json'
|
|
||||||
|
|
||||||
const type = process.argv[2]
|
const type = process.argv[2]
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import glob from 'glob'
|
||||||
import yaml from 'js-yaml'
|
import yaml from 'js-yaml'
|
||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
import mustache from 'mustache'
|
import mustache from 'mustache'
|
||||||
import { capitalize } from '../sites/shared/utils.mjs'
|
|
||||||
import conf from '../lerna.json'
|
import conf from '../lerna.json'
|
||||||
const { version } = conf
|
const { version } = conf
|
||||||
import {
|
import {
|
||||||
|
@ -81,18 +80,18 @@ for (const pkg of Object.values(software)) {
|
||||||
}
|
}
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
path.join(cwd, pkg.folder, pkg.name, 'CHANGELOG.md'),
|
path.join(cwd, pkg.folder, pkg.name, 'CHANGELOG.md'),
|
||||||
changelog(pkg, repo)
|
changelog(pkg)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
log.write(chalk.green(" Done\n"))
|
log.write(chalk.green(" Done\n"))
|
||||||
|
|
||||||
// Step 3: Generate overall CHANGELOG.md
|
// Step 4: Generate overall CHANGELOG.md
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
path.join(repo.path, 'CHANGELOG.md'),
|
path.join(repo.path, 'CHANGELOG.md'),
|
||||||
changelog('global', repo)
|
changelog('global')
|
||||||
)
|
)
|
||||||
|
|
||||||
// Step 6: Generate build script for published software
|
// Step 5: Generate build script for published software
|
||||||
log.write(chalk.blueBright('Generating buildall node script...'))
|
log.write(chalk.blueBright('Generating buildall node script...'))
|
||||||
const buildSteps = buildOrder.map((step, i) => `lerna run cibuild_step${i}`);
|
const buildSteps = buildOrder.map((step, i) => `lerna run cibuild_step${i}`);
|
||||||
const buildAllCommand = buildSteps.join(' && ');
|
const buildAllCommand = buildSteps.join(' && ');
|
||||||
|
@ -104,7 +103,7 @@ fs.writeFileSync(
|
||||||
)
|
)
|
||||||
log.write(chalk.green(" Done\n"))
|
log.write(chalk.green(" Done\n"))
|
||||||
|
|
||||||
// Step 7: Generate tests for designs and plugins
|
// Step 6: Generate tests for designs and plugins
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -435,38 +434,3 @@ function validate() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Puts a package.json, build.js, README.md, and CHANGELOG.md
|
|
||||||
* into every subdirectory under the packages directory.
|
|
||||||
* Also adds unit tests for patterns, and writes the global CHANGELOG.md.
|
|
||||||
*/
|
|
||||||
function reconfigure(pkgs, repo) {
|
|
||||||
for (const pkg of pkgs) {
|
|
||||||
console.log(chalk.blueBright(`Reconfiguring ${pkg}`))
|
|
||||||
//if (repo.exceptions.customPackageJson.indexOf(pkg) === -1) {
|
|
||||||
// const pkgConfig = packageConfig(pkg, repo)
|
|
||||||
// fs.writeFileSync(
|
|
||||||
// path.join(repo.path, 'packages', pkg, 'package.json'),
|
|
||||||
// JSON.stringify(pkgConfig, null, 2) + '\n'
|
|
||||||
// )
|
|
||||||
//}
|
|
||||||
//if (repo.exceptions.customBuild.indexOf(pkg) === -1) {
|
|
||||||
// fs.writeFileSync(
|
|
||||||
// path.join(repo.path, 'packages', pkg, 'build.js'),
|
|
||||||
// repo.templates.build
|
|
||||||
// )
|
|
||||||
//}
|
|
||||||
//if (repo.exceptions.customReadme.indexOf(pkg) === -1) {
|
|
||||||
// fs.writeFileSync(path.join(repo.path, 'packages', pkg, 'README.md'), readme(pkg, repo))
|
|
||||||
//}
|
|
||||||
if (repo.exceptions.customChangelog.indexOf(pkg) === -1) {
|
|
||||||
fs.writeFileSync(
|
|
||||||
path.join(repo.path, 'packages', pkg, 'CHANGELOG.md'),
|
|
||||||
changelog(pkg, repo)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
const type = packageType(pkg, repo)
|
|
||||||
}
|
|
||||||
fs.writeFileSync(path.join(repo.path, 'CHANGELOG.md'), changelog('global', repo))
|
|
||||||
console.log(chalk.yellowBright.bold('All done.'))
|
|
||||||
}
|
|
||||||
|
|
|
@ -66,7 +66,6 @@ const bearer = token => ({
|
||||||
* Exported because it's re-used by the Algolia indexing script
|
* Exported because it's re-used by the Algolia indexing script
|
||||||
*/
|
*/
|
||||||
const getContent = async (lang, type) => {
|
const getContent = async (lang, type) => {
|
||||||
const items = {}
|
|
||||||
let res
|
let res
|
||||||
try {
|
try {
|
||||||
res = await axios.get(`${uris[type]}&_locale=${lang}`)
|
res = await axios.get(`${uris[type]}&_locale=${lang}`)
|
||||||
|
@ -82,7 +81,7 @@ const getContent = async (lang, type) => {
|
||||||
/*
|
/*
|
||||||
* Adds maker to showcase post
|
* Adds maker to showcase post
|
||||||
*/
|
*/
|
||||||
const addMaker = (content, lang, token, makers) => {
|
const addMaker = (content, token, makers) => {
|
||||||
const promises = []
|
const promises = []
|
||||||
for (const item of content) {
|
for (const item of content) {
|
||||||
promises.push(axios.put(
|
promises.push(axios.put(
|
||||||
|
@ -112,7 +111,7 @@ const addAuthors = async (type, token) => {
|
||||||
|
|
||||||
for (const lang of languages) {
|
for (const lang of languages) {
|
||||||
const content = await getContent(lang, type)
|
const content = await getContent(lang, type)
|
||||||
if (type === 'showcaseposts') await addMaker(content, lang, token, makers)
|
if (type === 'showcaseposts') await addMaker(content, token, makers)
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
@ -133,7 +132,6 @@ const getToWork = async () => {
|
||||||
console.log('Failed to login to strapi')
|
console.log('Failed to login to strapi')
|
||||||
process.exit()
|
process.exit()
|
||||||
}
|
}
|
||||||
const translations = languages.length - 1
|
|
||||||
for (const type of Object.keys(uris)) {
|
for (const type of Object.keys(uris)) {
|
||||||
console.log(`Loading ${type} from Strapi`)
|
console.log(`Loading ${type} from Strapi`)
|
||||||
await addAuthors(type, token)
|
await addAuthors(type, token)
|
||||||
|
|
|
@ -246,7 +246,6 @@ const getToWork = async () => {
|
||||||
process.exit()
|
process.exit()
|
||||||
}
|
}
|
||||||
const content = {}
|
const content = {}
|
||||||
const translations = languages.length - 1
|
|
||||||
for (const type of Object.keys(uris)) {
|
for (const type of Object.keys(uris)) {
|
||||||
console.log(`Loading ${type} from Strapi`)
|
console.log(`Loading ${type} from Strapi`)
|
||||||
content[type] = await getContent(type)
|
content[type] = await getContent(type)
|
||||||
|
|
|
@ -3,10 +3,7 @@ import OsiLogo from 'shared/components/logos/osi.js'
|
||||||
import CreativeCommonsLogo from 'shared/components/logos/cc.js'
|
import CreativeCommonsLogo from 'shared/components/logos/cc.js'
|
||||||
import CcByLogo from 'shared/components/logos/cc-by.js'
|
import CcByLogo from 'shared/components/logos/cc-by.js'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import PageLink from 'shared/components/page-link'
|
|
||||||
import DocsLink from 'shared/components/docs-link'
|
|
||||||
import PinkedRibbon from 'shared/components/pinked-ribbon.js'
|
import PinkedRibbon from 'shared/components/pinked-ribbon.js'
|
||||||
import Worm from 'shared/components/worm.js'
|
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
|
|
||||||
import DiscordIcon from 'shared/components/icons/discord.js'
|
import DiscordIcon from 'shared/components/icons/discord.js'
|
||||||
|
|
|
@ -1,59 +1,7 @@
|
||||||
import React from 'react'
|
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import Link from 'next/link'
|
|
||||||
// Shared components
|
|
||||||
import Logo from 'shared/components/logos/freesewing.js'
|
|
||||||
import Aside from 'shared/components/navigation/aside'
|
import Aside from 'shared/components/navigation/aside'
|
||||||
import get from 'lodash.get'
|
|
||||||
import ThemePicker from 'shared/components/theme-picker'
|
import ThemePicker from 'shared/components/theme-picker'
|
||||||
|
|
||||||
const PageTitle = ({ app, slug, title }) => {
|
|
||||||
if (title) return <h1>{title}</h1>
|
|
||||||
if (slug) return <h1>{get(app.navigation, slug.split('/')).__title}</h1>
|
|
||||||
|
|
||||||
return <h1>FIXME: This page has no title</h1>
|
|
||||||
}
|
|
||||||
|
|
||||||
const Breadcrumbs = ({ app, slug=false, title }) => {
|
|
||||||
if (!slug) return null
|
|
||||||
const crumbs = []
|
|
||||||
const chunks = slug.split('/')
|
|
||||||
for (const i in chunks) {
|
|
||||||
const j = parseInt(i)+parseInt(1)
|
|
||||||
const page = get(app.navigation, chunks.slice(0,j))
|
|
||||||
if (page) crumbs.push([page.__linktitle, '/'+chunks.slice(0,j).join('/'), (j < chunks.length)])
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ul className="flex flex-row flex-wrap gap-2 font-bold">
|
|
||||||
<li>
|
|
||||||
<Link href="/">
|
|
||||||
<a title="To the homepage" className="text-base-content">
|
|
||||||
<Logo size={24} fill="currentColor" stroke={false}/>
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
{crumbs.map(crumb => (
|
|
||||||
<React.Fragment key={crumb[1]}>
|
|
||||||
<li className="text-base-content">»</li>
|
|
||||||
<li>
|
|
||||||
{crumb[2]
|
|
||||||
? (
|
|
||||||
<Link href={crumb[1]}>
|
|
||||||
<a title={crumb[0]} className="text-secondary hover:text-secondary-focus">
|
|
||||||
{crumb[0]}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
: <span className="text-base-content">{crumb[0]}</span>
|
|
||||||
}
|
|
||||||
</li>
|
|
||||||
</React.Fragment>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const DefaultLayout = ({ app, title=false, children=[] }) => {
|
const DefaultLayout = ({ app, title=false, children=[] }) => {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const slug = router.asPath.slice(1)
|
const slug = router.asPath.slice(1)
|
||||||
|
|
|
@ -20,10 +20,7 @@ const DefaultLayout = ({ app, title=false, crumbs=false, children=[] }) => {
|
||||||
{title && (
|
{title && (
|
||||||
<>
|
<>
|
||||||
<Breadcrumbs title={title} crumbs={breadcrumbs} />
|
<Breadcrumbs title={title} crumbs={breadcrumbs} />
|
||||||
{title
|
<h1>{title}</h1>
|
||||||
? <h1>{title}</h1>
|
|
||||||
: <h1>{app.getTitle(slug)}</h1>
|
|
||||||
}
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{children}
|
{children}
|
||||||
|
|
|
@ -25,7 +25,6 @@ const LayoutWrapper = ({
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
router.events?.on('routeChangeStart', startNavigation)
|
router.events?.on('routeChangeStart', startNavigation)
|
||||||
router.events?.on('routeChangeComplete', () => app.stopLoading())
|
router.events?.on('routeChangeComplete', () => app.stopLoading())
|
||||||
const slug = router.asPath.slice(1)
|
|
||||||
const [collapsePrimaryNav, setCollapsePrimaryNav] = useState(workbench || false)
|
const [collapsePrimaryNav, setCollapsePrimaryNav] = useState(workbench || false)
|
||||||
const [collapseAltMenu, setCollapseAltMenu] = useState(false)
|
const [collapseAltMenu, setCollapseAltMenu] = useState(false)
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,6 @@ import Docs from 'site/components/layouts/docs'
|
||||||
// Add feeds
|
// Add feeds
|
||||||
import Feeds from 'site/components/feeds.js'
|
import Feeds from 'site/components/feeds.js'
|
||||||
|
|
||||||
const layouts = {
|
|
||||||
docs: Docs,
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This component should wrap all page content */
|
/* This component should wrap all page content */
|
||||||
const PageWrapper= ({
|
const PageWrapper= ({
|
||||||
title="FIXME: No title set",
|
title="FIXME: No title set",
|
||||||
|
|
|
@ -4,11 +4,9 @@ import { banner } from '../../scripts/banner.mjs'
|
||||||
|
|
||||||
const config = configBuilder('dev')
|
const config = configBuilder('dev')
|
||||||
config.i18n = i18nConfig.i18n
|
config.i18n = i18nConfig.i18n
|
||||||
let greeting = false
|
|
||||||
if (!greeting) {
|
// Say hi
|
||||||
greeting = true
|
console.log(banner+"\n")
|
||||||
console.log(banner+"\n")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Suppress warnings about importing version from package.json
|
// Suppress warnings about importing version from package.json
|
||||||
// We'll deal with it in v3 of FreeSewing
|
// We'll deal with it in v3 of FreeSewing
|
||||||
|
|
|
@ -3,16 +3,12 @@ import useApp from 'site/hooks/useApp.js'
|
||||||
import TimeAgo from 'react-timeago'
|
import TimeAgo from 'react-timeago'
|
||||||
import MdxWrapper from 'shared/components/wrappers/mdx'
|
import MdxWrapper from 'shared/components/wrappers/mdx'
|
||||||
import mdxCompiler from 'shared/mdx/compiler'
|
import mdxCompiler from 'shared/mdx/compiler'
|
||||||
import Markdown from 'react-markdown'
|
|
||||||
import Head from 'next/head'
|
import Head from 'next/head'
|
||||||
import Lightbox from 'shared/components/lightbox.js'
|
import Lightbox from 'shared/components/lightbox.js'
|
||||||
import ImageWrapper from 'shared/components/wrappers/img.js'
|
import ImageWrapper from 'shared/components/wrappers/img.js'
|
||||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
import { strapiHost } from 'shared/config/freesewing.mjs'
|
import { strapiHost } from 'shared/config/freesewing.mjs'
|
||||||
import { strapiImage } from 'shared/utils'
|
import { strapiImage } from 'shared/utils'
|
||||||
import { useTranslation } from 'next-i18next'
|
|
||||||
|
|
||||||
const strapi = "https://posts.freesewing.org"
|
|
||||||
|
|
||||||
const Author = ({ author }) => (
|
const Author = ({ author }) => (
|
||||||
<div id="author" className="flex flex-col lg:flex-row m-auto p-2 items-center">
|
<div id="author" className="flex flex-col lg:flex-row m-auto p-2 items-center">
|
||||||
|
|
|
@ -2,10 +2,9 @@ import Page from 'site/components/wrappers/page.js'
|
||||||
import useApp from 'site/hooks/useApp.js'
|
import useApp from 'site/hooks/useApp.js'
|
||||||
import Head from 'next/head'
|
import Head from 'next/head'
|
||||||
import HelpUs from 'site/components/help-us.js'
|
import HelpUs from 'site/components/help-us.js'
|
||||||
import Link from 'next/link'
|
|
||||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
import Layout from 'site/components/layouts/bare'
|
import Layout from 'site/components/layouts/bare'
|
||||||
import Navigation, { Icons } from 'shared/components/navigation/primary'
|
import { Icons } from 'shared/components/navigation/primary'
|
||||||
import Highlight from 'shared/components/mdx/highlight'
|
import Highlight from 'shared/components/mdx/highlight'
|
||||||
import Popout from 'shared/components/popout'
|
import Popout from 'shared/components/popout'
|
||||||
import WebLink from 'shared/components/web-link'
|
import WebLink from 'shared/components/web-link'
|
||||||
|
|
|
@ -142,7 +142,7 @@ const indexMarkdownContent = async () => {
|
||||||
|
|
||||||
const run = async () => {
|
const run = async () => {
|
||||||
if (
|
if (
|
||||||
(process.env.NETLIFY && process.env.CONTEXT === 'production' && false) // disabled for now
|
(process.env.NETLIFY && process.env.CONTEXT === 'production')
|
||||||
|| process.env.FORCE_ALGOLIA
|
|| process.env.FORCE_ALGOLIA
|
||||||
) {
|
) {
|
||||||
await indexMarkdownContent()
|
await indexMarkdownContent()
|
||||||
|
|
|
@ -15,8 +15,6 @@ import TwitterIcon from 'shared/components/icons/twitter.js'
|
||||||
|
|
||||||
// Classes
|
// Classes
|
||||||
const link = "text-secondary font-bold hover:pointer hover:underline px-1"
|
const link = "text-secondary font-bold hover:pointer hover:underline px-1"
|
||||||
const accent = "text-accent font-bold text-lg px-1 block sm:inline"
|
|
||||||
const freesewing = "px-1 text-lg font-bold block sm:inline"
|
|
||||||
|
|
||||||
// Keep these translations in the component because they're only used here
|
// Keep these translations in the component because they're only used here
|
||||||
const translations = {
|
const translations = {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import Logo from 'shared/components/logos/freesewing.js'
|
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import ThemePicker from 'shared/components/theme-picker.js'
|
import ThemePicker from 'shared/components/theme-picker.js'
|
||||||
import LocalePicker from 'shared/components/locale-picker.js'
|
import LocalePicker from 'shared/components/locale-picker.js'
|
||||||
|
|
|
@ -1,58 +1,7 @@
|
||||||
import React from 'react'
|
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import Link from 'next/link'
|
|
||||||
// Shared components
|
|
||||||
import Logo from 'shared/components/logos/freesewing.js'
|
|
||||||
import Aside from 'shared/components/navigation/aside'
|
import Aside from 'shared/components/navigation/aside'
|
||||||
import get from 'lodash.get'
|
|
||||||
import { BeforeNav } from './lab'
|
import { BeforeNav } from './lab'
|
||||||
|
|
||||||
const PageTitle = ({ app, slug, title }) => {
|
|
||||||
if (title) return <h1>{title}</h1>
|
|
||||||
if (slug) return <h1>{get(app.navigation, slug.split('/')).__title}</h1>
|
|
||||||
|
|
||||||
return <h1>FIXME: This page has no title</h1>
|
|
||||||
}
|
|
||||||
|
|
||||||
const Breadcrumbs = ({ app, slug=false, title }) => {
|
|
||||||
if (!slug) return null
|
|
||||||
const crumbs = []
|
|
||||||
const chunks = slug.split('/')
|
|
||||||
for (const i in chunks) {
|
|
||||||
const j = parseInt(i)+parseInt(1)
|
|
||||||
const page = get(app.navigation, chunks.slice(0,j))
|
|
||||||
if (page) crumbs.push([page.__linktitle, '/'+chunks.slice(0,j).join('/'), (j < chunks.length)])
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ul className="flex flex-row flex-wrap gap-2 font-bold">
|
|
||||||
<li>
|
|
||||||
<Link href="/">
|
|
||||||
<a title="To the homepage" className="text-base-content">
|
|
||||||
<Logo size={24} fill="currentColor" stroke={false}/>
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
</li>
|
|
||||||
{crumbs.map(crumb => (
|
|
||||||
<React.Fragment key={crumb[1]}>
|
|
||||||
<li className="text-base-content">»</li>
|
|
||||||
<li>
|
|
||||||
{crumb[2]
|
|
||||||
? (
|
|
||||||
<Link href={crumb[1]}>
|
|
||||||
<a title={crumb[0]} className="text-secondary hover:text-secondary-focus">
|
|
||||||
{crumb[0]}
|
|
||||||
</a>
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
: <span className="text-base-content">{crumb[0]}</span>
|
|
||||||
}
|
|
||||||
</li>
|
|
||||||
</React.Fragment>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const DefaultLayout = ({ app, title=false, children=[] }) => {
|
const DefaultLayout = ({ app, title=false, children=[] }) => {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue