1
0
Fork 0
freesewing/packages/new-design/templates/shared/index.mjs.mustache

38 lines
1,009 B
Text

{{!
// Change the Mustache delimiter from double curly braces to double dollar signs.
// Dollar signs are allowed in EcmaScript identifier names,
// which is helpful when running unrendered Mustache templates through eslint.
//}}{{=$$ $$=}}
// Import Design constructor
import { Design } from '@freesewing/core'
// Import parts
$$#parts$$
import { $$.$$ } from './$$.$$.mjs'
$$/parts$$
// Create the new design
const $$Name$$ = new Design({
data: {
/*
* If you like, you can add any data you want to your design.
* We'll add the name here as an example.
*
* If you don't use this,
* you can remove this data key enterely.
*/
name: "$$ Name $$",
},
// A list of parts is all that is required.
parts: [ $$parts$$ ],
})
const Pattern = $$Name$$
/*
* Named exports
*
* We export the design itself as well as each part individually.
* This allows us to re-use these parts in other designs.
*/
export {$$#parts$$ $$.$$,$$/parts$$ $$Name$$, Pattern }