1
0
Fork 0

[plugins] fix: Provide name in export. Fixes #280

This commit is contained in:
joostdecock 2025-04-24 08:47:55 +02:00
parent f9d68bd2e1
commit 5d71d6f87a
17 changed files with 34 additions and 17 deletions

View file

@ -45,7 +45,8 @@ for (const plugin of bundledPlugins) {
}
export const plugin = {
...about,
name: about.id,
version: about.version,
store,
hooks,
macros,

View file

@ -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) {

View file

@ -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]],
}

View file

@ -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)]

View file

@ -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'

View file

@ -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

View file

@ -24,7 +24,8 @@ const translate = (locale, text, t, pattern) => {
}
export const plugin = {
...about,
name: about.id,
version: about.version,
hooks: { insertText: translate },
}

View file

@ -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) {

View file

@ -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,

View file

@ -485,7 +485,8 @@ const hemMacro = function (
}
export const plugin = {
...about,
name: about.id,
version: about.version,
macros: {
join: joinMacro,
offset: offsetMacro,

View file

@ -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]

View file

@ -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

View file

@ -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) {

View file

@ -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])

View file

@ -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')

View file

@ -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()

View file

@ -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) {