@powerlines/plugin-marked 0.1.82 → 0.1.83

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.
@@ -1 +1,29 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
package/dist/index.cjs CHANGED
@@ -1 +1,41 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`);let t=require(`defu`);t=e.__toESM(t);let n=require(`marked`);const r=(e={})=>({name:`marked`,async config(){return{marked:(0,t.default)(e,{async:!0,breaks:!0,gfm:!0,silent:!this.config.logLevel})}},async configResolved(){this.marked??={},this.marked.parse??=async(e,r={})=>n.marked.parse(e,(0,t.default)(r,this.config.marked)),this.marked.use??=(...e)=>n.marked.use(...e)}});var i=r;exports.default=i,exports.plugin=r;
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
+ let defu = require("defu");
4
+ defu = require_rolldown_runtime.__toESM(defu);
5
+ let marked = require("marked");
6
+
7
+ //#region src/index.ts
8
+ /**
9
+ * Marked Plugin
10
+ *
11
+ * @remarks
12
+ * A Powerlines plugin to use the Marked markdown transformer during the prepare task.
13
+ *
14
+ * @see https://marked.js.org
15
+ *
16
+ * @param options - The plugin options.
17
+ * @returns A Powerlines plugin instance.
18
+ */
19
+ const plugin = (options = {}) => {
20
+ return {
21
+ name: "marked",
22
+ async config() {
23
+ return { marked: (0, defu.default)(options, {
24
+ async: true,
25
+ breaks: true,
26
+ gfm: true,
27
+ silent: !this.config.logLevel
28
+ }) };
29
+ },
30
+ async configResolved() {
31
+ this.marked ??= {};
32
+ this.marked.parse ??= async (src, override = {}) => marked.marked.parse(src, (0, defu.default)(override, this.config.marked));
33
+ this.marked.use ??= (...args) => marked.marked.use(...args);
34
+ }
35
+ };
36
+ };
37
+ var src_default = plugin;
38
+
39
+ //#endregion
40
+ exports.default = src_default;
41
+ exports.plugin = plugin;
package/dist/index.mjs CHANGED
@@ -1 +1,37 @@
1
- import e from"defu";import{marked as t}from"marked";const n=(n={})=>({name:`marked`,async config(){return{marked:e(n,{async:!0,breaks:!0,gfm:!0,silent:!this.config.logLevel})}},async configResolved(){this.marked??={},this.marked.parse??=async(n,r={})=>t.parse(n,e(r,this.config.marked)),this.marked.use??=(...e)=>t.use(...e)}});var r=n;export{r as default,n as plugin};
1
+ import defu from "defu";
2
+ import { marked } from "marked";
3
+
4
+ //#region src/index.ts
5
+ /**
6
+ * Marked Plugin
7
+ *
8
+ * @remarks
9
+ * A Powerlines plugin to use the Marked markdown transformer during the prepare task.
10
+ *
11
+ * @see https://marked.js.org
12
+ *
13
+ * @param options - The plugin options.
14
+ * @returns A Powerlines plugin instance.
15
+ */
16
+ const plugin = (options = {}) => {
17
+ return {
18
+ name: "marked",
19
+ async config() {
20
+ return { marked: defu(options, {
21
+ async: true,
22
+ breaks: true,
23
+ gfm: true,
24
+ silent: !this.config.logLevel
25
+ }) };
26
+ },
27
+ async configResolved() {
28
+ this.marked ??= {};
29
+ this.marked.parse ??= async (src, override = {}) => marked.parse(src, defu(override, this.config.marked));
30
+ this.marked.use ??= (...args) => marked.use(...args);
31
+ }
32
+ };
33
+ };
34
+ var src_default = plugin;
35
+
36
+ //#endregion
37
+ export { src_default as default, plugin };
@@ -78,10 +78,18 @@ interface ParseOptions extends ParserOptions {
78
78
  */
79
79
  allowReturnOutsideFunction?: boolean;
80
80
  }
81
+ interface EmitOptions extends WriteOptions {
82
+ /**
83
+ * If true, will emit the file using {@link UnpluginBuildContext.emitFile | the bundler's emit function}.
84
+ */
85
+ emitWithBundler?: boolean;
86
+ needsCodeReference?: Parameters<UnpluginBuildContext["emitFile"]>[0]["needsCodeReference"];
87
+ originalFileName?: Parameters<UnpluginBuildContext["emitFile"]>[0]["originalFileName"];
88
+ }
81
89
  /**
82
90
  * Options for emitting entry virtual files
83
91
  */
84
- type EmitEntryOptions = WriteOptions & Omit<ResolvedEntryTypeDefinition, "file">;
92
+ type EmitEntryOptions = EmitOptions & Omit<ResolvedEntryTypeDefinition, "file">;
85
93
  /**
86
94
  * The unresolved Powerlines context.
87
95
  *
@@ -292,6 +300,22 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
292
300
  * The Powerlines builtin virtual files
293
301
  */
294
302
  getBuiltins: () => Promise<VirtualFile[]>;
303
+ /**
304
+ * Resolves a file and writes it to the VFS if it does not already exist
305
+ *
306
+ * @param code - The source code of the file
307
+ * @param path - The path to write the file to
308
+ * @param options - Additional options for writing the file
309
+ */
310
+ emit: (code: string, path: string, options?: EmitOptions) => Promise<void>;
311
+ /**
312
+ * Synchronously resolves a file and writes it to the VFS if it does not already exist
313
+ *
314
+ * @param code - The source code of the file
315
+ * @param path - The path to write the file to
316
+ * @param options - Additional options for writing the file
317
+ */
318
+ emitSync: (code: string, path: string, options?: EmitOptions) => void;
295
319
  /**
296
320
  * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
297
321
  *
@@ -300,7 +324,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
300
324
  * @param path - An optional path to write the builtin file to
301
325
  * @param options - Additional options for writing the builtin file
302
326
  */
303
- emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
327
+ emitBuiltin: (code: string, id: string, path?: string, options?: EmitOptions) => Promise<void>;
304
328
  /**
305
329
  * Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
306
330
  *
@@ -309,7 +333,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
309
333
  * @param path - An optional path to write the builtin file to
310
334
  * @param options - Additional options for writing the builtin file
311
335
  */
312
- emitBuiltinSync: (code: string, id: string, path?: string, options?: WriteOptions) => void;
336
+ emitBuiltinSync: (code: string, id: string, path?: string, options?: EmitOptions) => void;
313
337
  /**
314
338
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
315
339
  *
@@ -78,10 +78,18 @@ interface ParseOptions extends ParserOptions {
78
78
  */
79
79
  allowReturnOutsideFunction?: boolean;
80
80
  }
81
+ interface EmitOptions extends WriteOptions {
82
+ /**
83
+ * If true, will emit the file using {@link UnpluginBuildContext.emitFile | the bundler's emit function}.
84
+ */
85
+ emitWithBundler?: boolean;
86
+ needsCodeReference?: Parameters<UnpluginBuildContext["emitFile"]>[0]["needsCodeReference"];
87
+ originalFileName?: Parameters<UnpluginBuildContext["emitFile"]>[0]["originalFileName"];
88
+ }
81
89
  /**
82
90
  * Options for emitting entry virtual files
83
91
  */
84
- type EmitEntryOptions = WriteOptions & Omit<ResolvedEntryTypeDefinition, "file">;
92
+ type EmitEntryOptions = EmitOptions & Omit<ResolvedEntryTypeDefinition, "file">;
85
93
  /**
86
94
  * The unresolved Powerlines context.
87
95
  *
@@ -292,6 +300,22 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
292
300
  * The Powerlines builtin virtual files
293
301
  */
294
302
  getBuiltins: () => Promise<VirtualFile[]>;
303
+ /**
304
+ * Resolves a file and writes it to the VFS if it does not already exist
305
+ *
306
+ * @param code - The source code of the file
307
+ * @param path - The path to write the file to
308
+ * @param options - Additional options for writing the file
309
+ */
310
+ emit: (code: string, path: string, options?: EmitOptions) => Promise<void>;
311
+ /**
312
+ * Synchronously resolves a file and writes it to the VFS if it does not already exist
313
+ *
314
+ * @param code - The source code of the file
315
+ * @param path - The path to write the file to
316
+ * @param options - Additional options for writing the file
317
+ */
318
+ emitSync: (code: string, path: string, options?: EmitOptions) => void;
295
319
  /**
296
320
  * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
297
321
  *
@@ -300,7 +324,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
300
324
  * @param path - An optional path to write the builtin file to
301
325
  * @param options - Additional options for writing the builtin file
302
326
  */
303
- emitBuiltin: (code: string, id: string, path?: string, options?: WriteOptions) => Promise<void>;
327
+ emitBuiltin: (code: string, id: string, path?: string, options?: EmitOptions) => Promise<void>;
304
328
  /**
305
329
  * Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
306
330
  *
@@ -309,7 +333,7 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
309
333
  * @param path - An optional path to write the builtin file to
310
334
  * @param options - Additional options for writing the builtin file
311
335
  */
312
- emitBuiltinSync: (code: string, id: string, path?: string, options?: WriteOptions) => void;
336
+ emitBuiltinSync: (code: string, id: string, path?: string, options?: EmitOptions) => void;
313
337
  /**
314
338
  * Resolves a entry virtual file and writes it to the VFS if it does not already exist
315
339
  *
@@ -1 +1 @@
1
- export{};
1
+ export { };
@@ -1 +1 @@
1
- export{};
1
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-marked",
3
- "version": "0.1.82",
3
+ "version": "0.1.83",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to use the Marked markdown compiler to generate HTML.",
6
6
  "repository": {
@@ -117,18 +117,18 @@
117
117
  "files": ["dist/**/*"],
118
118
  "keywords": ["marked", "powerlines", "storm-software", "powerlines-plugin"],
119
119
  "dependencies": {
120
- "@stryke/fs": "^0.33.26",
121
- "@stryke/path": "^0.24.0",
122
- "@stryke/types": "^0.10.28",
120
+ "@stryke/fs": "^0.33.27",
121
+ "@stryke/path": "^0.24.1",
122
+ "@stryke/types": "^0.10.29",
123
123
  "defu": "^6.1.4",
124
- "powerlines": "^0.36.22"
124
+ "powerlines": "^0.36.23"
125
125
  },
126
126
  "devDependencies": {
127
- "@powerlines/nx": "^0.11.48",
128
- "@powerlines/plugin-plugin": "^0.12.69",
127
+ "@powerlines/nx": "^0.11.49",
128
+ "@powerlines/plugin-plugin": "^0.12.70",
129
129
  "@types/node": "^24.10.4",
130
130
  "marked": "^17.0.1"
131
131
  },
132
132
  "publishConfig": { "access": "public" },
133
- "gitHead": "f88fe8eb30f96536b83fc9af884972d48e31e63a"
133
+ "gitHead": "be47e546b48b9a82e460b5c5d4f02fb66e821f18"
134
134
  }