diff --git a/nodejs-tools/nodejs-docker-tools/youtube-dl/package.json b/nodejs-tools/nodejs-docker-tools/youtube-dl/package.json index cbf2384e..25690be3 100644 --- a/nodejs-tools/nodejs-docker-tools/youtube-dl/package.json +++ b/nodejs-tools/nodejs-docker-tools/youtube-dl/package.json @@ -14,7 +14,7 @@ }, "license": "MIT", "scripts": { - "docker": "docker-compose up && docker-compose down --rmi" + "docker": "docker-compose up; docker-compose down --rmi all" }, "dependencies": { }, diff --git a/nodejs-tools/nodejs-lib/graphics-programming/.eslintignore b/nodejs-tools/nodejs-lib/graphics-programming/.eslintignore new file mode 100644 index 00000000..70f7cbd7 --- /dev/null +++ b/nodejs-tools/nodejs-lib/graphics-programming/.eslintignore @@ -0,0 +1,4 @@ +*.js +*.cjs +*.d.ts +dist diff --git a/nodejs-tools/nodejs-lib/graphics-programming/.eslintrc.cjs b/nodejs-tools/nodejs-lib/graphics-programming/.eslintrc.cjs new file mode 100644 index 00000000..ef405018 --- /dev/null +++ b/nodejs-tools/nodejs-lib/graphics-programming/.eslintrc.cjs @@ -0,0 +1,7 @@ +module.exports = { + extends: ['vighnesh153/ts-base.eslintrc.cjs'], + parserOptions: { + project: './tsconfig.json', + tsconfigRootDir: __dirname, + }, +}; diff --git a/nodejs-tools/nodejs-lib/graphics-programming/README.md b/nodejs-tools/nodejs-lib/graphics-programming/README.md new file mode 100644 index 00000000..f2bb0aee --- /dev/null +++ b/nodejs-tools/nodejs-lib/graphics-programming/README.md @@ -0,0 +1,3 @@ +# Graphics programming + +Visit the [demo](https://vighnesh153.dev/projects/graphics) and check out the different graphics projects. diff --git a/nodejs-tools/nodejs-lib/graphics-programming/package.json b/nodejs-tools/nodejs-lib/graphics-programming/package.json new file mode 100644 index 00000000..f521c0a2 --- /dev/null +++ b/nodejs-tools/nodejs-lib/graphics-programming/package.json @@ -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" + } +} diff --git a/nodejs-tools/nodejs-lib/graphics-programming/src/collection.ts b/nodejs-tools/nodejs-lib/graphics-programming/src/collection.ts new file mode 100644 index 00000000..8ca3bf24 --- /dev/null +++ b/nodejs-tools/nodejs-lib/graphics-programming/src/collection.ts @@ -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, +]; diff --git a/nodejs-tools/nodejs-lib/graphics-programming/src/index.ts b/nodejs-tools/nodejs-lib/graphics-programming/src/index.ts new file mode 100644 index 00000000..989b92da --- /dev/null +++ b/nodejs-tools/nodejs-lib/graphics-programming/src/index.ts @@ -0,0 +1 @@ +export * from './collection'; diff --git a/nodejs-tools/nodejs-lib/graphics-programming/tsconfig.json b/nodejs-tools/nodejs-lib/graphics-programming/tsconfig.json new file mode 100644 index 00000000..fe111ac7 --- /dev/null +++ b/nodejs-tools/nodejs-lib/graphics-programming/tsconfig.json @@ -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"] +} diff --git a/nodejs-tools/nodejs-lib/graphics-programming/tsup.config.ts b/nodejs-tools/nodejs-lib/graphics-programming/tsup.config.ts new file mode 100644 index 00000000..4ddd0603 --- /dev/null +++ b/nodejs-tools/nodejs-lib/graphics-programming/tsup.config.ts @@ -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 }; + }, +})); diff --git a/nodejs-tools/nodejs-lib/graphics-programming/vite.config.ts b/nodejs-tools/nodejs-lib/graphics-programming/vite.config.ts new file mode 100644 index 00000000..68ef90b2 --- /dev/null +++ b/nodejs-tools/nodejs-lib/graphics-programming/vite.config.ts @@ -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'), + }, + }, +}); diff --git a/nodejs-tools/package-lock.json b/nodejs-tools/package-lock.json index df7c55df..12a6a480 100644 --- a/nodejs-tools/package-lock.json +++ b/nodejs-tools/package-lock.json @@ -9113,6 +9113,10 @@ "resolved": "nodejs-packages/github-gist", "link": true }, + "node_modules/@vighnesh153/graphics-programming": { + "resolved": "nodejs-lib/graphics-programming", + "link": true + }, "node_modules/@vighnesh153/localhost-cors-proxy": { "resolved": "nodejs-packages/localhost-cors-proxy", "link": true @@ -35952,6 +35956,241 @@ "vitest": "^0.34.4" } }, + "nodejs-lib/graphics-programming": { + "name": "@vighnesh153/graphics-programming", + "license": "MIT", + "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" + } + }, + "nodejs-lib/graphics-programming/node_modules/@vitest/expect": { + "version": "0.34.2", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.2.tgz", + "integrity": "sha512-EZm2dMNlLyIfDMha17QHSQcg2KjeAZaXd65fpPzXY5bvnfx10Lcaz3N55uEe8PhF+w4pw+hmrlHLLlRn9vkBJg==", + "dev": true, + "dependencies": { + "@vitest/spy": "0.34.2", + "@vitest/utils": "0.34.2", + "chai": "^4.3.7" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "nodejs-lib/graphics-programming/node_modules/@vitest/runner": { + "version": "0.34.2", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.2.tgz", + "integrity": "sha512-8ydGPACVX5tK3Dl0SUwxfdg02h+togDNeQX3iXVFYgzF5odxvaou7HnquALFZkyVuYskoaHUOqOyOLpOEj5XTA==", + "dev": true, + "dependencies": { + "@vitest/utils": "0.34.2", + "p-limit": "^4.0.0", + "pathe": "^1.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "nodejs-lib/graphics-programming/node_modules/@vitest/snapshot": { + "version": "0.34.2", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.2.tgz", + "integrity": "sha512-qhQ+xy3u4mwwLxltS4Pd4SR+XHv4EajiTPNY3jkIBLUApE6/ce72neJPSUQZ7bL3EBuKI+NhvzhGj3n5baRQUQ==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.1", + "pathe": "^1.1.1", + "pretty-format": "^29.5.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "nodejs-lib/graphics-programming/node_modules/@vitest/spy": { + "version": "0.34.2", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.2.tgz", + "integrity": "sha512-yd4L9OhfH6l0Av7iK3sPb3MykhtcRN5c5K5vm1nTbuN7gYn+yvUVVsyvzpHrjqS7EWqn9WsPJb7+0c3iuY60tA==", + "dev": true, + "dependencies": { + "tinyspy": "^2.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "nodejs-lib/graphics-programming/node_modules/@vitest/utils": { + "version": "0.34.2", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.2.tgz", + "integrity": "sha512-Lzw+kAsTPubhoQDp1uVAOP6DhNia1GMDsI9jgB0yMn+/nDaPieYQ88lKqz/gGjSHL4zwOItvpehec9OY+rS73w==", + "dev": true, + "dependencies": { + "diff-sequences": "^29.4.3", + "loupe": "^2.3.6", + "pretty-format": "^29.5.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "nodejs-lib/graphics-programming/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "nodejs-lib/graphics-programming/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "nodejs-lib/graphics-programming/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "nodejs-lib/graphics-programming/node_modules/vite-node": { + "version": "0.34.2", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.34.2.tgz", + "integrity": "sha512-JtW249Zm3FB+F7pQfH56uWSdlltCo1IOkZW5oHBzeQo0iX4jtC7o1t9aILMGd9kVekXBP2lfJBEQt9rBh07ebA==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "mlly": "^1.4.0", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^3.0.0 || ^4.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": ">=v14.18.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "nodejs-lib/graphics-programming/node_modules/vitest": { + "version": "0.34.2", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.34.2.tgz", + "integrity": "sha512-WgaIvBbjsSYMq/oiMlXUI7KflELmzM43BEvkdC/8b5CAod4ryAiY2z8uR6Crbi5Pjnu5oOmhKa9sy7uk6paBxQ==", + "dev": true, + "dependencies": { + "@types/chai": "^4.3.5", + "@types/chai-subset": "^1.3.3", + "@types/node": "*", + "@vitest/expect": "0.34.2", + "@vitest/runner": "0.34.2", + "@vitest/snapshot": "0.34.2", + "@vitest/spy": "0.34.2", + "@vitest/utils": "0.34.2", + "acorn": "^8.9.0", + "acorn-walk": "^8.2.0", + "cac": "^6.7.14", + "chai": "^4.3.7", + "debug": "^4.3.4", + "local-pkg": "^0.4.3", + "magic-string": "^0.30.1", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.3.3", + "strip-literal": "^1.0.1", + "tinybench": "^2.5.0", + "tinypool": "^0.7.0", + "vite": "^3.0.0 || ^4.0.0", + "vite-node": "0.34.2", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": ">=v14.18.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@vitest/browser": "*", + "@vitest/ui": "*", + "happy-dom": "*", + "jsdom": "*", + "playwright": "*", + "safaridriver": "*", + "webdriverio": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "playwright": { + "optional": true + }, + "safaridriver": { + "optional": true + }, + "webdriverio": { + "optional": true + } + } + }, + "nodejs-lib/graphics-programming/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "nodejs-lib/simple-code-to-html": { "name": "@vighnesh153/simple-code-to-html", "license": "MIT",