@orkestrel/scaffold 0.0.47 → 0.0.48

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.
@@ -12,6 +12,7 @@ export interface PolicyExpression extends PolicyNode {
12
12
  readonly key?: PolicyExpression
13
13
  readonly id?: unknown
14
14
  readonly method?: boolean
15
+ readonly kind?: 'get' | 'init' | 'set'
15
16
  readonly expression?: boolean
16
17
  readonly object?: PolicyExpression
17
18
  readonly property?: PolicyExpression
@@ -122,7 +123,9 @@ export function isPolicyMethod(node: PolicyExpression): boolean {
122
123
  return (
123
124
  node.type === 'FunctionExpression' &&
124
125
  parent?.value === node &&
125
- (parent.type === 'MethodDefinition' || (parent.type === 'Property' && parent.method === true))
126
+ (parent.type === 'MethodDefinition' ||
127
+ (parent.type === 'Property' &&
128
+ (parent.method === true || parent.kind === 'get' || parent.kind === 'set')))
126
129
  )
127
130
  }
128
131
 
@@ -648,8 +648,31 @@ describe('policy plugin', () => {
648
648
  name: 'accepts function syntax inside a class expression',
649
649
  code: 'function projectValue() { return class { read() { const value = () => 1; return value() } } }',
650
650
  },
651
+ {
652
+ name: 'accepts class accessors inside a factory',
653
+ code: 'function createAccessor() { class Accessor { get value() { return 1 } set value(value) { consume(value) } } return Accessor }',
654
+ },
651
655
  ],
652
656
  invalid: [
657
+ {
658
+ name: 'accepts object accessors while rejecting nested function expressions',
659
+ code: [
660
+ 'function createAccessor() {',
661
+ ' const control = function () { return 1 }',
662
+ ' return {',
663
+ ' get value() {',
664
+ ' const nested = function () { return 2 }',
665
+ ' return nested()',
666
+ ' },',
667
+ ' set value(value) { consume(value) },',
668
+ ' }',
669
+ '}',
670
+ ].join('\n'),
671
+ errors: [
672
+ { messageId: 'nested', line: 2, column: 18 },
673
+ { messageId: 'nested', line: 5, column: 21 },
674
+ ],
675
+ },
653
676
  {
654
677
  name: 'rejects a local function declaration',
655
678
  code: 'function projectValue() { function readValue() { return 1 } return readValue() }',
@@ -4,7 +4,7 @@ let _orkestrel_template = require("@orkestrel/template");
4
4
  let _orkestrel_emitter = require("@orkestrel/emitter");
5
5
  var package_default = {
6
6
  name: "@orkestrel/scaffold",
7
- version: "0.0.47",
7
+ version: "0.0.48",
8
8
  description: "Scaffold workspaces with five commands: new, audit, repair, catalog, and overwrite.",
9
9
  keywords: [
10
10
  "audit",
@@ -92,7 +92,7 @@ var package_default = {
92
92
  "@orkestrel/contract": "^0.0.13",
93
93
  "@orkestrel/emitter": "^0.0.7",
94
94
  "@orkestrel/markdown": "^0.0.9",
95
- "@orkestrel/process": "^0.0.4",
95
+ "@orkestrel/process": "^0.0.6",
96
96
  "@orkestrel/template": "^0.0.4"
97
97
  },
98
98
  devDependencies: {
@@ -100,7 +100,7 @@ var package_default = {
100
100
  "@orkestrel/guide": "^0.0.12",
101
101
  "@orkestrel/html": "^0.0.4",
102
102
  "@orkestrel/probe": "^0.0.2",
103
- "@orkestrel/test": "^0.0.8",
103
+ "@orkestrel/test": "^0.0.9",
104
104
  "@types/node": "^26.2.0",
105
105
  "@vitest/browser-playwright": "^4.1.11",
106
106
  "oxfmt": "^0.64.0",