Skip to content
Merged
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
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

28 changes: 22 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
pull_request:
branches: [master]

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -18,15 +23,26 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version: '24.x'
- run: yarn
- run: yarn lint
- run: webpack --config webpack.config.ui.js --mode production
- run: yarn build:ui --base=/glitch2/
env:
GA_ID: UA-282164-17
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
branch: gh-pages
folder: dist
path: dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
if: ${{ github.event_name == 'push' }}
4 changes: 2 additions & 2 deletions glitcher/generate-gif.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-webpack-loader-syntax,@typescript-eslint/ban-ts-comment,import/no-unresolved */
/* eslint-disable @typescript-eslint/ban-ts-comment,import/no-unresolved */
import GIF from 'gif.js';
// @ts-ignore
import GIFWorker from 'file-loader!gif.js/dist/gif.worker.js';
import GIFWorker from 'gif.js/dist/gif.worker.js?url';
import { RecordFrame } from './types';

export default function generateGIF(frames: readonly RecordFrame[]) {
Expand Down
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>glitch2</title>
</head>
<body>
<script type="module" src="/glitcher/index.ts"></script>
</body>
</html>
2 changes: 2 additions & 0 deletions libglitch/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as GlitchContext } from './GlitchContext';
export { default as modules } from './modules';
22 changes: 6 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,22 @@
"main": "index.js",
"scripts": {
"lint": "eslint libglitch glitcher",
"build:lib": "webpack --config webpack.config.lib.js --mode production",
"build:ui": "webpack --config webpack.config.ui.js --mode production",
"dev": "webpack serve --config webpack.config.ui.js --mode development"
"build:lib": "vite build --config vite.config.lib.ts",
"build:ui": "vite build",
"dev": "vite",
"preview": "vite preview"
},
"author": "Aarni Koskela <akx@iki.fi>",
"license": "MIT",
"dependencies": {
"@babel/core": "^7.24.4",
"@babel/preset-env": "^7.24.4",
"babel-loader": "^9.1.3",
"buffer": "^6.0.3",
"css-loader": "7.1.1",
"file-loader": "^6.2.0",
"gif.js": "^0.2.0",
"html-webpack-plugin": "5.6.0",
"jpeg-js": "^0.4.4",
"less": "^4.2.0",
"less-loader": "^12.2.0",
"lodash": "^4.17.21",
"mithril": "^2.0.4",
"style-loader": "4.0.0",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
"mithril": "^2.0.4"
},
"devDependencies": {
"@babel/preset-typescript": "^7.24.1",
"@types/gif.js": "^0.2.5",
"@types/mithril": "^2.0.7",
"@typescript-eslint/eslint-plugin": "^7.7.0",
Expand All @@ -41,7 +31,7 @@
"eslint-plugin-import": "^2.29.1",
"prettier": "^3.2.5",
"typescript": "^5.4.5",
"webpack-dev-server": "^5.0.4"
"vite": "^6.1.0"
},
"prettier": {
"trailingComma": "all",
Expand Down
13 changes: 13 additions & 0 deletions vite.config.lib.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from 'vite';

export default defineConfig({
build: {
outDir: 'dist',
lib: {
entry: 'libglitch/index.ts',
name: 'Glitch',
formats: ['umd'],
fileName: () => 'libglitch.js',
},
},
});
12 changes: 12 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from 'vite';

export default defineConfig({
build: {
outDir: 'dist',
},
define: {
'window.GA_ID': process.env.GA_ID
? JSON.stringify(process.env.GA_ID)
: 'undefined',
},
});
23 changes: 0 additions & 23 deletions webpack.config.lib.js

This file was deleted.

46 changes: 0 additions & 46 deletions webpack.config.ui.js

This file was deleted.

Loading
Loading