Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.min.*
frontend
node_modules

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added this as there are still some unhoisted dependencies (moment) that will be installed in markbind (lib)

src/lib/markbind/src/lib/markdown-it/*
src/lib/markbind/src/lib/markdown-it-shared/*

Expand Down
1 change: 0 additions & 1 deletion __mocks__/fs-extra-promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ fs.copySync = (src, dest) => {
*/
fs.readJsonSync = filePath => JSON.parse(fs.readFileSync(filePath, 'utf8'));


Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these occur due to dependency upgrades of eslint

/**
* Mocking fs-extra#outputJsonSync
*/
Expand Down
14 changes: 14 additions & 0 deletions docs/devGuide/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,17 @@ ESLint has [integrations with popular editors](https://eslint.org/docs/user-guid
There are several versions of the _test and linting scripts_ in the main `package.json` that execute for only one of the main or sub packages,
feel free to look into `package.json` and use them as you see fit!
</box>

## Updating dependencies

We use `npm install <package folder>` to <tooltip content="take a look under the command in the link!">[hoist](https://docs.npmjs.com/cli/install)</tooltip> the MarkBind core package's dependencies to the root `node_modules`, avoiding dependency duplication between the `markbind-cli` and `markbind` packages where possible.

Hence, when updating dependencies of the `markbind` core package, be sure to run the `npm install src/lib/markbind` command, or simply the `npm run install:markbind` script. If you upgraded the dependencies of multiple packages, simply run `npm run install:all` instead.
Comment thread
ang-zeyu marked this conversation as resolved.

If the dependency <tooltip content="i.e. is also listed under the root `package.json`">is also used</tooltip> in the root package, make sure to update its <tooltip content="as listed in the `package.json` file">version number</tooltip> as well!

<box type="warning">

Conversely, when updating dependencies of the *root* package, be sure to still check whether any subpackages list this as a dependency!
If so, follow the above process as well.
Comment thread
ang-zeyu marked this conversation as resolved.
</box>
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env node


// Entry file for Markbind project
const chokidar = require('chokidar');
const fs = require('fs-extra-promise');
Expand All @@ -13,9 +12,10 @@ const _ = {};
_.isBoolean = require('lodash/isBoolean');

const cliUtil = require('./src/util/cliUtil');
const { ensurePosix } = require('./src/lib/markbind/src/utils');
const fsUtil = require('./src/util/fsUtil');
const logger = require('./src/util/logger');
const utils = require('./src/lib/markbind/src/utils');

const Site = require('./src/Site');

const {
Expand Down Expand Up @@ -118,7 +118,7 @@ program
const outputFolder = path.join(rootFolder, '_site');

let onePagePath = options.onePage === true ? INDEX_MARKDOWN_FILE : options.onePage;
onePagePath = onePagePath ? ensurePosix(onePagePath) : onePagePath;
onePagePath = onePagePath ? utils.ensurePosix(onePagePath) : onePagePath;

const site = new Site(rootFolder, outputFolder, onePagePath, options.forceReload, options.siteConfig);

Expand Down Expand Up @@ -209,7 +209,7 @@ program

const didInitiateRebuild = site.changeCurrentPage(urlWithoutExtension);
if (didInitiateRebuild) {
req.url = ensurePosix(path.join(config.baseUrl || '/', LAZY_LOADING_SITE_FILE_NAME));
req.url = utils.ensurePosix(path.join(config.baseUrl || '/', LAZY_LOADING_SITE_FILE_NAME));
}
next();
};
Expand Down
7 changes: 7 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
testPathIgnorePatterns: [
'/frontend/',
'/node_modules/',
'/test/functional/',
],
};
Loading