Skip to content

Commit

Permalink
feat: updated dependencies, added theme switch, fixed found eslint er…
Browse files Browse the repository at this point in the history
…rors
  • Loading branch information
prisis committed Aug 8, 2023
1 parent bb244bc commit 2382724
Show file tree
Hide file tree
Showing 29 changed files with 14,705 additions and 13,162 deletions.
42 changes: 0 additions & 42 deletions .eslintrc.cjs

This file was deleted.

63 changes: 63 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/** @ts-check */
const globals = require("@anolilab/eslint-config/globals");
const { defineConfig } = require("@anolilab/eslint-config/define-config");

module.exports = defineConfig({
env: {
// Your environments (which contains several predefined global variables)
// Most environments are loaded automatically if our rules are added
},
extends: ["@anolilab/eslint-config", "@anolilab/eslint-config/typescript-type-checking"],
globals: {
...globals.es2021,
// Your global variables (setting to false means it's not allowed to be reassigned)
// myGlobal: false
},
ignorePatterns: ["!**/*"],
overrides: [
{
files: ["*.ts", "*.tsx", "*.mts", "*.cts", "*.js", "*.jsx"],
// Set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting
parserOptions: {},
rules: {},
},
{
files: ["*.ts", "*.tsx", "*.mts", "*.cts"],
// Set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting
parserOptions: {},
rules: {
"import/no-cycle": "off",
"no-use-before-define": "off",
},
settings: {
tailwindcss: {
config: "./tailwind.config.js",
whitelist: [],
},
},
},
{
files: ["*.js", "*.jsx"],
rules: {
"global-require": "off",
},
},
{
files: ["*.mdx"],
rules: {
"jsx-a11y/anchor-has-content": "off",
// @see https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/917
"jsx-a11y/heading-has-content": "off",
},
},
],
parserOptions: {
ecmaVersion: 2021,
project: "./tsconfig.json",
sourceType: "module",
},
root: true,
rules: {
// Customize your rules
},
});
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ repository:
default_branch: "main"
delete_branch_on_merge: true
is_template: true
description: "Template to create your own resume."
description: "Template to create your own resume"
has_downloads: true
has_issues: true
has_pages: false
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- uses: "actions/stale@v6"
- uses: "actions/stale@v5"
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
stale-issue-message: |
Expand All @@ -32,7 +32,7 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- uses: "actions/stale@v6"
- uses: "actions/stale@v5"
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
stale-issue-message: |
Expand All @@ -47,7 +47,7 @@ jobs:
timeout-minutes: 1
runs-on: "ubuntu-latest"
steps:
- uses: "actions/stale@v6"
- uses: "actions/stale@v5"
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
stale-issue-message: |
Expand All @@ -64,7 +64,7 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- uses: "actions/stale@v6"
- uses: "actions/stale@v5"
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
stale-issue-message: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ coverage/
resume.private.json

dist
.idea
8 changes: 4 additions & 4 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"**/*.{js,jsx,tsx,ts}": [
"prettier --config=.prettierrc.cjs --write",
"cross-env NO_LOGS=true eslint . --ext js,jsx,ts,tsx --max-warnings=1 --config .eslintrc.cjs --cache --cache-strategy content . --fix"
"prettier --config=.prettierrc.js --write",
"cross-env NO_LOGS=true eslint . --ext js,jsx,ts,tsx --max-warnings=1 --config .eslintrc.js --cache --cache-strategy content . --fix"
],
"*.{json,yml,yaml,less,css,scss,sass}": [
"prettier --config=.prettierrc.cjs --write"
"prettier --config=.prettierrc.js --write"
],
"*.{md,mdx}": [
"prettier --config=.prettierrc.cjs --write"
"prettier --config=.prettierrc.js --write"
]
}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.17.0
18.17
21 changes: 0 additions & 21 deletions .prettierrc.cjs

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// eslint-disable-next-line import/no-extraneous-dependencies
const config = require("@anolilab/prettier-config");

module.exports = {
...config,
};
35 changes: 3 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,45 +73,16 @@ To generate an résumé locally:

```toml
[build.environment]
NODE_VERSION = "16"
NPM_FLAGS="--version"

[[plugins]]
package = "/.netlify/netlify-plugin-pnpm"
NODE_VERSION = "18"

[build]
# If you download your resume.json (and resume.private.json) from a gist please use the command below and uncomment the current command
# command = "npx pnpm@7 install --store-dir=.pnpm --frozen-lockfile && npx pnpm@7 run download:resume && npx pnpm@7 run build && npx pnpm@7 run build:pdf"
command = "npx pnpm@7 install --store-dir=.pnpm --frozen-lockfile && npx pnpm@7 run build && npx pnpm@7 run build:pdf"
# command = "pnpm run download:resume && pnpm run build && pnpm run build:pdf"
command = "pnpm run build && pnpm run build:pdf"
publish = "dist"

```

To use `pnpm` on netlify you need to create this file `.netlify/netlify-plugin-pnpm/index.js` and `.netlify/netlify-plugin-pnpm/manifest.yml`.

`.netlify/netlify-plugin-pnpm/index.js`:

```js
module.exports = {
// eslint-disable-next-line consistent-return
onPreBuild: async ({ utils: { build, run } }) => {
try {
await run.command("npm install -g pnpm");
await run.command("pnpm install --frozen-lockfile=false");
} catch (error) {
return build.failBuild(error);
}
},
};
```

`.netlify/netlify-plugin-pnpm/manifest.yml`:

```yaml
name: netlify-plugin-pnpm
inputs: []
```
## Why not use the PDF generated by the pipeline

The pipeline generates a PDF using the public information found in
Expand Down
8 changes: 4 additions & 4 deletions __tests__/utils/get-network.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ import { getNetwork } from "../../src/utils";
const profiles = [
{
network: "Twitter",
username: "siliconHBO",
url: "https://twitter.com/siliconHBO",
username: "siliconHBO",
},
{
network: "Facebook",
username: "SiliconHBO",
url: "https://www.facebook.com/SiliconHBO",
username: "SiliconHBO",
},
{
network: "Instagram",
username: "siliconhbo",
url: "https://www.instagram.com/siliconhbo/",
username: "siliconhbo",
},
];

describe("getNetwork", () => {
it("returns network profile", () => {
expect(getNetwork(profiles, "twitter")).toEqual({
network: "Twitter",
username: "siliconHBO",
url: "https://twitter.com/siliconHBO",
username: "siliconHBO",
});
});

Expand Down
56 changes: 2 additions & 54 deletions assets/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions bin/build-pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ import process from "node:process";

import htmlToPdf from "../src/html-to-pdf";

async function buildPdf() {
const buildPdf = async (): Promise<void> => {
const distributionPath = path.join(process.cwd(), "dist");
// eslint-disable-next-line security/detect-non-literal-fs-filename
const assets = fs.readdirSync(path.join(distributionPath, "assets")).map((asset) => path.join(distributionPath, "assets", asset));

await htmlToPdf(path.join(distributionPath, "index.html"), assets, path.join(distributionPath, "resume.pdf"));
}
};

buildPdf()
// eslint-disable-next-line promise/always-return
.then(() => {
// eslint-disable-next-line unicorn/no-process-exit
process.exit(0);
})
.catch((error) => {
// eslint-disable-next-line unicorn/prefer-top-level-await
.catch((error: unknown) => {
// eslint-disable-next-line no-console
console.error(error);
// eslint-disable-next-line unicorn/no-process-exit
Expand Down
Loading

0 comments on commit 2382724

Please sign in to comment.