@lsst/pik-core 0.6.6 → 0.7.0

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
@@ -22,11 +22,11 @@ const env = 'LOCAL'; // @pik:option LOCAL
22
22
  `;
23
23
 
24
24
  // Parse content
25
- const parser = Parser.forExtension('ts');
25
+ const parser = Parser.forFilePath('config.ts');
26
26
  const { selectors } = parser.parse(content);
27
27
 
28
28
  // Switch option
29
- const switcher = SingleSwitcher.forExtension('ts');
29
+ const switcher = SingleSwitcher.forFilePath('config.ts');
30
30
  const newContent = switcher.switch(content, selectors[0], 'DEV');
31
31
  ```
32
32
 
@@ -84,8 +84,8 @@ export function myPlugin(config: MyPluginConfig): PikPlugin {
84
84
  ### Parser
85
85
 
86
86
  ```typescript
87
- // Create parser for file extension
88
- const parser = Parser.forExtension('ts');
87
+ // Create parser for file path
88
+ const parser = Parser.forFilePath('src/config.ts');
89
89
 
90
90
  // Parse content
91
91
  const result = parser.parse(content);
@@ -96,8 +96,8 @@ const result = parser.parse(content);
96
96
  ### SingleSwitcher
97
97
 
98
98
  ```typescript
99
- // Create switcher for file extension
100
- const switcher = SingleSwitcher.forExtension('ts');
99
+ // Create switcher for file path
100
+ const switcher = SingleSwitcher.forFilePath('src/config.ts');
101
101
 
102
102
  // Switch to option (deactivates all others)
103
103
  const newContent = switcher.switch(content, selector, 'optionName');
@@ -108,8 +108,8 @@ const newContent = switcher.switch(content, selector, 'optionName');
108
108
  ```typescript
109
109
  import { CommentStyle } from '@lsst/pik-core';
110
110
 
111
- // Get comment style for extension
112
- const style = CommentStyle.fromExtension('py'); // { lineComment: '#' }
111
+ // Get comment style for file path
112
+ const style = CommentStyle.fromFilePath('script.py'); // { lineComment: '#' }
113
113
 
114
114
  // Register custom style
115
115
  CommentStyle.register('custom', new CommentStyle(';;'));
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- export type { Option, Selector, ParseResult, PikPlugin } from './lib/types/index.js';
1
+ export type { Option, BlockOption, Selector, ParseResult, PikPlugin } from './lib/types/index.js';
2
2
  export { CommentStyle } from './lib/types/index.js';
3
3
  export { defineConfig, loadConfig, findLocalConfig, 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';
7
+ export { BlockSwitcher } from './lib/block-switcher.js';
7
8
  export { CommentManipulator } from './lib/comment-manipulator.js';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -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,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,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;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC"}
package/dist/index.js CHANGED
@@ -40,18 +40,9 @@ class CommentStyle {
40
40
  return !!(this.blockOpen && this.blockClose);
41
41
  }
42
42
  /**
43
- * Get comment style for a file extension
44
- */
45
- static fromExtension(extension) {
46
- const ext = extension.replace(/^\./, "").toLowerCase();
47
- return CommentStyle.styles[ext] ?? CommentStyle.defaultStyle;
48
- }
49
- /**
50
- * Get comment style for a file path, handling dotfiles like .env correctly.
43
+ * Get comment style for a file path.
51
44
  *
52
- * Unlike fromExtension(), this method properly handles:
53
- * - `.env` files (where extname returns '')
54
- * - `.env.local`, `.env.development`, etc. (where extname returns '.local', '.development')
45
+ * Handles dotfiles like `.env`, `.env.local`, `.env.development` correctly.
55
46
  */
56
47
  static fromFilePath(filePath) {
57
48
  const basename = filePath.split(/[/\\]/).pop() ?? "";
@@ -106,14 +97,10 @@ class Parser {
106
97
  }
107
98
  static SELECT_REGEX = /@pik:select\s+(\S+)/;
108
99
  static OPTION_REGEX = /@pik:option\s+(\S+)/;
100
+ static BLOCK_START_REGEX = /@pik:block-start\s+(\S+)/;
101
+ static BLOCK_END_REGEX = /@pik:block-end/;
109
102
  /**
110
- * Create a parser for a specific file extension
111
- */
112
- static forExtension(extension) {
113
- return new Parser(CommentStyle.fromExtension(extension));
114
- }
115
- /**
116
- * Create a parser for a file path, correctly handling dotfiles like .env
103
+ * Create a parser for a file path
117
104
  */
118
105
  static forFilePath(filePath) {
119
106
  return new Parser(CommentStyle.fromFilePath(filePath));
@@ -125,6 +112,7 @@ class Parser {
125
112
  const lines = content.split("\n");
126
113
  const selectors = [];
127
114
  let currentSelector = null;
115
+ let currentBlock = null;
128
116
  for (let i = 0; i < lines.length; i++) {
129
117
  const line = lines[i];
130
118
  const lineNumber = i + 1;
@@ -133,11 +121,39 @@ class Parser {
133
121
  currentSelector = {
134
122
  name: selectMatch[1],
135
123
  line: lineNumber,
136
- options: []
124
+ options: [],
125
+ blockOptions: []
137
126
  };
138
127
  selectors.push(currentSelector);
139
128
  continue;
140
129
  }
130
+ const blockStartMatch = line.match(Parser.BLOCK_START_REGEX);
131
+ if (blockStartMatch && currentSelector) {
132
+ currentBlock = {
133
+ name: blockStartMatch[1],
134
+ startLine: lineNumber,
135
+ contentLines: []
136
+ };
137
+ continue;
138
+ }
139
+ const blockEndMatch = line.match(Parser.BLOCK_END_REGEX);
140
+ if (blockEndMatch && currentSelector && currentBlock) {
141
+ const isActive = currentBlock.contentLines.length > 0 ? !this.isLineCommented(lines[currentBlock.contentLines[0] - 1]) : false;
142
+ const blockOption = {
143
+ name: currentBlock.name,
144
+ startLine: currentBlock.startLine,
145
+ endLine: lineNumber,
146
+ contentLines: currentBlock.contentLines,
147
+ isActive
148
+ };
149
+ currentSelector.blockOptions.push(blockOption);
150
+ currentBlock = null;
151
+ continue;
152
+ }
153
+ if (currentBlock) {
154
+ currentBlock.contentLines.push(lineNumber);
155
+ continue;
156
+ }
141
157
  const optionMatch = line.match(Parser.OPTION_REGEX);
142
158
  if (optionMatch && currentSelector) {
143
159
  const isStandalone = this.isStandaloneMarker(line);
@@ -324,13 +340,7 @@ class Switcher extends CommentManipulator {
324
340
  }
325
341
  class SingleSwitcher extends Switcher {
326
342
  /**
327
- * Create a switcher for a specific file extension
328
- */
329
- static forExtension(extension) {
330
- return new SingleSwitcher(CommentStyle.fromExtension(extension));
331
- }
332
- /**
333
- * Create a switcher for a file path, correctly handling dotfiles like .env
343
+ * Create a switcher for a file path
334
344
  */
335
345
  static forFilePath(filePath) {
336
346
  return new SingleSwitcher(CommentStyle.fromFilePath(filePath));
@@ -357,7 +367,53 @@ class SingleSwitcher extends Switcher {
357
367
  return lines.join("\n");
358
368
  }
359
369
  }
370
+ class BlockSwitcher extends CommentManipulator {
371
+ /**
372
+ * Create a switcher for a file path
373
+ */
374
+ static forFilePath(filePath) {
375
+ return new BlockSwitcher(CommentStyle.fromFilePath(filePath));
376
+ }
377
+ /**
378
+ * Switch to a specific block option, deactivating all others.
379
+ * - Selected block: all content lines uncommented
380
+ * - Other blocks: all content lines commented
381
+ */
382
+ switch(content, selector, blockName) {
383
+ this.validateBlockOption(selector, blockName);
384
+ const lines = content.split("\n");
385
+ const useBlockStyle = selector.blockOptions.some((block) => {
386
+ if (block.contentLines.length === 0) return false;
387
+ const line = lines[block.contentLines[0] - 1];
388
+ return this.isBlockCommented(line);
389
+ });
390
+ for (const block of selector.blockOptions) {
391
+ for (const lineNum of block.contentLines) {
392
+ const lineIndex = lineNum - 1;
393
+ const line = lines[lineIndex];
394
+ if (block.name === blockName) {
395
+ lines[lineIndex] = this.uncommentLine(line);
396
+ } else {
397
+ lines[lineIndex] = this.commentLine(line, useBlockStyle);
398
+ }
399
+ }
400
+ }
401
+ return lines.join("\n");
402
+ }
403
+ /**
404
+ * Validate that the block option exists in the selector
405
+ */
406
+ validateBlockOption(selector, blockName) {
407
+ const block = selector.blockOptions.find((b) => b.name === blockName);
408
+ if (!block) {
409
+ throw new Error(
410
+ `Block option "${blockName}" not found in selector "${selector.name}"`
411
+ );
412
+ }
413
+ }
414
+ }
360
415
  export {
416
+ BlockSwitcher,
361
417
  CommentManipulator,
362
418
  CommentStyle,
363
419
  Parser,
@@ -0,0 +1,22 @@
1
+ import type { Selector } from './types/index.js';
2
+ import { CommentManipulator } from './comment-manipulator.js';
3
+ /**
4
+ * Switcher that handles multi-line block options
5
+ */
6
+ export declare class BlockSwitcher extends CommentManipulator {
7
+ /**
8
+ * Create a switcher for a file path
9
+ */
10
+ static forFilePath(filePath: string): BlockSwitcher;
11
+ /**
12
+ * Switch to a specific block option, deactivating all others.
13
+ * - Selected block: all content lines uncommented
14
+ * - Other blocks: all content lines commented
15
+ */
16
+ switch(content: string, selector: Selector, blockName: string): string;
17
+ /**
18
+ * Validate that the block option exists in the selector
19
+ */
20
+ private validateBlockOption;
21
+ }
22
+ //# sourceMappingURL=block-switcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-switcher.d.ts","sourceRoot":"","sources":["../../src/lib/block-switcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;GAEG;AACH,qBAAa,aAAc,SAAQ,kBAAkB;IACnD;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa;IAInD;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IA4BtE;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAQ5B"}
@@ -7,13 +7,11 @@ export declare class Parser {
7
7
  private readonly commentStyle;
8
8
  private static readonly SELECT_REGEX;
9
9
  private static readonly OPTION_REGEX;
10
+ private static readonly BLOCK_START_REGEX;
11
+ private static readonly BLOCK_END_REGEX;
10
12
  constructor(commentStyle: CommentStyle);
11
13
  /**
12
- * Create a parser for a specific file extension
13
- */
14
- static forExtension(extension: string): Parser;
15
- /**
16
- * Create a parser for a file path, correctly handling dotfiles like .env
14
+ * Create a parser for a file path
17
15
  */
18
16
  static forFilePath(filePath: string): Parser;
19
17
  /**
@@ -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,Y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
  export declare class SingleSwitcher extends Switcher {
7
7
  /**
8
- * Create a switcher for a specific file extension
9
- */
10
- static forExtension(extension: string): SingleSwitcher;
11
- /**
12
- * Create a switcher for a file path, correctly handling dotfiles like .env
8
+ * Create a switcher for a file path
13
9
  */
14
10
  static forFilePath(filePath: string): SingleSwitcher;
15
11
  /**
@@ -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,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc;IAIpD;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;CAyBxE"}
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,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc;IAIpD;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;CAyBxE"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Represents a multi-line block option within a selector
3
+ */
4
+ export interface BlockOption {
5
+ /** Option name (e.g., "Development", "Production") */
6
+ name: string;
7
+ /** Line number where @pik:block-start is located (1-based) */
8
+ startLine: number;
9
+ /** Line number where @pik:block-end is located (1-based) */
10
+ endLine: number;
11
+ /** Line numbers of content lines between start/end (1-based) */
12
+ contentLines: number[];
13
+ /** Whether this block is currently active (content lines are not commented out) */
14
+ isActive: boolean;
15
+ }
16
+ //# sourceMappingURL=block-option.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-option.d.ts","sourceRoot":"","sources":["../../../src/lib/types/block-option.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mFAAmF;IACnF,QAAQ,EAAE,OAAO,CAAC;CACnB"}
@@ -18,15 +18,9 @@ export declare class CommentStyle {
18
18
  */
19
19
  get hasBlockComments(): boolean;
20
20
  /**
21
- * Get comment style for a file extension
22
- */
23
- static fromExtension(extension: string): CommentStyle;
24
- /**
25
- * Get comment style for a file path, handling dotfiles like .env correctly.
21
+ * Get comment style for a file path.
26
22
  *
27
- * Unlike fromExtension(), this method properly handles:
28
- * - `.env` files (where extname returns '')
29
- * - `.env.local`, `.env.development`, etc. (where extname returns '.local', '.development')
23
+ * Handles dotfiles like `.env`, `.env.local`, `.env.development` correctly.
30
24
  */
31
25
  static fromFilePath(filePath: string): CommentStyle;
32
26
  /**
@@ -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;IAiCrB,4CAA4C;aAC5B,WAAW,EAAE,MAAM;IAjCrC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC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D;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;CAI9D"}
@@ -1,4 +1,5 @@
1
1
  export type { Option } from './option.js';
2
+ export type { BlockOption } from './block-option.js';
2
3
  export type { Selector } from './selector.js';
3
4
  export type { ParseResult } from './parse-result.js';
4
5
  export { CommentStyle } from './comment-style.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { Option } from './option.js';
2
+ import type { BlockOption } from './block-option.js';
2
3
  /**
3
4
  * Represents a selector with its options
4
5
  */
@@ -7,7 +8,9 @@ export interface Selector {
7
8
  name: string;
8
9
  /** Line number where the selector is defined (1-based) */
9
10
  line: number;
10
- /** All options belonging to this selector */
11
+ /** All single-line options belonging to this selector */
11
12
  options: Option[];
13
+ /** All multi-line block options belonging to this selector */
14
+ blockOptions: BlockOption[];
12
15
  }
13
16
  //# sourceMappingURL=selector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../../src/lib/types/selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB"}
1
+ {"version":3,"file":"selector.d.ts","sourceRoot":"","sources":["../../../src/lib/types/selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,8DAA8D;IAC9D,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsst/pik-core",
3
- "version": "0.6.6",
3
+ "version": "0.7.0",
4
4
  "description": "Core library for parsing and switching @pik config markers",
5
5
  "type": "module",
6
6
  "license": "MIT",