saladplate 0.1.2 → 0.1.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.
package/README.md CHANGED
@@ -15,7 +15,7 @@ If you need more functionality that that, this is not the templating tool for yo
15
15
  ```bash
16
16
  $ npm -g install saladplate
17
17
  $ saladplate --version
18
- saladplate: version 0.1.0
18
+ saladplate: version 0.1.2
19
19
  ```
20
20
 
21
21
  ## Usage
@@ -62,19 +62,35 @@ console.info(template("The current PATH is: $PATH"));
62
62
 
63
63
  ## Development
64
64
 
65
- When developing locally, you can test your changes using the *script* `saladplate`,
65
+ When developing locally, you can test your changes using the _script_ `saladplate`,
66
66
  which uses `ts-node`. Note the use of `run` below, as well as the use of `--` to
67
67
  separate arguments to `npm run` from arguments to `saladplate`:
68
68
 
69
69
  ```bash
70
70
  $ npm run saladplate -- --version
71
71
 
72
- > saladplate@0.1.0 saladplate
72
+ > saladplate@0.1.2 saladplate
73
73
  > ts-node ./bin/saladplate.ts
74
74
 
75
- saladplate: version 0.1.0
75
+ saladplate: version 0.1.2
76
76
  ```
77
77
 
78
+ ### Building and publishing
79
+
80
+ To build the distributable JS:
81
+
82
+ ```bash
83
+ $ npm run build
84
+ ```
85
+
86
+ This will build to `dist/`. To publish to NPM:
87
+
88
+ ```bash
89
+ $ npm publish
90
+ ```
91
+
92
+ ### Testing
93
+
78
94
  Tests are located in `tests/` and consist of input templates `tests/*.test` and
79
95
  corresponding expected outputs `tests/*.expected`. To run tests:
80
96
 
@@ -1,2 +1,2 @@
1
- #! /usr/bin/env ts-node
1
+ #!/usr/bin/env ts-node
2
2
  export {};
@@ -1,4 +1,4 @@
1
- #! /usr/bin/env node
1
+ #!/usr/bin/env node
2
2
  "use strict";
3
3
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
4
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -75,9 +75,14 @@ function help() {
75
75
  });
76
76
  console.info("");
77
77
  }
78
+ const SALADPLATE_VERSION = "0.1.3";
78
79
  function version() {
79
- const version = process_1.default.env.npm_package_version;
80
- console.info(`${index_1.BIN}: version ${version !== null && version !== void 0 ? version : "unknown"}`);
80
+ var _a;
81
+ let version = SALADPLATE_VERSION;
82
+ if (version.startsWith("${{")) {
83
+ version = (_a = process_1.default.env.npm_package_version) !== null && _a !== void 0 ? _a : "";
84
+ }
85
+ console.info(`${index_1.BIN}: version ${version || "unknown"}`);
81
86
  }
82
87
  const parseArgs = () => {
83
88
  const { values: options, positionals: filenames } = util_1.default.parseArgs(parseArgsConfig);
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "saladplate",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Very simple templating.",
5
5
  "keywords": [
6
6
  "template",
7
7
  "templating"
8
8
  ],
9
- "main": "./dist/src/saladplate.js",
9
+ "main": "./dist/src/index.js",
10
10
  "bin": {
11
11
  "saladplate": "dist/bin/saladplate.js"
12
12
  },