Skip to content

Commit

Permalink
Development info
Browse files Browse the repository at this point in the history
  • Loading branch information
Eccenux committed Oct 22, 2023
1 parent 449f625 commit e6738a7
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions DEV.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Development
==========================

Wiki2git is a Node.js project and is configured to use VSCode for development.

Wiki2git is publishing two things:
- JS classes (via `main.js`).
- Command line tools (via `bin` in `package.json`).


Preparation
----------------------

### Install Nodejs
Obviously you'll need [Node.js](https://nodejs.org/en).
Node 14+ should be fine for Wiki2git alone, deps might require a higher Node version. In any case, I would recommend using the latest LTS version of Node.

### Install modules
Run first `npm i`.
You might want to run `npm up` to update some scripts too.

Recomended global modules/tools:
```bash
npm install -g eslint
```
You mostly need above if you will be using your shell (command line).


Command line tools
----------------------

Command line tools are defined as `bin` scripts in the `package.json`.

### Debugging cmd tools

To make debugging easier actual script is spearated from a command line tool.
So e.g. `src\cmd-load.js` defines `runScript` and can be used for debugging.
And `src\cmd-load-cmd.js` is only parsing command line arguments (and executing `runScript`).

### Running local bin

Check help:
```
npx wiki2git-load --help
npx wiki2git-commit --help
```

Example:
```
npx wiki2git-load --site meta.wikimedia.org -p "User:Nux/global.js"
npx wiki2git-commit --site meta.wikimedia.org --repo "repo/global-test" -o "global.js"
```


Publishing
----------------------

Step 1. Check and update versions.
```bash
# 1: update version in package.json
# 2: audit check and update package-lock
npm i
# 3: (optional) update modules
npm up
```

Step 2. Test. Note! Tests in this project are *slow* (especially `LoadData` tests).
```bash
npm test
```

Step 3. Final command(s).
```bash
npm publish
```

0 comments on commit e6738a7

Please sign in to comment.