[plugins] fix: Provide name in export. Fixes #280
This commit is contained in:
parent
f9d68bd2e1
commit
5d71d6f87a
17 changed files with 34 additions and 17 deletions
|
@ -45,7 +45,8 @@ for (const plugin of bundledPlugins) {
|
|||
}
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
store,
|
||||
hooks,
|
||||
macros,
|
||||
|
|
|
@ -23,7 +23,8 @@ import { sewtogetherMacros, sewtogetherDefs } from './sewtogether.mjs'
|
|||
import { flagStores } from './flag.mjs'
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
hooks: {
|
||||
preRender: [
|
||||
function (svg) {
|
||||
|
|
|
@ -2,7 +2,8 @@ import about from '../about.json' with { type: 'json' }
|
|||
import { pack } from './growing-packer.mjs'
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
store: [['pack', pack]],
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import about from '../about.json' with { type: 'json' }
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
hooks: {
|
||||
preSetDraft: function ({ settings, activeSet }) {
|
||||
const set = settings[Number(activeSet)]
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import about from '../about.json' with { type: 'json' }
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
macros: {
|
||||
flip: function (so, { paths, points, snippets }) {
|
||||
const axis = so?.axis === 'y' ? 'y' : 'x'
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import about from '../about.json' with { type: 'json' }
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
macros: {
|
||||
gore: function (so, { points, paths, Path }) {
|
||||
const from = so.from
|
||||
|
|
|
@ -24,7 +24,8 @@ const translate = (locale, text, t, pattern) => {
|
|||
}
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
hooks: { insertText: translate },
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import about from '../about.json' with { type: 'json' }
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
hooks: {
|
||||
preDraft: function ({ settings }) {
|
||||
for (const set of settings) {
|
||||
|
|
|
@ -36,7 +36,8 @@ const mirrorGen = (start, end) => {
|
|||
const capFirst = (string) => string.charAt(0).toUpperCase() + string.slice(1)
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
macros: {
|
||||
mirror: function ({
|
||||
mirror,
|
||||
|
|
|
@ -485,7 +485,8 @@ const hemMacro = function (
|
|||
}
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
macros: {
|
||||
join: joinMacro,
|
||||
offset: offsetMacro,
|
||||
|
|
|
@ -44,7 +44,8 @@ const keys = [
|
|||
* The plugin object itself
|
||||
*/
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
macros: {
|
||||
rmringsector: function (id = 'ringsector', { points, paths, store, part }) {
|
||||
const storeRoot = ['parts', part.name, 'macros', '@freesewing/plugin-ringsector', 'ids', id]
|
||||
|
|
|
@ -7,7 +7,8 @@ const pointKeys = ['start', 'cp1', 'cp2', 'end']
|
|||
const pathKeys = ['path']
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
macros: {
|
||||
round: function (mc, { points, paths, Point, Path, store }) {
|
||||
const C = 0.55191502449
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import about from '../about.json' with { type: 'json' }
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
macros: {
|
||||
sprinkle: function (so, { snippets, Snippet, points }) {
|
||||
for (let pid of so.on) {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import about from '../about.json' with { type: 'json' }
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
hooks: {
|
||||
preRender: function (svg, attributes = {}) {
|
||||
for (const key of Object.keys(attributes)) svg.attributes.set(key, attributes[key])
|
||||
|
|
|
@ -21,7 +21,8 @@ const grid = {
|
|||
}
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
hooks: {
|
||||
preRender: function (svg, data = {}) {
|
||||
const current = svg.attributes.get('class')
|
||||
|
|
|
@ -17,7 +17,8 @@ const delta = (start) => {
|
|||
/* eslint-enable no-undef */
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
hooks: {
|
||||
preSetDraft: function (pattern) {
|
||||
const time = now()
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import about from '../about.json' with { type: 'json' }
|
||||
|
||||
export const plugin = {
|
||||
...about,
|
||||
name: about.id,
|
||||
version: about.version,
|
||||
hooks: {
|
||||
preRender: function (svg) {
|
||||
for (const key in svg.attributes.list) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue