Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🎸 dotLottie v2 #89

Draft
wants to merge 51 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9457abf
feat: 🎸 dotLottie v2
theashraf Oct 25, 2024
df81d91
chore: convert to dotLottie v1/v2
theashraf Oct 25, 2024
bb2a8d2
refactor: Update dotLottie import paths for Node.js environment
theashraf Oct 25, 2024
d9dffb3
chore: 🤖 remove unncessary setters from v2
theashraf Oct 25, 2024
0833b60
build: Update build configuration for dotlottie-js package
theashraf Oct 25, 2024
67b8137
build: Update @changesets/cli to version 2.27.9
theashraf Oct 25, 2024
adcef6b
chore: Remove pull_request trigger from main.yml workflow
theashraf Oct 25, 2024
fcbd205
chore: Set "private" flag to true in package.json
theashraf Oct 25, 2024
649aa92
chore: 🤖 update versions (beta) (#91)
samuelOsborne Oct 25, 2024
8614d66
chore: Update .changeset configuration
theashraf Oct 25, 2024
d32d4ff
chore: Update dependencies in package.json files
theashraf Oct 25, 2024
b3f0b67
chore: v2 filenames
theashraf Oct 25, 2024
118d12c
chore: Remove unused CHANGELOG.md for node app
theashraf Oct 25, 2024
964672d
refactor: Refactor DotLottie version conversion functions
theashraf Oct 25, 2024
5570a8f
refactor: Refactor dotLottie conversion methods
theashraf Oct 25, 2024
ca5de2a
chore: 🤖 update versions (beta) (#92)
samuelOsborne Oct 25, 2024
9e7fa8b
fixes: proposed fixes for the beta launch (#93)
samuelOsborne Oct 25, 2024
f2ecb29
Refactor changeset format in pre.json
theashraf Oct 25, 2024
227e1dc
chore: 🤖 update versions (beta) (#94)
samuelOsborne Oct 25, 2024
ffb3ce3
chore: add .changeset prettierignore
theashraf Oct 28, 2024
81014cb
fix: dotLottie v1 <-> v2 conversion
theashraf Oct 28, 2024
9446f88
chore: 🤖 update versions (beta) (#95)
samuelOsborne Oct 28, 2024
9a32fd4
fix: export missing types for dotLottie v1
theashraf Oct 28, 2024
a7ba524
refactor: Remove unnecessary import in animation.ts
theashraf Oct 29, 2024
f4da60a
chore: 🤖 update versions (beta) (#96)
samuelOsborne Oct 29, 2024
df94db0
refactor: remove themes & stateMachines from manifest if non available
theashraf Oct 29, 2024
d45a351
chore: 🤖 update versions (beta) (#97)
samuelOsborne Oct 29, 2024
74bfed1
fix: 🐛 dotLottie manifest version format
theashraf Oct 30, 2024
bde0b64
chore: 🤖 update versions (beta) (#98)
samuelOsborne Oct 30, 2024
518d7d3
chore: add tests
theashraf Nov 3, 2024
e6499a3
refactor: update test configuration to use JavaScript files instead o…
theashraf Nov 3, 2024
6edbf81
fix: format
theashraf Nov 3, 2024
1611716
fix: add theme data schema
theashraf Nov 3, 2024
3666858
chore: 🤖 update versions (beta) (#99)
samuelOsborne Nov 3, 2024
926de78
refactor: update dotlottie-js exports
theashraf Nov 4, 2024
c052381
chore: 🤖 update versions (beta) (#100)
samuelOsborne Nov 4, 2024
28e6b57
fix: update dotlottie-js utils for v2 compatibility
theashraf Nov 4, 2024
4c0b6cd
chore: 🤖 update versions (beta) (#101)
samuelOsborne Nov 4, 2024
5372c7c
fix(conversion): 🐛 never build dotLottie instance before conversion
theashraf Nov 4, 2024
2134d08
chore: update changelog
theashraf Nov 4, 2024
9cfb87b
chore: 🤖 update versions (beta) (#102)
samuelOsborne Nov 4, 2024
f333907
feat: add theme & stateMachine manifest schema
theashraf Nov 4, 2024
b167892
refactor: update v2 manifest schema
theashraf Nov 4, 2024
9d571dd
chore: 🤖 update versions (beta) (#103)
samuelOsborne Nov 4, 2024
dc0ce5d
fix: update theme schema slotId to id
theashraf Nov 4, 2024
5b94a6c
chore: 🤖 update versions (beta) (#104)
samuelOsborne Nov 4, 2024
c6fa979
refactor: add tests && update LottieThemeCommon toString method
theashraf Nov 4, 2024
3873f14
chore: 🤖 update versions (beta) (#105)
samuelOsborne Nov 4, 2024
9b1d77e
chore: add playground.js
theashraf Nov 4, 2024
b2aae20
refactor: remove setGenerator method from DotLottieCommonV1 and DotLo…
theashraf Nov 5, 2024
a4302fb
chore: 🤖 update versions (beta) (#106)
samuelOsborne Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/angry-coats-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': patch
---

fix: dotLottie v1 <-> v2 conversion
5 changes: 5 additions & 0 deletions .changeset/chatty-cougars-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': patch
---

fix: dotLottie manifest version format
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"ignore": ["node-example", "next-example", "react-example", "vue-example"]
}
5 changes: 5 additions & 0 deletions .changeset/early-worms-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': patch
---

fix: export missing types for dotLottie v1
5 changes: 5 additions & 0 deletions .changeset/eighty-hats-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': patch
---

fix: update theme schema slotId
5 changes: 5 additions & 0 deletions .changeset/gorgeous-worms-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': patch
---

refactor: update v2 manifest schema
5 changes: 5 additions & 0 deletions .changeset/green-hairs-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': patch
---

refactor: dotLottie conversion methods
5 changes: 5 additions & 0 deletions .changeset/heavy-windows-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': patch
---

fix(conversion): 🐛 never build dotLottie instance before conversion
5 changes: 5 additions & 0 deletions .changeset/loud-melons-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': patch
---

fix: remove themes & stateMachines from manifest if non available
5 changes: 5 additions & 0 deletions .changeset/neat-carrots-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': patch
---

refactor: add tests && update LottieThemeCommon toString method
29 changes: 29 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"mode": "pre",
"tag": "beta",
"initialVersions": {
"@dotlottie/dotlottie-js": "0.8.1",
"next-example": "0.1.0",
"node-example": "1.0.0",
"react-example": "0.0.0",
"vue-example": "0.0.0"
},
"changesets": [
"angry-coats-check",
"chatty-cougars-fetch",
"early-worms-remain",
"eighty-hats-tease",
"gorgeous-worms-kneel",
"green-hairs-dream",
"heavy-windows-beg",
"loud-melons-lay",
"many-emus-cough",
"neat-carrots-judge",
"rare-dodos-travel",
"serious-queens-reply",
"serious-trains-brake",
"silly-pillows-share",
"wicked-insects-eat",
"wicked-points-flow"
]
}
5 changes: 5 additions & 0 deletions .changeset/rare-dodos-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': patch
---

small fixes
5 changes: 5 additions & 0 deletions .changeset/serious-queens-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@dotlottie/dotlottie-js": minor
---

feat: init dotLottie v2
5 changes: 5 additions & 0 deletions .changeset/serious-trains-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': patch
---

fix: getAnimations & getImages & getAudios for v2
5 changes: 5 additions & 0 deletions .changeset/silly-pillows-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': minor
---

refactor: remove setGenerator method from DotLottieCommonV1 and DotLottieCommon classes
5 changes: 5 additions & 0 deletions .changeset/wicked-insects-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': patch
---

fix: add theme data schema
5 changes: 5 additions & 0 deletions .changeset/wicked-points-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dotlottie/dotlottie-js': patch
---

fix: export missing types
16 changes: 10 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ on:
push:
branches:
- 'main'
pull_request:
- 'beta'
# pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -19,10 +20,10 @@ jobs:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup pnpm@8
- name: ⎔ Setup pnpm@9
uses: pnpm/action-setup@v2
with:
version: 8
version: 9

- name: ⎔ Setup Node@18
uses: actions/setup-node@v3
Expand All @@ -46,7 +47,9 @@ jobs:
run: pnpm lint

- name: 🛡️ Test
run: pnpm test
run: |
npx playwright install --with-deps
pnpm test

- name: 📏 Report bundle size
uses: andresz1/size-limit-action@v1
Expand All @@ -64,10 +67,10 @@ jobs:
with:
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

- name: ⎔ Setup pnpm@8
- name: ⎔ Setup pnpm@9
uses: pnpm/action-setup@v2
with:
version: 8
version: 9

- name: ⎔ Setup Node@18
uses: actions/setup-node@v3
Expand All @@ -80,6 +83,7 @@ jobs:

- name: 🏗 Build
run: pnpm build
working-directory: packages/dotlottie-js

- name: 🚀 Release
uses: changesets/action@v1
Expand Down
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ releases/
.next/
.nuxt/

apps/node/
apps/node/

.changeset/
4 changes: 2 additions & 2 deletions apps/next/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "next",
"name": "next-example",
"version": "0.1.0",
"private": true,
"scripts": {
Expand All @@ -9,7 +9,7 @@
"start": "next start"
},
"dependencies": {
"@dotlottie/dotlottie-js": "workspace:^",
"@dotlottie/dotlottie-js": "workspace:*",
"@dotlottie/player-component": "1.3.2",
"@types/node": "18.0.6",
"@types/react": "18.0.37",
Expand Down
6 changes: 1 addition & 5 deletions apps/next/src/pages/api/create-dotlottie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2023 Design Barn Inc.
*/

import { DotLottie } from '@dotlottie/dotlottie-js/node';
import { DotLottie } from '@dotlottie/dotlottie-js';
import type { NextApiRequest, NextApiResponse } from 'next';

interface Data {
Expand All @@ -14,18 +14,14 @@ export default async function handler(_req: NextApiRequest, res: NextApiResponse
let dotLottieAsBuffer = null;

await dotLottie
.setAuthor('Joe')
.setVersion('1.0')
.addAnimation({
id: 'animation_1',
// eslint-disable-next-line no-secrets/no-secrets
url: 'https://lottie.host/18b639d1-a200-4225-ba0e-3456d40f95a5/wlrsaqWa8r.json',
autoplay: true,
})
.addAnimation({
id: 'animation_2',
url: 'https://lottie.host/cf7b43d1-3d6b-407a-970b-6305b18bebfa/uB1Jboo1o1.json',
autoplay: true,
})
.build()
.then(async (value) => {
Expand Down
4 changes: 0 additions & 4 deletions apps/next/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@ export default function Home(): JSX.Element {
const dotlottie = new Dotlottiejs();

await dotlottie
.setAuthor('Joe')
.setVersion('1.0')
.addAnimation({
id: 'animation_1',
// eslint-disable-next-line no-secrets/no-secrets
url: 'https://lottie.host/18b639d1-a200-4225-ba0e-3456d40f95a5/wlrsaqWa8r.json',
autoplay: true,
})
.addAnimation({
id: 'animation_2',
url: 'https://lottie.host/cf7b43d1-3d6b-407a-970b-6305b18bebfa/uB1Jboo1o1.json',
autoplay: true,
})
.build()
.then((value) => {
Expand Down
6 changes: 1 addition & 5 deletions apps/next/src/pages/ssProps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2023 Design Barn Inc.
*/

import { DotLottie } from '@dotlottie/dotlottie-js/node';
import { DotLottie } from '@dotlottie/dotlottie-js';

import styles from '@/styles/Home.module.css';

Expand All @@ -18,18 +18,14 @@ export async function getServerSideProps(): Promise<{
const dotlottie = new DotLottie();

await dotlottie
.setAuthor('Joe')
.setVersion('1.0')
.addAnimation({
id: 'animation_1',
// eslint-disable-next-line no-secrets/no-secrets
url: 'https://lottie.host/18b639d1-a200-4225-ba0e-3456d40f95a5/wlrsaqWa8r.json',
autoplay: true,
})
.addAnimation({
id: 'animation_2',
url: 'https://lottie.host/cf7b43d1-3d6b-407a-970b-6305b18bebfa/uB1Jboo1o1.json',
autoplay: true,
})
.build();

Expand Down
4 changes: 0 additions & 4 deletions apps/node/audio_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import { getAnimation, getAudio, getAllAudio } from '@dotlottie/dotlottie-js/nod

// const dl = await
// dotLottie
// .setAuthor('Sam!')
// .setVersion('1.0')
// .addAnimation({
// id: 'audio',
// // url: 'https://assets10.lottiefiles.com/packages/lf20_tykuirhr.json',
Expand Down Expand Up @@ -64,8 +62,6 @@ import { getAnimation, getAudio, getAllAudio } from '@dotlottie/dotlottie-js/nod
const double = new DotLottie();

const doubleAnimation = await double
.setAuthor('Sam!')
.setVersion('1.0')
.addAnimation({
id: 'audio_0',
// url: 'https://assets10.lottiefiles.com/packages/lf20_tykuirhr.json',
Expand Down
4 changes: 0 additions & 4 deletions apps/node/lf-interactivity-page-generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ async function createDotLottie() {
// Can't change to a different animation
// TODO: MACROS!! START_FRAME / END_FRAME
const dl = await dotLottie
.setAuthor('Sam!')
.setVersion('1.0')
.addAnimation({
id: 'segments',
url: 'https://assets2.lottiefiles.com/packages/lf20_4fET62.json',
Expand Down Expand Up @@ -608,8 +606,6 @@ async function createSingles() {
const stateSegments = new DotLottie();

await stateSegments
.setAuthor('Sam!')
.setVersion('1.0')
.addAnimation({
id: 'segments',
url: 'https://assets2.lottiefiles.com/packages/lf20_4fET62.json',
Expand Down
5 changes: 3 additions & 2 deletions apps/node/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "node",
"name": "node-example",
"private": true,
"version": "1.0.0",
"description": "",
"author": "",
Expand All @@ -8,6 +9,6 @@
"keywords": [],
"scripts": {},
"dependencies": {
"@dotlottie/dotlottie-js": "workspace:^"
"@dotlottie/dotlottie-js": "workspace:*"
}
}
Loading
Loading