@powerlines/plugin-automd 0.1.338 → 0.1.339
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +26 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +26 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +2 -1
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -0
- package/dist/node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.mjs +2 -1
- package/dist/node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.mjs.map +1 -0
- package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_5b5d5334735dce5e1ae79d8924a5aa49e4139453056613d618786b961793a42b_magicast@0.5.2/node_modules/automd/dist/index.mjs +2 -1
- package/dist/node_modules/.pnpm/automd@0.4.3_patch_hash_5b5d5334735dce5e1ae79d8924a5aa49e4139453056613d618786b961793a42b_magicast@0.5.2/node_modules/automd/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs +2 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs.map +1 -0
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs +2 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs.map +1 -0
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs +2 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs.map +1 -0
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs +2 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs.map +1 -0
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs +2 -1
- package/dist/node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs +2 -1
- package/dist/node_modules/.pnpm/didyoumean2@7.0.4/node_modules/didyoumean2/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +2 -1
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs +2 -1
- package/dist/node_modules/.pnpm/fastest-levenshtein@1.0.16/node_modules/fastest-levenshtein/mod.mjs.map +1 -0
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs +2 -1
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/babel.mjs.map +1 -0
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs +2 -1
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/dist/jiti.mjs.map +1 -0
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs +2 -1
- package/dist/node_modules/.pnpm/jiti@2.4.2/node_modules/jiti/lib/jiti.mjs.map +1 -0
- package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs +2 -1
- package/dist/node_modules/.pnpm/lodash.deburr@4.1.0/node_modules/lodash.deburr/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +2 -1
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs +2 -1
- package/dist/node_modules/.pnpm/mdbox@0.1.1/node_modules/mdbox/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/mlly@1.8.1/node_modules/mlly/dist/index.mjs +2 -1
- package/dist/node_modules/.pnpm/mlly@1.8.1/node_modules/mlly/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +2 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +2 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +2 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs.map +1 -0
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +2 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs.map +1 -0
- package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs +2 -1
- package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs.map +1 -0
- package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs +2 -1
- package/dist/node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs.map +1 -0
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +2 -1
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs.map +1 -0
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +2 -1
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs +2 -1
- package/dist/node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs +2 -1
- package/dist/node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs +2 -1
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/babel.mjs.map +1 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs +2 -1
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs.map +1 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs +2 -1
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs.map +1 -0
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs +2 -1
- package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs.map +1 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/plugin.d.cts +50 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +50 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/toc.d.cts +35 -0
- package/dist/types/toc.d.cts.map +1 -0
- package/dist/types/toc.d.mts +35 -0
- package/dist/types/toc.d.mts.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.mjs","names":["defu"],"sources":["../../../../../../../../../../node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/loader/loader.mjs"],"sourcesContent":["import { defu } from 'defu';\nimport { createJiti } from 'jiti';\nimport { r as resolveSchema } from '../shared/untyped.BTwOq8Jl.mjs';\nimport babelPluginUntyped from './babel.mjs';\nimport '../shared/untyped.Br_uXjZG.mjs';\nimport 'scule';\n\nasync function loadSchema(entryPath, options = {}) {\n const jiti = createJiti(\n options.cwd || process.cwd(),\n defu(options.jiti, {\n interopDefault: true,\n transformOptions: {\n babel: {\n plugins: [[babelPluginUntyped, { experimentalFunctions: true }]]\n }\n }\n })\n );\n let rawSchema = await jiti.import(entryPath);\n const rawSchemaKeys = Object.keys(rawSchema);\n if (rawSchemaKeys.length === 1 && rawSchemaKeys[0] === \"default\") {\n rawSchema = rawSchema.default;\n }\n const schema = await resolveSchema(rawSchema, options.defaults, {\n ignoreDefaults: options.ignoreDefaults\n });\n return schema;\n}\n\nexport { loadSchema };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;AAOA,eAAe,WAAW,WAAW,UAAU,EAAE,EAAE;CAYjD,IAAI,YAAY,MAXH,WACX,QAAQ,OAAO,QAAQ,KAAK,EAC5BA,OAAK,QAAQ,MAAM;EACjB,gBAAgB;EAChB,kBAAkB,EAChB,OAAO,EACL,SAAS,CAAC,CAAC,oBAAoB,EAAE,uBAAuB,MAAM,CAAC,CAAC,EACjE,EACF;EACF,CAAC,CACH,CAC0B,OAAO,UAAU;CAC5C,MAAM,gBAAgB,OAAO,KAAK,UAAU;AAC5C,KAAI,cAAc,WAAW,KAAK,cAAc,OAAO,UACrD,aAAY,UAAU;AAKxB,QAHe,MAAM,cAAc,WAAW,QAAQ,UAAU,EAC9D,gBAAgB,QAAQ,gBACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"untyped.BTwOq8Jl.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.BTwOq8Jl.mjs"],"sourcesContent":["import { i as isObject, g as getType, a as getValue, s as setValue, j as joinPath, b as nonEmpty, u as unique } from './untyped.Br_uXjZG.mjs';\n\nasync function resolveSchema(obj, defaults, options = {}) {\n const schema = await _resolveSchema(obj, \"\", {\n root: obj,\n defaults,\n resolveCache: {},\n ignoreDefaults: !!options.ignoreDefaults\n });\n return schema;\n}\nasync function _resolveSchema(input, id, ctx) {\n if (id in ctx.resolveCache) {\n return ctx.resolveCache[id];\n }\n const schemaId = \"#\" + id.replace(/\\./g, \"/\");\n if (!isObject(input)) {\n const safeInput = Array.isArray(input) ? [...input] : input;\n const schema2 = {\n type: getType(input),\n id: schemaId,\n default: ctx.ignoreDefaults ? void 0 : safeInput\n };\n normalizeSchema(schema2, { ignoreDefaults: ctx.ignoreDefaults });\n ctx.resolveCache[id] = schema2;\n if (ctx.defaults && getValue(ctx.defaults, id) === void 0) {\n setValue(ctx.defaults, id, schema2.default);\n }\n return schema2;\n }\n const node = { ...input };\n const schema = ctx.resolveCache[id] = {\n ...node.$schema,\n id: schemaId\n };\n for (const key in node) {\n if (key === \"$resolve\" || key === \"$schema\" || key === \"$default\") {\n continue;\n }\n schema.properties = schema.properties || {};\n if (!schema.properties[key]) {\n const child = schema.properties[key] = await _resolveSchema(\n node[key],\n joinPath(id, key),\n ctx\n );\n if (Array.isArray(child.tags) && child.tags.includes(\"@required\")) {\n schema.required = schema.required || [];\n if (!schema.required.includes(key)) {\n schema.required.push(key);\n }\n }\n }\n }\n if (!ctx.ignoreDefaults) {\n if (ctx.defaults) {\n schema.default = getValue(ctx.defaults, id);\n }\n if (schema.default === void 0 && \"$default\" in node) {\n schema.default = node.$default;\n }\n if (typeof node.$resolve === \"function\") {\n schema.default = await node.$resolve(schema.default, async (key) => {\n return (await _resolveSchema(getValue(ctx.root, key), key, ctx)).default;\n });\n }\n }\n if (ctx.defaults) {\n setValue(ctx.defaults, id, schema.default);\n }\n if (!schema.type) {\n schema.type = getType(schema.default) || (schema.properties ? \"object\" : \"any\");\n }\n normalizeSchema(schema, { ignoreDefaults: ctx.ignoreDefaults });\n if (ctx.defaults && getValue(ctx.defaults, id) === void 0) {\n setValue(ctx.defaults, id, schema.default);\n }\n return schema;\n}\nasync function applyDefaults(ref, input) {\n await resolveSchema(ref, input);\n return input;\n}\nfunction normalizeSchema(schema, options) {\n if (schema.type === \"array\" && !(\"items\" in schema)) {\n schema.items = {\n type: nonEmpty(unique(schema.default.map((i) => getType(i))))\n };\n if (schema.items.type) {\n if (schema.items.type.length === 0) {\n schema.items.type = \"any\";\n } else if (schema.items.type.length === 1) {\n schema.items.type = schema.items.type[0];\n }\n }\n }\n if (!options.ignoreDefaults && schema.default === void 0 && (\"properties\" in schema || schema.type === \"object\" || schema.type === \"any\")) {\n const propsWithDefaults = Object.entries(schema.properties || {}).filter(([, prop]) => \"default\" in prop).map(([key, value]) => [key, value.default]);\n schema.default = Object.fromEntries(propsWithDefaults);\n }\n}\n\nexport { applyDefaults as a, resolveSchema as r };\n"],"x_google_ignoreList":[0],"mappings":";;;AAEA,eAAe,cAAc,KAAK,UAAU,UAAU,EAAE,EAAE;AAOxD,QANe,MAAM,eAAe,KAAK,IAAI;EAC3C,MAAM;EACN;EACA,cAAc,EAAE;EAChB,gBAAgB,CAAC,CAAC,QAAQ;EAC3B,CAAC;;AAGJ,eAAe,eAAe,OAAO,IAAI,KAAK;AAC5C,KAAI,MAAM,IAAI,aACZ,QAAO,IAAI,aAAa;CAE1B,MAAM,WAAW,MAAM,GAAG,QAAQ,OAAO,IAAI;AAC7C,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AAE,KAAK,IAAI,EAAE;IACjE;;AAGN,KAAI,IAAI,SACN,UAAS,IAAI,UAAU,IAAI,OAAO,QAAQ;AAE5C,KAAI,CAAC,OAAO,KACV,QAAO,OAAO,QAAQ,OAAO,QAAQ,KAAK,OAAO,aAAa,WAAW;AAE3E,iBAAgB,QAAQ,EAAE,gBAAgB,IAAI,gBAAgB,CAAC;AAC/D,KAAI,IAAI,YAAY,SAAS,IAAI,UAAU,GAAG,KAAK,KAAK,EACtD,UAAS,IAAI,UAAU,IAAI,OAAO,QAAQ;AAE5C,QAAO;;AAMT,SAAS,gBAAgB,QAAQ,SAAS;AACxC,KAAI,OAAO,SAAS,WAAW,EAAE,WAAW,SAAS;AACnD,SAAO,QAAQ,EACb,MAAM,SAAS,OAAO,OAAO,QAAQ,KAAK,MAAM,QAAQ,EAAE,CAAC,CAAC,CAAC,EAC9D;AACD,MAAI,OAAO,MAAM,MACf;OAAI,OAAO,MAAM,KAAK,WAAW,EAC/B,QAAO,MAAM,OAAO;YACX,OAAO,MAAM,KAAK,WAAW,EACtC,QAAO,MAAM,OAAO,OAAO,MAAM,KAAK;;;AAI5C,KAAI,CAAC,QAAQ,kBAAkB,OAAO,YAAY,KAAK,MAAM,gBAAgB,UAAU,OAAO,SAAS,YAAY,OAAO,SAAS,QAAQ;EACzI,MAAM,oBAAoB,OAAO,QAAQ,OAAO,cAAc,EAAE,CAAC,CAAC,QAAQ,GAAG,UAAU,aAAa,KAAK,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,KAAK,MAAM,QAAQ,CAAC;AACrJ,SAAO,UAAU,OAAO,YAAY,kBAAkB"}
|
package/dist/node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs
CHANGED
|
@@ -97,4 +97,5 @@ function getTypeDescriptor(type) {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
//#endregion
|
|
100
|
-
export { cachedFn, getType, getTypeDescriptor, getValue, isObject, joinPath, mergedTypes, nonEmpty, normalizeTypes, setValue, unique };
|
|
100
|
+
export { cachedFn, getType, getTypeDescriptor, getValue, isObject, joinPath, mergedTypes, nonEmpty, normalizeTypes, setValue, unique };
|
|
101
|
+
//# sourceMappingURL=untyped.Br_uXjZG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"untyped.Br_uXjZG.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/untyped@2.0.0/node_modules/untyped/dist/shared/untyped.Br_uXjZG.mjs"],"sourcesContent":["import { pascalCase } from 'scule';\n\nfunction defineUntypedSchema(options) {\n return options;\n}\nfunction getType(val) {\n const type = typeof val;\n if (type === \"undefined\" || val === null) {\n return void 0;\n }\n if (Array.isArray(val)) {\n return \"array\";\n }\n return type;\n}\nfunction isObject(val) {\n return val !== null && !Array.isArray(val) && typeof val === \"object\";\n}\nfunction nonEmpty(arr) {\n return arr.filter(Boolean);\n}\nfunction unique(arr) {\n return [...new Set(arr)];\n}\nfunction joinPath(a, b = \"\", sep = \".\") {\n return a ? a + sep + b : b;\n}\nfunction setValue(obj, path, val) {\n const keys = path.split(\".\");\n const _key = keys.pop();\n for (const key of keys) {\n if (!obj || typeof obj !== \"object\") {\n return;\n }\n if (!(key in obj)) {\n obj[key] = {};\n }\n obj = obj[key];\n }\n if (_key) {\n if (!obj || typeof obj !== \"object\") {\n return;\n }\n obj[_key] = val;\n }\n}\nfunction getValue(obj, path) {\n for (const key of path.split(\".\")) {\n if (!obj || typeof obj !== \"object\" || !(key in obj)) {\n return;\n }\n obj = obj[key];\n }\n return obj;\n}\nfunction mergedTypes(...types) {\n types = types.filter(Boolean);\n if (types.length === 0) {\n return {};\n }\n if (types.length === 1) {\n return types[0];\n }\n const tsTypes = normalizeTypes(\n types.flatMap((t) => t.tsType).filter(Boolean)\n );\n return {\n type: normalizeTypes(\n types.flatMap((t) => t.type).filter(Boolean)\n ),\n tsType: Array.isArray(tsTypes) ? tsTypes.join(\" | \") : tsTypes,\n items: mergedTypes(\n ...types.flatMap((t) => t.items).filter(Boolean)\n )\n };\n}\nfunction normalizeTypes(val) {\n const arr = unique(val.filter(Boolean));\n if (arr.length === 0 || arr.includes(\"any\")) {\n return;\n }\n return arr.length > 1 ? arr : arr[0];\n}\nfunction cachedFn(fn) {\n let val;\n let resolved = false;\n const cachedFn2 = () => {\n if (!resolved) {\n val = fn();\n resolved = true;\n }\n return val;\n };\n return cachedFn2;\n}\nconst jsTypes = /* @__PURE__ */ new Set([\n \"string\",\n \"number\",\n \"bigint\",\n \"boolean\",\n \"symbol\",\n \"function\",\n \"object\",\n \"any\",\n \"array\"\n]);\nfunction isJSType(val) {\n return jsTypes.has(val);\n}\nconst FRIENDLY_TYPE_RE = /(typeof )?import\\([\"'](?<importName>[^\"']+)[\"']\\)(\\[[\"']|\\.)(?<firstType>[^\\s\"']+)([\"']])?/g;\nfunction getTypeDescriptor(type) {\n if (!type) {\n return {};\n }\n let markdownType = type;\n for (const match of type.matchAll(FRIENDLY_TYPE_RE) || []) {\n const { importName, firstType } = match.groups || {};\n if (importName && firstType) {\n markdownType = markdownType.replace(\n match[0],\n pascalCase(importName) + pascalCase(firstType)\n );\n }\n }\n return {\n ...isJSType(type) ? { type } : {},\n tsType: type,\n ...markdownType === type ? {} : { markdownType }\n };\n}\n\nexport { getValue as a, nonEmpty as b, getTypeDescriptor as c, defineUntypedSchema as d, cachedFn as e, getType as g, isObject as i, joinPath as j, mergedTypes as m, normalizeTypes as n, setValue as s, unique as u };\n"],"x_google_ignoreList":[0],"mappings":";;;AAKA,SAAS,QAAQ,KAAK;CACpB,MAAM,OAAO,OAAO;AACpB,KAAI,SAAS,eAAe,QAAQ,KAClC;AAEF,KAAI,MAAM,QAAQ,IAAI,CACpB,QAAO;AAET,QAAO;;AAET,SAAS,SAAS,KAAK;AACrB,QAAO,QAAQ,QAAQ,CAAC,MAAM,QAAQ,IAAI,IAAI,OAAO,QAAQ;;AAE/D,SAAS,SAAS,KAAK;AACrB,QAAO,I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AAI,WAAW,KAAK,IAAI,SAAS,MAAM,CACzC;AAEF,QAAO,IAAI,SAAS,IAAI,MAAM,IAAI;;AAEpC,SAAS,SAAS,IAAI;CACpB,IAAI;CACJ,IAAI,WAAW;CACf,MAAM,kBAAkB;AACtB,MAAI,CAAC,UAAU;AACb,SAAM,IAAI;AACV,cAAW;;AAEb,SAAO;;AAET,QAAO;;AAET,MAAM,0BAA0B,IAAI,IAAI;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AACF,SAAS,SAAS,KAAK;AACrB,QAAO,QAAQ,IAAI,IAAI;;AAEzB,MAAM,mBAAmB;AACzB,SAAS,kBAAkB,MAAM;AAC/B,KAAI,CAAC,KACH,QAAO,EAAE;CAEX,IAAI,eAAe;AACnB,MAAK,MAAM,SAAS,KAAK,SAAS,iBAAiB,IAAI,EAAE,EAAE;EACzD,MAAM,EAAE,YAAY,cAAc,MAAM,UAAU,EAAE;AACpD,MAAI,cAAc,UAChB,gBAAe,aAAa,QAC1B,MAAM,IACN,WAAW,WAAW,GAAG,WAAW,UAAU,CAC/C;;AAGL,QAAO;EACL,GAAG,SAAS,KAAK,GAAG,EAAE,MAAM,GAAG,EAAE;EACjC,QAAQ;EACR,GAAG,iBAAiB,OAAO,EAAE,GAAG,EAAE,cAAc;EACjD"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TOCOptions, __ΩTOCOptions } from "./toc.cjs";
|
|
2
|
+
import { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig } from "./plugin.cjs";
|
|
3
|
+
export { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, TOCOptions, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig, __ΩTOCOptions };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TOCOptions, __ΩTOCOptions } from "./toc.mjs";
|
|
2
|
+
import { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig } from "./plugin.mjs";
|
|
3
|
+
export { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, TOCOptions, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig, __ΩTOCOptions };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { TOCOptions } from "./toc.cjs";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
3
|
+
import { Config } from "automd";
|
|
4
|
+
|
|
5
|
+
//#region src/types/plugin.d.ts
|
|
6
|
+
type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix"> & {
|
|
7
|
+
/**
|
|
8
|
+
* Path to the AutoMD configuration file.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* If not provided, the plugin will use the default AutoMD configuration resolution mechanism.
|
|
12
|
+
*/
|
|
13
|
+
configFile?: string;
|
|
14
|
+
/**
|
|
15
|
+
* An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.
|
|
16
|
+
*
|
|
17
|
+
* @defaultValue true
|
|
18
|
+
*/
|
|
19
|
+
allowIssues?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Alternate prefix strings to use for finding generators
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* By default, AutoMD looks for generators with the "automd" prefix, so that any `<!-- automd:generator [...args] --> ... <!-- /automd -->` comments will be picked up. If you want to use different prefixes (for example, to avoid conflicts with other tools), you would provide a value like "myPrefix" and AutoMD would also look for `<!-- myPrefix:generator [...args] --> ... <!-- /myPrefix -->` comments.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue ["automd", "powerlines", "\{framework\}"]
|
|
27
|
+
*/
|
|
28
|
+
prefix?: string | string[];
|
|
29
|
+
/**
|
|
30
|
+
* Table of Contents generator options
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* If set to `false`, the built-in Table of Contents generator will be disabled.
|
|
34
|
+
*/
|
|
35
|
+
toc?: false | TOCOptions;
|
|
36
|
+
};
|
|
37
|
+
type AutoMDPluginUserConfig = UserConfig & {
|
|
38
|
+
automd?: Config & Pick<AutoMDPluginOptions, "configFile" | "allowIssues" | "toc">;
|
|
39
|
+
};
|
|
40
|
+
type AutoMDPluginResolvedConfig = ResolvedConfig & {
|
|
41
|
+
automd: Config & Pick<AutoMDPluginOptions, "configFile" | "allowIssues" | "toc">;
|
|
42
|
+
};
|
|
43
|
+
type AutoMDPluginContext<TResolvedConfig extends AutoMDPluginResolvedConfig = AutoMDPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
44
|
+
declare type __ΩAutoMDPluginOptions = any[];
|
|
45
|
+
declare type __ΩAutoMDPluginUserConfig = any[];
|
|
46
|
+
declare type __ΩAutoMDPluginResolvedConfig = any[];
|
|
47
|
+
declare type __ΩAutoMDPluginContext = any[];
|
|
48
|
+
//#endregion
|
|
49
|
+
export { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig };
|
|
50
|
+
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KAsBY,mBAAA,GAAsB,KAChC;;AADF;;;;;EAsCY,UAAA,CAAA,EAAA,MAAA;EAAyB;;;;;EAKzB,WAAA,CAAA,EAAA,OAAA;EAA6B;;;;;AAKzC;;;EAGkB,MAAA,CAAA,EAAA,MAAA,GAAA,MAAA,EAAA;EAAd;;;;;;gBAhBY;;KAGJ,sBAAA,GAAyB;WAC1B,SACP,KAAK;;KAGG,0BAAA,GAA6B;UAC/B,SACN,KAAK;;KAGG,4CACc,6BACtB,8BACA,cAAc"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { TOCOptions } from "./toc.mjs";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
|
|
3
|
+
import { Config } from "automd";
|
|
4
|
+
|
|
5
|
+
//#region src/types/plugin.d.ts
|
|
6
|
+
type AutoMDPluginOptions = Omit<Config, "dir" | "watch" | "onWatch" | "prefix"> & {
|
|
7
|
+
/**
|
|
8
|
+
* Path to the AutoMD configuration file.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* If not provided, the plugin will use the default AutoMD configuration resolution mechanism.
|
|
12
|
+
*/
|
|
13
|
+
configFile?: string;
|
|
14
|
+
/**
|
|
15
|
+
* An indicator specifying whether or not issues found by AutoMD during the prepare task are considered fatal.
|
|
16
|
+
*
|
|
17
|
+
* @defaultValue true
|
|
18
|
+
*/
|
|
19
|
+
allowIssues?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Alternate prefix strings to use for finding generators
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* By default, AutoMD looks for generators with the "automd" prefix, so that any `<!-- automd:generator [...args] --> ... <!-- /automd -->` comments will be picked up. If you want to use different prefixes (for example, to avoid conflicts with other tools), you would provide a value like "myPrefix" and AutoMD would also look for `<!-- myPrefix:generator [...args] --> ... <!-- /myPrefix -->` comments.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue ["automd", "powerlines", "\{framework\}"]
|
|
27
|
+
*/
|
|
28
|
+
prefix?: string | string[];
|
|
29
|
+
/**
|
|
30
|
+
* Table of Contents generator options
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* If set to `false`, the built-in Table of Contents generator will be disabled.
|
|
34
|
+
*/
|
|
35
|
+
toc?: false | TOCOptions;
|
|
36
|
+
};
|
|
37
|
+
type AutoMDPluginUserConfig = UserConfig & {
|
|
38
|
+
automd?: Config & Pick<AutoMDPluginOptions, "configFile" | "allowIssues" | "toc">;
|
|
39
|
+
};
|
|
40
|
+
type AutoMDPluginResolvedConfig = ResolvedConfig & {
|
|
41
|
+
automd: Config & Pick<AutoMDPluginOptions, "configFile" | "allowIssues" | "toc">;
|
|
42
|
+
};
|
|
43
|
+
type AutoMDPluginContext<TResolvedConfig extends AutoMDPluginResolvedConfig = AutoMDPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
44
|
+
declare type __ΩAutoMDPluginOptions = any[];
|
|
45
|
+
declare type __ΩAutoMDPluginUserConfig = any[];
|
|
46
|
+
declare type __ΩAutoMDPluginResolvedConfig = any[];
|
|
47
|
+
declare type __ΩAutoMDPluginContext = any[];
|
|
48
|
+
//#endregion
|
|
49
|
+
export { AutoMDPluginContext, AutoMDPluginOptions, AutoMDPluginResolvedConfig, AutoMDPluginUserConfig, __ΩAutoMDPluginContext, __ΩAutoMDPluginOptions, __ΩAutoMDPluginResolvedConfig, __ΩAutoMDPluginUserConfig };
|
|
50
|
+
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KAsBY,mBAAA,GAAsB,KAChC;;AADF;;;;;EAsCY,UAAA,CAAA,EAAA,MAAA;EAAyB;;;;;EAKzB,WAAA,CAAA,EAAA,OAAA;EAA6B;;;;;AAKzC;;;EAGkB,MAAA,CAAA,EAAA,MAAA,GAAA,MAAA,EAAA;EAAd;;;;;;gBAhBY;;KAGJ,sBAAA,GAAyB;WAC1B,SACP,KAAK;;KAGG,0BAAA,GAA6B;UAC/B,SACN,KAAK;;KAGG,4CACc,6BACtB,8BACA,cAAc"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/types/toc.d.ts
|
|
2
|
+
interface TOCOptions {
|
|
3
|
+
/**
|
|
4
|
+
* A slugify function to generate slugs for the headings.
|
|
5
|
+
*/
|
|
6
|
+
slugify?: (str: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* The maximum depth of headings to include in the TOC.
|
|
9
|
+
*
|
|
10
|
+
* @defaultValue 6
|
|
11
|
+
*/
|
|
12
|
+
maxDepth?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to include the first H1 heading in the TOC.
|
|
15
|
+
*/
|
|
16
|
+
firstH1?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The bullet character to use for list items in the TOC.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue "-"
|
|
21
|
+
*/
|
|
22
|
+
bullets?: string;
|
|
23
|
+
/**
|
|
24
|
+
* A prefix to add to each heading in the TOC.
|
|
25
|
+
*/
|
|
26
|
+
prefix?: string;
|
|
27
|
+
/**
|
|
28
|
+
* A filter function to determine which headings to include in the TOC.
|
|
29
|
+
*/
|
|
30
|
+
filter?: (str: string, level: number) => boolean;
|
|
31
|
+
}
|
|
32
|
+
declare type __ΩTOCOptions = any[];
|
|
33
|
+
//#endregion
|
|
34
|
+
export { TOCOptions, __ΩTOCOptions };
|
|
35
|
+
//# sourceMappingURL=toc.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toc.d.cts","names":[],"sources":["../../src/types/toc.ts"],"sourcesContent":[],"mappings":";UAkBiB,UAAA;EAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/types/toc.d.ts
|
|
2
|
+
interface TOCOptions {
|
|
3
|
+
/**
|
|
4
|
+
* A slugify function to generate slugs for the headings.
|
|
5
|
+
*/
|
|
6
|
+
slugify?: (str: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* The maximum depth of headings to include in the TOC.
|
|
9
|
+
*
|
|
10
|
+
* @defaultValue 6
|
|
11
|
+
*/
|
|
12
|
+
maxDepth?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to include the first H1 heading in the TOC.
|
|
15
|
+
*/
|
|
16
|
+
firstH1?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The bullet character to use for list items in the TOC.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue "-"
|
|
21
|
+
*/
|
|
22
|
+
bullets?: string;
|
|
23
|
+
/**
|
|
24
|
+
* A prefix to add to each heading in the TOC.
|
|
25
|
+
*/
|
|
26
|
+
prefix?: string;
|
|
27
|
+
/**
|
|
28
|
+
* A filter function to determine which headings to include in the TOC.
|
|
29
|
+
*/
|
|
30
|
+
filter?: (str: string, level: number) => boolean;
|
|
31
|
+
}
|
|
32
|
+
declare type __ΩTOCOptions = any[];
|
|
33
|
+
//#endregion
|
|
34
|
+
export { TOCOptions, __ΩTOCOptions };
|
|
35
|
+
//# sourceMappingURL=toc.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toc.d.mts","names":[],"sources":["../../src/types/toc.ts"],"sourcesContent":[],"mappings":";UAkBiB,UAAA;EAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-automd",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.339",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin to maintain a project's markdown files using AutoMD generators.",
|
|
6
6
|
"repository": {
|
|
@@ -114,10 +114,10 @@
|
|
|
114
114
|
"markdown-toc": "^1.2.0"
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
117
|
+
"@powerlines/plugin-plugin": "^0.12.290",
|
|
118
118
|
"@types/node": "^25.4.0",
|
|
119
119
|
"automd": "^0.4.3"
|
|
120
120
|
},
|
|
121
121
|
"publishConfig": { "access": "public" },
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "387dd4f3e14b4e5a2580ffcf2951d7727aae15a3"
|
|
123
123
|
}
|