1
0
Fork 0

wip(new-design): Added different templates

This commit is contained in:
Joost De Cock 2022-06-23 15:17:18 +02:00
parent 437d444462
commit 14f43fb078
38 changed files with 977 additions and 87 deletions

3
.gitignore vendored
View file

@ -60,6 +60,7 @@ packages/utils/tiler
packages/utils/validateEmail
packages/utils/validateTld
# Any NPM or Yarn lock files
designs/*/package-lock.json
designs/*/yarn.lock
@ -78,6 +79,8 @@ sites/strapi/.cache
sites/*/public/locales/*/*.json
sites/*/public/feeds/*
packages/new-design/shared/public/locales/*/*.json
packages/new-design/shared/.gitignore
packages/new-design/lib/banner.mjs
# Lab auto-generated pages
sites/lab/lib

View file

@ -76,6 +76,8 @@ packageJson:
lunetius: &starf
author: Starfetch (https://github.com/starfetch)
new-design:
bin:
"@freesewing/new-design": "dist/index.js"
files:
- README.md
- package.json
@ -85,8 +87,7 @@ packageJson:
- templates/**/*
- index.mjs
- package.json
bin:
"@freesewing/new-design": "index.mjs"
module: '!'
noble:
author: woutervdub (https://github.com/woutervdub)

View file

@ -43,7 +43,7 @@ i18n:
test: *test
testci: *testci
new-design:
prebuild: "SITE=new-design/shared node ../../sites/shared/prebuild/i18n-only.mjs"
prebuild: "SITE=new-design/shared node ../../sites/shared/prebuild/i18n-only.mjs && cp ../../scripts/banner.mjs ./lib"
mbuild: '!'
test: '!'
testci: '!'

View file

@ -1,7 +1,6 @@
import path from 'path'
import chalk from 'chalk'
import commander from 'commander'
import { banner } from '../../../scripts/banner.mjs'
import { banner } from './banner.mjs'
import {
checkNodeVersion,
getChoices,

View file

@ -189,5 +189,27 @@ export const config = {
to: 'shared/config/measurements.mjs'
}
],
}
},
gitignore: `
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
node_modules
# builds
dist
.next
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
`,
}

View file

@ -15,7 +15,6 @@ const cwd = __dirname
? __dirname
: dirname(fileURLToPath(import.meta.url))
console.log({cwd})
const nl = "\n"
const tab = " "
const nlt = nl+tab
@ -158,6 +157,20 @@ const downloadLabFiles = async (config) => {
return
}
// Helper method to initialize a git repository
const initGitRepo = async (config, choices) => {
await writeFile(join(config.dest, '.gitignore'), config.gitignore, 'utf-8')
return execa(
`git init -b main && git add . && git commit -m ":tada: Initialized ${choices.name} repository"`,
{
cwd: config.dest,
shell: true
}
)
}
// Creates the environment based on the user's choices
export const createEnvironment = async (choices) => {
@ -179,13 +192,16 @@ export const createEnvironment = async (choices) => {
shared: await rdir(config.source.shared),
}
// Output a linebreak
console.log()
// Copy/Template files
await oraPromise(
copyTemplate(config, choices),
{
text: chalk.white.bold(' 🟨⬜⬜ Copying template files')+chalk.white.dim(' | Just a moment'),
successText: chalk.white.bold(' 🟩⬜⬜ Copied template files'),
failText: chalk.white.bold(' 🟥⬜⬜ Failed to copy template files'),
text: chalk.white.bold('🟨⬜⬜ Copying template files')+chalk.white.dim(' | Just a moment'),
successText: chalk.white.bold('🟩⬜⬜ Copied template files'),
failText: chalk.white.bold(' ⚠️ Failed to copy template files'),
}
)
@ -193,9 +209,9 @@ export const createEnvironment = async (choices) => {
await oraPromise(
installDependencies(config, choices),
{
text: chalk.white.bold(' 🟩🟨⬜ Installing dependencies')+chalk.white.dim(' | Please wait, this will take a while'),
successText: chalk.white.bold(' 🟩🟩⬜ Installed dependencies'),
failText: chalk.white.bold(' 🟩🟥⬜ Failed to install dependencies'),
text: chalk.white.bold('🟩🟨⬜ Installing dependencies')+chalk.white.dim(' | Please wait, this will take a while'),
successText: chalk.white.bold('🟩🟩⬜ Installed dependencies'),
failText: chalk.white.bold(' ⚠️ Failed to install dependencies'),
}
)
@ -203,77 +219,21 @@ export const createEnvironment = async (choices) => {
await oraPromise(
downloadLabFiles(config),
{
text: chalk.white.bold(' 🟩🟩🟨 Downloading web components')+chalk.white.dim(' | Almost there'),
successText: chalk.white.bold(' 🟩🟩🟩 Downloaded web components'),
failText: chalk.white.bold(' 🟩🟩🟥 Failed to download web components'),
text: chalk.white.bold('🟩🟩🟨⬜ Downloading web components')+chalk.white.dim(' | Almost there'),
successText: chalk.white.bold('🟩🟩🟩⬜ Downloaded web components'),
failText: chalk.white.bold(' ⚠️ Failed to download web components'),
}
)
// Initialize git repository
await oraPromise(
initGitRepo(config, choices),
{
text: chalk.white.bold('🟩🟩🟩⬜ Initializing git repository')+chalk.white.dim(' | You have git, right?'),
successText: chalk.white.bold('🟩🟩🟩🟩 Initialized git repository'),
failText: chalk.white.bold(' ⚠️ Failed to initialize git repository')+chalk.white.dim(' | This does not stop you from developing your design'),
}
)
}
//const handlebars = require('handlebars')
//const execa = require('execa')
//const fs = require('fs')
//const globby = require('globby')
//const normalize = require('normalize-path')
//const mkdirp = require('make-dir')
//const ora = require('ora')
//const pEachSeries = require('p-each-series')
//const pkg = require('../package')
/*
const templateBlacklist = new Set([path.join('example', 'public', 'favicon.ico')])
module.exports = async (info) => {
if (git) {
const promise = module.exports.initGitRepo({ dest })
ora.promise(promise, 'Initializing git repo')
await promise
}
return dest
}
module.exports.initGitRepo = async (opts) => {
const { dest } = opts
const gitIgnorePath = path.join(dest, '.gitignore')
fs.writeFileSync(
gitIgnorePath,
`
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
node_modules
# builds
build
dist
.rpt2_cache
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
`,
'utf8'
)
const cmd = `git init && git add . && git commit -m ":tada: Initialized ${pkg.name}@${pkg.version} with create-freesewing-pattern"`
return execa.sync(cmd, { cwd: dest, shell: true })
}
*/

View file

@ -18,14 +18,13 @@
"freesewing"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"scripts": {
"build": "node build.js",
"clean": "rimraf dist",
"symlink": "mkdir -p ./node_modules/@freesewing && cd ./node_modules/@freesewing && ln -s -f ../../../* . && cd -",
"lab": "cd ../../sites/lab && yarn start",
"tips": "node ../../scripts/help.mjs",
"prebuild": "SITE=new-design/shared node ../../sites/shared/prebuild/i18n-only.mjs",
"prebuild": "SITE=new-design/shared node ../../sites/shared/prebuild/i18n-only.mjs && cp ../../scripts/banner.mjs ./lib",
"cibuild_step6": "node build.js"
},
"peerDependencies": {},
@ -58,6 +57,6 @@
"npm": ">=6"
},
"bin": {
"@freesewing/new-design": "index.mjs"
"@freesewing/new-design": "dist/index.js"
}
}

View file

@ -0,0 +1,29 @@
import { version } from './package.json'
import { config as bellaConfig } from '@freesewing/bella'
export default {
name: '{{name}}',
version,
optionGroups: {
...bellaConfig.optionGroups,
},
measurements: [
...bellaConfig.measurements,
],
dependencies: {
bellaFrontSideDart: 'bellaBack',
},
inject: {
back: 'bellaBack',
front: 'bellaFrontSideDart'
},
hide: [
'bellaBack',
'bellaFrontSideDart',
],
parts: [],
options: {
...bellaConfig.options,
},
}

View file

@ -0,0 +1,94 @@
{
"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": "node --experimental-json-modules ./node_modules/.bin/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": "latest",
"@freesewing/bella": "next",
"@freesewing/plugin-bundle": "latest",
"@freesewing/config-helpers": "next"
},
"devDependencies": {
"@freesewing/plugin-svgattr": "latest",
"@freesewing/plugin-theme": "latest",
"@freesewing/plugin-i18n": "latest",
"@freesewing/utils": "latest",
"@freesewing/models": "latest",
"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",
"next": "latest",
"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",
"tailwindcss": "^3.1.3",
"tailwindcss-open-variant": "^1.0.0"
},
"files": [
"dist/*",
"README.md",
"package.json"
],
"publishConfig": {
"access": "public",
"tag": "next"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=6"
}
}

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,27 @@
// Import dependencies
import freesewing from '@freesewing/core'
import plugins from '@freesewing/plugin-bundle'
// Import Bella so we can extend it
import Bella from '@freesewing/bella'
// Import configuration
import config from '../config'
// Import parts
import draftBack from './back'
import draftFront from './front'
// Create the new design
const Design = new freesewing.Design(config, plugins)
// Attach Bella's draft methods to the prototype
for (const m of [ 'Back', 'FrontSideDart' ]) {
Design.prototype[`draftBella${m}`] = function (part) {
return new Bella(this.settings)[`draft${m}`](part)
}
}
// Attach the draft methods to the prototype
Design.prototype.draftBack = draftBack
Design.prototype.draftFront = draftFront
// Export the new Design
export default Design

View file

@ -0,0 +1,35 @@
import { version } from './package.json'
import { config as bentConfig } from '@freesewing/bent'
export default {
name: '{{name}}',
version,
optionGroups: {
...bentConfig.optionGroups,
},
measurements: [
...bentConfig.measurements,
],
inject: {
bentBack: 'bentBase',
bentFront: 'bentBack',
bentTopSleeve: 'bentSleeve',
bentUnderSleeve: 'bentSleeve',
front: 'bentFront',
back: 'bentBack',
topSleeve: 'bentTopSleeve',
underSleeve: 'bentUnderSleeve',
},
hide: [
'bentBase',
'bentFront',
'bentBack',
'bentSleeve',
'bentTopSleeve',
'bentUnderSleeve',
],
options: {
...bentConfig.options,
},
}

View file

@ -0,0 +1,96 @@
{
"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": "node --experimental-json-modules ./node_modules/.bin/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": "latest",
"@freesewing/bent": "next",
"@freesewing/brian": "next",
"@freesewing/plugin-bundle": "latest",
"@freesewing/plugin-mirror": "latest",
"@freesewing/config-helpers": "next"
},
"devDependencies": {
"@freesewing/plugin-svgattr": "latest",
"@freesewing/plugin-theme": "latest",
"@freesewing/plugin-i18n": "latest",
"@freesewing/utils": "latest",
"@freesewing/models": "latest",
"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",
"next": "latest",
"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",
"tailwindcss": "^3.1.3",
"tailwindcss-open-variant": "^1.0.0"
},
"files": [
"dist/*",
"README.md",
"package.json"
],
"publishConfig": {
"access": "public",
"tag": "next"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=6"
}
}

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,38 @@
// Import dependencies
import freesewing from '@freesewing/core'
import plugins from '@freesewing/plugin-bundle'
// Import Bent so we can extend it
import Bent from '@freesewing/bent'
// Import configuration
import config from '../config'
// Import parts
import draftFront from './front'
import draftBack from './back'
import draftTopSleeve from './top-sleeve'
import draftUnderSleeve from './under-sleeve'
// Create the new design
const Design = new freesewing.Design(config, plugins)
// Attach Bent's draft methods to the prototype
for (const m of [
'Base',
'Front',
'Back',
'Sleeve',
'TopSleeve',
'UnderSleeve',
]) {
Design.prototype[`draftBent${m}`] = function (part) {
return new Bent(this.settings)[`draft${m}`](part)
}
}
// Attach the draft methods to the prototype
Design.prototype.draftBack = draftBack
Design.prototype.draftFront = draftFront
Design.prototype.draftTopSleeve = draftTopSleeve
Design.prototype.draftUnderSleeve = draftUnderSleeve
// Export the new Design
export default Design

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,37 @@
import { version } from './package.json'
import { config as breannaConfig } from '@freesewing/breanna'
export default {
name: '{{name}}',
version,
optionGroups: {
...breannaConfig.optionGroups,
},
measurements: [
...breannaConfig.measurements,
],
dependencies: {
},
inject: {
breannaBack: 'breannaBase',
breannaFrontBase: 'breannaBase',
breannaFront: 'breannaFrontBase',
breannaSleeve: 'breannaSleevecap',
front: 'breannaFront',
back: 'breannaBack',
sleeve: 'breannaSleeve',
},
hide: [
'breannaBase',
'breannaBack',
'breannaFrontBase',
'breannaFront',
'breannaSleevecap',
'breannaSleeve',
],
parts: [],
options: {
...breannaConfig.options,
},
}

View file

@ -0,0 +1,94 @@
{
"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": "node --experimental-json-modules ./node_modules/.bin/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": "latest",
"@freesewing/breanna": "next",
"@freesewing/plugin-bundle": "latest",
"@freesewing/config-helpers": "next"
},
"devDependencies": {
"@freesewing/plugin-svgattr": "latest",
"@freesewing/plugin-theme": "latest",
"@freesewing/plugin-i18n": "latest",
"@freesewing/utils": "latest",
"@freesewing/models": "latest",
"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",
"next": "latest",
"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",
"tailwindcss": "^3.1.3",
"tailwindcss-open-variant": "^1.0.0"
},
"files": [
"dist/*",
"README.md",
"package.json"
],
"publishConfig": {
"access": "public",
"tag": "next"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=6"
}
}

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,36 @@
// Import dependencies
import freesewing from '@freesewing/core'
import plugins from '@freesewing/plugin-bundle'
// Import Breanna so we can extend it
import Breanna from '@freesewing/breanna'
// Import configuration
import config from '../config'
// Import parts
import draftBack from './back'
import draftFront from './front'
import draftSleeve from './sleeve'
// Create the new design
const Design = new freesewing.Design(config, plugins)
// Attach Breanna's draft methods to the prototype
for (const m of [
'Base',
'Back',
'FrontBase',
'Front',
'Sleevecap',
'Sleeve',
]) {
Design.prototype[`draftBreanna${m}`] = function (part) {
return new Breanna(this.settings)[`draft${m}`](part)
}
}
// Attach the draft methods to the prototype
Design.prototype.draftBack = draftBack
Design.prototype.draftFront = draftFront
Design.prototype.draftSleeve = draftSleeve
// Export the new Design
export default Design

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,37 @@
import { version } from './package.json'
import { config as brianConfig } from '@freesewing/brian'
export default {
name: '{{name}}',
version,
optionGroups: {
...brianConfig.optionGroups,
},
measurements: [
...brianConfig.measurements,
],
dependencies: {
brianSleevecap: 'brianFront',
},
inject: {
brianBack: 'brianBase',
brianFront: 'brianBack',
brianSleeve: 'brianSleevecap',
back: 'brianBack',
front: 'brianFront',
sleeve: 'brianSleeve',
},
hide: [
'brianBase',
'brianFront',
'brianBack',
'brianSleevecap',
'brianSleeve',
'sleevecap',
],
parts: [],
options: {
...brianConfig.options,
},
}

View file

@ -0,0 +1,94 @@
{
"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": "node --experimental-json-modules ./node_modules/.bin/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": "latest",
"@freesewing/brian": "next",
"@freesewing/plugin-bundle": "latest",
"@freesewing/config-helpers": "next"
},
"devDependencies": {
"@freesewing/plugin-svgattr": "latest",
"@freesewing/plugin-theme": "latest",
"@freesewing/plugin-i18n": "latest",
"@freesewing/utils": "latest",
"@freesewing/models": "latest",
"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",
"next": "latest",
"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",
"tailwindcss": "^3.1.3",
"tailwindcss-open-variant": "^1.0.0"
},
"files": [
"dist/*",
"README.md",
"package.json"
],
"publishConfig": {
"access": "public",
"tag": "next"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=6"
}
}

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,35 @@
// Import dependencies
import freesewing from '@freesewing/core'
import plugins from '@freesewing/plugin-bundle'
// Import Brian so we can extend it
import Brian from '@freesewing/brian'
// Import configuration
import config from '../config'
// Import parts
import draftFront from './front'
import draftBack from './back'
import draftSleeve from './sleeve'
// Create the new design
const Design = new freesewing.Design(config, plugins)
// Attach Brian's draft methods to the prototype
for (const m of [
'Base',
'Front',
'Back',
'Sleevecap',
'Sleeve',
]) {
Design.prototype[`draftBrian${m}`] = function (part) {
return new Brian(this.settings)[`draft${m}`](part)
}
}
// Attach the draft methods to the prototype
Design.prototype.draftBack = draftBack
Design.prototype.draftFront = draftFront
Design.prototype.draftSleeve = draftSleeve
// Export the new Design
export default Design

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -1,4 +1,4 @@
export default function (part) {
export default (part) => {
const {
Point, points,
Path, paths,

View file

@ -0,0 +1,28 @@
import { version } from './package.json'
import { config as titanConfig } from '@freesewing/titan'
export default {
name: '{{name}}',
version,
optionGroups: {
...titanConfig.optionGroups,
},
measurements: [
...titanConfig.measurements,
],
dependencies: {
titanFront: 'titanBack',
},
inject: {
front: 'titanFront',
back: 'titanBack',
},
hide: [
'titanFront',
'titanBack',
],
options: {
...titanConfig.options,
},
}

View file

@ -0,0 +1,94 @@
{
"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": "node --experimental-json-modules ./node_modules/.bin/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": "latest",
"@freesewing/titan": "next",
"@freesewing/plugin-bundle": "latest",
"@freesewing/config-helpers": "next"
},
"devDependencies": {
"@freesewing/plugin-svgattr": "latest",
"@freesewing/plugin-theme": "latest",
"@freesewing/plugin-i18n": "latest",
"@freesewing/utils": "latest",
"@freesewing/models": "latest",
"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",
"next": "latest",
"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",
"tailwindcss": "^3.1.3",
"tailwindcss-open-variant": "^1.0.0"
},
"files": [
"dist/*",
"README.md",
"package.json"
],
"publishConfig": {
"access": "public",
"tag": "next"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=6"
}
}

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,7 @@
export default (part) => {
// Do to this part what you wish, before returning it
return part
}

View file

@ -0,0 +1,27 @@
// Import dependencies
import freesewing from '@freesewing/core'
import plugins from '@freesewing/plugin-bundle'
// Import Titan so we can extend it
import Titan from '@freesewing/titan'
// Import configuration
import config from '../config'
// Import parts
import draftFront from './front'
import draftBack from './back'
// Create the new design
const Design = new freesewing.Design(config, plugins)
// Attach Titan's draft methods to the prototype
for (const m of [ 'Back', 'Front' ]) {
Design.prototype[`draftTitan${m}`] = function (part) {
return new Titan(this.settings)[`draft${m}`](part)
}
}
// Attach the draft methods to the prototype
Design.prototype.draftBack = draftBack
Design.prototype.draftFront = draftFront
// Export the new Design
export default Design