Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldivo authored Oct 31, 2024
0 parents commit 1159bfb
Show file tree
Hide file tree
Showing 63 changed files with 9,528 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy static content to Pages

on:
push:
branches: ["main"]
workflow_dispatch:

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

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Yarn
run: npm install -g yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build
env:
BASE_PATH: ${{ github.event.repository.name }}

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./dist"

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Binary file added .yarn/install-state.gz
Binary file not shown.
180 changes: 180 additions & 0 deletions .yarn/patches/yargs-npm-17.7.2-80b62638e1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
diff --git a/lib/platform-shims/browser.mjs b/lib/platform-shims/browser.mjs
index 5f8ec61f449a10d0281268b409cf026da6468333..f445dff7ee396c4c589af8eab2040e12cba3da00 100644
--- a/lib/platform-shims/browser.mjs
+++ b/lib/platform-shims/browser.mjs
@@ -1,95 +1,94 @@
/* eslint-disable no-unused-vars */
-'use strict';
+"use strict"

-import cliui from 'https://unpkg.com/[email protected]/index.mjs'; // eslint-disable-line
-import Parser from 'https://unpkg.com/[email protected]/browser.js'; // eslint-disable-line
-import {getProcessArgvBin} from '../../build/lib/utils/process-argv.js';
-import {YError} from '../../build/lib/yerror.js';
+import cliui from "https://unpkg.com/[email protected]/index.mjs" // eslint-disable-line
+import Parser from "https://unpkg.com/[email protected]/browser.js" // eslint-disable-line
+import { getProcessArgvBin } from "../../build/lib/utils/process-argv.js"
+import { YError } from "../../build/lib/yerror.js"

-const REQUIRE_ERROR = 'require is not supported in browser';
-const REQUIRE_DIRECTORY_ERROR =
- 'loading a directory of commands is not supported in browser';
+const REQUIRE_ERROR = "require is not supported in browser"
+const REQUIRE_DIRECTORY_ERROR = "loading a directory of commands is not supported in browser"

export default {
- assert: {
- notStrictEqual: (a, b) => {
- // noop.
+ assert: {
+ notStrictEqual: (a, b) => {
+ // noop.
+ },
+ strictEqual: (a, b) => {
+ // noop.
+ },
},
- strictEqual: (a, b) => {
- // noop.
+ cliui,
+ findUp: () => undefined,
+ getEnv: (key) => {
+ // There is no environment in browser:
+ return undefined
},
- },
- cliui,
- findUp: () => undefined,
- getEnv: key => {
- // There is no environment in browser:
- return undefined;
- },
- inspect: console.log,
- getCallerFile: () => {
- throw new YError(REQUIRE_DIRECTORY_ERROR);
- },
- getProcessArgvBin,
- mainFilename: 'yargs',
- Parser,
- path: {
- basename: str => str,
- dirname: str => str,
- extname: str => str,
- relative: str => str,
- },
- process: {
- argv: () => [],
- cwd: () => '',
- emitWarning: (warning, name) => {},
- execPath: () => '',
- // exit is noop browser:
- exit: () => {},
- nextTick: cb => {
- // eslint-disable-next-line no-undef
- window.setTimeout(cb, 1);
+ inspect: console.log,
+ getCallerFile: () => {
+ throw new YError(REQUIRE_DIRECTORY_ERROR)
},
- stdColumns: 80,
- },
- readFileSync: () => {
- return '';
- },
- require: () => {
- throw new YError(REQUIRE_ERROR);
- },
- requireDirectory: () => {
- throw new YError(REQUIRE_DIRECTORY_ERROR);
- },
- stringWidth: str => {
- return [...str].length;
- },
- // TODO: replace this with y18n once it's ported to ESM:
- y18n: {
- __: (...str) => {
- if (str.length === 0) return '';
- const args = str.slice(1);
- return sprintf(str[0], ...args);
+ getProcessArgvBin,
+ mainFilename: "yargs",
+ Parser,
+ path: {
+ basename: (str) => str,
+ dirname: (str) => str,
+ extname: (str) => str,
+ relative: (str) => str,
},
- __n: (str1, str2, count, ...args) => {
- if (count === 1) {
- return sprintf(str1, ...args);
- } else {
- return sprintf(str2, ...args);
- }
+ process: {
+ argv: () => [],
+ cwd: () => "",
+ emitWarning: (warning, name) => {},
+ execPath: () => "",
+ // exit is noop browser:
+ exit: () => {},
+ nextTick: (cb) => {
+ // eslint-disable-next-line no-undef
+ window.setTimeout(cb, 1)
+ },
+ stdColumns: 80,
},
- getLocale: () => {
- return 'en_US';
+ readFileSync: () => {
+ return ""
},
- setLocale: () => {},
- updateLocale: () => {},
- },
-};
+ require: () => {
+ throw new YError(REQUIRE_ERROR)
+ },
+ requireDirectory: () => {
+ throw new YError(REQUIRE_DIRECTORY_ERROR)
+ },
+ stringWidth: (str) => {
+ return [...str].length
+ },
+ // TODO: replace this with y18n once it's ported to ESM:
+ y18n: {
+ __: (...str) => {
+ if (str.length === 0) return ""
+ const args = str.slice(1)
+ return sprintf(str[0], ...args)
+ },
+ __n: (str1, str2, count, ...args) => {
+ if (count === 1) {
+ return sprintf(str1, ...args)
+ } else {
+ return sprintf(str2, ...args)
+ }
+ },
+ getLocale: () => {
+ return "en_US"
+ },
+ setLocale: () => {},
+ updateLocale: () => {},
+ },
+}

function sprintf(_str, ...args) {
- let str = '';
- const split = _str.split('%s');
- split.forEach((token, i) => {
- str += `${token}${split[i + 1] !== undefined && args[i] ? args[i] : ''}`;
- });
- return str;
+ let str = ""
+ const split = _str.split("%s")
+ split.forEach((token, i) => {
+ str += `${token}${split[i + 1] !== undefined && args[i] ? args[i] : ""}`
+ })
+ return str
}
Loading

0 comments on commit 1159bfb

Please sign in to comment.