-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initialize graphics programming lib
- Loading branch information
1 parent
99edc49
commit d370b8c
Showing
11 changed files
with
423 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.js | ||
*.cjs | ||
*.d.ts | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
extends: ['vighnesh153/ts-base.eslintrc.cjs'], | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Graphics programming | ||
|
||
Visit the [demo](https://vighnesh153.dev/projects/graphics) and check out the different graphics projects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "@vighnesh153/graphics-programming", | ||
"private": true, | ||
"type": "module", | ||
"exports": { | ||
"types": "./dist/src/index.d.ts", | ||
"import": "./dist/main.js" | ||
}, | ||
"main": "./dist/main.js", | ||
"types": "./dist/src/index.d.ts", | ||
"license": "MIT", | ||
"scripts": { | ||
"build:once:types": "tsc", | ||
"build:once:bundle": "tsup", | ||
"build:watch:bundle": "tsup --watch", | ||
"build": "run-s build:once:bundle build:once:types", | ||
"dev": "npm-run-all --parallel build:watch:*", | ||
"test:watch": "vitest --passWithNoTests", | ||
"test": "vitest run --passWithNoTests" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"devDependencies": { | ||
"@types/node": "*", | ||
"@vighnesh153/tsconfig": "*", | ||
"@vighnesh153/utils": "*", | ||
"eslint-config-vighnesh153": "*", | ||
"npm-run-all": "^4.1.5", | ||
"tsup": "^7.2.0", | ||
"typescript": "^5.2.2", | ||
"vitest": "0.34.2" | ||
} | ||
} |
91 changes: 91 additions & 0 deletions
91
nodejs-tools/nodejs-lib/graphics-programming/src/collection.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
interface GraphicsProject { | ||
imageLink: string; | ||
title: string; | ||
} | ||
|
||
const barnsleysFern: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/8F9Y1DQ.png', | ||
title: `Barnsley's Fern`, | ||
}; | ||
|
||
const brickBreakerGame: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/C0N3twn.png', | ||
title: 'Brick Breaker Game', | ||
}; | ||
|
||
const connectingParticles: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/ZKYXBhX.png', | ||
title: 'Connecting Particles', | ||
}; | ||
|
||
const flappyBlockGame: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/hKgLkKy.png', | ||
title: 'Flappy Block Game', | ||
}; | ||
|
||
const gridPathFinderGame: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/j0JsNwY.png', | ||
title: 'Grid Path Finder', | ||
}; | ||
|
||
const pongGame: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/9c0kEFU.png', | ||
title: 'Pong Game', | ||
}; | ||
|
||
const pseudoHilbertCurve: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/Lcyw7DQ.png', | ||
title: 'Pseudo Hilbert Curve', | ||
}; | ||
|
||
const serpinskisTriangle: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/J2zUHcl.png', | ||
title: `Sierpinski's Triangle`, | ||
}; | ||
|
||
const snakeGame: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/spwnsPX.png', | ||
title: 'Snake Game', | ||
}; | ||
|
||
const sortingVisualizer: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/YHKu6TN.png', | ||
title: 'Sorting Visualizer', | ||
}; | ||
|
||
const symmetricBinaryTree: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/tzA2Pyf.png', | ||
title: 'Symmetric Binary Tree', | ||
}; | ||
|
||
const towerOfHanoi: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/kIsetz4.png', | ||
title: 'Tower of Hanoi', | ||
}; | ||
|
||
const treePathFinder: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/879Zf9b.png', | ||
title: 'Tree Path Finder', | ||
}; | ||
|
||
const twinklingStars: GraphicsProject = { | ||
imageLink: 'https://i.imgur.com/Zhk91iE.png', | ||
title: 'Twinkling Stars', | ||
}; | ||
|
||
export const graphicsProjects: GraphicsProject[] = [ | ||
gridPathFinderGame, | ||
serpinskisTriangle, | ||
towerOfHanoi, | ||
symmetricBinaryTree, | ||
connectingParticles, | ||
pseudoHilbertCurve, | ||
sortingVisualizer, | ||
twinklingStars, | ||
treePathFinder, | ||
pongGame, | ||
barnsleysFern, | ||
snakeGame, | ||
flappyBlockGame, | ||
brickBreakerGame, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './collection'; |
13 changes: 13 additions & 0 deletions
13
nodejs-tools/nodejs-lib/graphics-programming/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"extends": "@vighnesh153/tsconfig/typescript-library.json", | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"types": ["vitest/globals"], | ||
"outDir": "dist", | ||
"paths": { | ||
"@/*": ["src/*"] | ||
} | ||
}, | ||
"include": [".", "src", "tests"], | ||
"exclude": ["dist", "build", "node_modules"] | ||
} |
17 changes: 17 additions & 0 deletions
17
nodejs-tools/nodejs-lib/graphics-programming/tsup.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { defineConfig } from 'tsup'; | ||
|
||
export default defineConfig(() => ({ | ||
entry: { | ||
main: './src/index.ts', | ||
}, | ||
splitting: false, | ||
clean: true, | ||
minify: true, | ||
treeshake: true, | ||
format: ['esm'], | ||
outExtension({ format }) { | ||
let js: string | undefined; | ||
if (format === 'esm') js = `.js`; | ||
return { js }; | ||
}, | ||
})); |
13 changes: 13 additions & 0 deletions
13
nodejs-tools/nodejs-lib/graphics-programming/vite.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import path from 'node:path'; | ||
import { defineConfig } from 'vitest/config'; | ||
|
||
export default defineConfig({ | ||
test: { | ||
globals: true, | ||
}, | ||
resolve: { | ||
alias: { | ||
'@': path.resolve(__dirname, './src'), | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.