Skip to content

Commit

Permalink
feat: switch to lottie_worker, updated code style (#210)
Browse files Browse the repository at this point in the history
* feat: switch to lottie_worker, updated code style
  • Loading branch information
samuelOsborne committed Jun 8, 2023
1 parent 56e1f4f commit cec4885
Show file tree
Hide file tree
Showing 67 changed files with 5,542 additions and 43,117 deletions.
Binary file modified .DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/hot-scissors-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lottiefiles/lottie-player': major
---

uses the lottie_worker script and deprecates html renderer
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ dist/
# Testing
coverage/
examples/
cypress/
cypress.config.ts
commitlint.config.js
64 changes: 46 additions & 18 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,59 @@
/**
* Copyright 2022 Design Barn Inc.
* Copyright 2023 Design Barn Inc.
*/

module.exports = {
plugins: ["@lottiefiles", "only-warn"],
root: true,

plugins: ['@lottiefiles'],

extends: [
// "plugin:@lottiefiles/nodejs",
"plugin:@lottiefiles/typescript",
"plugin:@lottiefiles/typescript-typechecking",
"plugin:@lottiefiles/prettier",
'plugin:@lottiefiles/esnext',
'plugin:@lottiefiles/typescript',
'plugin:@lottiefiles/typescript-typechecking',
'plugin:@lottiefiles/nodejs',
'plugin:@lottiefiles/prettier',
],

globals: {
cep: true,
},
overrides: [
{
files: ['*.ts', '*.tsx', '*.cts', '*.mts'],

parserOptions: {
sourceType: "module",
project: "tsconfig.json",
ecmaVersion: 2017,
},
parserOptions: {
project: ['./packages/*/tsconfig.json', './tsconfig.json'],
tsconfigRootDir: __dirname,
ecmaversion: 2022,
},
},

// Allow code in bin and scripts folders to do CLI things
{
files: ['**/@(bin|scripts|examples)/**/*.@(js|ts|cjs|mjs|cts|mts)'],
rules: {
'no-console': 'off',
'node/shebang': 'off',
},
},
],

rules: {
"no-console": "warn",
"@typescript-eslint/no-explicit-any": "off",
"jsx-a11y/anchor-is-valid": "off",
'default-param-last': 'off',
'@typescript-eslint/default-param-last': ['error'],
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/dot-notation': 'off',
'no-case-declarations': 'off',

// Disable project specific
'func-style': 'off',

// Disable the async generator warning
'no-restricted-syntax': 'off',

// Disable deprecation testing
'deprecation/deprecation': 'off',

'no-undefined': 'off',
'import/extensions': 'off',
'no-invalid-this': 'off',
},
ignorePatterns: ["node_modules", "dist", "packages"],
};
197 changes: 108 additions & 89 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,112 +1,131 @@
name: Release
name: main

on:
push:
branches: [master]
pull_request:

jobs:
build:
validate:
runs-on: ubuntu-latest
timeout-minutes: 15

strategy:
matrix:
node-version: [14.x]

steps:
- name: Checkout
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup pnpm@7
uses: pnpm/action-setup@v2
with:
fetch-depth: 0
- name: Cache NPM
uses: actions/cache@v2
env:
cache-name: cache-npm
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
version: 7

- name: ⎔ Setup Node@18
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://npm.pkg.github.com"
- name: Install dependencies
run: yarn
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Build project
run: yarn build
- name: Serve example app
continue-on-error: false
run: yarn run serve
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Build project and run tests
continue-on-error: false
run: yarn run run-tests
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
cache: 'pnpm'
node-version: 18
# scope: "@lottiefiles"
# registry-url: "https://npm.pkg.github.com/"
# always-auth: true

- name: 📥 Download deps
run: pnpm install

- name: 🏗 Build
run: pnpm build

# - name: 🔍 Verify types
# run: pnpm type-check

- name: 💅 Verify format (`pnpm format` committed?)
run: pnpm format --check --no-write

# - name: 🕵️ Lint
# run: pnpm lint

release-npm:
needs: build
name: Release npm
- name: 🛡️ Test
run: pnpm test
release:
needs: validate
runs-on: ubuntu-latest
if: ${{ github.repository == 'LottieFiles/lottie-player' && github.event_name == 'push' }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup pnpm@7
uses: pnpm/action-setup@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- run: yarn install
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Build project
continue-on-error: false
run: yarn build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm publish --access public
version: 7

- name: ⎔ Setup Node@18 for Github Packages
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: 18
# scope: "@lottiefiles"
# registry-url: "https://npm.pkg.github.com/"
# always-auth: true

- name: 📥 Download deps
run: pnpm install
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GPR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPMJS_TOKEN }}
GIT_COMMIT: ${{ github.sha }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}

release-gpr:
needs: build
name: Release gpr
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1

- name: 🏗 Build
run: pnpm build

- name: Setup npmrc
run: echo "//registry.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc

- name: 🚀 Release to Github Packages
uses: changesets/action@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://npm.pkg.github.com/
scope: "@lottiefiles"
- run: yarn install
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Build project
continue-on-error: false
run: yarn build
commit: 'chore: 🤖 update versions'
title: 'chore: 🤖 update versions'
publish: pnpm release:publish
version: pnpm release:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run:
echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" >
~/.npmrc
- run: npm publish --@lottiefiles:registry=https://npm.pkg.github.com/

- name: Delete npmrc
run: rm -rf ~/.npmrc

- name: ⎔ Setup Node@18 for NPM
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: 18
scope: '@lottiefiles'
registry-url: https://registry.npmjs.org/

- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMJS_TOKEN }}" >> ~/.npmrc

- name: 🚀 Release to NPM
uses: changesets/action@v1
with:
commit: 'chore: 🤖 update versions'
title: 'chore: 🤖 update versions'
publish: pnpm release:publish
version: pnpm release:version
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPMJS_TOKEN }}
GIT_COMMIT: ${{ github.sha }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}

# - name: 🏷 Push tags
# uses: changesets/action@v1
# with:
# commit: "chore: 🤖 update versions"
# title: "chore: 🤖 update versions"
# tag: pnpm release:tag
# # publish: pnpm release:publish
# version: pnpm release:version
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPMJS_TOKEN }}
# NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

11 changes: 11 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage/
cypress/
dist/
.changeset/
.nyc_output
CHANGELOG.md
cypress.config.ts
pnpm-lock.yaml
README.md
src/index.html
src/tgs-player-demo.html
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 LottieFiles.com
Copyright (c) 2023 LottieFiles.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
36 changes: 0 additions & 36 deletions babel.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* Copyright 2020 Design Barn Inc.
*/

module.exports = { extends: ["@commitlint/config-conventional"] };
module.exports = { extends: ['@commitlint/config-conventional'] };
Loading

0 comments on commit cec4885

Please sign in to comment.