Skip to content

Commit 2baa092

Browse files
committed
initial commit
0 parents  commit 2baa092

File tree

135 files changed

+9918
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+9918
-0
lines changed

.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": ["@dudes/playground"]
11+
}

.github/workflows/gh-pages.yaml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
cache-and-install:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
15+
- name: Install Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 16
19+
20+
- name: Install pnpm
21+
uses: pnpm/action-setup@v2
22+
id: pnpm-install
23+
with:
24+
version: 8
25+
run_install: false
26+
27+
- name: Get pnpm store directory
28+
id: pnpm-cache
29+
shell: bash
30+
run: |
31+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
32+
33+
- name: Setup pnpm cache
34+
uses: actions/cache@v3
35+
with:
36+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
37+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
38+
restore-keys: |
39+
${{ runner.os }}-pnpm-store-
40+
41+
- name: Install dependencies
42+
run: pnpm install
43+
44+
- name: Build
45+
run: pnpm build
46+
47+
- name: Deploy to GitHub Pages
48+
uses: JamesIves/github-pages-deploy-action@4.1.5
49+
with:
50+
branch: gh-pages
51+
folder: ./apps/playground/dist

.github/workflows/npm-publish.yaml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: NPM Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
id-token: write
10+
11+
jobs:
12+
cache-and-install:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Install Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
23+
- name: Install pnpm
24+
uses: pnpm/action-setup@v2
25+
id: pnpm-install
26+
with:
27+
version: 8
28+
run_install: false
29+
30+
- name: Get pnpm store directory
31+
id: pnpm-cache
32+
shell: bash
33+
run: |
34+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
35+
36+
- name: Setup pnpm cache
37+
uses: actions/cache@v3
38+
with:
39+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
40+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
41+
restore-keys: |
42+
${{ runner.os }}-pnpm-store-
43+
44+
- name: Install dependencies
45+
run: pnpm install
46+
47+
- name: Build packages
48+
run: pnpm build
49+
50+
- name: Publish packages
51+
shell: bash
52+
run: |
53+
echo "//registry.npmjs.org/:_authToken="${{ secrets.NPM_TOKEN }}"" > ~/.npmrc
54+
pnpm -r --filter='./apps/*' publish --access public --provenance

.gitignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
25+
.turbo

.prettierignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
node_modules
2+
dist
3+
public
4+
build
5+
logs
6+
coverage
7+
.next
8+
.turbo
9+
.github
10+
.angular
11+
.svelte-kit
12+
.vscode
13+
*.log*
14+
*.log
15+
*.lock
16+
*.yaml
17+
*.yml
18+
*.sh
19+
*.svg
20+
*rc.*
21+
*.htm
22+
*.html
23+
*.md
24+
.*ignore

.prettierrc.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@crashmax/prettier-config')

.vscode/extensions.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"Vue.volar",
4+
"Vue.vscode-typescript-vue-plugin"
5+
]
6+
}

README.md

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Dudes
2+
3+
> Animated dudes for chatters in your stream
4+
5+
> [!WARNING]
6+
> Permantly moved to [twirapp/dudes](https://github.com/twirapp/dudes)
7+
8+
## Install
9+
10+
```bash
11+
pnpm add @twirapp/dudes
12+
```
13+
14+
## Usage
15+
16+
```vue
17+
<script setup lang="ts">
18+
import DudesOverlay, { DudesLayers } from '@twirapp/dudes'
19+
import { onMounted, ref } from 'vue'
20+
21+
import type {
22+
DudesStyles,
23+
AssetsLoaderOptions,
24+
SoundAsset
25+
} from '@twirapp/dudes/types'
26+
27+
const soundAssets: SoundAsset[] = [
28+
{
29+
alias: 'Jump',
30+
src: './sounds/jump.mp3'
31+
}
32+
]
33+
34+
const assetsLoaderOptions: AssetsLoaderOptions = {
35+
basePath: location.href + 'sprites/',
36+
defaultSearchParams: {
37+
ts: Date.now()
38+
}
39+
}
40+
41+
const settings = ref<DudesStyles>({
42+
// override default settings
43+
})
44+
45+
const dudesRef = ref<DudesMethods | null>(null)
46+
47+
onMounted(async () => {
48+
if (!dudesRef.value) return
49+
await dudesRef.value.initDudes()
50+
51+
const dudeName = 'Twir'
52+
const dude = await dudesRef.value.createDude({
53+
id: dudeName,
54+
name,
55+
sprite: {
56+
name: 'dude',
57+
layers: [
58+
{
59+
layer: DudesLayers.Body,
60+
// http://localhost:5173/sprites/body.png
61+
src: 'body.png'
62+
},
63+
{
64+
layer: DudesLayers.Eyes,
65+
// http://localhost:5173/sprites/eyes.png
66+
src: 'eyes.png'
67+
}
68+
]
69+
}
70+
})
71+
})
72+
</script>
73+
74+
<template>
75+
<dudes-overlay
76+
ref="dudesRef"
77+
:assets-loader-options="assetsLoaderOptions"
78+
:sounds="soundAssets"
79+
:settings="settings"
80+
/>
81+
</template>
82+
83+
<style>
84+
* {
85+
margin: 0;
86+
box-sizing: border-box;
87+
}
88+
89+
body {
90+
overflow: hidden;
91+
background: #000;
92+
}
93+
</style>
94+
```
95+
96+
## Creating new sprites
97+
98+
It's really easy to create sprites with [Aseprite](https://github.com/aseprite/aseprite)
99+
100+
Sprite size is 32x32.
101+
102+
Example can be found in [sprites](apps/playground/public/sprites) folder.
103+
104+
## Useful links
105+
106+
- [https://0x72.itch.io/pixeldudesmaker](https://0x72.itch.io/pixeldudesmaker)
107+
- [https://masterpose.itch.io/pixelduuuuudesmaker](https://masterpose.itch.io/pixelduuuuudesmaker)

apps/dudes/CHANGELOG.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# @twirapp/dudes
2+
3+
## 1.1.2
4+
5+
### Patch Changes
6+
7+
- chore: lowercase layers and frametags names
8+
chore: removed method `updateSettings`
9+
10+
## 1.1.1
11+
12+
### Patch Changes
13+
14+
- fix: types
15+
16+
## 1.1.0
17+
18+
### Minor Changes
19+
20+
- feat: refactor `createDude`
21+
22+
## 1.0.2
23+
24+
### Patch Changes
25+
26+
- chore: refactor load/unload bundle
27+
28+
## 1.0.1
29+
30+
### Patch Changes
31+
32+
- fix: idle animation
33+
34+
## 1.0.0
35+
36+
### Major Changes
37+
38+
- feat: sprite builder
39+
40+
## 0.6.1
41+
42+
### Patch Changes
43+
44+
- fix: collisions and types
45+
46+
## 0.6.0
47+
48+
### Minor Changes
49+
50+
- chore: refactor

apps/dudes/package.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "@twirapp/dudes",
3+
"version": "1.1.2",
4+
"type": "module",
5+
"files": [
6+
"dist"
7+
],
8+
"exports": {
9+
".": {
10+
"types": "./dist/index.d.ts",
11+
"import": "./dist/dudes.js",
12+
"require": "./dist/dudes.umd.cjs"
13+
},
14+
"./types": {
15+
"types": "./dist/types.d.ts"
16+
}
17+
},
18+
"scripts": {
19+
"dev": "pnpm run \"/^watch:.*/\"",
20+
"watch:build": "vite build --watch",
21+
"watch:types": "pnpm types --watch",
22+
"build": "vite build && pnpm types",
23+
"types": "vue-tsc --declaration --emitDeclarationOnly "
24+
},
25+
"devDependencies": {
26+
"@vitejs/plugin-vue": "5.0.4",
27+
"vite": "5.1.5",
28+
"vue-tsc": "2.0.6"
29+
},
30+
"peerDependencies": {
31+
"vue": ">=3.0.0"
32+
},
33+
"dependencies": {
34+
"@pixi/gif": "2.1.1",
35+
"gsap": "3.12.5",
36+
"pixi.js": "7.4.0",
37+
"vue": "3.4.21"
38+
}
39+
}

0 commit comments

Comments
 (0)