1
0
Fork 0

chore(brian): Switch to new conditional bust plugin export

This commit is contained in:
Joost De Cock 2022-08-28 14:52:18 +02:00
parent 610302ac21
commit e11571f1e1
3 changed files with 13 additions and 20 deletions

View file

@ -38,7 +38,7 @@
"vbuild": "VERBOSE=1 node --experimental-json-modules build.mjs",
"lab": "cd ../../sites/lab && yarn start",
"tips": "node ../../scripts/help.mjs",
"prettier": "npx prettier --write 'src/*.js'",
"prettier": "npx prettier --write 'src/*.mjs' 'tests/*.mjs'",
"testci": "npx mocha tests/*.test.mjs --reporter ../../tests/reporters/terse.js",
"cibuild_step3": "node --experimental-json-modules build.mjs"
},

View file

@ -1,31 +1,25 @@
// FreeSewing core library
import freesewing from '@freesewing/core'
// FreeSewing Design constructor
import { Design } from '@freesewing/core'
// FreeSewing Plugins
import pluginBundle from '@freesewing/plugin-bundle'
import bustPlugin from '@freesewing/plugin-bust'
import { pluginBundle } from '@freesewing/plugin-bundle'
import { withCondition as bustPlugin } from '@freesewing/plugin-bust'
// Design parts
import { back } from './back.mjs'
import { front } from './front.mjs'
import { sleeve } from './sleeve.mjs'
// Get name & version from package.json
import { name, version } from '../package.json' assert { type: 'json' }
import { name, version } from '../package.json'
// Re-export skeleton parts so peope can re-use them
import { base } from './base.mjs'
import { sleevecap } from './sleevecap.mjs'
// Setup our new design
const Brian = new freesewing.Design({
const Brian = new Design({
name,
version,
parts: [ back, front, sleeve ],
plugins: pluginBundle,
conditionalPlugins: {
plugin: bustPlugin,
condition: (settings=false) =>
settings?.options?.draftForHighBust &&
settings?.measurements?.highBust
? true : false
}
conditionalPlugins: bustPlugin
})
// Named exports

View file

@ -1,5 +1,4 @@
// This file is auto-generated.
// Changes you make will be overwritten.
// This file is auto-generated | Any changes you make will be overwritten.
import { Brian } from './dist/index.mjs'
// Shared tests
@ -10,8 +9,8 @@ import { testPatternSampling } from '../../../tests/designs/sampling.mjs'
// Test config
testPatternConfig(Brian)
// Test drafting
//testPatternDrafting("brian", Pattern)
// Test drafting - Change the second parameter to `true` to log errors
testPatternDrafting(Brian, false)
// Test sampling
//testPatternSampling( "brian", Pattern)
// Test sampling - Change the second parameter to `true` to log errors
testPatternSampling(Brian, false)