inherited designs all use base templates
This commit is contained in:
parent
6c901e80eb
commit
af4185b126
31 changed files with 108 additions and 2729 deletions
|
@ -1,15 +1,9 @@
|
|||
import { banner } from './banner.mjs'
|
||||
import {
|
||||
checkNodeVersion,
|
||||
getChoices,
|
||||
createEnvironment,
|
||||
} from './utils.mjs'
|
||||
|
||||
// import { banner } from './banner.mjs'
|
||||
import { checkNodeVersion, getChoices, createEnvironment } from './utils.mjs'
|
||||
|
||||
export const cli = async () => {
|
||||
|
||||
// Make it pretty
|
||||
console.log(banner+"\n")
|
||||
// console.log(banner+"\n")
|
||||
|
||||
// Make sure we have a valid NodeJS version
|
||||
checkNodeVersion()
|
||||
|
@ -20,4 +14,3 @@ export const cli = async () => {
|
|||
// Create environment from template
|
||||
createEnvironment(choices)
|
||||
}
|
||||
|
||||
|
|
|
@ -123,11 +123,17 @@ const ensureDir = async (file, suppress = false) => {
|
|||
}
|
||||
}
|
||||
|
||||
const writeTemplateFile = async (to, template, args) => {
|
||||
if (!dirs[to]) await ensureDir(to)
|
||||
|
||||
return writeFile(to, mustache.render(template, args))
|
||||
}
|
||||
// Helper method to copy template files
|
||||
const copyTemplate = async (config, choices) => {
|
||||
// Copy files in parallel rather than using await
|
||||
const promises = []
|
||||
|
||||
// const templateConfig
|
||||
// Copy shared files
|
||||
for (const from of config.files.shared) {
|
||||
// FIXME: Explain the -7
|
||||
|
@ -136,16 +142,60 @@ const copyTemplate = async (config, choices) => {
|
|||
promises.push(copyFile(from, to))
|
||||
}
|
||||
|
||||
// Template files
|
||||
for (const from of config.files.template) {
|
||||
let to = join(config.dest, from.slice(config.source.template.length - 7))
|
||||
if (to.slice(-9) === '.mustache') to = to.slice(0, -9)
|
||||
if (!dirs[to]) await ensureDir(to)
|
||||
// Template out file
|
||||
const src = await readFile(from, 'utf-8')
|
||||
promises.push(writeFile(to, mustache.render(src, { name: choices.name, tag: config.tag })))
|
||||
// Template the package.json
|
||||
const packageJsonTemplate = await readFile(config.files.templates['package.json'], 'utf-8')
|
||||
const packageJsonTo = join(config.dest, 'package.json')
|
||||
promises.push(
|
||||
writeTemplateFile(packageJsonTo, packageJsonTemplate, {
|
||||
name: choices.name,
|
||||
tag: config.tag,
|
||||
dependencies: config.templateData.dependencies,
|
||||
})
|
||||
)
|
||||
|
||||
const designSrcDir = join(config.dest, 'design/src')
|
||||
|
||||
// Template the index file
|
||||
const indexTemplate = await readFile(config.files.templates['index'], 'utf-8')
|
||||
const indexTo = join(designSrcDir, 'index.mjs')
|
||||
promises.push(
|
||||
writeTemplateFile(indexTo, indexTemplate, {
|
||||
name: choices.name,
|
||||
parts: config.templateData.parts,
|
||||
})
|
||||
)
|
||||
|
||||
// Template the parts
|
||||
if (choices.template !== 'scratch') {
|
||||
const partTemplate = await readFile(config.files.templates['inherited-part'], 'utf-8')
|
||||
const baseConfig = {
|
||||
baseName: choices.template,
|
||||
baseNameUpcase: choices.template[0].toUpperCase() + choices.template.slice(1),
|
||||
name: choices.name,
|
||||
}
|
||||
|
||||
config.templateData.parts.forEach(async (p) => {
|
||||
const to = join(designSrcDir, `${p}.mjs`)
|
||||
promises.push(
|
||||
writeTemplateFile(to, partTemplate, {
|
||||
part: p,
|
||||
partUpcase: p[0].toUpperCase() + p.slice(1),
|
||||
...baseConfig,
|
||||
})
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
// // Template files
|
||||
// for (const from of config.files.template) {
|
||||
// let to = join(config.dest, from.slice(config.source.template.length - 7))
|
||||
// if (to.slice(-9) === '.mustache') to = to.slice(0, -9)
|
||||
// if (!dirs[to]) await ensureDir(to)
|
||||
// // Template out file
|
||||
// const src = await readFile(from, 'utf-8')
|
||||
// promises.push(writeFile(to, mustache.render(src, { name: choices.name, tag: config.tag })))
|
||||
// }
|
||||
|
||||
await Promise.all(promises)
|
||||
|
||||
return
|
||||
|
@ -256,7 +306,8 @@ export const createEnvironment = async (choices) => {
|
|||
;(config.cwd = cwd),
|
||||
(config.source = {
|
||||
root: cwd,
|
||||
template: cwd + `/../templates/from-${choices.template}`,
|
||||
templateData: cwd + `/../templates/from-${choices.template}.mjs`,
|
||||
templates: join(cwd, `/../templates/shared`),
|
||||
shared: cwd + `/../shared`,
|
||||
})
|
||||
config.dest = join(process.cwd(), choices.name)
|
||||
|
@ -264,12 +315,22 @@ export const createEnvironment = async (choices) => {
|
|||
// Create target directory
|
||||
await mkdir(config.dest, { recursive: true })
|
||||
|
||||
const templateFiles = await rdir(config.source.templates)
|
||||
const templates = {}
|
||||
templateFiles.forEach(
|
||||
(f) =>
|
||||
(templates[f.replace(`${config.source.templates}/`, '').replace(/(\.mjs)*\.mustache/, '')] =
|
||||
f)
|
||||
)
|
||||
|
||||
// Find files
|
||||
config.files = {
|
||||
template: await rdir(config.source.template),
|
||||
templates,
|
||||
shared: await rdir(config.source.shared),
|
||||
}
|
||||
|
||||
config.templateData = await import(config.source.templateData)
|
||||
|
||||
// Output a linebreak
|
||||
console.log()
|
||||
|
||||
|
@ -285,7 +346,7 @@ export const createEnvironment = async (choices) => {
|
|||
),
|
||||
})
|
||||
} catch (err) {
|
||||
/* no feedback here */
|
||||
console.log(err)
|
||||
}
|
||||
|
||||
// Install dependencies
|
||||
|
|
2
packages/new-design/templates/from-bella.mjs
Normal file
2
packages/new-design/templates/from-bella.mjs
Normal file
|
@ -0,0 +1,2 @@
|
|||
export const parts = ['back', 'frontSideDart']
|
||||
export const dependencies = ['@freesewing/bella']
|
|
@ -1,169 +0,0 @@
|
|||
import { frontSideDart as bellaFront } from '@freesewing/bella'
|
||||
|
||||
function draftFront({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
*/
|
||||
//Path, // A Path constructor to create new paths
|
||||
//Point, // A Point constructor to create new points
|
||||
//Snippet, // A Snippet constructor to create new snippets
|
||||
/*
|
||||
* Content constainers
|
||||
*/
|
||||
//paths, // Add a Path to your part by adding it to this object
|
||||
//points, // Add a Points to your part by adding it to this object
|
||||
//snippets, // Add a Snippet to your part by adding it to this object
|
||||
/*
|
||||
* Access to settings
|
||||
*/
|
||||
//absoluteOptions, // Access to settings.absoluteOptions
|
||||
//complete, // Access to settings.complete
|
||||
//measurements, // Access to settings.measurements
|
||||
//options, // Access to settings.options
|
||||
//paperless, // Access to settings.paperless
|
||||
//sa, // Access to settings.sa
|
||||
//scale, // Access to settings.scale
|
||||
/*
|
||||
* Access to utilities
|
||||
*/
|
||||
//getId, //See the getId documentation
|
||||
//hide, //See the hide documentation
|
||||
//log, //See the logging documentation
|
||||
//macro, //See the macros documentation
|
||||
//setHidden, //See the setHidden documentation
|
||||
//store, //See the store documentation
|
||||
//unhide, //See the unhide documentation
|
||||
//units, //See the units documentation
|
||||
//utils, //See the utils documentation
|
||||
/*
|
||||
* Return value
|
||||
*/
|
||||
part, // Your draft method must return this
|
||||
}) {
|
||||
|
||||
// Work your magic here
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const front = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
* We STRONGLY recommend naming your parts in the format of
|
||||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.front',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
* This should be a function that drafts and returns the part
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftFront,
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
*
|
||||
* You'll need to import these parts, just as with the from key above.
|
||||
*
|
||||
* If you don't have any parts to draft prior to this part,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
],
|
||||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend bella, and this is the front part,
|
||||
* we're extending bella's frontSideDart part here.
|
||||
* It was imported at the top of this file from @freesewing/bella
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: bellaFront,
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
* We've set this to false here to clarify its use.
|
||||
* I you don't want to hide this part,
|
||||
* you can remove the hide key entirely.
|
||||
*/
|
||||
hide: false,
|
||||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Bella's front part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
hideDependencies: true,
|
||||
/*
|
||||
* hideAll: Set this to true to hide both the part and its dependencies.
|
||||
*
|
||||
* This is a combination of the hide and hideDependencies keys in case
|
||||
* you want to both hide this part and its dependencies.
|
||||
* We've included it here with a value of false to its use.
|
||||
* I you don't want to hide this a part and its dependencies,
|
||||
* you can remove the hideAll key entirely.
|
||||
*/
|
||||
hideAll: false,
|
||||
options: {
|
||||
/*
|
||||
* options: Holds (the configuration of) options for this part
|
||||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Bella's front part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/options
|
||||
*/
|
||||
},
|
||||
measurements: [
|
||||
/*
|
||||
* measurements: Holds a list of measurements required by this part.
|
||||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Bella's front part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
optionalMeasurements: [
|
||||
/*
|
||||
* optionalMeasurements: Holds a list of measurements optional in this part.
|
||||
*
|
||||
* Declare measurements that are optional for this part here.
|
||||
*
|
||||
* If you don't have any optional measurements to add,
|
||||
* you can remove this optionalMeasurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
plugins: [
|
||||
/*
|
||||
* plugins: Holds a list of plugins this part relies on.
|
||||
*
|
||||
* Add all the plugins here that you need in this part.
|
||||
* You only need to add additional plugins.
|
||||
* All plugins coming from Bella's front part are already loaded.
|
||||
*
|
||||
* If you don't have any plugins to add,
|
||||
* you can remove this plugins key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/plugins
|
||||
*/
|
||||
]
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
// Import Design constructor
|
||||
import { Design } from '@freesewing/core'
|
||||
// Import parts
|
||||
import { back } from './back'
|
||||
import { front } from './front'
|
||||
|
||||
// Create the new design
|
||||
const Pattern = 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: [ back, front ],
|
||||
})
|
||||
|
||||
/*
|
||||
* 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 { back, front, Pattern }
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
{
|
||||
"name": "@freesewing/{{name}}",
|
||||
"version": "0.0.1",
|
||||
"description": "A new FreeSewing design",
|
||||
"author": "Joost De Cock <joost@joost.at> (https://github.com/joostdecock)",
|
||||
"homepage": "https://freesewing.org/",
|
||||
"repository": "github:freesewing/freesewing",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/freesewing/freesewing/issues"
|
||||
},
|
||||
"funding": {
|
||||
"type": "individual",
|
||||
"url": "https://freesewing.org/patrons/join"
|
||||
},
|
||||
"keywords": [
|
||||
"freesewing",
|
||||
"design",
|
||||
"diy",
|
||||
"fashion",
|
||||
"parametric design",
|
||||
"sewing",
|
||||
"sewing pattern"
|
||||
],
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"scripts": {
|
||||
"dev": "next dev -p 8000",
|
||||
"build": "node build.js",
|
||||
"clean": "rimraf dist",
|
||||
"mbuild": "NO_MINIFY=1 node build.js",
|
||||
"test": "BABEL_ENV=production npx mocha tests/*.test.mjs --require @babel/register",
|
||||
"vbuild": "VERBOSE=1 node build.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@freesewing/core": "{{ tag }}",
|
||||
"@freesewing/bella": "{{ tag }}",
|
||||
"@freesewing/plugin-bundle": "{{ tag }}"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@freesewing/plugin-svgattr": "{{ tag }}",
|
||||
"@freesewing/plugin-theme": "{{ tag }}",
|
||||
"@freesewing/plugin-i18n": "{{ tag }}",
|
||||
"@freesewing/models": "{{ tag }}",
|
||||
"@headlessui/react": "^1.6.5",
|
||||
"js-yaml": "^4.1.0",
|
||||
"file-saver": "^2.0.5",
|
||||
"axios": "^0.27.2",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-sizeme": "^3.0.2",
|
||||
"react-zoom-pan-pinch": "^2.1.3",
|
||||
"react-markdown": "^8.0.3",
|
||||
"roughjs": "^4.5.2",
|
||||
"@tailwindcss/typography": "^0.5.2",
|
||||
"d3-dispatch": "^3.0.1",
|
||||
"d3-drag": "^3.0.0",
|
||||
"d3-selection": "^3.0.0",
|
||||
"daisyui": "^2.0.6",
|
||||
"lodash.get": "^4.4.2",
|
||||
"lodash.orderby": "^4.6.0",
|
||||
"lodash.set": "^4.3.2",
|
||||
"lodash.unset": "^4.5.2",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"next": "^12.3.2",
|
||||
"next-i18next": "^11.0.0",
|
||||
"react-copy-to-clipboard": "^5.0.4",
|
||||
"react-hotkeys-hook": "^3.4.4",
|
||||
"react-swipeable": "^6.2.0",
|
||||
"react-timeago": "^6.2.1",
|
||||
"mocha": "^9.1.1",
|
||||
"chai": "^4.2.0",
|
||||
"autoprefixer": "^10.4.0",
|
||||
"eslint-config-next": "12.1.6",
|
||||
"highlight.js": "^11.5.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"pdfkit": "^0.13.0",
|
||||
"svg-to-pdfkit": "^0.1.8",
|
||||
"postcss": "^8.4.14",
|
||||
"postcss-for": "^2.1.1",
|
||||
"tailwindcss": "^3.1.3",
|
||||
"tailwindcss-open-variant": "^1.0.0",
|
||||
"web-worker": "^1.2.0"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
"README.md",
|
||||
"package.json"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"tag": "next"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0",
|
||||
"npm": ">=6"
|
||||
}
|
||||
}
|
2
packages/new-design/templates/from-bent.mjs
Normal file
2
packages/new-design/templates/from-bent.mjs
Normal file
|
@ -0,0 +1,2 @@
|
|||
export const parts = ['back', 'front', 'topSleeve', 'underSleeve']
|
||||
export const dependencies = ['@freesewing/bent', '@freesewing/brian', '@freesewing/plugin-bust']
|
|
@ -1,169 +0,0 @@
|
|||
import { back as bentBack } from '@freesewing/bent'
|
||||
|
||||
function draftBack({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
*/
|
||||
//Path, // A Path constructor to create new paths
|
||||
//Point, // A Point constructor to create new points
|
||||
//Snippet, // A Snippet constructor to create new snippets
|
||||
/*
|
||||
* Content constainers
|
||||
*/
|
||||
//paths, // Add a Path to your part by adding it to this object
|
||||
//points, // Add a Points to your part by adding it to this object
|
||||
//snippets, // Add a Snippet to your part by adding it to this object
|
||||
/*
|
||||
* Access to settings
|
||||
*/
|
||||
//absoluteOptions, // Access to settings.absoluteOptions
|
||||
//complete, // Access to settings.complete
|
||||
//measurements, // Access to settings.measurements
|
||||
//options, // Access to settings.options
|
||||
//paperless, // Access to settings.paperless
|
||||
//sa, // Access to settings.sa
|
||||
//scale, // Access to settings.scale
|
||||
/*
|
||||
* Access to utilities
|
||||
*/
|
||||
//getId, //See the getId documentation
|
||||
//hide, //See the hide documentation
|
||||
//log, //See the logging documentation
|
||||
//macro, //See the macros documentation
|
||||
//setHidden, //See the setHidden documentation
|
||||
//store, //See the store documentation
|
||||
//unhide, //See the unhide documentation
|
||||
//units, //See the units documentation
|
||||
//utils, //See the utils documentation
|
||||
/*
|
||||
* Return value
|
||||
*/
|
||||
part, // Your draft method must return this
|
||||
}) {
|
||||
|
||||
// Work your magic here
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const back = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
* We STRONGLY recommend naming your parts in the format of
|
||||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.back',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
* This should be a function that drafts and returns the part
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftBack,
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
*
|
||||
* You'll need to import these parts, just as with the from key above.
|
||||
*
|
||||
* If you don't have any parts to draft prior to this part,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
],
|
||||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend Bent, and this is the back part,
|
||||
* we're extending Bent's back part here.
|
||||
* It was imported at the top of this file from @freesewing/bent
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: bentBack,
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
* We've set this to false here to clarify its use.
|
||||
* I you don't want to hide this part,
|
||||
* you can remove the hide key entirely.
|
||||
*/
|
||||
hide: false,
|
||||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Bent's back part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
hideDependencies: true,
|
||||
/*
|
||||
* hideAll: Set this to true to hide both the part and its dependencies.
|
||||
*
|
||||
* This is a combination of the hide and hideDependencies keys in case
|
||||
* you want to both hide this part and its dependencies.
|
||||
* We've included it here with a value of false to its use.
|
||||
* I you don't want to hide this a part and its dependencies,
|
||||
* you can remove the hideAll key entirely.
|
||||
*/
|
||||
hideAll: false,
|
||||
options: {
|
||||
/*
|
||||
* options: Holds (the configuration of) options for this part
|
||||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Bent's back part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/options
|
||||
*/
|
||||
},
|
||||
measurements: [
|
||||
/*
|
||||
* measurements: Holds a list of measurements required by this part.
|
||||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Bent's back part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
optionalMeasurements: [
|
||||
/*
|
||||
* optionalMeasurements: Holds a list of measurements optional in this part.
|
||||
*
|
||||
* Declare measurements that are optional for this part here.
|
||||
*
|
||||
* If you don't have any optional measurements to add,
|
||||
* you can remove this optionalMeasurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
plugins: [
|
||||
/*
|
||||
* plugins: Holds a list of plugins this part relies on.
|
||||
*
|
||||
* Add all the plugins here that you need in this part.
|
||||
* You only need to add additional plugins.
|
||||
* All plugins coming from Bent's back part are already loaded.
|
||||
*
|
||||
* If you don't have any plugins to add,
|
||||
* you can remove this plugins key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/plugins
|
||||
*/
|
||||
]
|
||||
}
|
|
@ -1,169 +0,0 @@
|
|||
import { front as bentFront } from '@freesewing/bent'
|
||||
|
||||
function draftFront({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
*/
|
||||
//Path, // A Path constructor to create new paths
|
||||
//Point, // A Point constructor to create new points
|
||||
//Snippet, // A Snippet constructor to create new snippets
|
||||
/*
|
||||
* Content constainers
|
||||
*/
|
||||
//paths, // Add a Path to your part by adding it to this object
|
||||
//points, // Add a Points to your part by adding it to this object
|
||||
//snippets, // Add a Snippet to your part by adding it to this object
|
||||
/*
|
||||
* Access to settings
|
||||
*/
|
||||
//absoluteOptions, // Access to settings.absoluteOptions
|
||||
//complete, // Access to settings.complete
|
||||
//measurements, // Access to settings.measurements
|
||||
//options, // Access to settings.options
|
||||
//paperless, // Access to settings.paperless
|
||||
//sa, // Access to settings.sa
|
||||
//scale, // Access to settings.scale
|
||||
/*
|
||||
* Access to utilities
|
||||
*/
|
||||
//getId, //See the getId documentation
|
||||
//hide, //See the hide documentation
|
||||
//log, //See the logging documentation
|
||||
//macro, //See the macros documentation
|
||||
//setHidden, //See the setHidden documentation
|
||||
//store, //See the store documentation
|
||||
//unhide, //See the unhide documentation
|
||||
//units, //See the units documentation
|
||||
//utils, //See the utils documentation
|
||||
/*
|
||||
* Return value
|
||||
*/
|
||||
part, // Your draft method must return this
|
||||
}) {
|
||||
|
||||
// Work your magic here
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const front = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
* We STRONGLY recommend naming your parts in the format of
|
||||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.front',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
* This should be a function that drafts and returns the part
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftFront,
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
*
|
||||
* You'll need to import these parts, just as with the from key above.
|
||||
*
|
||||
* If you don't have any parts to draft prior to this part,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
],
|
||||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend Bent, and this is the front part,
|
||||
* we're extending Bent's front part here.
|
||||
* It was imported at the top of this file from @freesewing/bent
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: bentFront,
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
* We've set this to false here to clarify its use.
|
||||
* I you don't want to hide this part,
|
||||
* you can remove the hide key entirely.
|
||||
*/
|
||||
hide: false,
|
||||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Bent's front part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
hideDependencies: true,
|
||||
/*
|
||||
* hideAll: Set this to true to hide both the part and its dependencies.
|
||||
*
|
||||
* This is a combination of the hide and hideDependencies keys in case
|
||||
* you want to both hide this part and its dependencies.
|
||||
* We've included it here with a value of false to its use.
|
||||
* I you don't want to hide this a part and its dependencies,
|
||||
* you can remove the hideAll key entirely.
|
||||
*/
|
||||
hideAll: false,
|
||||
options: {
|
||||
/*
|
||||
* options: Holds (the configuration of) options for this part
|
||||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Bent's front part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/options
|
||||
*/
|
||||
},
|
||||
measurements: [
|
||||
/*
|
||||
* measurements: Holds a list of measurements required by this part.
|
||||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Bent's front part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
optionalMeasurements: [
|
||||
/*
|
||||
* optionalMeasurements: Holds a list of measurements optional in this part.
|
||||
*
|
||||
* Declare measurements that are optional for this part here.
|
||||
*
|
||||
* If you don't have any optional measurements to add,
|
||||
* you can remove this optionalMeasurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
plugins: [
|
||||
/*
|
||||
* plugins: Holds a list of plugins this part relies on.
|
||||
*
|
||||
* Add all the plugins here that you need in this part.
|
||||
* You only need to add additional plugins.
|
||||
* All plugins coming from Bent's front part are already loaded.
|
||||
*
|
||||
* If you don't have any plugins to add,
|
||||
* you can remove this plugins key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/plugins
|
||||
*/
|
||||
]
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
// Import Design constructor
|
||||
import { Design } from '@freesewing/core'
|
||||
// Import parts
|
||||
import { back } from './back.mjs'
|
||||
import { front } from './front.mjs'
|
||||
import { topSleeve } from './topsleeve.mjs'
|
||||
import { underSleeve } from './undersleeve.mjs'
|
||||
|
||||
// Create the new design
|
||||
const Pattern = 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: [ back, front, topSleeve, underSleeve ],
|
||||
})
|
||||
|
||||
/*
|
||||
* 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 { back, front, topSleeve, underSleeve, Pattern }
|
||||
|
|
@ -1,169 +0,0 @@
|
|||
import { topSleeve as bentTopSleeve } from '@freesewing/bent'
|
||||
|
||||
function draftTopSleeve({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
*/
|
||||
//Path, // A Path constructor to create new paths
|
||||
//Point, // A Point constructor to create new points
|
||||
//Snippet, // A Snippet constructor to create new snippets
|
||||
/*
|
||||
* Content constainers
|
||||
*/
|
||||
//paths, // Add a Path to your part by adding it to this object
|
||||
//points, // Add a Points to your part by adding it to this object
|
||||
//snippets, // Add a Snippet to your part by adding it to this object
|
||||
/*
|
||||
* Access to settings
|
||||
*/
|
||||
//absoluteOptions, // Access to settings.absoluteOptions
|
||||
//complete, // Access to settings.complete
|
||||
//measurements, // Access to settings.measurements
|
||||
//options, // Access to settings.options
|
||||
//paperless, // Access to settings.paperless
|
||||
//sa, // Access to settings.sa
|
||||
//scale, // Access to settings.scale
|
||||
/*
|
||||
* Access to utilities
|
||||
*/
|
||||
//getId, //See the getId documentation
|
||||
//hide, //See the hide documentation
|
||||
//log, //See the logging documentation
|
||||
//macro, //See the macros documentation
|
||||
//setHidden, //See the setHidden documentation
|
||||
//store, //See the store documentation
|
||||
//unhide, //See the unhide documentation
|
||||
//units, //See the units documentation
|
||||
//utils, //See the utils documentation
|
||||
/*
|
||||
* Return value
|
||||
*/
|
||||
part, // Your draft method must return this
|
||||
}) {
|
||||
|
||||
// Work your magic here
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const topSleeve = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
* We STRONGLY recommend naming your parts in the format of
|
||||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.topSleeve',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
* This should be a function that drafts and returns the part
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftTopSleeve,
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
*
|
||||
* You'll need to import these parts, just as with the from key above.
|
||||
*
|
||||
* If you don't have any parts to draft prior to this part,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
],
|
||||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend Bent, and this is the topSleeve part,
|
||||
* we're extending Bent's topSleeve part here.
|
||||
* It was imported at the top of this file from @freesewing/bent
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: bentTopSleeve,
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
* We've set this to false here to clarify its use.
|
||||
* I you don't want to hide this part,
|
||||
* you can remove the hide key entirely.
|
||||
*/
|
||||
hide: false,
|
||||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Bent's topSleeve part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
hideDependencies: true,
|
||||
/*
|
||||
* hideAll: Set this to true to hide both the part and its dependencies.
|
||||
*
|
||||
* This is a combination of the hide and hideDependencies keys in case
|
||||
* you want to both hide this part and its dependencies.
|
||||
* We've included it here with a value of false to its use.
|
||||
* I you don't want to hide this a part and its dependencies,
|
||||
* you can remove the hideAll key entirely.
|
||||
*/
|
||||
hideAll: false,
|
||||
options: {
|
||||
/*
|
||||
* options: Holds (the configuration of) options for this part
|
||||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Bent's topSleeve part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/options
|
||||
*/
|
||||
},
|
||||
measurements: [
|
||||
/*
|
||||
* measurements: Holds a list of measurements required by this part.
|
||||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Bent's topSleeve part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
optionalMeasurements: [
|
||||
/*
|
||||
* optionalMeasurements: Holds a list of measurements optional in this part.
|
||||
*
|
||||
* Declare measurements that are optional for this part here.
|
||||
*
|
||||
* If you don't have any optional measurements to add,
|
||||
* you can remove this optionalMeasurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
plugins: [
|
||||
/*
|
||||
* plugins: Holds a list of plugins this part relies on.
|
||||
*
|
||||
* Add all the plugins here that you need in this part.
|
||||
* You only need to add additional plugins.
|
||||
* All plugins coming from Bent's topSleeve part are already loaded.
|
||||
*
|
||||
* If you don't have any plugins to add,
|
||||
* you can remove this plugins key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/plugins
|
||||
*/
|
||||
]
|
||||
}
|
|
@ -1,169 +0,0 @@
|
|||
import { underSleeve as bentUnderSleeve } from '@freesewing/bent'
|
||||
|
||||
function draftUnderSleeve({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
*/
|
||||
//Path, // A Path constructor to create new paths
|
||||
//Point, // A Point constructor to create new points
|
||||
//Snippet, // A Snippet constructor to create new snippets
|
||||
/*
|
||||
* Content constainers
|
||||
*/
|
||||
//paths, // Add a Path to your part by adding it to this object
|
||||
//points, // Add a Points to your part by adding it to this object
|
||||
//snippets, // Add a Snippet to your part by adding it to this object
|
||||
/*
|
||||
* Access to settings
|
||||
*/
|
||||
//absoluteOptions, // Access to settings.absoluteOptions
|
||||
//complete, // Access to settings.complete
|
||||
//measurements, // Access to settings.measurements
|
||||
//options, // Access to settings.options
|
||||
//paperless, // Access to settings.paperless
|
||||
//sa, // Access to settings.sa
|
||||
//scale, // Access to settings.scale
|
||||
/*
|
||||
* Access to utilities
|
||||
*/
|
||||
//getId, //See the getId documentation
|
||||
//hide, //See the hide documentation
|
||||
//log, //See the logging documentation
|
||||
//macro, //See the macros documentation
|
||||
//setHidden, //See the setHidden documentation
|
||||
//store, //See the store documentation
|
||||
//unhide, //See the unhide documentation
|
||||
//units, //See the units documentation
|
||||
//utils, //See the utils documentation
|
||||
/*
|
||||
* Return value
|
||||
*/
|
||||
part, // Your draft method must return this
|
||||
}) {
|
||||
|
||||
// Work your magic here
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const underSleeve = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
* We STRONGLY recommend naming your parts in the format of
|
||||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.underSleeve',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
* This should be a function that drafts and returns the part
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftUnderSleeve,
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
*
|
||||
* You'll need to import these parts, just as with the from key above.
|
||||
*
|
||||
* If you don't have any parts to draft prior to this part,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
],
|
||||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend Bent, and this is the underSleeve part,
|
||||
* we're extending Bent's underSleeve part here.
|
||||
* It was imported at the top of this file from @freesewing/bent
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: bentUnderSleeve,
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
* We've set this to false here to clarify its use.
|
||||
* I you don't want to hide this part,
|
||||
* you can remove the hide key entirely.
|
||||
*/
|
||||
hide: false,
|
||||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Bent's underSleeve part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
hideDependencies: true,
|
||||
/*
|
||||
* hideAll: Set this to true to hide both the part and its dependencies.
|
||||
*
|
||||
* This is a combination of the hide and hideDependencies keys in case
|
||||
* you want to both hide this part and its dependencies.
|
||||
* We've included it here with a value of false to its use.
|
||||
* I you don't want to hide this a part and its dependencies,
|
||||
* you can remove the hideAll key entirely.
|
||||
*/
|
||||
hideAll: false,
|
||||
options: {
|
||||
/*
|
||||
* options: Holds (the configuration of) options for this part
|
||||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Bent's underSleeve part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/options
|
||||
*/
|
||||
},
|
||||
measurements: [
|
||||
/*
|
||||
* measurements: Holds a list of measurements required by this part.
|
||||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Bent's underSleeve part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
optionalMeasurements: [
|
||||
/*
|
||||
* optionalMeasurements: Holds a list of measurements optional in this part.
|
||||
*
|
||||
* Declare measurements that are optional for this part here.
|
||||
*
|
||||
* If you don't have any optional measurements to add,
|
||||
* you can remove this optionalMeasurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
plugins: [
|
||||
/*
|
||||
* plugins: Holds a list of plugins this part relies on.
|
||||
*
|
||||
* Add all the plugins here that you need in this part.
|
||||
* You only need to add additional plugins.
|
||||
* All plugins coming from Bent's underSleeve part are already loaded.
|
||||
*
|
||||
* If you don't have any plugins to add,
|
||||
* you can remove this plugins key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/plugins
|
||||
*/
|
||||
]
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
{
|
||||
"name": "@freesewing/{{name}}",
|
||||
"version": "0.0.1",
|
||||
"description": "A new FreeSewing design",
|
||||
"author": "Joost De Cock <joost@joost.at> (https://github.com/joostdecock)",
|
||||
"homepage": "https://freesewing.org/",
|
||||
"repository": "github:freesewing/freesewing",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/freesewing/freesewing/issues"
|
||||
},
|
||||
"funding": {
|
||||
"type": "individual",
|
||||
"url": "https://freesewing.org/patrons/join"
|
||||
},
|
||||
"keywords": [
|
||||
"freesewing",
|
||||
"design",
|
||||
"diy",
|
||||
"fashion",
|
||||
"parametric design",
|
||||
"sewing",
|
||||
"sewing pattern"
|
||||
],
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"scripts": {
|
||||
"dev": "next dev -p 8000",
|
||||
"build": "node build.js",
|
||||
"clean": "rimraf dist",
|
||||
"mbuild": "NO_MINIFY=1 node build.js",
|
||||
"test": "BABEL_ENV=production npx mocha tests/*.test.mjs --require @babel/register",
|
||||
"vbuild": "VERBOSE=1 node build.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@freesewing/core": "{{ tag }}",
|
||||
"@freesewing/bent": "{{ tag }}",
|
||||
"@freesewing/brian": "{{ tag }}",
|
||||
"@freesewing/plugin-bundle": "{{ tag }}",
|
||||
"@freesewing/plugin-bust": "{{ tag }}"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@freesewing/plugin-svgattr": "{{ tag }}",
|
||||
"@freesewing/plugin-theme": "{{ tag }}",
|
||||
"@freesewing/plugin-i18n": "{{ tag }}",
|
||||
"@freesewing/models": "{{ tag }}",
|
||||
"@headlessui/react": "^1.6.5",
|
||||
"js-yaml": "^4.1.0",
|
||||
"file-saver": "^2.0.5",
|
||||
"axios": "^0.27.2",
|
||||
"pdfkit": "^0.13.0",
|
||||
"svg-to-pdfkit": "^0.1.8",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-sizeme": "^3.0.2",
|
||||
"react-zoom-pan-pinch": "^2.1.3",
|
||||
"react-markdown": "^8.0.3",
|
||||
"roughjs": "^4.5.2",
|
||||
"@tailwindcss/typography": "^0.5.2",
|
||||
"d3-dispatch": "^3.0.1",
|
||||
"d3-drag": "^3.0.0",
|
||||
"d3-selection": "^3.0.0",
|
||||
"daisyui": "^2.0.6",
|
||||
"lodash.get": "^4.4.2",
|
||||
"lodash.orderby": "^4.6.0",
|
||||
"lodash.set": "^4.3.2",
|
||||
"lodash.unset": "^4.5.2",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"next": "^12.3.2",
|
||||
"next-i18next": "^11.0.0",
|
||||
"react-copy-to-clipboard": "^5.0.4",
|
||||
"react-hotkeys-hook": "^3.4.4",
|
||||
"react-swipeable": "^6.2.0",
|
||||
"react-timeago": "^6.2.1",
|
||||
"mocha": "^9.1.1",
|
||||
"chai": "^4.2.0",
|
||||
"autoprefixer": "^10.4.0",
|
||||
"eslint-config-next": "12.1.6",
|
||||
"highlight.js": "^11.5.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"postcss": "^8.4.14",
|
||||
"postcss-for": "^2.1.1",
|
||||
"tailwindcss": "^3.1.3",
|
||||
"tailwindcss-open-variant": "^1.0.0",
|
||||
"web-worker": "^1.2.0"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
"README.md",
|
||||
"package.json"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"tag": "next"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0",
|
||||
"npm": ">=6"
|
||||
}
|
||||
}
|
2
packages/new-design/templates/from-breanna.mjs
Normal file
2
packages/new-design/templates/from-breanna.mjs
Normal file
|
@ -0,0 +1,2 @@
|
|||
export const parts = ['back', 'front', 'sleeve']
|
||||
export const dependencies = ['@freesewing/breanna']
|
|
@ -1,169 +0,0 @@
|
|||
import { back as breannaBack } from '@freesewing/breanna'
|
||||
|
||||
function draftBack({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
*/
|
||||
//Path, // A Path constructor to create new paths
|
||||
//Point, // A Point constructor to create new points
|
||||
//Snippet, // A Snippet constructor to create new snippets
|
||||
/*
|
||||
* Content constainers
|
||||
*/
|
||||
//paths, // Add a Path to your part by adding it to this object
|
||||
//points, // Add a Points to your part by adding it to this object
|
||||
//snippets, // Add a Snippet to your part by adding it to this object
|
||||
/*
|
||||
* Access to settings
|
||||
*/
|
||||
//absoluteOptions, // Access to settings.absoluteOptions
|
||||
//complete, // Access to settings.complete
|
||||
//measurements, // Access to settings.measurements
|
||||
//options, // Access to settings.options
|
||||
//paperless, // Access to settings.paperless
|
||||
//sa, // Access to settings.sa
|
||||
//scale, // Access to settings.scale
|
||||
/*
|
||||
* Access to utilities
|
||||
*/
|
||||
//getId, //See the getId documentation
|
||||
//hide, //See the hide documentation
|
||||
//log, //See the logging documentation
|
||||
//macro, //See the macros documentation
|
||||
//setHidden, //See the setHidden documentation
|
||||
//store, //See the store documentation
|
||||
//unhide, //See the unhide documentation
|
||||
//units, //See the units documentation
|
||||
//utils, //See the utils documentation
|
||||
/*
|
||||
* Return value
|
||||
*/
|
||||
part, // Your draft method must return this
|
||||
}) {
|
||||
|
||||
// Work your magic here
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const back = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
* We STRONGLY recommend naming your parts in the format of
|
||||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.back',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
* This should be a function that drafts and returns the part
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftBack,
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
*
|
||||
* You'll need to import these parts, just as with the from key above.
|
||||
*
|
||||
* If you don't have any parts to draft prior to this part,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
],
|
||||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend Breanna, and this is the back part,
|
||||
* we're extending Breanna's back part here.
|
||||
* It was imported at the top of this file from @freesewing/breanna
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: breannaBack,
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
* We've set this to false here to clarify its use.
|
||||
* I you don't want to hide this part,
|
||||
* you can remove the hide key entirely.
|
||||
*/
|
||||
hide: false,
|
||||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Breanna's back part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
hideDependencies: true,
|
||||
/*
|
||||
* hideAll: Set this to true to hide both the part and its dependencies.
|
||||
*
|
||||
* This is a combination of the hide and hideDependencies keys in case
|
||||
* you want to both hide this part and its dependencies.
|
||||
* We've included it here with a value of false to its use.
|
||||
* I you don't want to hide this a part and its dependencies,
|
||||
* you can remove the hideAll key entirely.
|
||||
*/
|
||||
hideAll: false,
|
||||
options: {
|
||||
/*
|
||||
* options: Holds (the configuration of) options for this part
|
||||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Breanna's back part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/options
|
||||
*/
|
||||
},
|
||||
measurements: [
|
||||
/*
|
||||
* measurements: Holds a list of measurements required by this part.
|
||||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Breanna's back part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
optionalMeasurements: [
|
||||
/*
|
||||
* optionalMeasurements: Holds a list of measurements optional in this part.
|
||||
*
|
||||
* Declare measurements that are optional for this part here.
|
||||
*
|
||||
* If you don't have any optional measurements to add,
|
||||
* you can remove this optionalMeasurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
plugins: [
|
||||
/*
|
||||
* plugins: Holds a list of plugins this part relies on.
|
||||
*
|
||||
* Add all the plugins here that you need in this part.
|
||||
* You only need to add additional plugins.
|
||||
* All plugins coming from Breanna's back part are already loaded.
|
||||
*
|
||||
* If you don't have any plugins to add,
|
||||
* you can remove this plugins key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/plugins
|
||||
*/
|
||||
]
|
||||
}
|
|
@ -1,169 +0,0 @@
|
|||
import { front as breannaFront } from '@freesewing/breanna'
|
||||
|
||||
function draftFront({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
*/
|
||||
//Path, // A Path constructor to create new paths
|
||||
//Point, // A Point constructor to create new points
|
||||
//Snippet, // A Snippet constructor to create new snippets
|
||||
/*
|
||||
* Content constainers
|
||||
*/
|
||||
//paths, // Add a Path to your part by adding it to this object
|
||||
//points, // Add a Points to your part by adding it to this object
|
||||
//snippets, // Add a Snippet to your part by adding it to this object
|
||||
/*
|
||||
* Access to settings
|
||||
*/
|
||||
//absoluteOptions, // Access to settings.absoluteOptions
|
||||
//complete, // Access to settings.complete
|
||||
//measurements, // Access to settings.measurements
|
||||
//options, // Access to settings.options
|
||||
//paperless, // Access to settings.paperless
|
||||
//sa, // Access to settings.sa
|
||||
//scale, // Access to settings.scale
|
||||
/*
|
||||
* Access to utilities
|
||||
*/
|
||||
//getId, //See the getId documentation
|
||||
//hide, //See the hide documentation
|
||||
//log, //See the logging documentation
|
||||
//macro, //See the macros documentation
|
||||
//setHidden, //See the setHidden documentation
|
||||
//store, //See the store documentation
|
||||
//unhide, //See the unhide documentation
|
||||
//units, //See the units documentation
|
||||
//utils, //See the utils documentation
|
||||
/*
|
||||
* Return value
|
||||
*/
|
||||
part, // Your draft method must return this
|
||||
}) {
|
||||
|
||||
// Work your magic here
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const front = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
* We STRONGLY recommend naming your parts in the format of
|
||||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.front',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
* This should be a function that drafts and returns the part
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftFront,
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
*
|
||||
* You'll need to import these parts, just as with the from key above.
|
||||
*
|
||||
* If you don't have any parts to draft prior to this part,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
],
|
||||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend Breanna, and this is the front part,
|
||||
* we're extending Breanna's front part here.
|
||||
* It was imported at the top of this file from @freesewing/breanna
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: breannaFront,
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
* We've set this to false here to clarify its use.
|
||||
* I you don't want to hide this part,
|
||||
* you can remove the hide key entirely.
|
||||
*/
|
||||
hide: false,
|
||||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Breanna's front part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
hideDependencies: true,
|
||||
/*
|
||||
* hideAll: Set this to true to hide both the part and its dependencies.
|
||||
*
|
||||
* This is a combination of the hide and hideDependencies keys in case
|
||||
* you want to both hide this part and its dependencies.
|
||||
* We've included it here with a value of false to its use.
|
||||
* I you don't want to hide this a part and its dependencies,
|
||||
* you can remove the hideAll key entirely.
|
||||
*/
|
||||
hideAll: false,
|
||||
options: {
|
||||
/*
|
||||
* options: Holds (the configuration of) options for this part
|
||||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Breanna's front part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/options
|
||||
*/
|
||||
},
|
||||
measurements: [
|
||||
/*
|
||||
* measurements: Holds a list of measurements required by this part.
|
||||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Breanna's front part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
optionalMeasurements: [
|
||||
/*
|
||||
* optionalMeasurements: Holds a list of measurements optional in this part.
|
||||
*
|
||||
* Declare measurements that are optional for this part here.
|
||||
*
|
||||
* If you don't have any optional measurements to add,
|
||||
* you can remove this optionalMeasurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
plugins: [
|
||||
/*
|
||||
* plugins: Holds a list of plugins this part relies on.
|
||||
*
|
||||
* Add all the plugins here that you need in this part.
|
||||
* You only need to add additional plugins.
|
||||
* All plugins coming from Breanna's front part are already loaded.
|
||||
*
|
||||
* If you don't have any plugins to add,
|
||||
* you can remove this plugins key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/plugins
|
||||
*/
|
||||
]
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
// Import Design constructor
|
||||
import { Design } from '@freesewing/core'
|
||||
// Import parts
|
||||
import { back } from './back'
|
||||
import { front } from './front'
|
||||
import { sleeve } from './sleeve'
|
||||
|
||||
// Create the new design
|
||||
const Pattern = 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: [ back, front, sleeve ],
|
||||
})
|
||||
|
||||
/*
|
||||
* 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 { back, front, sleeve, Pattern }
|
||||
|
|
@ -1,169 +0,0 @@
|
|||
import { sleeve as breannaSleeve } from '@freesewing/breanna'
|
||||
|
||||
function draftSleeve({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
*/
|
||||
//Path, // A Path constructor to create new paths
|
||||
//Point, // A Point constructor to create new points
|
||||
//Snippet, // A Snippet constructor to create new snippets
|
||||
/*
|
||||
* Content constainers
|
||||
*/
|
||||
//paths, // Add a Path to your part by adding it to this object
|
||||
//points, // Add a Points to your part by adding it to this object
|
||||
//snippets, // Add a Snippet to your part by adding it to this object
|
||||
/*
|
||||
* Access to settings
|
||||
*/
|
||||
//absoluteOptions, // Access to settings.absoluteOptions
|
||||
//complete, // Access to settings.complete
|
||||
//measurements, // Access to settings.measurements
|
||||
//options, // Access to settings.options
|
||||
//paperless, // Access to settings.paperless
|
||||
//sa, // Access to settings.sa
|
||||
//scale, // Access to settings.scale
|
||||
/*
|
||||
* Access to utilities
|
||||
*/
|
||||
//getId, //See the getId documentation
|
||||
//hide, //See the hide documentation
|
||||
//log, //See the logging documentation
|
||||
//macro, //See the macros documentation
|
||||
//setHidden, //See the setHidden documentation
|
||||
//store, //See the store documentation
|
||||
//unhide, //See the unhide documentation
|
||||
//units, //See the units documentation
|
||||
//utils, //See the utils documentation
|
||||
/*
|
||||
* Return value
|
||||
*/
|
||||
part, // Your draft method must return this
|
||||
}) {
|
||||
|
||||
// Work your magic here
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const sleeve = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
* We STRONGLY recommend naming your parts in the format of
|
||||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.sleeve',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
* This should be a function that drafts and returns the part
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftSleeve,
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
*
|
||||
* You'll need to import these parts, just as with the from key above.
|
||||
*
|
||||
* If you don't have any parts to draft prior to this part,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
],
|
||||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend Breanna, and this is the sleeve part,
|
||||
* we're extending Breanna's sleeve part here.
|
||||
* It was imported at the top of this file from @freesewing/breanna
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: breannaSleeve,
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
* We've set this to false here to clarify its use.
|
||||
* I you don't want to hide this part,
|
||||
* you can remove the hide key entirely.
|
||||
*/
|
||||
hide: false,
|
||||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Breanna's sleeve part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
hideDependencies: true,
|
||||
/*
|
||||
* hideAll: Set this to true to hide both the part and its dependencies.
|
||||
*
|
||||
* This is a combination of the hide and hideDependencies keys in case
|
||||
* you want to both hide this part and its dependencies.
|
||||
* We've included it here with a value of false to its use.
|
||||
* I you don't want to hide this a part and its dependencies,
|
||||
* you can remove the hideAll key entirely.
|
||||
*/
|
||||
hideAll: false,
|
||||
options: {
|
||||
/*
|
||||
* options: Holds (the configuration of) options for this part
|
||||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Breanna's sleeve part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/options
|
||||
*/
|
||||
},
|
||||
measurements: [
|
||||
/*
|
||||
* measurements: Holds a list of measurements required by this part.
|
||||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Breanna's sleeve part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
optionalMeasurements: [
|
||||
/*
|
||||
* optionalMeasurements: Holds a list of measurements optional in this part.
|
||||
*
|
||||
* Declare measurements that are optional for this part here.
|
||||
*
|
||||
* If you don't have any optional measurements to add,
|
||||
* you can remove this optionalMeasurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
plugins: [
|
||||
/*
|
||||
* plugins: Holds a list of plugins this part relies on.
|
||||
*
|
||||
* Add all the plugins here that you need in this part.
|
||||
* You only need to add additional plugins.
|
||||
* All plugins coming from Breanna's sleeve part are already loaded.
|
||||
*
|
||||
* If you don't have any plugins to add,
|
||||
* you can remove this plugins key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/plugins
|
||||
*/
|
||||
]
|
||||
}
|
2
packages/new-design/templates/from-brian.mjs
Normal file
2
packages/new-design/templates/from-brian.mjs
Normal file
|
@ -0,0 +1,2 @@
|
|||
export const parts = ['back', 'front', 'sleeve']
|
||||
export const dependencies = ['@freesewing/brian', '@freesewing/plugin-bust']
|
|
@ -1,169 +0,0 @@
|
|||
import { back as brianBack } from '@freesewing/brian'
|
||||
|
||||
function draftBack({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
*/
|
||||
//Path, // A Path constructor to create new paths
|
||||
//Point, // A Point constructor to create new points
|
||||
//Snippet, // A Snippet constructor to create new snippets
|
||||
/*
|
||||
* Content constainers
|
||||
*/
|
||||
//paths, // Add a Path to your part by adding it to this object
|
||||
//points, // Add a Points to your part by adding it to this object
|
||||
//snippets, // Add a Snippet to your part by adding it to this object
|
||||
/*
|
||||
* Access to settings
|
||||
*/
|
||||
//absoluteOptions, // Access to settings.absoluteOptions
|
||||
//complete, // Access to settings.complete
|
||||
//measurements, // Access to settings.measurements
|
||||
//options, // Access to settings.options
|
||||
//paperless, // Access to settings.paperless
|
||||
//sa, // Access to settings.sa
|
||||
//scale, // Access to settings.scale
|
||||
/*
|
||||
* Access to utilities
|
||||
*/
|
||||
//getId, //See the getId documentation
|
||||
//hide, //See the hide documentation
|
||||
//log, //See the logging documentation
|
||||
//macro, //See the macros documentation
|
||||
//setHidden, //See the setHidden documentation
|
||||
//store, //See the store documentation
|
||||
//unhide, //See the unhide documentation
|
||||
//units, //See the units documentation
|
||||
//utils, //See the utils documentation
|
||||
/*
|
||||
* Return value
|
||||
*/
|
||||
part, // Your draft method must return this
|
||||
}) {
|
||||
|
||||
// Work your magic here
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const back = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
* We STRONGLY recommend naming your parts in the format of
|
||||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.back',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
* This should be a function that drafts and returns the part
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftBack,
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
*
|
||||
* You'll need to import these parts, just as with the from key above.
|
||||
*
|
||||
* If you don't have any parts to draft prior to this part,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
],
|
||||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend brian, and this is the back part,
|
||||
* we're extending brian's back part here.
|
||||
* It was imported at the top of this file from @freesewing/brian
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: brianBack,
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
* We've set this to false here to clarify its use.
|
||||
* I you don't want to hide this part,
|
||||
* you can remove the hide key entirely.
|
||||
*/
|
||||
hide: false,
|
||||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Brian's back part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
hideDependencies: true,
|
||||
/*
|
||||
* hideAll: Set this to true to hide both the part and its dependencies.
|
||||
*
|
||||
* This is a combination of the hide and hideDependencies keys in case
|
||||
* you want to both hide this part and its dependencies.
|
||||
* We've included it here with a value of false to its use.
|
||||
* I you don't want to hide this a part and its dependencies,
|
||||
* you can remove the hideAll key entirely.
|
||||
*/
|
||||
hideAll: false,
|
||||
options: {
|
||||
/*
|
||||
* options: Holds (the configuration of) options for this part
|
||||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Brian's back part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/options
|
||||
*/
|
||||
},
|
||||
measurements: [
|
||||
/*
|
||||
* measurements: Holds a list of measurements required by this part.
|
||||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Brian's back part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
optionalMeasurements: [
|
||||
/*
|
||||
* optionalMeasurements: Holds a list of measurements optional in this part.
|
||||
*
|
||||
* Declare measurements that are optional for this part here.
|
||||
*
|
||||
* If you don't have any optional measurements to add,
|
||||
* you can remove this optionalMeasurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
plugins: [
|
||||
/*
|
||||
* plugins: Holds a list of plugins this part relies on.
|
||||
*
|
||||
* Add all the plugins here that you need in this part.
|
||||
* You only need to add additional plugins.
|
||||
* All plugins coming from Brian's back part are already loaded.
|
||||
*
|
||||
* If you don't have any plugins to add,
|
||||
* you can remove this plugins key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/plugins
|
||||
*/
|
||||
]
|
||||
}
|
|
@ -1,169 +0,0 @@
|
|||
import { front as brianFront } from '@freesewing/brian'
|
||||
|
||||
function draftFront({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
*/
|
||||
//Path, // A Path constructor to create new paths
|
||||
//Point, // A Point constructor to create new points
|
||||
//Snippet, // A Snippet constructor to create new snippets
|
||||
/*
|
||||
* Content constainers
|
||||
*/
|
||||
//paths, // Add a Path to your part by adding it to this object
|
||||
//points, // Add a Points to your part by adding it to this object
|
||||
//snippets, // Add a Snippet to your part by adding it to this object
|
||||
/*
|
||||
* Access to settings
|
||||
*/
|
||||
//absoluteOptions, // Access to settings.absoluteOptions
|
||||
//complete, // Access to settings.complete
|
||||
//measurements, // Access to settings.measurements
|
||||
//options, // Access to settings.options
|
||||
//paperless, // Access to settings.paperless
|
||||
//sa, // Access to settings.sa
|
||||
//scale, // Access to settings.scale
|
||||
/*
|
||||
* Access to utilities
|
||||
*/
|
||||
//getId, //See the getId documentation
|
||||
//hide, //See the hide documentation
|
||||
//log, //See the logging documentation
|
||||
//macro, //See the macros documentation
|
||||
//setHidden, //See the setHidden documentation
|
||||
//store, //See the store documentation
|
||||
//unhide, //See the unhide documentation
|
||||
//units, //See the units documentation
|
||||
//utils, //See the utils documentation
|
||||
/*
|
||||
* Return value
|
||||
*/
|
||||
part, // Your draft method must return this
|
||||
}) {
|
||||
|
||||
// Work your magic here
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const front = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
* We STRONGLY recommend naming your parts in the format of
|
||||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.front',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
* This should be a function that drafts and returns the part
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftFront,
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
*
|
||||
* You'll need to import these parts, just as with the from key above.
|
||||
*
|
||||
* If you don't have any parts to draft prior to this part,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
],
|
||||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend Brian, and this is the front part,
|
||||
* we're extending Brian's front part here.
|
||||
* It was imported at the top of this file from @freesewing/brian
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: brianFront,
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
* We've set this to false here to clarify its use.
|
||||
* I you don't want to hide this part,
|
||||
* you can remove the hide key entirely.
|
||||
*/
|
||||
hide: false,
|
||||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Brian's front part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
hideDependencies: true,
|
||||
/*
|
||||
* hideAll: Set this to true to hide both the part and its dependencies.
|
||||
*
|
||||
* This is a combination of the hide and hideDependencies keys in case
|
||||
* you want to both hide this part and its dependencies.
|
||||
* We've included it here with a value of false to its use.
|
||||
* I you don't want to hide this a part and its dependencies,
|
||||
* you can remove the hideAll key entirely.
|
||||
*/
|
||||
hideAll: false,
|
||||
options: {
|
||||
/*
|
||||
* options: Holds (the configuration of) options for this part
|
||||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Brian's front part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/options
|
||||
*/
|
||||
},
|
||||
measurements: [
|
||||
/*
|
||||
* measurements: Holds a list of measurements required by this part.
|
||||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Brian's front part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
optionalMeasurements: [
|
||||
/*
|
||||
* optionalMeasurements: Holds a list of measurements optional in this part.
|
||||
*
|
||||
* Declare measurements that are optional for this part here.
|
||||
*
|
||||
* If you don't have any optional measurements to add,
|
||||
* you can remove this optionalMeasurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
plugins: [
|
||||
/*
|
||||
* plugins: Holds a list of plugins this part relies on.
|
||||
*
|
||||
* Add all the plugins here that you need in this part.
|
||||
* You only need to add additional plugins.
|
||||
* All plugins coming from Brian's front part are already loaded.
|
||||
*
|
||||
* If you don't have any plugins to add,
|
||||
* you can remove this plugins key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/plugins
|
||||
*/
|
||||
]
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
// Import Design constructor
|
||||
import { Design } from '@freesewing/core'
|
||||
// Import parts
|
||||
import { back } from './back'
|
||||
import { front } from './front'
|
||||
import { sleeve } from './sleeve'
|
||||
|
||||
// Create the new design
|
||||
const Pattern = 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: [ back, front, sleeve ],
|
||||
})
|
||||
|
||||
/*
|
||||
* 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 { back, front, sleeve, Pattern }
|
||||
|
|
@ -1,169 +0,0 @@
|
|||
import { sleeve as brianSleeve } from '@freesewing/brian'
|
||||
|
||||
function draftSleeve({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
*/
|
||||
//Path, // A Path constructor to create new paths
|
||||
//Point, // A Point constructor to create new points
|
||||
//Snippet, // A Snippet constructor to create new snippets
|
||||
/*
|
||||
* Content constainers
|
||||
*/
|
||||
//paths, // Add a Path to your part by adding it to this object
|
||||
//points, // Add a Points to your part by adding it to this object
|
||||
//snippets, // Add a Snippet to your part by adding it to this object
|
||||
/*
|
||||
* Access to settings
|
||||
*/
|
||||
//absoluteOptions, // Access to settings.absoluteOptions
|
||||
//complete, // Access to settings.complete
|
||||
//measurements, // Access to settings.measurements
|
||||
//options, // Access to settings.options
|
||||
//paperless, // Access to settings.paperless
|
||||
//sa, // Access to settings.sa
|
||||
//scale, // Access to settings.scale
|
||||
/*
|
||||
* Access to utilities
|
||||
*/
|
||||
//getId, //See the getId documentation
|
||||
//hide, //See the hide documentation
|
||||
//log, //See the logging documentation
|
||||
//macro, //See the macros documentation
|
||||
//setHidden, //See the setHidden documentation
|
||||
//store, //See the store documentation
|
||||
//unhide, //See the unhide documentation
|
||||
//units, //See the units documentation
|
||||
//utils, //See the utils documentation
|
||||
/*
|
||||
* Return value
|
||||
*/
|
||||
part, // Your draft method must return this
|
||||
}) {
|
||||
|
||||
// Work your magic here
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const sleeve = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
* We STRONGLY recommend naming your parts in the format of
|
||||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.sleeve',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
* This should be a function that drafts and returns the part
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftSleeve,
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
*
|
||||
* You'll need to import these parts, just as with the from key above.
|
||||
*
|
||||
* If you don't have any parts to draft prior to this part,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
],
|
||||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend brian, and this is the sleeve part,
|
||||
* we're extending brian's sleeve part here.
|
||||
* It was imported at the top of this file from @freesewing/brian
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: brianSleeve,
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
* We've set this to false here to clarify its use.
|
||||
* I you don't want to hide this part,
|
||||
* you can remove the hide key entirely.
|
||||
*/
|
||||
hide: false,
|
||||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Brian's sleeve part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
hideDependencies: true,
|
||||
/*
|
||||
* hideAll: Set this to true to hide both the part and its dependencies.
|
||||
*
|
||||
* This is a combination of the hide and hideDependencies keys in case
|
||||
* you want to both hide this part and its dependencies.
|
||||
* We've included it here with a value of false to its use.
|
||||
* I you don't want to hide this a part and its dependencies,
|
||||
* you can remove the hideAll key entirely.
|
||||
*/
|
||||
hideAll: false,
|
||||
options: {
|
||||
/*
|
||||
* options: Holds (the configuration of) options for this part
|
||||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Brian's sleeve part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/options
|
||||
*/
|
||||
},
|
||||
measurements: [
|
||||
/*
|
||||
* measurements: Holds a list of measurements required by this part.
|
||||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Brian's sleeve part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
optionalMeasurements: [
|
||||
/*
|
||||
* optionalMeasurements: Holds a list of measurements optional in this part.
|
||||
*
|
||||
* Declare measurements that are optional for this part here.
|
||||
*
|
||||
* If you don't have any optional measurements to add,
|
||||
* you can remove this optionalMeasurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
plugins: [
|
||||
/*
|
||||
* plugins: Holds a list of plugins this part relies on.
|
||||
*
|
||||
* Add all the plugins here that you need in this part.
|
||||
* You only need to add additional plugins.
|
||||
* All plugins coming from Brian's sleeve part are already loaded.
|
||||
*
|
||||
* If you don't have any plugins to add,
|
||||
* you can remove this plugins key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/plugins
|
||||
*/
|
||||
]
|
||||
}
|
|
@ -1,98 +0,0 @@
|
|||
{
|
||||
"name": "@freesewing/{{name}}",
|
||||
"version": "0.0.1",
|
||||
"description": "A new FreeSewing design",
|
||||
"author": "Joost De Cock <joost@joost.at> (https://github.com/joostdecock)",
|
||||
"homepage": "https://freesewing.org/",
|
||||
"repository": "github:freesewing/freesewing",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/freesewing/freesewing/issues"
|
||||
},
|
||||
"funding": {
|
||||
"type": "individual",
|
||||
"url": "https://freesewing.org/patrons/join"
|
||||
},
|
||||
"keywords": [
|
||||
"freesewing",
|
||||
"design",
|
||||
"diy",
|
||||
"fashion",
|
||||
"parametric design",
|
||||
"sewing",
|
||||
"sewing pattern"
|
||||
],
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"scripts": {
|
||||
"dev": "next dev -p 8000",
|
||||
"build": "node build.js",
|
||||
"clean": "rimraf dist",
|
||||
"mbuild": "NO_MINIFY=1 node build.js",
|
||||
"test": "BABEL_ENV=production npx mocha tests/*.test.mjs --require @babel/register",
|
||||
"vbuild": "VERBOSE=1 node build.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@freesewing/core": "{{ tag }}",
|
||||
"@freesewing/brian": "{{ tag }}",
|
||||
"@freesewing/plugin-bundle": "{{ tag }}",
|
||||
"@freesewing/plugin-bust": "{{ tag }}"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@freesewing/plugin-svgattr": "{{ tag }}",
|
||||
"@freesewing/plugin-theme": "{{ tag }}",
|
||||
"@freesewing/plugin-i18n": "{{ tag }}",
|
||||
"@freesewing/models": "{{ tag }}",
|
||||
"@headlessui/react": "^1.6.5",
|
||||
"js-yaml": "^4.1.0",
|
||||
"file-saver": "^2.0.5",
|
||||
"axios": "^0.27.2",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-sizeme": "^3.0.2",
|
||||
"react-zoom-pan-pinch": "^2.1.3",
|
||||
"react-markdown": "^8.0.3",
|
||||
"@tailwindcss/typography": "^0.5.2",
|
||||
"d3-dispatch": "^3.0.1",
|
||||
"d3-drag": "^3.0.0",
|
||||
"d3-selection": "^3.0.0",
|
||||
"daisyui": "^2.0.6",
|
||||
"lodash.get": "^4.4.2",
|
||||
"lodash.orderby": "^4.6.0",
|
||||
"lodash.set": "^4.3.2",
|
||||
"lodash.unset": "^4.5.2",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"next": "^12.3.2",
|
||||
"next-i18next": "^11.0.0",
|
||||
"react-copy-to-clipboard": "^5.0.4",
|
||||
"react-hotkeys-hook": "^3.4.4",
|
||||
"react-swipeable": "^6.2.0",
|
||||
"react-timeago": "^6.2.1",
|
||||
"mocha": "^9.1.1",
|
||||
"chai": "^4.2.0",
|
||||
"autoprefixer": "^10.4.0",
|
||||
"eslint-config-next": "12.1.6",
|
||||
"highlight.js": "^11.5.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"pdfkit": "^0.13.0",
|
||||
"svg-to-pdfkit": "^0.1.8",
|
||||
"postcss-for": "^2.1.1",
|
||||
"postcss": "^8.4.14",
|
||||
"tailwindcss": "^3.1.3",
|
||||
"tailwindcss-open-variant": "^1.0.0",
|
||||
"web-worker": "^1.2.0"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
"README.md",
|
||||
"package.json"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"tag": "next"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0",
|
||||
"npm": ">=6"
|
||||
}
|
||||
}
|
2
packages/new-design/templates/from-titan.mjs
Normal file
2
packages/new-design/templates/from-titan.mjs
Normal file
|
@ -0,0 +1,2 @@
|
|||
export const parts = ['back', 'front']
|
||||
export const dependencies = ['@freesewing/titan', '@freesewing/snapseries']
|
|
@ -1,155 +0,0 @@
|
|||
import { back as titanBack } from '@freesewing/titan'
|
||||
|
||||
function draftBack({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
*/
|
||||
//Path, // A Path constructor to create new paths
|
||||
//Point, // A Point constructor to create new points
|
||||
//Snippet, // A Snippet constructor to create new snippets
|
||||
/*
|
||||
* Content constainers
|
||||
*/
|
||||
//paths, // Add a Path to your part by adding it to this object
|
||||
//points, // Add a Points to your part by adding it to this object
|
||||
//snippets, // Add a Snippet to your part by adding it to this object
|
||||
/*
|
||||
* Access to settings
|
||||
*/
|
||||
//absoluteOptions, // Access to settings.absoluteOptions
|
||||
//complete, // Access to settings.complete
|
||||
//measurements, // Access to settings.measurements
|
||||
//options, // Access to settings.options
|
||||
//paperless, // Access to settings.paperless
|
||||
//sa, // Access to settings.sa
|
||||
//scale, // Access to settings.scale
|
||||
/*
|
||||
* Access to utilities
|
||||
*/
|
||||
//getId, //See the getId documentation
|
||||
//hide, //See the hide documentation
|
||||
//log, //See the logging documentation
|
||||
//macro, //See the macros documentation
|
||||
//setHidden, //See the setHidden documentation
|
||||
//store, //See the store documentation
|
||||
//unhide, //See the unhide documentation
|
||||
//units, //See the units documentation
|
||||
//utils, //See the utils documentation
|
||||
/*
|
||||
* Return value
|
||||
*/
|
||||
part, // Your draft method must return this
|
||||
}) {
|
||||
|
||||
// Work your magic here
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const back = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
* We STRONGLY recommend naming your parts in the format of
|
||||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.back',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
* This should be a function that drafts and returns the part
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftBack,
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
*
|
||||
* You'll need to import these parts, just as with the from key above.
|
||||
*
|
||||
* If you don't have any parts to draft prior to this part,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
],
|
||||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend Titan, and this is the back part,
|
||||
* we're extending Titan's back part here.
|
||||
* It was imported at the top of this file from @freesewing/titan
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: titanBack,
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
* We've set this to false here to clarify its use.
|
||||
* I you don't want to hide this part,
|
||||
* you can remove the hide key entirely.
|
||||
*/
|
||||
hide: false,
|
||||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Titan's back part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
hideDependencies: true,
|
||||
/*
|
||||
* hideAll: Set this to true to hide both the part and its dependencies.
|
||||
*
|
||||
* This is a combination of the hide and hideDependencies keys in case
|
||||
* you want to both hide this part and its dependencies.
|
||||
* We've included it here with a value of false to its use.
|
||||
* I you don't want to hide this a part and its dependencies,
|
||||
* you can remove the hideAll key entirely.
|
||||
*/
|
||||
hideAll: false,
|
||||
options: {
|
||||
/*
|
||||
* options: Holds (the configuration of) options for this part
|
||||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Titan's back part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/options
|
||||
*/
|
||||
},
|
||||
measurements: [
|
||||
/*
|
||||
* measurements: Holds a list of measurements required by this part.
|
||||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Titan's back part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
optionalMeasurements: [
|
||||
/*
|
||||
* optionalMeasurements: Holds a list of measurements optional in this part.
|
||||
*
|
||||
* Declare measurements that are optional for this part here.
|
||||
*
|
||||
* If you don't have any optional measurements to add,
|
||||
* you can remove this optionalMeasurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
}
|
|
@ -1,155 +0,0 @@
|
|||
import { front as titanFront } from '@freesewing/titan'
|
||||
|
||||
function draftFront({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
*/
|
||||
//Path, // A Path constructor to create new paths
|
||||
//Point, // A Point constructor to create new points
|
||||
//Snippet, // A Snippet constructor to create new snippets
|
||||
/*
|
||||
* Content constainers
|
||||
*/
|
||||
//paths, // Add a Path to your part by adding it to this object
|
||||
//points, // Add a Points to your part by adding it to this object
|
||||
//snippets, // Add a Snippet to your part by adding it to this object
|
||||
/*
|
||||
* Access to settings
|
||||
*/
|
||||
//absoluteOptions, // Access to settings.absoluteOptions
|
||||
//complete, // Access to settings.complete
|
||||
//measurements, // Access to settings.measurements
|
||||
//options, // Access to settings.options
|
||||
//paperless, // Access to settings.paperless
|
||||
//sa, // Access to settings.sa
|
||||
//scale, // Access to settings.scale
|
||||
/*
|
||||
* Access to utilities
|
||||
*/
|
||||
//getId, //See the getId documentation
|
||||
//hide, //See the hide documentation
|
||||
//log, //See the logging documentation
|
||||
//macro, //See the macros documentation
|
||||
//setHidden, //See the setHidden documentation
|
||||
//store, //See the store documentation
|
||||
//unhide, //See the unhide documentation
|
||||
//units, //See the units documentation
|
||||
//utils, //See the utils documentation
|
||||
/*
|
||||
* Return value
|
||||
*/
|
||||
part, // Your draft method must return this
|
||||
}) {
|
||||
|
||||
// Work your magic here
|
||||
|
||||
return part
|
||||
}
|
||||
|
||||
export const front = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
* We STRONGLY recommend naming your parts in the format of
|
||||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.front',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
* This should be a function that drafts and returns the part
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftFront,
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
*
|
||||
* You'll need to import these parts, just as with the from key above.
|
||||
*
|
||||
* If you don't have any parts to draft prior to this part,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
],
|
||||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend titan, and this is the front part,
|
||||
* we're extending titan's front part here.
|
||||
* It was imported at the top of this file from @freesewing/titan
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: titanFront,
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
* We've set this to false here to clarify its use.
|
||||
* I you don't want to hide this part,
|
||||
* you can remove the hide key entirely.
|
||||
*/
|
||||
hide: false,
|
||||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Titan's front part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
hideDependencies: true,
|
||||
/*
|
||||
* hideAll: Set this to true to hide both the part and its dependencies.
|
||||
*
|
||||
* This is a combination of the hide and hideDependencies keys in case
|
||||
* you want to both hide this part and its dependencies.
|
||||
* We've included it here with a value of false to its use.
|
||||
* I you don't want to hide this a part and its dependencies,
|
||||
* you can remove the hideAll key entirely.
|
||||
*/
|
||||
hideAll: false,
|
||||
options: {
|
||||
/*
|
||||
* options: Holds (the configuration of) options for this part
|
||||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Titan's front part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/options
|
||||
*/
|
||||
},
|
||||
measurements: [
|
||||
/*
|
||||
* measurements: Holds a list of measurements required by this part.
|
||||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Titan's front part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
optionalMeasurements: [
|
||||
/*
|
||||
* optionalMeasurements: Holds a list of measurements optional in this part.
|
||||
*
|
||||
* Declare measurements that are optional for this part here.
|
||||
*
|
||||
* If you don't have any optional measurements to add,
|
||||
* you can remove this optionalMeasurements key entirely.
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/measurements
|
||||
*/
|
||||
],
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
{
|
||||
"name": "@freesewing/{{name}}",
|
||||
"version": "0.0.1",
|
||||
"description": "A new FreeSewing design",
|
||||
"author": "Joost De Cock <joost@joost.at> (https://github.com/joostdecock)",
|
||||
"homepage": "https://freesewing.org/",
|
||||
"repository": "github:freesewing/freesewing",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/freesewing/freesewing/issues"
|
||||
},
|
||||
"funding": {
|
||||
"type": "individual",
|
||||
"url": "https://freesewing.org/patrons/join"
|
||||
},
|
||||
"keywords": [
|
||||
"freesewing",
|
||||
"design",
|
||||
"diy",
|
||||
"fashion",
|
||||
"parametric design",
|
||||
"sewing",
|
||||
"sewing pattern"
|
||||
],
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"scripts": {
|
||||
"dev": "next dev -p 8000",
|
||||
"build": "node build.js",
|
||||
"clean": "rimraf dist",
|
||||
"mbuild": "NO_MINIFY=1 node build.js",
|
||||
"test": "BABEL_ENV=production npx mocha tests/*.test.mjs --require @babel/register",
|
||||
"vbuild": "VERBOSE=1 node build.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@freesewing/core": "{{ tag }}",
|
||||
"@freesewing/titan": "{{ tag }}",
|
||||
"@freesewing/snapseries": "{{ tag }}",
|
||||
"@freesewing/plugin-bundle": "{{ tag }}"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@freesewing/plugin-svgattr": "{{ tag }}",
|
||||
"@freesewing/plugin-theme": "{{ tag }}",
|
||||
"@freesewing/plugin-i18n": "{{ tag }}",
|
||||
"@freesewing/models": "{{ tag }}",
|
||||
"@headlessui/react": "^1.6.5",
|
||||
"js-yaml": "^4.1.0",
|
||||
"file-saver": "^2.0.5",
|
||||
"axios": "^0.27.2",
|
||||
"react": "^17.0.2",
|
||||
"svg-to-pdfkit": "^0.1.8",
|
||||
"react-dom": "^17.0.2",
|
||||
"pdfkit": "^0.13.0",
|
||||
"react-sizeme": "^3.0.2",
|
||||
"react-zoom-pan-pinch": "^2.1.3",
|
||||
"react-markdown": "^8.0.3",
|
||||
"roughjs": "^4.5.2",
|
||||
"@tailwindcss/typography": "^0.5.2",
|
||||
"d3-dispatch": "^3.0.1",
|
||||
"d3-drag": "^3.0.0",
|
||||
"d3-selection": "^3.0.0",
|
||||
"daisyui": "^2.0.6",
|
||||
"lodash.get": "^4.4.2",
|
||||
"lodash.orderby": "^4.6.0",
|
||||
"lodash.set": "^4.3.2",
|
||||
"lodash.unset": "^4.5.2",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"next": "^12.3.2",
|
||||
"next-i18next": "^11.0.0",
|
||||
"react-copy-to-clipboard": "^5.0.4",
|
||||
"react-hotkeys-hook": "^3.4.4",
|
||||
"react-swipeable": "^6.2.0",
|
||||
"react-timeago": "^6.2.1",
|
||||
"mocha": "^9.1.1",
|
||||
"chai": "^4.2.0",
|
||||
"autoprefixer": "^10.4.0",
|
||||
"eslint-config-next": "12.1.6",
|
||||
"highlight.js": "^11.5.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"postcss": "^8.4.14",
|
||||
"postcss-for": "^2.1.1",
|
||||
"tailwindcss": "^3.1.3",
|
||||
"tailwindcss-open-variant": "^1.0.0",
|
||||
"web-worker": "^1.2.0"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
"README.md",
|
||||
"package.json"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"tag": "next"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0",
|
||||
"npm": ">=6"
|
||||
}
|
||||
}
|
|
@ -1,8 +1,9 @@
|
|||
// Import Design constructor
|
||||
import { Design } from '@freesewing/core'
|
||||
// Import parts
|
||||
import { back } from './back'
|
||||
import { front } from './front'
|
||||
{{#parts}}
|
||||
import { {{.}} } from './{{.}}.mjs'
|
||||
{{/parts}}
|
||||
|
||||
// Create the new design
|
||||
const Pattern = new Design({
|
||||
|
@ -17,7 +18,7 @@ const Pattern = new Design({
|
|||
name: "{{ name }}",
|
||||
},
|
||||
// A list of parts is all that is required.
|
||||
parts: [ back, front ],
|
||||
parts: [ {{parts}} ],
|
||||
})
|
||||
|
||||
/*
|
||||
|
@ -26,5 +27,5 @@ const Pattern = new Design({
|
|||
* We export the design itself as well as each part individually.
|
||||
* This allows us to re-use these parts in other designs.
|
||||
*/
|
||||
export { back, front, Pattern }
|
||||
export { {{#parts}}{{.}}, {{/parts}}Pattern }
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { back as bellaBack } from '@freesewing/bella'
|
||||
import { {{part}} as {{baseName}}{{partUpcase}} } from '@freesewing/{{baseName}}'
|
||||
|
||||
function draftBack({
|
||||
function draft{{partUpcase}} ({
|
||||
// Uncomment below to destructure what you need
|
||||
/*
|
||||
* Content constructors
|
||||
|
@ -47,7 +47,7 @@ function draftBack({
|
|||
return part
|
||||
}
|
||||
|
||||
export const back = {
|
||||
export const {{part}} = {
|
||||
/*
|
||||
* name: Holds the name of this part.
|
||||
*
|
||||
|
@ -55,7 +55,7 @@ export const back = {
|
|||
* design.part to avoid naming conflicts when people re-use
|
||||
* parts across designs.
|
||||
*/
|
||||
name: '{{ name }}.back',
|
||||
name: '{{ name }}.{{part}}',
|
||||
/*
|
||||
* draft: Holds the draft method for this part
|
||||
*
|
||||
|
@ -63,7 +63,7 @@ export const back = {
|
|||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/draft
|
||||
*/
|
||||
draft: draftBack,
|
||||
draft: draft{{partUpcase}},
|
||||
after: [
|
||||
/*
|
||||
* after: Holds a list of parts that should be drafted prior to this part.
|
||||
|
@ -79,13 +79,13 @@ export const back = {
|
|||
/*
|
||||
* from: Holds the part you want to extend.
|
||||
*
|
||||
* Since you opted to extend Bella, and this is the back part,
|
||||
* we're extending Bella's back part here.
|
||||
* It was imported at the top of this file from @freesewing/Bella
|
||||
* Since you opted to extend {{baseNameUpcase}}, and this is the {{part}} part,
|
||||
* we're extending {{baseNameUpcase}}'s {{part}} part here.
|
||||
* It was imported at the top of this file from @freesewing/{{baseNameUpcase}}
|
||||
*
|
||||
* Documentation: https://freesewing.dev/reference/api/part/config/dependencies
|
||||
*/
|
||||
from: bellaBack,
|
||||
from: {{baseName}}{{partUpcase}},
|
||||
/*
|
||||
* hide: Set this to true to hide a part.
|
||||
*
|
||||
|
@ -97,7 +97,7 @@ export const back = {
|
|||
/*
|
||||
* hideDependecies: Set this to true to hide a part's dependencies.
|
||||
*
|
||||
* We've set this to true here since you're extending Bella's back part.
|
||||
* We've set this to true here since you're extending {{baseNameUpcase}}'s {{part}} part.
|
||||
* I you don't want to hide this part's dependencies,
|
||||
* you can remove the hideDependencies key entirely.
|
||||
*/
|
||||
|
@ -118,7 +118,7 @@ export const back = {
|
|||
*
|
||||
* Declare options used in this part here.
|
||||
* You only need to add additional options.
|
||||
* All options coming from Bella's back part are already loaded.
|
||||
* All options coming from {{baseNameUpcase}}'s {{part}} part are already loaded.
|
||||
*
|
||||
* If you don't have any options to add,
|
||||
* you can remove this options key entirely.
|
||||
|
@ -132,7 +132,7 @@ export const back = {
|
|||
*
|
||||
* Declare measurements required by this part here.
|
||||
* You only need to add additional measurements.
|
||||
* All measurements coming from Bella's back part are already loaded.
|
||||
* All measurements coming from {{baseNameUpcase}}'s {{part}} part are already loaded.
|
||||
*
|
||||
* If you don't have any required measurements to add,
|
||||
* you can remove this measurements key entirely.
|
||||
|
@ -158,7 +158,7 @@ export const back = {
|
|||
*
|
||||
* Add all the plugins here that you need in this part.
|
||||
* You only need to add additional plugins.
|
||||
* All plugins coming from Bella's back part are already loaded.
|
||||
* All plugins coming from {{baseNameUpcase}}'s {{part}} part are already loaded.
|
||||
*
|
||||
* If you don't have any plugins to add,
|
||||
* you can remove this plugins key entirely.
|
|
@ -34,7 +34,9 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@freesewing/core": "{{ tag }}",
|
||||
"@freesewing/breanna": "{{ tag }}",
|
||||
{{#dependencies}}
|
||||
"{{{.}}}": "{{tag}}",
|
||||
{{/dependencies}}
|
||||
"@freesewing/plugin-bundle": "{{ tag }}"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -46,8 +48,6 @@
|
|||
"js-yaml": "^4.1.0",
|
||||
"file-saver": "^2.0.5",
|
||||
"axios": "^0.27.2",
|
||||
"pdfkit": "^0.13.0",
|
||||
"svg-to-pdfkit": "^0.1.8",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-sizeme": "^3.0.2",
|
||||
|
@ -66,6 +66,7 @@
|
|||
"lodash.clonedeep": "^4.5.0",
|
||||
"next": "^12.3.2",
|
||||
"next-i18next": "^11.0.0",
|
||||
"pdfkit": "^0.13.0",
|
||||
"react-copy-to-clipboard": "^5.0.4",
|
||||
"react-hotkeys-hook": "^3.4.4",
|
||||
"react-swipeable": "^6.2.0",
|
||||
|
@ -78,6 +79,7 @@
|
|||
"js-yaml": "^4.1.0",
|
||||
"postcss": "^8.4.14",
|
||||
"postcss-for": "^2.1.1",
|
||||
"svg-to-pdfkit": "^0.1.8",
|
||||
"tailwindcss": "^3.1.3",
|
||||
"tailwindcss-open-variant": "^1.0.0",
|
||||
"web-worker": "^1.2.0"
|
Loading…
Add table
Add a link
Reference in a new issue