Skip to content

Commit f241c8a

Browse files
committed
Update to up-to-date structure
1 parent 968bdb8 commit f241c8a

17 files changed

Lines changed: 3936 additions & 10736 deletions

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "npm"
4-
directory: "/"
3+
- package-ecosystem: 'npm'
4+
directory: '/'
55
schedule:
6-
interval: "weekly"
6+
interval: 'weekly'

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Continues Integration
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
ci:
12+
name: Continues Integration
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
check-latest: true
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Linting
29+
run: npm run lint
30+
31+
- name: Tests
32+
run: npm test
33+
34+
- name: Build
35+
run: npm run build

.gitignore

Lines changed: 5 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,29 @@
1-
# Logs
21
logs
32
*.log
43
npm-debug.log*
54
yarn-debug.log*
65
yarn-error.log*
76
lerna-debug.log*
87

9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
8+
dist
9+
.cache
2210
coverage
2311
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
3812
build/Release
39-
40-
# Dependency directories
4113
node_modules/
4214
jspm_packages/
43-
44-
# TypeScript v1 declaration files
4515
typings/
46-
47-
# TypeScript cache
4816
*.tsbuildinfo
49-
50-
# Optional npm cache directory
5117
.npm
52-
53-
# Optional eslint cache
5418
.eslintcache
55-
56-
# Microbundle cache
57-
.rpt2_cache/
58-
.rts2_cache_cjs/
59-
.rts2_cache_es/
60-
.rts2_cache_umd/
61-
62-
# Optional REPL history
6319
.node_repl_history
64-
65-
# Output of 'npm pack'
6620
*.tgz
67-
68-
# Yarn Integrity file
21+
.next
6922
.yarn-integrity
7023

71-
# dotenv environment variables file
7224
.env
7325
.env.test
7426

75-
# parcel-bundler cache (https://parceljs.org/)
76-
.cache
77-
78-
# Next.js build output
79-
.next
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
83-
dist
84-
85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
90-
91-
# vuepress build output
92-
.vuepress/dist
93-
94-
# Serverless directories
95-
.serverless/
96-
97-
# FuseBox cache
98-
.fusebox/
99-
100-
# DynamoDB Local files
101-
.dynamodb/
102-
103-
# TernJS port file
104-
.tern-port
105-
106-
# ItelliJ IDEs settings folders
10727
.idea/
108-
109-
# macOS service files
110-
.DS_Store
28+
.DS_Store
29+
.claude

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
node_modules/
3+
package-lock.json

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021-2023 echocat
3+
Copyright (c) 2021-2025 echocat
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,41 @@
22

33
Code kata in JavaScript where you have to write a library of books and magazines.
44

5-
[A code kata is an exercise in programming which helps a programmer hone their skills through practice and repetition.](https://en.wikipedia.org/wiki/Kata_(programming))
5+
[A code kata is an exercise in programming which helps a programmer hone their skills through practice and repetition.](<https://en.wikipedia.org/wiki/Kata_(programming)>)
66

7-
* [Frame conditions](#frame-conditions)
8-
* [Tasks](#tasks)
9-
* [Procedure](#procedure)
10-
* [License](#license)
7+
- [Frame conditions](#frame-conditions)
8+
- [Tasks](#tasks)
9+
- [Procedure](#procedure)
10+
- [FAQ](#faq)
11+
- [License](#license)
1112

1213
## Frame conditions
1314

14-
1. You have exact __2.5 hours__ of time - __no minute longer__.
15+
1. You have exact **2.5 hours** of time - **no minute longer**.
1516
If you reach this time limit stop your work immediately.
1617
It is one part of the kata to respect this time limit.
1718
There are no restrictions on how to use the provided time.
18-
If you want to code the entire time, take a break or a cigaret - it’s up to you.
19+
If you want to code the entire time, take a break or a cigaret - it’s up to you.
1920

2021
2. There is no complete or incomplete, most likely it'll be impossible to close all the tasks in the first run (that's the point of kata as a type of practice). Keep in mind following priorities though:
21-
1. __Code quality and structure__.
22+
1. **Code quality and structure**.
2223
2. Functionality.
2324
3. UI/UX.
2425

25-
4. This is a real world situation. You are allowed to consult the Internet, use every library you want, call a friend...
26+
3. This is a real world situation. You are allowed to consult the Internet, use every library you want, call a friend...
2627
**BUT you're NOT allowed to:**
27-
* do pair programming
28-
* have a look at your previous implementation of this kata if you've done it before
28+
- do pair programming
29+
- have a look at your previous implementation of this kata if you've done it before
2930

30-
5. Given resources:
31-
* [`authors.csv`](data/authors.csv): Contains authors with its `email`, `firstName` and `lastName`.
32-
* [`books.csv`](data/books.csv): Contains books with its `title`, `description`, one or more `authors` and an `isbn`.
33-
* [`magazines.csv`](data/magazines.csv): Contains magazines with its `title`, one or more `authors`, a `publishedAt` and an `isbn`.
31+
4. Given resources:
32+
- [`authors.csv`](data/authors.csv): Contains authors with its `email`, `firstName` and `lastName`.
33+
- [`books.csv`](data/books.csv): Contains books with its `title`, `description`, one or more `authors` and an `isbn`.
34+
- [`magazines.csv`](data/magazines.csv): Contains magazines with its `title`, one or more `authors`, a `publishedAt` and an `isbn`.
3435

3536
## Tasks
3637

37-
* [Main tasks](#main-tasks)
38-
* [Optional tasks](#optional-tasks)
38+
- [Main tasks](#main-tasks)
39+
- [Optional tasks](#optional-tasks)
3940

4041
### Main tasks
4142

@@ -66,7 +67,7 @@ Code kata in JavaScript where you have to write a library of books and magazines
6667
# Example: git clone https://github.com/echocat/javascript-kata-1.git
6768
```
6869

69-
2. Just download it from [here](https://github.com/echocat/javascript-kata-1/archive/master.zip)
70+
2. Just download it from [here](https://github.com/echocat/javascript-kata-1/archive/main.zip)
7071

7172
2. Open in your favorite text editor/IDE.
7273

@@ -78,58 +79,62 @@ Code kata in JavaScript where you have to write a library of books and magazines
7879

7980
## FAQ
8081

82+
- [How to run your application?](#how-to-run-your-application)
83+
- [What's the structure of the boilerplate?](#whats-the-structure-of-the-boilerplate)
84+
- [How to lint your code?](#how-to-lint-your-code)
85+
- [How to run your tests?](#how-to-run-your-tests)
86+
8187
### How to run your application?
8288
8389
1. Install dependencies:
90+
8491
```bash
8592
npm i
8693
```
8794
8895
2. Run `start` script:
96+
8997
```bash
90-
npm run start
98+
npm start
9199
```
92-
100+
93101
This command will run dev server. After this the project is accessible on [http://localhost:9000/](http://localhost:9000/)
94102
95-
#### What's the structure of the boilerplate?
103+
### What's the structure of the boilerplate?
96104

97105
> **Important!** `react` and `react-dom` are already included in `package.json`. If you want to use other libraries/frameworks, you have to install and include them manually.
98106

99-
1. [`webpack`](https://webpack.js.org/) for building and bundling:
100-
* `.js` and `.css` files work out of the box.
101-
* entry point is `src/index.js` file.
102-
* bundle is being written in `dist/main.js`.
107+
1. [`vite`](https://vite.dev/) for building and bundling:
108+
- `.js` and `.css` files work out of the box.
109+
- entry point is `src/index.js` file.
110+
- bundle is being written in `dist/assets/index-*.js`.
103111

104-
2. [`jest`](https://jestjs.io/) for testing.
112+
2. [`vitest`](https://vitest.dev/) for testing.
105113

106114
3. [`eslint`](https://eslint.org/) for code checking.
107115

108-
3. [`webpack-dev-server`](https://webpack.js.org/configuration/dev-server/) for hacking:
109-
* configured to serve content of `dist`, `data` and `static` folders. If you run server, CSV files are gonna be available from the root, e.g. `data/authors.csv` will be served over [http://localhost:9000/authors.csv](http://localhost:9000/authors.csv)
110-
* supports live reload
111-
112-
4. [`babel`](https://babeljs.io/) for code transpiling:
113-
* preconfigured with `preset-env` and `preset-react`.
114-
* `plugin-transform-runtime` plugin to support `async`/`await`.
115-
> **Hint:** if you prefer using another build tool/bundler/test suite/etc: feel free to modify whatever you need.
116+
4. [`prettier`](https://prettier.io/) for formatting the code.
116117

117-
#### How to lint your code?
118+
### How to lint your code?
118119

119120
For code check:
121+
120122
```bash
121123
npm run lint
122124
```
123125

124126
To fix the linting errors:
127+
125128
```bash
126129
npm run lint:fix
127130
```
128131

129-
#### How to run your tests?
132+
### How to run your tests?
133+
130134
```bash
131-
npm run test
135+
npm test
132136
```
133137

134138
## License
139+
135140
See [LICENSE](LICENSE) file.

0 commit comments

Comments
 (0)