chore(plugin-sprinkle): Ported to v3
This commit is contained in:
parent
60c5533e0e
commit
e8476727a7
4 changed files with 14 additions and 13 deletions
|
@ -14,7 +14,7 @@ const banner = `/**
|
|||
const options = {
|
||||
banner: { js: banner },
|
||||
bundle: true,
|
||||
entryPoints: ['src/index.js'],
|
||||
entryPoints: ['src/index.mjs'],
|
||||
format: 'esm',
|
||||
outfile: 'dist/index.mjs',
|
||||
external: ["@freesewing"],
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
"vbuild": "VERBOSE=1 node --experimental-json-modules build.mjs",
|
||||
"lab": "cd ../../sites/lab && yarn start",
|
||||
"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",
|
||||
"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 {
|
||||
name: pkg.name,
|
||||
version: pkg.version,
|
||||
hooks: {
|
||||
preRender: (svg) => svg.attributes.setIfUnset('freesewing:plugin-sprinkle', pkg.version),
|
||||
},
|
||||
export const plugin = {
|
||||
name,
|
||||
version,
|
||||
macros: {
|
||||
sprinkle: function (so) {
|
||||
for (let pid of so.on) {
|
||||
|
@ -16,3 +13,8 @@ export default {
|
|||
},
|
||||
},
|
||||
}
|
||||
|
||||
// More specifically named exports
|
||||
export const sprinklePlugin = plugin
|
||||
export const pluginSprinkle = plugin
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
// This file is auto-generated.
|
||||
// Changes you make will be overwritten.
|
||||
import plugin from './dist/index.mjs'
|
||||
// This file is auto-generated | Any changes you make will be overwritten.
|
||||
import { plugin } from './dist/index.mjs'
|
||||
import { sharedPluginTests } from '../../../tests/plugins/shared.mjs'
|
||||
|
||||
|
||||
// Run shared tests
|
||||
sharedPluginTests(plugin)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue