1.3.10 • Published 17 days ago

@uniwebcms/tutorial-builder v1.3.10

Weekly downloads
-
License
MIT
Repository
github
Last release
17 days ago

Tutorial builder

Generator of markdown files for a Docusaurus tutorial website,

Directory Structure:

tutorial-builder
  └── src
      ├── browser
      │   └── ... -- Browser-specific components
      └── node
          └── ... -- Node.js specific utilities

Main Entry Point

In package.json, we set the main field to point to bundle.js under dist. This is the primary entry point to get components.

{
  "main": "dist/bundle.js",
}

Conditional Exports

Node.js introduced a feature called conditional exports that allows defining different entry points based on the environment. This can be helpful if your library has distinct Node and browser entry points.

{
  "exports": {
    ".": "./dist/bundle.js",
    "./config": "./dist/node/index.js"
  },
}

With this format, the node script to generate the config object can be imported as:

const getConfig = require('@uniwebcms/tutorial-builder/config');

Build and public

The built is saved to the /dist folder, which is not committed. The project must be built before it is published to npm.

First, install the dependencies

npm i
npm run build
npm publish 

The first time the package is published, call npm login to log in and npm publish -access public to make the package is public accessible.

Webpack

When the library is used in a project that bundles its code with Webpack, Webpack will look for fields like module or browser in package.json to determine the correct entry point.

If you're providing already bundled code for the browser, ensure that you exclude Node.js-specific code from that bundle and vice-versa.

Peer Dependencies

Docusaurus relies on React, so we list React (and any other such dependencies) as a peer dependency. This ensures that the consuming application uses a single version of React.

1.3.10

17 days ago

1.3.9

5 months ago

1.3.8

6 months ago

1.3.7

6 months ago

1.3.6

6 months ago

1.3.5

7 months ago

1.3.4

8 months ago

1.3.3

8 months ago

1.3.2

8 months ago

1.3.1

8 months ago

1.2.11

9 months ago

1.2.10

9 months ago

1.2.9

9 months ago

1.2.8

9 months ago

1.2.7

9 months ago

1.2.6

9 months ago

1.2.5

9 months ago

1.2.4

9 months ago

1.2.3

9 months ago

1.2.2

9 months ago

1.2.1

9 months ago

1.2.0

9 months ago

1.1.12

9 months ago

1.1.11

9 months ago

1.1.10

9 months ago

1.1.9

9 months ago

1.1.8

9 months ago

1.1.7

9 months ago

1.1.6

9 months ago

1.1.5

9 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.16

9 months ago

1.0.15

9 months ago

1.0.14

9 months ago

1.0.13

9 months ago

1.0.12

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago