marko 5.21.3 → 5.21.4

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/bin/markoc.js CHANGED
@@ -65,6 +65,15 @@ var args = require("argly")
65
65
  type: "boolean",
66
66
  description: "Only print warnings and errors"
67
67
  },
68
+ "--migrate -m": {
69
+ type: "boolean",
70
+ description:
71
+ "Run any migrations that exist for the provided template and write changes to disk"
72
+ },
73
+ "--strip-types -t": {
74
+ type: "boolean",
75
+ description: "Strip all type information from the compiled template"
76
+ },
68
77
  "--browser -b": {
69
78
  type: "boolean",
70
79
  description: "Browser output"
@@ -123,12 +132,15 @@ var isForBrowser = false;
123
132
  if (args.browser) {
124
133
  output = "dom";
125
134
  isForBrowser = true;
135
+ } else if (args.migrate) {
136
+ output = "migrate";
126
137
  }
127
138
 
128
139
  var compileOptions = {
129
140
  output: output,
130
141
  browser: isForBrowser,
131
142
  sourceOnly: false,
143
+ stripTypes: args.stripTypes,
132
144
  sourceMaps: args.sourceMaps || false,
133
145
  compilerType: "markoc",
134
146
  compilerVersion: markoPkgVersion || markocPkgVersion
@@ -325,7 +337,7 @@ if (args.clean) {
325
337
  }
326
338
 
327
339
  found[path] = true;
328
- var outPath = path + ".js";
340
+ var outPath = args.migrate ? path : path + ".js";
329
341
 
330
342
  if (!args.quiet)
331
343
  console.log(
package/docs/compiler.md CHANGED
@@ -89,6 +89,17 @@ Default: false
89
89
 
90
90
  Set to true to have the compiler provide the `ast` in it's output.
91
91
 
92
+ #### `stripTypes`
93
+
94
+ Type: `boolean|undefined`<br>
95
+ Default: undefined
96
+
97
+ Remove all typescript types from the output when `true`.
98
+ If the value is `undefined`, the default, the compiler will remove types if
99
+ the `output` option is not `source` or `migrate`.
100
+
101
+ For example to run migrations _and_ strip types you can set both `output: "migrate"` and `stripTypes: true`.
102
+
92
103
  #### `runtimeId`
93
104
 
94
105
  Type: `string`<br>
@@ -128,7 +139,7 @@ Whether source maps should be output with the compiled templates.
128
139
  #### `meta`
129
140
 
130
141
  Type: `boolean`<br>
131
- Default: `false,
142
+ Default: `false`
132
143
 
133
144
  _Deprecated_. This option inlines the metadata in the output Javascript code. Metadata should be accessed instead from the `CompileResult`.
134
145
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "5.21.3",
3
+ "version": "5.21.4",
4
4
  "license": "MIT",
5
5
  "description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
6
6
  "dependencies": {