1
0
Fork 0

tada: First commit

This commit is contained in:
Joost De Cock 2018-08-11 12:41:00 +02:00
parent 4bf5995d5d
commit 8e473c635c
10 changed files with 4995 additions and 2 deletions

View 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/plugin-bundle/.gitignore vendored Normal file
View 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

View file

@ -0,0 +1,2 @@
src
.editorconfig

View file

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2018 freesewing Copyright (c) 2018 Joost De Cock
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View file

@ -1,2 +1,64 @@
<p align="center">
<a title="Go to freesewing.org" href="https://freesewing.org/"><img src="https://freesewing.org/img/logo/black.svg" align="center" width="150px" alt="Freesewing logo"/></a>
</p>
<h4 align="center"><em>&nbsp;<a title="Go to freesewing.org" href="https://freesewing.org/">freesewing</a></em>
<br><sup>a library for made-to-measure sewing patterns</sup>
</h4>
# plugin-bundle # plugin-bundle
Five essential freesewing build-time plugins in one neat bundle
A freesewing plugin that provides the following plugins in one bundle:
1) [plugin-cutonfold](https://github.com/freesewing/plugin-cutonfold) : Add cut-on-fold indicators to your patterns
2) [plugin-dimension](https://github.com/freesewing/plugin-dimension) : Add dimensions to your (paperless) patterns
3) [plugin-grainline](https://github.com/freesewing/plugin-grainline) : Add grainline indicators to your patterns
4) [plugin-logo](https://github.com/freesewing/plugin-logo) : Add our logo to your patterns
5) [plugin-title](https://github.com/freesewing/plugin-title) : Add pretty titles to your pattern parts
## Usage
To load this plugin, add it to your instantiated pattern.
On node.js:
```js
import pattern from '@freesewing/brian'
import pluginBundle from '@freesewing/plugin-bundle'
pattern.with(pluginBundle);
```
In the browser, this plugin will register as `freesewing.plugins.bundle`:
```html
<script type="text/javascript" src="https://unpkg.com/freesewing"></script>
<script type="text/javascript" src="https://unpkg.com/@freesewing/plugin-bundle"></script>
<script type="text/javascript" src="https://unpkg.com/@freesewing/brian"></script>
<script>
var pattern = freesewing.patterns.brian
.with(freesewing.plugins.bundle);
</script>
```
## Install
To install, run:
```sh
npm install @freesewing/plugin-bundle
```
## Build
To build this plugin, run:
```sh
npm run build
```
## License: MIT
See [the license file](https://github.com/freesewing/plugin-theme/blob/master/LICENSE)
for details.

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

4738
packages/plugin-bundle/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,69 @@
{
"name": "@freesewing/plugin-bundle",
"version": "0.0.1",
"description": "Five essential freesewing build-time plugins in one neat bundle",
"author": "Joost De Cock <joost@decock.org> (https://github.com/joostdecock)",
"license": "MIT",
"homepage": "https://github.com/freesewing/plugin-bundle#readme",
"repository": "github:freesewing/plugin-bundle",
"bugs": {
"url": "https://github.com/freesewing/plugin-bundle/issues"
},
"keywords": [
"freesewing",
"plugin",
"sewing",
"patterns",
"bundle"
],
"main": "dist/index.js",
"unpkg": "dist/browser.js",
"module": "dist/index.mjs",
"scripts": {
"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",
"precommit": "npm run pretty && lint-staged",
"test": "echo \"Error: no test specified\" && exit 1",
"clean": "rimraf dist",
"pretty": "npx prettier --write \"src/*.js\"",
"lint": "eslint --fix \"src/*.js\"",
"browserbuild": "rollup -c rollup.js --file dist/browser.js --format iife --name freesewing.plugins.bundle",
"nodebuild": "rollup -c rollup.js --file dist/index.js --format cjs",
"modulebuild": "rollup -c rollup.js --file dist/index.mjs --format 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"
]
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.6",
"eslint": "^5.2.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-prettier": "^2.6.2",
"husky": "^0.14.3",
"lint-staged": "^7.2.0",
"prettier": "^1.13.7",
"rimraf": "^2.6.2",
"rollup-plugin-babel": "^3.0.7",
"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"
]
}

View file

@ -0,0 +1,27 @@
import { terser } from "rollup-plugin-terser";
import babel from "rollup-plugin-babel";
import resolve from "rollup-plugin-node-resolve";
import json from "rollup-plugin-json";
import { version, name, description, author, license } from "./package.json";
export default {
input: "src/index.js",
plugins: [
resolve({
browser: true
}),
json(),
babel({
exclude: "node_modules/**"
}),
terser({
output: {
preamble: `/**\n * ${name} | v${version}\n * ${
description
}\n * (c) ${new Date().getFullYear()} ${author}\n * @license ${
license
}\n */`
}
})
]
};

View file

@ -0,0 +1,20 @@
import { version, name } from "../package.json";
export default {
name: name,
version: version,
hooks: {
debug: function(next, d = "", e = "", b = "", u = "", g = "") {
console.log(
"%cDebug",
"color: #dd69dd; font-weight: bold",
d,
e,
b,
u,
g
);
next();
}
}
};