0.2.4 • Published 6 months ago

@sdeverywhere/plugin-config v0.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@sdeverywhere/plugin-config

This package provides a plugin that reads CSV files used to configure a library or app around a System Dynamics model generated by SDEverywhere.

Quick Start

The best way to get started with SDEverywhere is to follow the Quick Start instructions. If you follow those instructions, the @sdeverywhere/plugin-config package will be added to your project automatically, in which case you can skip the next section and jump straight to the "Usage" section below.

Install

# npm
npm install --save-dev @sdeverywhere/plugin-config

# pnpm
pnpm add -D @sdeverywhere/plugin-config

# yarn
yarn add -D @sdeverywhere/plugin-config

Usage

Note: If you followed the "Quick Start" instructions above, the create script will have already performed the following steps for you. Reading these instructions can still be helpful if you are setting up a project manually or want to understand how plugin-config can be integrated into your project.

To get started:

  1. Copy the included template config files to your local project:
cd your-model-project
npm install --save-dev @sdeverywhere/plugin-config
cp -rf "./node_modules/@sdeverywhere/plugin-config/template-config" ./config
  1. Replace the placeholder values in the CSV files with values that are suitable for your model.

  2. Add a line to your sde.config.js file that uses the configProcessor function supplied by this package:

import { configProcessor } from '@sdeverywhere/plugin-config'

export async function config() {
  return {
    // Specify the Vensim model to read
    modelFiles: ['example.mdl'],

    // Read csv files from `config` directory and write to the recommended output
    // directory structure.  See `ConfigProcessorOptions` for more details.
    modelSpec: configProcessor({
      config: 'config'
    }),

    plugins: [
      // ...
    ]
  }
}
  1. Run sde bundle or sde dev; your config files will be used to drive the build process.

Documentation

API documentation (for plugin configuration options) is available in the docs directory.

License

SDEverywhere is distributed under the MIT license. See LICENSE for more details.

0.2.3

7 months ago

0.2.2

7 months ago

0.2.4

6 months ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.1

2 years ago

0.1.0

2 years ago