@sdeverywhere/compile 0.7.4 → 0.7.6

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.
package/README.md CHANGED
@@ -1,11 +1,38 @@
1
1
  # @sdeverywhere/compile
2
2
 
3
- This package contains the core SDEverywhere compiler that takes a Vensim model
4
- as input and generates C code as output.
3
+ This package contains the core [SDEverywhere](https://github.com/climateinteractive/SDEverywhere) compiler that takes a Vensim model as input and generates C code as output.
4
+
5
+ ## Quick Start
6
+
7
+ The best way to get started with SDEverywhere is to follow the [Quick Start](https://github.com/climateinteractive/SDEverywhere#quick-start) instructions.
8
+ If you follow those instructions, the `@sdeverywhere/cli` package will be added to your project automatically, and that package uses `@sdeverywhere/compile` as an implementation detail.
9
+ Therefore, most users do not need to install this package directly.
10
+
11
+ ## Install
12
+
13
+ As noted above, most users do not need to install this package directly, but for more advanced use cases, it can be installed as follows.
14
+
15
+ ```sh
16
+ # npm
17
+ npm install --save-dev @sdeverywhere/compile
18
+
19
+ # pnpm
20
+ pnpm add -D @sdeverywhere/compile
21
+
22
+ # yarn
23
+ yarn add -D @sdeverywhere/compile
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ Most users do not need to interact with the `@sdeverywhere/compile` package directly; it is primarily used in the implementation of the `@sdeverywhere/cli` package and `sde` command line tool.
29
+
30
+ More usage details will be included here at a later time when the interfaces stabilize.
5
31
 
6
32
  ## Documentation
7
33
 
8
- TODO
34
+ The `compile` package is currently treated as an implementation detail of the `cli` package.
35
+ As such, there is no public API documentation at this time, but we hope to expose a public API once the interfaces stabilize.
9
36
 
10
37
  ## License
11
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdeverywhere/compile",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "description": "The core Vensim to C compiler for the SDEverywhere tool suite.",
5
5
  "type": "module",
6
6
  "files": [
@@ -1,7 +1,7 @@
1
1
  import util from 'util'
2
2
  import B from 'bufx'
3
3
  import { parse as parseCsv } from 'csv-parse/sync'
4
- import R from 'ramda'
4
+ import * as R from 'ramda'
5
5
  import split from 'split-string'
6
6
  import XLSX from 'xlsx'
7
7
 
@@ -224,8 +224,8 @@ export let readCsv = (pathname, delimiter = ',') => {
224
224
  delimiter,
225
225
  columns: false,
226
226
  trim: true,
227
- skip_empty_lines: true,
228
- skip_records_with_empty_values: true
227
+ skip_empty_lines: false,
228
+ skip_records_with_empty_values: false
229
229
  }
230
230
  try {
231
231
  let data = B.read(pathname)
@@ -1,7 +1,7 @@
1
1
  import fs from 'fs'
2
2
  import B from 'bufx'
3
3
  import byline from 'byline'
4
- import R from 'ramda'
4
+ import * as R from 'ramda'
5
5
 
6
6
  import { canonicalVensimName } from './helpers.js'
7
7
 
@@ -1,7 +1,7 @@
1
1
  import util from 'util'
2
2
  import B from 'bufx'
3
3
  import yaml from 'js-yaml'
4
- import R from 'ramda'
4
+ import * as R from 'ramda'
5
5
  import { canonicalName, asort, vlog } from './helpers.js'
6
6
 
7
7
  // A subscript is a dimension or an index.
@@ -1,4 +1,4 @@
1
- import R from 'ramda'
1
+ import * as R from 'ramda'
2
2
 
3
3
  import { asort, lines, strlist, abend, mapIndexed } from '../_shared/helpers.js'
4
4
  import { sub, allDimensions, allMappings, subscriptFamilies } from '../_shared/subscript.js'
@@ -1,6 +1,6 @@
1
1
  import path from 'path'
2
2
  import { ModelLexer, ModelParser } from 'antlr4-vensim'
3
- import R from 'ramda'
3
+ import * as R from 'ramda'
4
4
  import XLSX from 'xlsx'
5
5
 
6
6
  import {
@@ -1,4 +1,4 @@
1
- import R from 'ramda'
1
+ import * as R from 'ramda'
2
2
 
3
3
  import { canonicalName } from '../_shared/helpers.js'
4
4
  import { sub, isDimension } from '../_shared/subscript.js'
@@ -1,5 +1,5 @@
1
1
  import { ModelParser } from 'antlr4-vensim'
2
- import R from 'ramda'
2
+ import * as R from 'ramda'
3
3
 
4
4
  import {
5
5
  canonicalName,
@@ -1,6 +1,6 @@
1
1
  import B from 'bufx'
2
2
  import yaml from 'js-yaml'
3
- import R from 'ramda'
3
+ import * as R from 'ramda'
4
4
 
5
5
  import { decanonicalize, isIterable, listConcat, strlist, vlog, vsort } from '../_shared/helpers.js'
6
6
  import {
@@ -1,6 +1,6 @@
1
1
  import path from 'path'
2
2
  import { ModelParser } from 'antlr4-vensim'
3
- import R from 'ramda'
3
+ import * as R from 'ramda'
4
4
  import XLSX from 'xlsx'
5
5
 
6
6
  import { cFunctionName, matchRegex, readCsv } from '../_shared/helpers.js'
@@ -1,4 +1,4 @@
1
- import R from 'ramda'
1
+ import * as R from 'ramda'
2
2
 
3
3
  import { canonicalName } from '../_shared/helpers.js'
4
4
  import { sub, isIndex, normalizeSubscripts } from '../_shared/subscript.js'
@@ -1,5 +1,5 @@
1
1
  import { ModelParser } from 'antlr4-vensim'
2
- import R from 'ramda'
2
+ import * as R from 'ramda'
3
3
 
4
4
  import { canonicalName, vlog, strlist, cartesianProductOf } from '../_shared/helpers.js'
5
5
  import {
@@ -1,6 +1,6 @@
1
1
  import path from 'path'
2
2
  import B from 'bufx'
3
- import R from 'ramda'
3
+ import * as R from 'ramda'
4
4
  import { splitEquations, replaceDelimitedStrings } from '../_shared/helpers.js'
5
5
 
6
6
  export let preprocessModel = (mdlFilename, spec, profile = 'genc', writeFiles = false, outDecls = []) => {