diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 09be4f7..e2941f3 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -35,7 +35,7 @@ jobs: private-key: ${{ secrets.BOT_PRIVATE_KEY }} - id: checkout name: Checkout ${{ github.head_ref }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ github.head_ref }} diff --git a/.github/workflows/auto-review.yml b/.github/workflows/auto-review.yml index a00dbef..eac6f86 100644 --- a/.github/workflows/auto-review.yml +++ b/.github/workflows/auto-review.yml @@ -58,7 +58,7 @@ jobs: run: gh auth status - id: checkout name: Checkout ${{ github.head_ref }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ github.head_ref }} diff --git a/.github/workflows/cache-cleanup.yml b/.github/workflows/cache-cleanup.yml index e0b20a7..fbf7213 100644 --- a/.github/workflows/cache-cleanup.yml +++ b/.github/workflows/cache-cleanup.yml @@ -46,7 +46,7 @@ jobs: uses: hmarr/debug-action@v3.0.0 - id: checkout name: Checkout main - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: main diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c153407..9374d5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: uses: hmarr/debug-action@v3.0.0 - id: checkout name: Checkout ${{ env.REF_NAME }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ env.REF }} @@ -103,7 +103,7 @@ jobs: steps: - id: checkout name: Checkout ${{ env.REF_NAME }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: fetch-depth: 0 persist-credentials: false @@ -131,7 +131,7 @@ jobs: steps: - id: checkout name: Checkout ${{ env.REF_NAME }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: fetch-depth: 0 persist-credentials: false @@ -156,7 +156,7 @@ jobs: steps: - id: checkout name: Checkout ${{ env.REF_NAME }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ env.REF }} @@ -185,7 +185,7 @@ jobs: steps: - id: checkout name: Checkout ${{ env.REF_NAME }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ env.REF }} @@ -214,7 +214,7 @@ jobs: steps: - id: checkout name: Checkout ${{ env.REF_NAME }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ env.REF }} @@ -251,7 +251,7 @@ jobs: steps: - id: checkout name: Checkout ${{ env.REF_NAME }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ env.REF }} @@ -299,7 +299,7 @@ jobs: steps: - id: checkout name: Checkout ${{ env.REF_NAME }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ env.REF }} @@ -348,7 +348,7 @@ jobs: steps: - id: checkout name: Checkout ${{ env.REF_NAME }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: fetch-depth: 0 persist-credentials: false diff --git a/.github/workflows/dependabot-dedupe.yml b/.github/workflows/dependabot-dedupe.yml index 96619bc..d209693 100644 --- a/.github/workflows/dependabot-dedupe.yml +++ b/.github/workflows/dependabot-dedupe.yml @@ -48,7 +48,7 @@ jobs: private-key: ${{ secrets.BOT_PRIVATE_KEY }} - id: checkout name: Checkout ${{ github.head_ref }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ github.head_ref }} diff --git a/.github/workflows/infrastructure.yml b/.github/workflows/infrastructure.yml index 2fed753..207d689 100644 --- a/.github/workflows/infrastructure.yml +++ b/.github/workflows/infrastructure.yml @@ -51,7 +51,7 @@ jobs: private-key: ${{ secrets.BOT_PRIVATE_KEY }} - id: checkout name: Checkout ${{ github.ref_name }}@${{ github.sha }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ github.sha }} diff --git a/.github/workflows/integrity.yml b/.github/workflows/integrity.yml index 26637b8..3da6ebe 100644 --- a/.github/workflows/integrity.yml +++ b/.github/workflows/integrity.yml @@ -43,7 +43,7 @@ jobs: steps: - id: checkout name: Checkout ${{ github.head_ref || github.ref_name }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ github.head_ref || github.ref }} diff --git a/.github/workflows/label-linked-issues.yml b/.github/workflows/label-linked-issues.yml index 5b836e0..d40068d 100644 --- a/.github/workflows/label-linked-issues.yml +++ b/.github/workflows/label-linked-issues.yml @@ -44,7 +44,7 @@ jobs: uses: hmarr/debug-action@v3.0.0 - id: checkout name: Checkout main - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: main diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 969354e..5a656eb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -47,7 +47,7 @@ jobs: uses: hmarr/debug-action@v3.0.0 - id: checkout name: Checkout ${{ github.ref_name }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ github.ref }} @@ -83,7 +83,7 @@ jobs: steps: - id: checkout name: Checkout ${{ github.ref_name }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ github.ref }} @@ -122,7 +122,7 @@ jobs: steps: - id: checkout name: Checkout ${{ github.ref_name }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ github.ref }} diff --git a/.github/workflows/release-chore.yml b/.github/workflows/release-chore.yml index 33b40a5..1b860e0 100644 --- a/.github/workflows/release-chore.yml +++ b/.github/workflows/release-chore.yml @@ -53,7 +53,7 @@ jobs: exit 1 - id: checkout name: Checkout ${{ github.ref_name }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ github.ref }} @@ -109,7 +109,7 @@ jobs: private-key: ${{ secrets.BOT_PRIVATE_KEY }} - id: checkout name: Checkout ${{ github.ref_name }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: ref: ${{ github.ref }} token: ${{ steps.bot-token.outputs.token }} @@ -136,7 +136,7 @@ jobs: private-key: ${{ secrets.BOT_PRIVATE_KEY }} - id: checkout name: Checkout ${{ needs.preflight.outputs.branch }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: fetch-depth: 0 persist-credentials: false @@ -196,7 +196,7 @@ jobs: private-key: ${{ secrets.BOT_PRIVATE_KEY }} - id: checkout name: Checkout ${{ needs.preflight.outputs.branch }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ needs.preflight.outputs.branch }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 178f433..51675ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,7 +57,7 @@ jobs: uses: hmarr/debug-action@v3.0.0 - id: checkout name: Checkout ${{ env.REF_NAME }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: ref: ${{ env.REF }} - id: version @@ -89,7 +89,7 @@ jobs: steps: - id: checkout name: Checkout ${{ env.REF_NAME }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: fetch-depth: 0 persist-credentials: true diff --git a/.github/workflows/typescript-canary.yml b/.github/workflows/typescript-canary.yml index 4970380..43fb863 100644 --- a/.github/workflows/typescript-canary.yml +++ b/.github/workflows/typescript-canary.yml @@ -48,7 +48,7 @@ jobs: uses: hmarr/debug-action@v3.0.0 - id: checkout name: Checkout ${{ github.ref_name }} - uses: actions/checkout@v4.1.3 + uses: actions/checkout@v4.1.6 with: persist-credentials: false ref: ${{ github.ref }} diff --git a/src/__tests__/esast.spec-d.ts b/src/__tests__/esast.spec-d.ts index 11587ac..36d453f 100644 --- a/src/__tests__/esast.spec-d.ts +++ b/src/__tests__/esast.spec-d.ts @@ -34,6 +34,7 @@ describe('unit-d:esast', () => { | mdast.Nodes | TestSubject.Comment | TestSubject.ExpressionStatement + | TestSubject.MethodProperty | TestSubject.ShorthandProperty | TestSubject.TemplateLiteral > diff --git a/src/nodes/__tests__/property-shorthand.spec-d.ts b/src/nodes/__tests__/property-shorthand.spec-d.ts index 1e60c78..5410e3f 100644 --- a/src/nodes/__tests__/property-shorthand.spec-d.ts +++ b/src/nodes/__tests__/property-shorthand.spec-d.ts @@ -17,10 +17,6 @@ describe('unit-d:nodes/ShorthandProperty', () => { expectTypeOf().toHaveProperty('assignment').toEqualTypeOf() }) - it('should match [computed: false]', () => { - expectTypeOf().toHaveProperty('computed').toEqualTypeOf() - }) - it('should match [kind: Extract]', () => { expectTypeOf() .toHaveProperty('kind') diff --git a/src/nodes/definition-method.ts b/src/nodes/definition-method.ts index 5bbfb3b..acb1576 100644 --- a/src/nodes/definition-method.ts +++ b/src/nodes/definition-method.ts @@ -11,7 +11,8 @@ import type { FunctionExpression, MethodKind, ModifierList, - Parent + Parent, + PropertyName } from '@flex-development/esast' /** @@ -38,6 +39,7 @@ interface MethodDefinition extends Parent { * @see {@linkcode Expression} * @see {@linkcode FunctionExpression} * @see {@linkcode ModifierList} + * @see {@linkcode PropertyName} */ children: | [ @@ -53,7 +55,7 @@ interface MethodDefinition extends Parent { ...comments: InternalComments, value: FunctionExpression ] - | [name: Expression, ...comments: Comments, value: FunctionExpression] + | [name: PropertyName, ...comments: Comments, value: FunctionExpression] /** * Boolean indicating if method name is computed. @@ -85,4 +87,4 @@ interface MethodDefinition extends Parent { type: 'methodDefinition' } -export type { MethodDefinitionData, MethodDefinition as default } +export type { MethodDefinition as default, MethodDefinitionData } diff --git a/src/nodes/expression-object.ts b/src/nodes/expression-object.ts index 56d9679..34b3d2d 100644 --- a/src/nodes/expression-object.ts +++ b/src/nodes/expression-object.ts @@ -6,10 +6,8 @@ import type { Comment, Data, - MethodProperty, Parent, - ShorthandProperty, - SimpleProperty, + Property, SpreadElement } from '@flex-development/esast' @@ -34,18 +32,10 @@ interface ObjectExpression extends Parent { * List of children. * * @see {@linkcode Comment} - * @see {@linkcode MethodProperty} - * @see {@linkcode ShorthandProperty} - * @see {@linkcode SimpleProperty} + * @see {@linkcode Property} * @see {@linkcode SpreadElement} */ - children: ( - | Comment - | MethodProperty - | ShorthandProperty - | SimpleProperty - | SpreadElement - )[] + children: (Comment | Property | SpreadElement)[] /** * Info from the ecosystem. @@ -60,4 +50,4 @@ interface ObjectExpression extends Parent { type: 'objectExpression' } -export type { ObjectExpressionData, ObjectExpression as default } +export type { ObjectExpression as default, ObjectExpressionData } diff --git a/src/nodes/pattern-object.ts b/src/nodes/pattern-object.ts index b2a6e1d..13e549e 100644 --- a/src/nodes/pattern-object.ts +++ b/src/nodes/pattern-object.ts @@ -4,13 +4,11 @@ */ import type { - AssignmentProperty, Comment, Data, Parent, - RenamedProperty, - RestElement, - ShorthandProperty + Property, + RestElement } from '@flex-development/esast' /** @@ -33,19 +31,11 @@ interface ObjectPattern extends Parent { /** * List of children. * - * @see {@linkcode AssignmentProperty} * @see {@linkcode Comment} - * @see {@linkcode RenamedProperty} + * @see {@linkcode Property} * @see {@linkcode RestElement} - * @see {@linkcode ShorthandProperty} */ - children: ( - | AssignmentProperty - | Comment - | RenamedProperty - | RestElement - | ShorthandProperty - )[] + children: (Comment | Property | RestElement)[] /** * Info from the ecosystem. @@ -60,4 +50,4 @@ interface ObjectPattern extends Parent { type: 'objectPattern' } -export type { ObjectPatternData, ObjectPattern as default } +export type { ObjectPattern as default, ObjectPatternData } diff --git a/src/nodes/property-method.ts b/src/nodes/property-method.ts index 70d9cbd..557b9d5 100644 --- a/src/nodes/property-method.ts +++ b/src/nodes/property-method.ts @@ -3,15 +3,7 @@ * @module esast/nodes/MethodProperty */ -import type { InternalComments } from '#internal' -import type { - Comments, - Expression, - FunctionExpression, - ModifierList, - Property, - PropertyName -} from '@flex-development/esast' +import type { MethodDefinition, Property } from '@flex-development/esast' /** * A method property. @@ -29,27 +21,9 @@ interface MethodProperty extends Property { /** * List of children. * - * @see {@linkcode Comments} - * @see {@linkcode Expression} - * @see {@linkcode FunctionExpression} - * @see {@linkcode PropertyName} - * @see {@linkcode ModifierList} + * @see {@linkcode MethodDefinition} */ - children: - | [ - ...comments: Comments, - key: Expression, - ...comments: InternalComments, - value: FunctionExpression - ] - | [ - modifiers: ModifierList, - ...comments: Comments, - key: Expression, - ...comments: InternalComments, - value: FunctionExpression - ] - | [key: PropertyName, ...comments: Comments, value: FunctionExpression] + children: [MethodDefinition] /** * Boolean indicating if property value is a method. diff --git a/src/nodes/property-shorthand.ts b/src/nodes/property-shorthand.ts index 303529b..ecb9416 100644 --- a/src/nodes/property-shorthand.ts +++ b/src/nodes/property-shorthand.ts @@ -4,9 +4,9 @@ */ import type { - Identifier, Property, - PropertyKind + PropertyKind, + PropertyName } from '@flex-development/esast' /** @@ -25,14 +25,9 @@ interface ShorthandProperty extends Property { /** * List of children. * - * @see {@linkcode Identifier} + * @see {@linkcode PropertyName} */ - children: [key: Identifier] - - /** - * Boolean indicating if property is computed. - */ - computed: false + children: [key: PropertyName] /** * Property kind. diff --git a/src/nodes/property-simple.ts b/src/nodes/property-simple.ts index 9769be2..80700dd 100644 --- a/src/nodes/property-simple.ts +++ b/src/nodes/property-simple.ts @@ -7,7 +7,6 @@ import type { InternalComments } from '#internal' import type { Comments, Expression, - FunctionExpression, Property, PropertyKind, PropertyName @@ -38,13 +37,9 @@ interface SimpleProperty extends Property { ...comments: Comments, key: Expression, ...comments: InternalComments, - value: Exclude - ] - | [ - key: PropertyName, - ...comments: Comments, - value: Exclude + value: Expression ] + | [key: PropertyName, ...comments: Comments, value: Expression] /** * Property kind. diff --git a/src/nodes/property.ts b/src/nodes/property.ts index 7d0a2fc..800ad37 100644 --- a/src/nodes/property.ts +++ b/src/nodes/property.ts @@ -10,12 +10,11 @@ import type { Comments, Data, Expression, - FunctionExpression, - Identifier, - ModifierList, + MethodDefinition, ObjectPattern, Parent, - PropertyKind + PropertyKind, + PropertyName } from '@flex-development/esast' /** @@ -47,10 +46,9 @@ interface Property extends Parent { * @see {@linkcode AssignmentPattern} * @see {@linkcode Comments} * @see {@linkcode Expression} - * @see {@linkcode FunctionExpression} - * @see {@linkcode Identifier} - * @see {@linkcode ModifierList} + * @see {@linkcode MethodDefinition} * @see {@linkcode ObjectPattern} + * @see {@linkcode PropertyName} */ children: | [ @@ -60,19 +58,13 @@ interface Property extends Parent { value: ArrayPattern | AssignmentPattern | Expression | ObjectPattern ] | [ - key: Expression, + key: PropertyName, ...comments: Comments, value: ArrayPattern | AssignmentPattern | Expression | ObjectPattern ] - | [ - modifiers: ModifierList, - ...comments: Comments, - key: Expression, - ...comments: InternalComments, - value: FunctionExpression - ] | [assignment: AssignmentPattern] - | [key: Identifier] + | [method: MethodDefinition] + | [shorthand: PropertyName] /** * Boolean indicating if property is computed. @@ -109,4 +101,4 @@ interface Property extends Parent { type: 'property' } -export type { PropertyData, Property as default } +export type { Property as default, PropertyData }