Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
feat: start moving to react
Browse files Browse the repository at this point in the history
  • Loading branch information
levino committed Apr 27, 2023
1 parent 268d770 commit 5cbc829
Show file tree
Hide file tree
Showing 33 changed files with 14,691 additions and 229 deletions.
3 changes: 0 additions & 3 deletions .gitconfig

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
bower_components/
node_modules/
public/
npm-debug.log
resume.html
resume.pdf
resume.json
index.html
.DS_Store
19 changes: 19 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { StorybookConfig } from "@storybook/react-webpack5";
const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/preset-create-react-app",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/react-webpack5",
options: {},
},
docs: {
autodocs: "tag",
},
staticDirs: ["../public"],
};
export default config;
16 changes: 16 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import "../style.css";
import type { Preview } from "@storybook/react";

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
};

export default preview;
3 changes: 3 additions & 0 deletions index.de.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const createTheme = require("./index");

module.exports = createTheme("de");
3 changes: 3 additions & 0 deletions index.en.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const createTheme = require('./index')

module.exports = createTheme('en')
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Handlebars.registerHelper('paragraphSplit', paragraphSplit);
Handlebars.registerHelper('toLowerCase', toLowerCase);
Handlebars.registerHelper('spaceToDash', spaceToDash);

function render(resume) {
const createRender = (language) => (resume) => {
const css = readFileSync(`${__dirname}/style.css`, 'utf-8');
const tpl = readFileSync(`${__dirname}/resume.hbs`, 'utf-8');
const partialsDir = join(__dirname, 'theme/partials');
Expand Down Expand Up @@ -51,4 +51,9 @@ const pdfRenderOptions = {
}
}

module.exports = { render, pdfRenderOptions };
const createTheme = (language = 'en') => ({
pdfRenderOptions,
render: createRender(language)
})

module.exports = createTheme
218 changes: 0 additions & 218 deletions package-lock.json

This file was deleted.

75 changes: 73 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,81 @@
"url": "https://github.com/francescoes/jsonresume-theme-stackoverflow"
},
"license": "MIT",
"main": "index.js",
"main": "index.en.js",
"exports": {
".": "index.en.js",
"./german": "index.de.js"
},
"dependencies": {
"handlebars": "^4.7.7",
"markdown-it": "^13.0.1",
"moment": "^2.29.2"
"moment": "^2.29.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"typescript": "^4.4.2",
"web-vitals": "^2.1.0"
},
"devDependencies": {
"@kurone-kito/jsonresume-types": "^0.3.7",
"@storybook/addon-essentials": "^7.0.7",
"@storybook/addon-interactions": "^7.0.7",
"@storybook/addon-links": "^7.0.7",
"@storybook/blocks": "^7.0.7",
"@storybook/preset-create-react-app": "^7.0.7",
"@storybook/react": "^7.0.7",
"@storybook/react-webpack5": "^7.0.7",
"@storybook/testing-library": "^0.0.14-next.2",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^13.2.1",
"@types/jest": "^27.0.1",
"@types/node": "^16.7.13",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"babel-plugin-named-exports-order": "^0.0.2",
"prop-types": "^15.8.1",
"react-scripts": "^5.0.1",
"resume-cli": "^3.0.8",
"storybook": "^7.0.7",
"typescript": "^5.0.4",
"webpack": "^5.81.0"
},
"scripts": {
"dev": "resume serve --theme .",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
],
"overrides": [
{
"files": [
"**/*.stories.*"
],
"rules": {
"import/no-anonymous-default-export": "off"
}
}
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Binary file added public/favicon.ico
Binary file not shown.
Loading

0 comments on commit 5cbc829

Please sign in to comment.