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

Fix/worker build #216

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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": []
}
10 changes: 10 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"@lottiefiles/lottie-player": "2.0.1"
},
"changesets": [
"silly-radios-bathe"
]
}
5 changes: 5 additions & 0 deletions .changeset/silly-radios-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lottiefiles/lottie-player': patch
---

bumping to beta
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: 107 additions & 90 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,112 +1,129 @@
name: Release
name: main

on:
push:
branches: [master]
branches: ['master', 'fix/worker-build']
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 }}
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 format (`pnpm format` committed?)
run: pnpm format --check --no-write

- name: 🛡️ Test
run: pnpm test

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

release-npm:
needs: build
name: Release npm
# - name: 🕵️ Lint
# run: pnpm lint

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/'

- 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:
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
Loading
Loading