wikiploy 1.3.1 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,30 @@
1
+ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3
+
4
+ name: Node tests
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+
12
+ jobs:
13
+ build:
14
+
15
+ runs-on: ubuntu-latest
16
+
17
+ strategy:
18
+ matrix:
19
+ node-version: [16.x, 18.x]
20
+ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21
+
22
+ steps:
23
+ - uses: actions/checkout@v3
24
+ - name: Use Node.js ${{ matrix.node-version }}
25
+ uses: actions/setup-node@v3
26
+ with:
27
+ node-version: ${{ matrix.node-version }}
28
+ cache: 'npm'
29
+ - run: npm ci
30
+ - run: npm test
package/DEV.md ADDED
@@ -0,0 +1,49 @@
1
+ Development
2
+ ==========================
3
+
4
+ Wikiploy is a Node.js project and is configured to use VSCode for development.
5
+
6
+ ## Prepararion
7
+
8
+ ### Install Nodejs
9
+ Obviously you'll need [Node.js](https://nodejs.org/en).
10
+ Node 14+ should be fine for Wikiploy alone, but Puppeteer has certain expectations and 16+ is a better choice. In any case, I would recommend using the latest LTS version of Node.
11
+
12
+ Note that you can use [NVM-windows](https://github.com/coreybutler/nvm-windows) if you need multiple Node.js versions installed on Windows.
13
+
14
+ ### Install modules
15
+ Run first `npm i`.
16
+ You might want to run `npm up` to update some scripts too.
17
+
18
+ Recomended global modules/tools:
19
+ ```
20
+ npm install -g eslint
21
+ npm install -g mocha
22
+ ```
23
+ You mostly need above if you will be using your shell (command line).
24
+
25
+ ## Running tests
26
+ To run tests in your shell you can use npm: `npm test`. Or just run `mocha`.
27
+
28
+ Better yet install [VSCode](https://code.visualstudio.com/download) and the recommended extenstions. It will make things easier (especially for debugging tests).
29
+
30
+ In VSC, you should see a laboratory flask icon on the sidebar. From there, you can run individual tests or all at once.
31
+ Note that you might need to reload the testing sidebar to see all tests, especially after adding new test files.
32
+ To view output of individual tests use the testing sidebar. Navigate to the test and click on it.
33
+
34
+ You can also run (and debug) each test case directly from a test file. You might need to press reload in the sidebar if you don't see buttons to run and debug tests.
35
+
36
+ ## Publishing
37
+
38
+ Step. 1. Check.
39
+ ```
40
+ npm test
41
+ ```
42
+ Step. 2. Change version in the package.
43
+
44
+ Step. 3. Final commands.
45
+ ```
46
+ npm up
47
+ npm test
48
+ npm publish
49
+ ```
package/README.md CHANGED
@@ -13,6 +13,7 @@ Rollout your JS, CSS etc from your git repository to as many MW wikis as you nee
13
13
  This is using [Puppeteer](https://pptr.dev/) to control [Chrome Canary](https://www.google.com/chrome/canary/) or similar. You just open Chrome with remote debug enabled and run a script. The idea is that you are logged in in Chrome and so all edits are still your edits. You can keep the Canary running in the background when you are changing and deploying more stuff.
14
14
 
15
15
  Wikiploy will also work with other Chromium based browser. [Instructions for enabling remote debug in MS Edge](https://learn.microsoft.com/en-us/microsoft-edge/devtools-protocol-chromium/).
16
+ Note that to completely close Edge you might need use settings: Continue running in background when Microsoft Edge is closed (pl. *Kontynuuj działanie aplikacji i rozszerzeń w tle po zamknięciu przeglądarki Microsoft Edge*).
16
17
 
17
18
  ## Basic script and dst
18
19
  ```js
package/assets/test.css CHANGED
@@ -2,4 +2,7 @@
2
2
  .yadda.yadda.yadda {
3
3
  content: 'bla, bla, bla';
4
4
  }
5
- .something {}
5
+ .something {
6
+ display: block;
7
+ }
8
+ /* puppeteer 20.7.x */
package/assets/test.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // test.js
2
2
  console.log('test');
3
- // edit
3
+ // puppeteer 20.7.x
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "wikiploy",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "User scripts and gadgets deployment for MediaWiki (Wikipedia).",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1"
8
+ "test": "mocha"
9
9
  },
10
10
  "repository": {
11
11
  "type": "git",
@@ -25,11 +25,11 @@
25
25
  },
26
26
  "homepage": "https://github.com/Eccenux/Wikiploy#readme",
27
27
  "dependencies": {
28
- "puppeteer": "^20.7.2"
28
+ "puppeteer": "20.7.x"
29
29
  },
30
30
  "devDependencies": {
31
- "chai": "^4.3.7",
32
- "mocha": "^10.2.0",
33
- "eslint": "^8.43.0"
31
+ "chai": "4.x",
32
+ "mocha": "10.x",
33
+ "eslint": "8.x"
34
34
  }
35
35
  }