Skip to content

Commit

Permalink
feat(parse): add extraCompositions child node titles (#11)
Browse files Browse the repository at this point in the history
* refactor(parse): jsontraverse typo

* feat(parse): missing node titles for comps children

* chore(github): fix npm release
  • Loading branch information
Aidosmf authored Jun 27, 2023
1 parent b6f3fef commit a4e9867
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-owls-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lottiefiles/relottie-parse": patch
---

feat: add extraCompositions child node titles
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
release:
name: Release

if: ${{ github.repository == 'LottieFiles/relottie' && github.event_name == 'push' }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -29,6 +29,8 @@ jobs:
with:
cache: 'pnpm'
node-version: ${{ matrix.node-version }}
scope: '@lottiefiles'
registry-url: 'https://npm.pkg.github.com/'

- name: 📥 Install dependencies
run: pnpm install
Expand Down
3 changes: 3 additions & 0 deletions packages/relottie-parse/src/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,9 @@ export const objectEntity: NoKeyEntityMap = {
[CT.textRanges]: {
defaultTitle: OT.textRange,
},
[CT.extraCompositions]: {
defaultTitle: OT.assetPrecomposition,
},
};

const createDependentTitles = (
Expand Down
4 changes: 2 additions & 2 deletions packages/relottie-parse/src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2022 Design Barn Inc.
*/

import { parse as jsonParse, traverse as jsontraverse } from '@humanwhocodes/momoa';
import { parse as jsonParse, traverse as jsonTraverse } from '@humanwhocodes/momoa';
import type {
ArrayNode,
Collection,
Expand Down Expand Up @@ -538,7 +538,7 @@ export function parse(document: string, file: VFile, settings: SettingsOptions =

const info: Info = { hasExpressions: false };

jsontraverse(jsonAst, {
jsonTraverse(jsonAst, {
enter(node: Momoa.AstNode, parent: Momoa.AstParent) {
traverseJsonEnter(node, parent, lastStack, file, options);
},
Expand Down

0 comments on commit a4e9867

Please sign in to comment.