@lsst/pik-core 0.5.1 → 0.5.3

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @lsst/pik-core
2
2
 
3
- Core library for parsing and switching `@pik` config markers in source files.
3
+ Core library for pik - provides parsing, switching, config loading, and plugin types.
4
4
 
5
5
  ## Installation
6
6
 
@@ -8,10 +8,12 @@ Core library for parsing and switching `@pik` config markers in source files.
8
8
  npm install @lsst/pik-core
9
9
  ```
10
10
 
11
- ## Usage
11
+ ## Parsing and Switching
12
+
13
+ Parse and switch `@pik` config markers in source files:
12
14
 
13
15
  ```typescript
14
- import { Parser, SingleSwitcher } from '@lsst25/pik-core';
16
+ import { Parser, SingleSwitcher } from '@lsst/pik-core';
15
17
 
16
18
  const content = `
17
19
  // @pik:select Environment
@@ -28,6 +30,55 @@ const switcher = SingleSwitcher.forExtension('ts');
28
30
  const newContent = switcher.switch(content, selectors[0], 'DEV');
29
31
  ```
30
32
 
33
+ ## Config Loading
34
+
35
+ Load pik configuration from project files:
36
+
37
+ ```typescript
38
+ import { loadConfig, defineConfig } from '@lsst/pik-core';
39
+
40
+ // Load config (looks for pik.config.ts, .pik.config.ts, etc.)
41
+ const config = await loadConfig();
42
+
43
+ // Type-safe config definition
44
+ export default defineConfig({
45
+ select: { include: ['src/**/*.ts'] },
46
+ worktree: { baseDir: '../' },
47
+ });
48
+ ```
49
+
50
+ ## Creating Plugins
51
+
52
+ Create custom plugins using the `PikPlugin` interface:
53
+
54
+ ```typescript
55
+ import type { Command } from 'commander';
56
+ import type { PikPlugin } from '@lsst/pik-core';
57
+
58
+ interface MyPluginConfig {
59
+ apiKey: string;
60
+ }
61
+
62
+ export function myPlugin(config: MyPluginConfig): PikPlugin {
63
+ return {
64
+ name: 'My Plugin',
65
+ description: 'Does something cool',
66
+ command: 'my',
67
+ aliases: ['m'],
68
+
69
+ register(program: Command) {
70
+ program
71
+ .command('my')
72
+ .alias('m')
73
+ .description('My custom command')
74
+ .action(() => {
75
+ console.log(`Using: ${config.apiKey}`);
76
+ });
77
+ },
78
+ };
79
+ }
80
+ ```
81
+
31
82
  ## API
32
83
 
33
84
  ### Parser
@@ -55,7 +106,7 @@ const newContent = switcher.switch(content, selector, 'optionName');
55
106
  ### CommentStyle
56
107
 
57
108
  ```typescript
58
- import { CommentStyle } from '@lsst25/pik-core';
109
+ import { CommentStyle } from '@lsst/pik-core';
59
110
 
60
111
  // Get comment style for extension
61
112
  const style = CommentStyle.fromExtension('py'); // { lineComment: '#' }
@@ -64,6 +115,17 @@ const style = CommentStyle.fromExtension('py'); // { lineComment: '#' }
64
115
  CommentStyle.register('custom', new CommentStyle(';;'));
65
116
  ```
66
117
 
118
+ ### isValidPlugin
119
+
120
+ ```typescript
121
+ import { isValidPlugin } from '@lsst/pik-core';
122
+
123
+ // Validate a plugin object
124
+ if (isValidPlugin(obj)) {
125
+ // obj is PikPlugin
126
+ }
127
+ ```
128
+
67
129
  ## Types
68
130
 
69
131
  ```typescript
@@ -79,6 +141,19 @@ interface Option {
79
141
  content: string;
80
142
  isActive: boolean;
81
143
  }
144
+
145
+ interface PikPlugin {
146
+ name: string;
147
+ description: string;
148
+ command: string;
149
+ aliases?: string[];
150
+ register: (program: Command) => void;
151
+ }
152
+
153
+ interface PikConfig {
154
+ plugins?: PikPlugin[];
155
+ [pluginName: string]: unknown;
156
+ }
82
157
  ```
83
158
 
84
159
  ## License
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export type { Option, Selector, ParseResult, PikPlugin } from './lib/types/index.js';
2
2
  export { CommentStyle } from './lib/types/index.js';
3
- export { defineConfig, loadConfig, type PikConfig } from './lib/config.js';
3
+ export { defineConfig, loadConfig, isValidPlugin, type PikConfig, } from './lib/config.js';
4
4
  export { Parser } from './lib/parser.js';
5
5
  export { Switcher } from './lib/switcher.js';
6
6
  export { SingleSwitcher } from './lib/single-switcher.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG3E,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EACL,YAAY,EACZ,UAAU,EACV,aAAa,EACb,KAAK,SAAS,GACf,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC"}
package/dist/index.js CHANGED
@@ -2,8 +2,10 @@ import { pathToFileURL } from "url";
2
2
  import { existsSync } from "fs";
3
3
  import { resolve } from "path";
4
4
  class CommentStyle {
5
- constructor(lineComment) {
5
+ constructor(lineComment, blockOpen, blockClose) {
6
6
  this.lineComment = lineComment;
7
+ this.blockOpen = blockOpen;
8
+ this.blockClose = blockClose;
7
9
  }
8
10
  static styles = {
9
11
  // JavaScript/TypeScript
@@ -13,9 +15,9 @@ class CommentStyle {
13
15
  tsx: new CommentStyle("//"),
14
16
  mjs: new CommentStyle("//"),
15
17
  mts: new CommentStyle("//"),
16
- // HTML (for script tags)
17
- html: new CommentStyle("//"),
18
- htm: new CommentStyle("//"),
18
+ // HTML - supports both // (in script) and <!-- --> (in HTML)
19
+ html: new CommentStyle("//", "<!--", "-->"),
20
+ htm: new CommentStyle("//", "<!--", "-->"),
19
21
  // Config files
20
22
  yaml: new CommentStyle("#"),
21
23
  yml: new CommentStyle("#"),
@@ -29,6 +31,16 @@ class CommentStyle {
29
31
  env: new CommentStyle("#")
30
32
  };
31
33
  static defaultStyle = new CommentStyle("//");
34
+ /** Block comment opening (e.g., "<!--") */
35
+ blockOpen;
36
+ /** Block comment closing (e.g., "-->") */
37
+ blockClose;
38
+ /**
39
+ * Check if this style supports block comments
40
+ */
41
+ get hasBlockComments() {
42
+ return !!(this.blockOpen && this.blockClose);
43
+ }
32
44
  /**
33
45
  * Get comment style for a file extension
34
46
  */
@@ -68,6 +80,13 @@ async function loadConfig(cwd = process.cwd()) {
68
80
  }
69
81
  return null;
70
82
  }
83
+ function isValidPlugin(obj) {
84
+ if (typeof obj !== "object" || obj === null) {
85
+ return false;
86
+ }
87
+ const plugin = obj;
88
+ return typeof plugin.name === "string" && typeof plugin.description === "string" && typeof plugin.command === "string" && typeof plugin.register === "function";
89
+ }
71
90
  class Parser {
72
91
  constructor(commentStyle) {
73
92
  this.commentStyle = commentStyle;
@@ -117,7 +136,17 @@ class Parser {
117
136
  * Check if a line is commented out
118
137
  */
119
138
  isLineCommented(line) {
120
- return line.trimStart().startsWith(this.commentStyle.lineComment);
139
+ const trimmed = line.trimStart();
140
+ if (trimmed.startsWith(this.commentStyle.lineComment)) {
141
+ return true;
142
+ }
143
+ if (this.commentStyle.hasBlockComments) {
144
+ const { blockOpen, blockClose } = this.commentStyle;
145
+ if (trimmed.startsWith(blockOpen) && trimmed.includes(blockClose)) {
146
+ return true;
147
+ }
148
+ }
149
+ return false;
121
150
  }
122
151
  }
123
152
  class CommentManipulator {
@@ -125,31 +154,73 @@ class CommentManipulator {
125
154
  this.commentStyle = commentStyle;
126
155
  }
127
156
  /**
128
- * Check if a line is commented out
157
+ * Check if a line is commented out (line or block comment)
129
158
  */
130
159
  isLineCommented(line) {
131
- return line.trimStart().startsWith(this.commentStyle.lineComment);
160
+ const trimmed = line.trimStart();
161
+ if (trimmed.startsWith(this.commentStyle.lineComment)) {
162
+ return true;
163
+ }
164
+ if (this.commentStyle.hasBlockComments) {
165
+ const { blockOpen, blockClose } = this.commentStyle;
166
+ if (trimmed.startsWith(blockOpen) && trimmed.includes(blockClose)) {
167
+ return true;
168
+ }
169
+ }
170
+ return false;
171
+ }
172
+ /**
173
+ * Check if a line uses block comment style
174
+ */
175
+ isBlockCommented(line) {
176
+ if (!this.commentStyle.hasBlockComments) {
177
+ return false;
178
+ }
179
+ const trimmed = line.trimStart();
180
+ const { blockOpen, blockClose } = this.commentStyle;
181
+ return trimmed.startsWith(blockOpen) && trimmed.includes(blockClose);
132
182
  }
133
183
  /**
134
- * Comment out a line if not already commented
184
+ * Comment out a line if not already commented.
185
+ * Uses the same comment style as the original if block-commented,
186
+ * otherwise uses line comment style.
135
187
  */
136
- commentLine(line) {
188
+ commentLine(line, useBlockStyle = false) {
137
189
  const trimmed = line.trimStart();
138
190
  if (trimmed.startsWith(this.commentStyle.lineComment)) {
139
191
  return line;
140
192
  }
193
+ if (this.isBlockCommented(line)) {
194
+ return line;
195
+ }
141
196
  const indent = line.slice(0, line.length - trimmed.length);
197
+ if (useBlockStyle && this.commentStyle.hasBlockComments) {
198
+ const { blockOpen, blockClose } = this.commentStyle;
199
+ return `${indent}${blockOpen} ${trimmed} ${blockClose}`;
200
+ }
142
201
  return `${indent}${this.commentStyle.lineComment} ${trimmed}`;
143
202
  }
144
203
  /**
145
- * Uncomment a line if commented
204
+ * Uncomment a line if commented (handles both line and block comments)
146
205
  */
147
206
  uncommentLine(line) {
148
207
  const trimmed = line.trimStart();
208
+ const indent = line.slice(0, line.length - trimmed.length);
209
+ if (this.commentStyle.hasBlockComments) {
210
+ const { blockOpen, blockClose } = this.commentStyle;
211
+ if (trimmed.startsWith(blockOpen)) {
212
+ const afterOpen = trimmed.slice(blockOpen.length);
213
+ const closeIndex = afterOpen.indexOf(blockClose);
214
+ if (closeIndex !== -1) {
215
+ const content2 = afterOpen.slice(0, closeIndex).trim();
216
+ const rest = afterOpen.slice(closeIndex + blockClose.length);
217
+ return `${indent}${content2}${rest}`;
218
+ }
219
+ }
220
+ }
149
221
  if (!trimmed.startsWith(this.commentStyle.lineComment)) {
150
222
  return line;
151
223
  }
152
- const indent = line.slice(0, line.length - trimmed.length);
153
224
  const withoutComment = trimmed.slice(this.commentStyle.lineComment.length);
154
225
  const content = withoutComment.startsWith(" ") ? withoutComment.slice(1) : withoutComment;
155
226
  return `${indent}${content}`;
@@ -181,13 +252,17 @@ class SingleSwitcher extends Switcher {
181
252
  switch(content, selector, optionName) {
182
253
  this.validateOption(selector, optionName);
183
254
  const lines = content.split("\n");
255
+ const useBlockStyle = selector.options.some((opt) => {
256
+ const line = lines[opt.line - 1];
257
+ return this.isBlockCommented(line);
258
+ });
184
259
  for (const option of selector.options) {
185
260
  const lineIndex = option.line - 1;
186
261
  const line = lines[lineIndex];
187
262
  if (option.name === optionName) {
188
263
  lines[lineIndex] = this.uncommentLine(line);
189
264
  } else {
190
- lines[lineIndex] = this.commentLine(line);
265
+ lines[lineIndex] = this.commentLine(line, useBlockStyle);
191
266
  }
192
267
  }
193
268
  return lines.join("\n");
@@ -200,5 +275,6 @@ export {
200
275
  SingleSwitcher,
201
276
  Switcher,
202
277
  defineConfig,
278
+ isValidPlugin,
203
279
  loadConfig
204
280
  };
@@ -6,15 +6,21 @@ export declare abstract class CommentManipulator {
6
6
  protected readonly commentStyle: CommentStyle;
7
7
  constructor(commentStyle: CommentStyle);
8
8
  /**
9
- * Check if a line is commented out
9
+ * Check if a line is commented out (line or block comment)
10
10
  */
11
11
  protected isLineCommented(line: string): boolean;
12
12
  /**
13
- * Comment out a line if not already commented
13
+ * Check if a line uses block comment style
14
14
  */
15
- protected commentLine(line: string): string;
15
+ protected isBlockCommented(line: string): boolean;
16
16
  /**
17
- * Uncomment a line if commented
17
+ * Comment out a line if not already commented.
18
+ * Uses the same comment style as the original if block-commented,
19
+ * otherwise uses line comment style.
20
+ */
21
+ protected commentLine(line: string, useBlockStyle?: boolean): string;
22
+ /**
23
+ * Uncomment a line if commented (handles both line and block comments)
18
24
  */
19
25
  protected uncommentLine(line: string): string;
20
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"comment-manipulator.d.ts","sourceRoot":"","sources":["../../src/lib/comment-manipulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;GAEG;AACH,8BAAsB,kBAAkB;IAC1B,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY;gBAA1B,YAAY,EAAE,YAAY;IAEzD;;OAEG;IACH,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIhD;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAU3C;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAe9C"}
1
+ {"version":3,"file":"comment-manipulator.d.ts","sourceRoot":"","sources":["../../src/lib/comment-manipulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;GAEG;AACH,8BAAsB,kBAAkB;IAC1B,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY;gBAA1B,YAAY,EAAE,YAAY;IAEzD;;OAEG;IACH,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAmBhD;;OAEG;IACH,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAUjD;;;;OAIG;IACH,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,UAAQ,GAAG,MAAM;IAwBlE;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAkC9C"}
@@ -1,7 +1,23 @@
1
+ import type { PikPlugin } from './types/plugin.js';
1
2
  /**
2
3
  * Base config interface - plugins extend this via declaration merging
3
4
  */
4
5
  export interface PikConfig {
6
+ /**
7
+ * External plugins to load.
8
+ * Each plugin should be a factory function call that returns a PikPlugin:
9
+ * @example
10
+ * ```ts
11
+ * import { myPlugin } from 'pik-plugin-my';
12
+ *
13
+ * export default {
14
+ * plugins: [
15
+ * myPlugin({ someOption: 'value' }),
16
+ * ],
17
+ * }
18
+ * ```
19
+ */
20
+ plugins?: PikPlugin[];
5
21
  [pluginName: string]: unknown;
6
22
  }
7
23
  /**
@@ -12,4 +28,8 @@ export declare function defineConfig<T extends PikConfig>(config: T): T;
12
28
  * Load pik config from the current directory
13
29
  */
14
30
  export declare function loadConfig(cwd?: string): Promise<PikConfig | null>;
31
+ /**
32
+ * Validate that an object satisfies the PikPlugin interface
33
+ */
34
+ export declare function isValidPlugin(obj: unknown): obj is PikPlugin;
15
35
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAE9D;AAaD;;GAEG;AACH,wBAAsB,UAAU,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAYvF"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAE9D;AAaD;;GAEG;AACH,wBAAsB,UAAU,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAYvF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,SAAS,CAa5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/lib/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,WAAW,EAAY,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;GAEG;AACH,qBAAa,MAAM;IAIL,OAAO,CAAC,QAAQ,CAAC,YAAY;IAHzC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAyB;IAC7D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAyB;gBAEhC,YAAY,EAAE,YAAY;IAEvD;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAI9C;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IAqCnC;;OAEG;IACH,OAAO,CAAC,eAAe;CAGxB"}
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/lib/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,WAAW,EAAY,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;GAEG;AACH,qBAAa,MAAM;IAIL,OAAO,CAAC,QAAQ,CAAC,YAAY;IAHzC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAyB;IAC7D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAyB;gBAEhC,YAAY,EAAE,YAAY;IAEvD;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAI9C;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IAqCnC;;OAEG;IACH,OAAO,CAAC,eAAe;CAkBxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"single-switcher.d.ts","sourceRoot":"","sources":["../../src/lib/single-switcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IAC1C;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc;IAItD;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;CAkBxE"}
1
+ {"version":3,"file":"single-switcher.d.ts","sourceRoot":"","sources":["../../src/lib/single-switcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IAC1C;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc;IAItD;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;CAwBxE"}
@@ -6,9 +6,17 @@ export declare class CommentStyle {
6
6
  readonly lineComment: string;
7
7
  private static readonly styles;
8
8
  private static readonly defaultStyle;
9
+ /** Block comment opening (e.g., "<!--") */
10
+ readonly blockOpen?: string;
11
+ /** Block comment closing (e.g., "-->") */
12
+ readonly blockClose?: string;
9
13
  constructor(
10
14
  /** Line comment prefix (e.g., "//", "#") */
11
- lineComment: string);
15
+ lineComment: string, blockOpen?: string, blockClose?: string);
16
+ /**
17
+ * Check if this style supports block comments
18
+ */
19
+ get hasBlockComments(): boolean;
12
20
  /**
13
21
  * Get comment style for a file extension
14
22
  */
@@ -1 +1 @@
1
- {"version":3,"file":"comment-style.d.ts","sourceRoot":"","sources":["../../../src/lib/types/comment-style.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,YAAY;IA4BrB,4CAA4C;aAC5B,WAAW,EAAE,MAAM;IA5BrC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAsB5B;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAA0B;;IAG5D,4CAA4C;IAC5B,WAAW,EAAE,MAAM;IAGrC;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAKrD;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;CAI9D"}
1
+ {"version":3,"file":"comment-style.d.ts","sourceRoot":"","sources":["../../../src/lib/types/comment-style.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,YAAY;IAiCrB,4CAA4C;aAC5B,WAAW,EAAE,MAAM;IAjCrC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAsB5B;IAEF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAA0B;IAE9D,2CAA2C;IAC3C,SAAgB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnC,0CAA0C;IAC1C,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;;IAGlC,4CAA4C;IAC5B,WAAW,EAAE,MAAM,EACnC,SAAS,CAAC,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,MAAM;IAMrB;;OAEG;IACH,IAAI,gBAAgB,IAAI,OAAO,CAE9B;IAED;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAKrD;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;CAI9D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsst/pik-core",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Core library for parsing and switching @pik config markers",
5
5
  "type": "module",
6
6
  "license": "MIT",