tada: Initial code commit
This commit is contained in:
parent
53ee2842ca
commit
786577c716
16 changed files with 6084 additions and 4 deletions
3
packages/pattern-bundle/.babelrc
Normal file
3
packages/pattern-bundle/.babelrc
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"plugins": ["transform-object-rest-spread"]
|
||||
}
|
13
packages/pattern-bundle/.editorconfig
Normal file
13
packages/pattern-bundle/.editorconfig
Normal file
|
@ -0,0 +1,13 @@
|
|||
# editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
62
packages/pattern-bundle/.gitignore
vendored
Normal file
62
packages/pattern-bundle/.gitignore
vendored
Normal file
|
@ -0,0 +1,62 @@
|
|||
dist
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
# next.js build output
|
||||
.next
|
2
packages/pattern-bundle/.npmignore
Normal file
2
packages/pattern-bundle/.npmignore
Normal file
|
@ -0,0 +1,2 @@
|
|||
src
|
||||
.editorconfig
|
21
packages/pattern-bundle/LICENSE
Normal file
21
packages/pattern-bundle/LICENSE
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2018 Joost De Cock
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -7,22 +7,25 @@
|
|||
|
||||
# Freesewing patterns
|
||||
|
||||
An overview of sewing patterns available for [the JavaScript version of freesewing](https://github.com/freesewing/freesewing).
|
||||
This bundles the sewing patterns available for (the JavaScript version of)
|
||||
[freesewing](https://github.com/freesewing/freesewing).
|
||||
|
||||
## Blocks
|
||||
## Included patterns
|
||||
|
||||
### Blocks
|
||||
|
||||
Blocks or slopers are basic patterns shapes that you can extend into fully detailed patterns.
|
||||
|
||||
- [brian](https://github.com/freesewing/brian) : A basic body block for menswear, and the basis for many of our menswear patterns.
|
||||
|
||||
## Menswear
|
||||
### Menswear
|
||||
|
||||
- [aaron](https://github.com/freesewing/aaron) : A tank top or A-shirt
|
||||
- [bruce](https://github.com/freesewing/bruce) : Boxer briefs
|
||||
- [hugo](https://github.com/freesewing/hugo) : A hooded sweatshirt with raglan sleeves
|
||||
|
||||
|
||||
## Womenswear
|
||||
### Womenswear
|
||||
|
||||
- [cathrin](https://github.com/freesewing/cathrin) : An underbust corset or waist trainer
|
||||
|
||||
|
@ -37,3 +40,19 @@ Blocks or slopers are basic patterns shapes that you can extend into fully detai
|
|||
> It is not a limitation, or even a suggestion, of what you can or should wear or make.
|
||||
>
|
||||
> Wear whatever you want, and be proud of the things you make.
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm i --save @freesewing/patterns
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
This exposes 3 named exports:
|
||||
|
||||
- `patterns` : An object holding pattern constructors
|
||||
- `patternList` : An array of pattern names
|
||||
- `patternInfo` : Extra pattern information that is typically used for frontend integration (tags, difficulty level, that sort of thing).
|
||||
|
||||
For more details, please refer to [the main freesewing library](https://github.com/freesewing/freesewing).
|
||||
|
|
5745
packages/pattern-bundle/package-lock.json
generated
Normal file
5745
packages/pattern-bundle/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
81
packages/pattern-bundle/package.json
Normal file
81
packages/pattern-bundle/package.json
Normal file
|
@ -0,0 +1,81 @@
|
|||
{
|
||||
"version": "0.2.0",
|
||||
"name": "@freesewing/patterns",
|
||||
"description": "An umbrella package for all freesewing patterns",
|
||||
"author": "Joost De Cock <joost@decock.org> (https://github.com/joostdecock)",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/freesewing/patterns#readme",
|
||||
"repository": "github:freesewing/patterns",
|
||||
"bugs": {
|
||||
"url": "https://github.com/freesewing/patterns/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"freesewing",
|
||||
"patterns",
|
||||
"sewing"
|
||||
],
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"unpkg": "dist/browser.js",
|
||||
"scripts": {
|
||||
"precommit": "npm run pretty && lint-staged",
|
||||
"patch": "npm version patch -m ':bookmark: v%s' && npm run build",
|
||||
"minor": "npm version minor -m ':bookmark: v%s' && npm run build",
|
||||
"major": "npm version major -m ':bookmark: v%s' && npm run build",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"clean": "rimraf dist",
|
||||
"pretty": "npx prettier --write \"src/*.js\"",
|
||||
"lint": "eslint --fix \"src/*.js\"",
|
||||
"watch": "rollup -w -c rollup.js -o dist/browser.js -f iife -n freesewing_patterns --footer 'freesewing.patterns = freesewing_patterns;'",
|
||||
"browserbuild": "rollup -c rollup.js -o dist/browser.js -f iife -n freesewing_patterns --footer 'freesewing.patterns = freesewing_patterns;'",
|
||||
"nodebuild": "rollup -c rollup.js -o dist/index.js -f cjs",
|
||||
"modulebuild": "rollup -c rollup.js -o dist/index.mjs -f es",
|
||||
"build": "npm run clean && npm run browserbuild && npm run nodebuild && npm run modulebuild"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,json}": [
|
||||
"prettier --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@freesewing/aaron": "^0.3",
|
||||
"@freesewing/brian": "^0.13",
|
||||
"@freesewing/bruce": "^0.3",
|
||||
"@freesewing/cathrin": "^0.2",
|
||||
"@freesewing/hugo": "^0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.56",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.56",
|
||||
"@babel/preset-env": "7.0.0-beta.56",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-eslint": "^8.2.6",
|
||||
"babel-loader": "^8.0.0-beta.4",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"eslint": "5.3.0",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-plugin-prettier": "^2.6.2",
|
||||
"husky": "^0.14.3",
|
||||
"lint-staged": "^7.2.0",
|
||||
"prettier": "1.14.0",
|
||||
"rimraf": "^2.6.2",
|
||||
"rollup-plugin-babel": "^3.0.7",
|
||||
"rollup-plugin-commonjs": "9.1.3",
|
||||
"rollup-plugin-filesize": "^4.0.1",
|
||||
"rollup-plugin-json": "^3.0.0",
|
||||
"rollup-plugin-node-resolve": "^3.3.0",
|
||||
"rollup-plugin-terser": "^1.0.1"
|
||||
},
|
||||
"files": [
|
||||
"dist/*",
|
||||
"README.md",
|
||||
"package-lock.json",
|
||||
"package.json"
|
||||
]
|
||||
}
|
33
packages/pattern-bundle/rollup.js
Normal file
33
packages/pattern-bundle/rollup.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
import { terser } from "rollup-plugin-terser";
|
||||
import babel from "rollup-plugin-babel";
|
||||
import resolve from "rollup-plugin-node-resolve";
|
||||
import commonjs from "rollup-plugin-commonjs";
|
||||
import json from "rollup-plugin-json";
|
||||
import path from "path";
|
||||
import { name, version, description, author, license } from "./package.json";
|
||||
|
||||
export default {
|
||||
input: "src/index.js",
|
||||
plugins: [
|
||||
resolve({
|
||||
browser: true
|
||||
}),
|
||||
json(),
|
||||
commonjs(),
|
||||
babel({
|
||||
exclude: "node_modules/**"
|
||||
}),
|
||||
terser({
|
||||
output: {
|
||||
preamble: `/**\n * ${name} | v${version}\n * ${description}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${license}\n */`
|
||||
}
|
||||
})
|
||||
],
|
||||
external: ["freesewing", "@freesewing/plugin-bundle"],
|
||||
output: {
|
||||
globals: {
|
||||
freesewing: "freesewing",
|
||||
"@freesewing/plugin-bundle": "freesewing.plugins.bundle"
|
||||
}
|
||||
}
|
||||
};
|
38
packages/pattern-bundle/src/index.js
Normal file
38
packages/pattern-bundle/src/index.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
import aaron from "@freesewing/aaron";
|
||||
import brian from "@freesewing/brian";
|
||||
import bruce from "@freesewing/bruce";
|
||||
import cathrin from "@freesewing/cathrin";
|
||||
import hugo from "@freesewing/hugo";
|
||||
import info from "./info";
|
||||
|
||||
export const patterns = {
|
||||
aaron,
|
||||
brian,
|
||||
bruce,
|
||||
cathrin,
|
||||
hugo,
|
||||
Aaron: aaron,
|
||||
Brian: brian,
|
||||
Bruce: bruce,
|
||||
Cathrin: cathrin,
|
||||
Hugo: hugo
|
||||
};
|
||||
|
||||
export const patternList = ["aaron", "brian", "bruce", "cathrin", "hugo"];
|
||||
|
||||
let list = [];
|
||||
for (let p of patternList) {
|
||||
for (let m of patterns[p].config.measurements) list.push(m);
|
||||
info[p].measurements = patterns[p].config.measurements;
|
||||
info[p].options = [];
|
||||
for (let o of Object.keys(patterns[p].config.options)) {
|
||||
if (typeof patterns[p].config.options[o] === "object")
|
||||
info[p].options.push(o);
|
||||
}
|
||||
}
|
||||
|
||||
export const patternInfo = info;
|
||||
|
||||
export const measurementList = list.filter(function(value, index, self) {
|
||||
return self.indexOf(value) === index;
|
||||
});
|
10
packages/pattern-bundle/src/info/aaron.js
Normal file
10
packages/pattern-bundle/src/info/aaron.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
const info = {
|
||||
design: "Joost De Cock",
|
||||
code: "Joost De Cock",
|
||||
department: "menswear",
|
||||
type: "pattern",
|
||||
difficulty: 3,
|
||||
tags: ["underwear", "top", "basics"]
|
||||
};
|
||||
|
||||
export default info;
|
10
packages/pattern-bundle/src/info/brian.js
Normal file
10
packages/pattern-bundle/src/info/brian.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
const info = {
|
||||
design: "Joost De Cock",
|
||||
code: "Joost De Cock",
|
||||
department: "menswear",
|
||||
type: "block",
|
||||
difficulty: 3,
|
||||
tags: ["top"]
|
||||
};
|
||||
|
||||
export default info;
|
10
packages/pattern-bundle/src/info/bruce.js
Normal file
10
packages/pattern-bundle/src/info/bruce.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
const info = {
|
||||
design: "Joost De Cock",
|
||||
code: "Joost De Cock",
|
||||
department: "menswear",
|
||||
type: "pattern",
|
||||
difficulty: 3,
|
||||
tags: ["underwear", "bottom", "basics"]
|
||||
};
|
||||
|
||||
export default info;
|
10
packages/pattern-bundle/src/info/cathrin.js
Normal file
10
packages/pattern-bundle/src/info/cathrin.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
const info = {
|
||||
design: "Joost De Cock",
|
||||
code: "Joost De Cock",
|
||||
department: "womenswear",
|
||||
type: "pattern",
|
||||
difficulty: 4,
|
||||
tags: ["underwear", "top"]
|
||||
};
|
||||
|
||||
export default info;
|
10
packages/pattern-bundle/src/info/hugo.js
Normal file
10
packages/pattern-bundle/src/info/hugo.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
const info = {
|
||||
design: "Joost De Cock",
|
||||
code: "Joost De Cock",
|
||||
department: "menswear",
|
||||
type: "pattern",
|
||||
difficulty: 3,
|
||||
tags: ["top", "basics"]
|
||||
};
|
||||
|
||||
export default info;
|
13
packages/pattern-bundle/src/info/index.js
Normal file
13
packages/pattern-bundle/src/info/index.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
import aaron from "./aaron";
|
||||
import brian from "./brian";
|
||||
import bruce from "./bruce";
|
||||
import cathrin from "./cathrin";
|
||||
import hugo from "./hugo";
|
||||
|
||||
export default {
|
||||
aaron,
|
||||
brian,
|
||||
bruce,
|
||||
cathrin,
|
||||
hugo
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue