chore(plugin-round): Ported to v3
This commit is contained in:
parent
fcea467c8e
commit
3e59f830fd
5 changed files with 14 additions and 15 deletions
|
@ -14,7 +14,7 @@ const banner = `/**
|
||||||
const options = {
|
const options = {
|
||||||
banner: { js: banner },
|
banner: { js: banner },
|
||||||
bundle: true,
|
bundle: true,
|
||||||
entryPoints: ['src/index.js'],
|
entryPoints: ['src/index.mjs'],
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
outfile: 'dist/index.mjs',
|
outfile: 'dist/index.mjs',
|
||||||
external: ["@freesewing"],
|
external: ["@freesewing"],
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
"vbuild": "VERBOSE=1 node --experimental-json-modules build.mjs",
|
"vbuild": "VERBOSE=1 node --experimental-json-modules build.mjs",
|
||||||
"lab": "cd ../../sites/lab && yarn start",
|
"lab": "cd ../../sites/lab && yarn start",
|
||||||
"tips": "node ../../scripts/help.mjs",
|
"tips": "node ../../scripts/help.mjs",
|
||||||
"prettier": "npx prettier --write 'src/*.js' 'tests/*.mjs'",
|
"prettier": "npx prettier --write 'src/*.mjs' 'tests/*.mjs'",
|
||||||
"testci": "npx mocha tests/*.test.mjs --reporter ../../tests/reporters/terse.js",
|
"testci": "npx mocha tests/*.test.mjs --reporter ../../tests/reporters/terse.js",
|
||||||
"cibuild_step1": "node --experimental-json-modules build.mjs"
|
"cibuild_step1": "node --experimental-json-modules build.mjs"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
import pkg from '../package.json'
|
import { name, version } from '../package.json'
|
||||||
|
|
||||||
export default {
|
export const plugin = {
|
||||||
name: pkg.name,
|
name,
|
||||||
version: pkg.version,
|
version,
|
||||||
hooks: {
|
|
||||||
preRender: (svg) => svg.attributes.setIfUnset('freesewing:plugin-round', pkg.version),
|
|
||||||
},
|
|
||||||
macros: {
|
macros: {
|
||||||
round: function (so) {
|
round: function (so) {
|
||||||
const C = 0.55191502449
|
const C = 0.55191502449
|
||||||
|
@ -40,3 +37,8 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// More specifically named exports
|
||||||
|
export const roundPlugin = plugin
|
||||||
|
export const pluginRound = plugin
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import chai from 'chai'
|
import chai from 'chai'
|
||||||
//import freesewing from '@freesewing/core'
|
|
||||||
//import plugin from '../dist/index.mjs'
|
|
||||||
|
|
||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
// This file is auto-generated.
|
// This file is auto-generated | Any changes you make will be overwritten.
|
||||||
// Changes you make will be overwritten.
|
import { plugin } from './dist/index.mjs'
|
||||||
import plugin from './dist/index.mjs'
|
|
||||||
import { sharedPluginTests } from '../../../tests/plugins/shared.mjs'
|
import { sharedPluginTests } from '../../../tests/plugins/shared.mjs'
|
||||||
|
|
||||||
|
|
||||||
// Run shared tests
|
// Run shared tests
|
||||||
sharedPluginTests(plugin)
|
sharedPluginTests(plugin)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue