diff --git a/plugins/plugin-round/build.mjs b/plugins/plugin-round/build.mjs index 9d1da1994da..0f283af1c6d 100644 --- a/plugins/plugin-round/build.mjs +++ b/plugins/plugin-round/build.mjs @@ -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"], diff --git a/plugins/plugin-round/package.json b/plugins/plugin-round/package.json index d8965705eb5..b1f8366bb16 100644 --- a/plugins/plugin-round/package.json +++ b/plugins/plugin-round/package.json @@ -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" }, diff --git a/plugins/plugin-round/src/index.js b/plugins/plugin-round/src/index.mjs similarity index 87% rename from plugins/plugin-round/src/index.js rename to plugins/plugin-round/src/index.mjs index 960479277ff..d8ef37a1360 100644 --- a/plugins/plugin-round/src/index.js +++ b/plugins/plugin-round/src/index.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-round', pkg.version), - }, +export const plugin = { + name, + version, macros: { round: function (so) { const C = 0.55191502449 @@ -40,3 +37,8 @@ export default { }, }, } + +// More specifically named exports +export const roundPlugin = plugin +export const pluginRound = plugin + diff --git a/plugins/plugin-round/tests/plugin.test.mjs b/plugins/plugin-round/tests/plugin.test.mjs index 742b30dadc1..c30064b22c8 100644 --- a/plugins/plugin-round/tests/plugin.test.mjs +++ b/plugins/plugin-round/tests/plugin.test.mjs @@ -1,6 +1,4 @@ import chai from 'chai' -//import freesewing from '@freesewing/core' -//import plugin from '../dist/index.mjs' const expect = chai.expect diff --git a/plugins/plugin-round/tests/shared.test.mjs b/plugins/plugin-round/tests/shared.test.mjs index 9638f75571e..fdf846844b0 100644 --- a/plugins/plugin-round/tests/shared.test.mjs +++ b/plugins/plugin-round/tests/shared.test.mjs @@ -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) +