@rhinostone/swig 2.2.0 → 2.3.0
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/HISTORY.md +5 -0
- package/ROADMAP.md +4 -0
- package/bin/swig.js +272 -87
- package/dist/swig.js +2 -2
- package/dist/swig.min.js +2 -2
- package/lib/swig.js +4 -4
- package/package.json +3 -4
- package/.changes/unreleased/.gitkeep +0 -0
- package/.changes/v0.1.2.md +0 -6
- package/.changes/v0.1.3.md +0 -6
- package/.changes/v0.1.5.md +0 -11
- package/.changes/v0.1.6.md +0 -6
- package/.changes/v0.1.7.md +0 -7
- package/.changes/v0.1.8.md +0 -7
- package/.changes/v0.1.9.md +0 -7
- package/.changes/v0.10.0.md +0 -11
- package/.changes/v0.11.0.md +0 -15
- package/.changes/v0.11.1.md +0 -6
- package/.changes/v0.11.2.md +0 -6
- package/.changes/v0.12.0.md +0 -7
- package/.changes/v0.12.1.md +0 -11
- package/.changes/v0.13.0.md +0 -8
- package/.changes/v0.13.1.md +0 -8
- package/.changes/v0.13.2.md +0 -9
- package/.changes/v0.13.3.md +0 -5
- package/.changes/v0.13.4.md +0 -5
- package/.changes/v0.13.5.md +0 -4
- package/.changes/v0.14.0.md +0 -6
- package/.changes/v0.2.0.md +0 -7
- package/.changes/v0.2.1.md +0 -6
- package/.changes/v0.2.2.md +0 -6
- package/.changes/v0.2.3.md +0 -10
- package/.changes/v0.3.0.md +0 -6
- package/.changes/v0.4.0.md +0 -11
- package/.changes/v0.5.0.md +0 -11
- package/.changes/v0.6.0.md +0 -12
- package/.changes/v0.6.1.md +0 -6
- package/.changes/v0.7.0.md +0 -7
- package/.changes/v0.8.0.md +0 -18
- package/.changes/v0.9.0.md +0 -13
- package/.changes/v0.9.1.md +0 -6
- package/.changes/v0.9.2.md +0 -6
- package/.changes/v0.9.3.md +0 -6
- package/.changes/v0.9.4.md +0 -10
- package/.changes/v1.0.0-pre1.md +0 -22
- package/.changes/v1.0.0-pre2.md +0 -18
- package/.changes/v1.0.0-pre3.md +0 -7
- package/.changes/v1.0.0-rc1.md +0 -12
- package/.changes/v1.0.0-rc2.md +0 -10
- package/.changes/v1.0.0-rc3.md +0 -7
- package/.changes/v1.0.0.md +0 -7
- package/.changes/v1.1.0.md +0 -6
- package/.changes/v1.2.0.md +0 -10
- package/.changes/v1.2.1.md +0 -4
- package/.changes/v1.2.2.md +0 -4
- package/.changes/v1.3.0.md +0 -14
- package/.changes/v1.3.2.md +0 -6
- package/.changes/v1.4.0.md +0 -13
- package/.changes/v1.4.1.md +0 -5
- package/.changes/v1.4.2.md +0 -10
- package/.changes/v1.4.3.md +0 -4
- package/.changes/v1.4.4.md +0 -6
- package/.changes/v1.4.5.md +0 -10
- package/.changes/v1.4.6.md +0 -6
- package/.changes/v1.4.7.md +0 -8
- package/.changes/v1.5.0.md +0 -4
- package/.changes/v1.6.0.md +0 -4
- package/.changes/v2.0.0-alpha.1.md +0 -4
- package/.changes/v2.0.0-alpha.2.md +0 -4
- package/.changes/v2.0.0-alpha.4.md +0 -10
- package/.changes/v2.0.0-alpha.5.md +0 -16
- package/.changes/v2.0.0-alpha.6.md +0 -4
- package/.changes/v2.0.0-alpha.7.md +0 -4
- package/.changes/v2.0.0-alpha.8.md +0 -4
- package/.changes/v2.0.0.md +0 -6
- package/.changes/v2.0.1.md +0 -8
- package/.changes/v2.1.0.md +0 -8
- package/.changes/v2.2.0.md +0 -8
- package/.playwright-mcp/console-2026-04-22T15-34-20-480Z.log +0 -2
- package/.playwright-mcp/console-2026-04-22T15-35-04-265Z.log +0 -11
- package/.playwright-mcp/console-2026-04-22T15-37-26-953Z.log +0 -1
- package/.playwright-mcp/console-2026-04-22T15-51-15-160Z.log +0 -148
- package/.playwright-mcp/console-2026-04-22T15-51-33-405Z.log +0 -74
- package/.playwright-mcp/console-2026-04-22T15-51-53-922Z.log +0 -74
- package/.playwright-mcp/console-2026-04-22T15-53-10-736Z.log +0 -74
- package/.playwright-mcp/console-2026-04-22T15-53-40-091Z.log +0 -883
- package/.playwright-mcp/console-2026-04-22T16-12-02-541Z.log +0 -74
- package/.playwright-mcp/console-2026-04-22T16-33-44-982Z.log +0 -13973
- package/.playwright-mcp/page-2026-04-22T15-34-24-524Z.yml +0 -1
- package/.playwright-mcp/page-2026-04-22T15-35-04-346Z.yml +0 -0
- package/.playwright-mcp/page-2026-04-22T15-37-27-039Z.yml +0 -5
- package/.playwright-mcp/page-2026-04-22T15-51-15-600Z.yml +0 -76
- package/.playwright-mcp/page-2026-04-22T15-51-33-605Z.yml +0 -0
- package/.playwright-mcp/page-2026-04-22T15-51-54-206Z.yml +0 -676
- package/.playwright-mcp/page-2026-04-22T15-53-11-277Z.yml +0 -632
- package/.playwright-mcp/page-2026-04-22T15-53-40-297Z.yml +0 -0
- package/.playwright-mcp/page-2026-04-22T16-12-02-855Z.yml +0 -0
- package/.playwright-mcp/page-2026-04-22T16-33-45-281Z.yml +0 -0
package/.changes/v0.12.1.md
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
[0.12.1](https://github.com/paularmstrong/swig/tree/v0.12.1) / 2012-10-05
|
|
2
|
-
-------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** More information on some parser errors
|
|
5
|
-
* **Added** indent parameter to json_encode filter to support pretty-printing.
|
|
6
|
-
* **Added** support for variables as `extends` tag parameters
|
|
7
|
-
* **Fixed** Compile errors in Android and other random browsers
|
|
8
|
-
* **Fixed** Misc documentation
|
|
9
|
-
* **Fixed** Leaking __keys variable into global scope
|
|
10
|
-
*
|
|
11
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.12.1/docs)
|
package/.changes/v0.13.0.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
[0.13.0](https://github.com/paularmstrong/swig/tree/v0.13.0) / 2012-10-20
|
|
2
|
-
-------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** Support for nested blocks! [gh-64](https://github.com/paularmstrong/swig/issues/64) [gh-129](https://github.com/paularmstrong/swig/issues/129) ([nsaun](https://github.com/nsaun))
|
|
5
|
-
* **Changed** Removed the `parentBlock` argument from tags.
|
|
6
|
-
* **Fixed** Object keys may now contain dots
|
|
7
|
-
|
|
8
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.13.0/docs)
|
package/.changes/v0.13.1.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
[0.13.1](https://github.com/paularmstrong/swig/tree/v0.13.1) / 2012-10-28
|
|
2
|
-
-------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** Macros should be preserved when using inheritence [gh-132](https://github.com/paularmstrong/swig/issues/132) ([nsaun](https://github.com/nsaun))
|
|
5
|
-
* **Fixed** bug in parent tag logic [gh-130](https://github.com/paularmstrong/swig/issues/130)
|
|
6
|
-
* **Fixed** Error messaging when parent block failed compilation [gh-129](https://github.com/paularmstrong/swig/issues/129) ([nsaun](https://github.com/nsaun))
|
|
7
|
-
|
|
8
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.13.1/docs)
|
package/.changes/v0.13.2.md
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
[0.13.2](https://github.com/paularmstrong/swig/tree/v0.13.2) / 2012-10-28
|
|
2
|
-
-------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** Allow variables, filters, arguments to span lines [gh-122](https://github.com/paularmstrong/swig/issues/122)
|
|
5
|
-
* **Changed** Throw Errors when using undefined filters [gh-115](https://github.com/paularmstrong/swig/issues/115)
|
|
6
|
-
* **Fixed** compiling files from absolute paths [gh-103](https://github.com/paularmstrong/swig/issues/103)
|
|
7
|
-
* **Fixed** Prevent global variables from being used before context variables [gh-117](https://github.com/paularmstrong/swig/issues/117)
|
|
8
|
-
|
|
9
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.13.2/docs)
|
package/.changes/v0.13.3.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
[0.13.3](https://github.com/paularmstrong/swig/tree/v0.13.3) / 2012-12-07
|
|
2
|
-
-------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** Support % (modulus) in if tags [gh-155](https://github.com/paularmstrong/swig/pull/155)
|
|
5
|
-
* **Added** Support multi-root via array [gh-143](https://github.com/paularmstrong/swig/pull/143)
|
package/.changes/v0.13.4.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
[0.13.4](https://github.com/paularmstrong/swig/tree/v0.13.4) / 2012-12-19
|
|
2
|
-
-------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** Runaway loop on missing template [gh-162](https://github.com/paularmstrong/swig/pull/162) [gh-165](https://github.com/paularmstrong/swig/pull/165)
|
|
5
|
-
* **Fixed** Allow variables in if tag conditionals to have filters with arguments [gh-167](https://github.com/paularmstrong/swig/pull/167)
|
package/.changes/v0.13.5.md
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
[0.13.5](https://github.com/paularmstrong/swig/tree/v0.13.5) / 2013-01-29
|
|
2
|
-
-------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** date filter output for 'O' when time-zone offset is negative [gh-185](https://github.com/paularmstrong/swig/pull/185)
|
package/.changes/v0.14.0.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[0.14.0](https://github.com/paularmstrong/swig/tree/v0.14.0) / 2013-06-08
|
|
2
|
-
-------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** Allow executing functions from within templates [gh-182](https://github.com/paularmstrong/swig/pull/182)
|
|
5
|
-
* **Added** New `spaceless` tag [gh-193](https://github.com/paularmstrong/swig/pull/193)
|
|
6
|
-
* **Fixed** bug when attempting to loop over nested vars with `for`. [gh-232](https://github.com/paularmstrong/swig/pull/232)
|
package/.changes/v0.2.0.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
[0.2.0](https://github.com/paularmstrong/swig/tree/v0.2.0) / 2011-09-11
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** `if` statements allow filters applied to operands.
|
|
5
|
-
* **Fixed** `for` loops allow filters applied to the object that will be iterated over.
|
|
6
|
-
|
|
7
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.2.0/docs)
|
package/.changes/v0.2.1.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[0.2.1](https://github.com/paularmstrong/swig/tree/v0.2.1) / 2011-09-13
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** Support for `else` within `if` blocks.
|
|
5
|
-
|
|
6
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.2.1/docs)
|
package/.changes/v0.2.2.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[0.2.2](https://github.com/paularmstrong/swig/tree/v0.2.2) / 2011-09-16
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** Support for `else if ...` within `if` blocks.
|
|
5
|
-
|
|
6
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.2.2/docs)
|
package/.changes/v0.2.3.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
[0.2.3](https://github.com/paularmstrong/swig/tree/v0.2.3) / 2011-09-16
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** Critical fix for negations in `if` blocks.
|
|
5
|
-
* **Added** Support for `forloop.first` in `for` blocks.
|
|
6
|
-
* **Added** Support for `forloop.last` in `for` blocks.
|
|
7
|
-
* **Added** Support for `forloop.key` in `for` blocks.
|
|
8
|
-
* **Added** Support for `{% empty %}` in `for` blocks.
|
|
9
|
-
|
|
10
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.2.3/docs)
|
package/.changes/v0.3.0.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[0.3.0](https://github.com/paularmstrong/swig/tree/v0.3.0) / 2011-09-17
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** Support for `{% set ... %}` tag.
|
|
5
|
-
|
|
6
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.3.0/docs)
|
package/.changes/v0.4.0.md
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
[0.4.0](https://github.com/paularmstrong/swig/tree/v0.4.0) / 2011-09-24
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** Macro support [docs](docs/tags.md)
|
|
5
|
-
* **Changed** Removed requirement to manually specify `locals` for express support.
|
|
6
|
-
* **Changed** Increased cache lookup speed by removing crypto dependency.
|
|
7
|
-
* **Fixed** `length` filter returns length of objects (number of keys).
|
|
8
|
-
* **Fixed** Filters return empty string unless they can apply to the given object.
|
|
9
|
-
* **Fixed** Filters will attempt to apply to all values in an object or array.
|
|
10
|
-
|
|
11
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.4.0/docs)
|
package/.changes/v0.5.0.md
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
[0.5.0](https://github.com/paularmstrong/swig/tree/v0.5.0) / 2011-09-27
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** More error messaging in some edge cases.
|
|
5
|
-
* **Added** Better error messaging including context and line numbers.
|
|
6
|
-
* **Changed** Improved compile and render speeds.
|
|
7
|
-
* **Changed** `include` tags accept context variables instead of just strings.
|
|
8
|
-
* **Changed** Templates can be compiled and rendered from an absolute path outside of the template root.
|
|
9
|
-
* **Fixed** Will not double escape output.
|
|
10
|
-
|
|
11
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.5.0/docs)
|
package/.changes/v0.6.0.md
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
[0.6.0](https://github.com/paularmstrong/swig/tree/v0.6.0) / 2011-10-02
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** `{% import foo as bar %}` tag for importing macros.
|
|
5
|
-
* **Added** Allow escaping for js in escape filter and autoescape tag.
|
|
6
|
-
* **Added** `raw` filter to force variable to not be escaped.
|
|
7
|
-
* **Added** `escape` and `e` filters to force variable to be escaped.
|
|
8
|
-
* **Added** Allow filters to accept any JS objects, arrays, strings, and context variables.
|
|
9
|
-
* **Changed** `if`, `else`, and `else if` tags support all JS-valid if-syntaxes + extra operators.
|
|
10
|
-
* **Fixed** `default` filter for undefined variables. closes gh-18
|
|
11
|
-
|
|
12
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.6.0/docs)
|
package/.changes/v0.6.1.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[0.6.1](https://github.com/paularmstrong/swig/tree/v0.6.1) / 2011-10-02
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** chaining filters when the first takes a variable as an argument will not crash parsing.
|
|
5
|
-
|
|
6
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.6.1/docs)
|
package/.changes/v0.7.0.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
[0.7.0](https://github.com/paularmstrong/swig/tree/v0.7.0) / 2011-10-05
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** `make browser` will build Swig for use in major browsers. [gh-3](https://github.com/paularmstrong/swig/issues/3)
|
|
5
|
-
* **Changed** Allow overriding `escape` filters. [gh-19](https://github.com/paularmstrong/swig/issues/19)
|
|
6
|
-
|
|
7
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.7.0/docs)
|
package/.changes/v0.8.0.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
[0.8.0](https://github.com/paularmstrong/swig/tree/v0.8.0) / 2011-11-04
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** date filter formats `z`, `W`, `t`, `L`, `o`, `B`, and `c`.
|
|
5
|
-
* **Added** New `filter` tag.
|
|
6
|
-
* **Added** Node.js compatible 0.4.1 - 0.6.X
|
|
7
|
-
* **Added** Allow setting cache globally or per-template.
|
|
8
|
-
* **Changed** Removed `swig.render` and `swig.fromString`.
|
|
9
|
-
* **Changed** `swig.fromFile` is now `swig.compileFile`.
|
|
10
|
-
* **Changed** `swig.init()` will clear template cache.
|
|
11
|
-
* **Changed** `swig.init()` is now optional for browser mode with no custom settings.
|
|
12
|
-
* **Changed** Development dependencies are be more lenient.
|
|
13
|
-
* **Fixed** Parser will properly preserver '\' escaping. [gh-24](https://github.com/paularmstrong/swig/issues/24)
|
|
14
|
-
* **Fixed** Rewrote tag argument parsing for proper space handling.
|
|
15
|
-
* **Fixed** Rewrote filter argument parsing. [gh-23](https://github.com/paularmstrong/swig/issues/23)
|
|
16
|
-
* **Fixed** Allow pipe `|` characters in filter arguments. [gh-22](https://github.com/paularmstrong/swig/issues/22)
|
|
17
|
-
|
|
18
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.8.0/docs)
|
package/.changes/v0.9.0.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
[0.9.0](https://github.com/paularmstrong/swig/tree/v0.9.0) / 2011-12-30
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** DateZ license to browser header, use link to underscore license.
|
|
5
|
-
* **Added** Timezone support in `date` filter [gh-27](https://github.com/paularmstrong/swig/issues/27).
|
|
6
|
-
* **Added** New `raw` tag.
|
|
7
|
-
* **Changed** Swig is no longer node 0.4 compatible.
|
|
8
|
-
* **Fixed** Filter `date('f')` for 10am times.
|
|
9
|
-
* **Fixed** Filter `date('r')` returns in UTC date format. This is more correct tospec RFC2822, per [php.net/date](http://php.net/date).
|
|
10
|
-
* **Fixed** Filter `add` when adding numbers/numbers+strings together.
|
|
11
|
-
* **Fixed** Tests for error messages that changed in node >0.6.0.
|
|
12
|
-
|
|
13
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.9.0/docs)
|
package/.changes/v0.9.1.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[0.9.1](https://github.com/paularmstrong/swig/tree/v0.9.1) / 2012-01-18
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** Allow multi-line tags and comments. [gh-30](https://github.com/paularmstrong/swig/issues/30)
|
|
5
|
-
|
|
6
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.9.1/docs)
|
package/.changes/v0.9.2.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[0.9.2](https://github.com/paularmstrong/swig/tree/v0.9.2) / 2012-01-23
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** Correctly reset autoescape after closing an autoescape tag. [gh-39](https://github.com/paularmstrong/swig/issues/39)
|
|
5
|
-
|
|
6
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.9.2/docs)
|
package/.changes/v0.9.3.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[0.9.3](https://github.com/paularmstrong/swig/tree/v0.9.3) / 2012-01-28
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** Allow object and array values to be accessed via context variables [gh-40](https://github.com/paularmstrong/swig/issues/40)
|
|
5
|
-
|
|
6
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.9.3/docs)
|
package/.changes/v0.9.4.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
[0.9.4](https://github.com/paularmstrong/swig/tree/v0.9.4) / 2012-02-07
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** `parent` tag would not render when called within tags [gh-41](https://github.com/paularmstrong/swig/issues/41)
|
|
5
|
-
* **Fixed** Documentation for forloop.index & forloop.key [gh-42](https://github.com/paularmstrong/swig/issues/42)
|
|
6
|
-
* **Fixed** Errors when using `include` inside base template `block` tags [gh-43](https://github.com/paularmstrong/swig/issues/43)
|
|
7
|
-
* **Fixed** Allow `set` tag to set values to numbers [gh-45](https://github.com/paularmstrong/swig/issues/45)
|
|
8
|
-
* **Fixed** `set` tag for booleans using too many checks
|
|
9
|
-
|
|
10
|
-
[Documentation](https://github.com/paularmstrong/swig/tree/v0.9.4/docs)
|
package/.changes/v1.0.0-pre1.md
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
[1.0.0-pre1](https://github.com/paularmstrong/swig/tree/v1.0.0-pre1) / 2013-08-14
|
|
2
|
-
---------------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** Completely rewritting parsing engine supports many more syntaxes and is much easier to extend.
|
|
5
|
-
* **Changed** There is no more `swig.init` method.
|
|
6
|
-
* **Changed** Custom filters can be added using `swig.addFilter`
|
|
7
|
-
* **Changed** Custom tags can be added using `swig.addTag`
|
|
8
|
-
* **Changed** Writing custom tags uses an entirely new, simplified format
|
|
9
|
-
* **Changed** Removed the underscore/lodash dependency
|
|
10
|
-
* **Changed** Template parsing has been completely rewritten
|
|
11
|
-
* **Changed** `swig.compileFile` returns a function that renders templates, not an object
|
|
12
|
-
* **Changed** Express-compatible using `swig.renderFile`.
|
|
13
|
-
* **Changed** `extends`, `import`, and `include` now reference files with relative paths from the current file.
|
|
14
|
-
* **Changed** `extends` may no longer accept variables.
|
|
15
|
-
* **Changed** `else if` tag is now `elseif` or `elif`.
|
|
16
|
-
* **Changed** Removed `only` argument from `include`.
|
|
17
|
-
* **Changed** allow `_`, `$` to start var names in templates.
|
|
18
|
-
* **Changed** Documentation is auto-generated from jsdoc comments in-files.
|
|
19
|
-
* **Added** Ability to set custom var/tag/comment controls (`{{`, `}}`, etc, can be customized).
|
|
20
|
-
* **Added** Variable/string concatenation [gh-135](https://github.com/paularmstrong/swig/issues/135).
|
|
21
|
-
* **Added** Binary application for `compile`, `run`, and `render` (Lets you pre-compile templates into JS functions for client-side delivery).
|
|
22
|
-
* **Fixed** Lots.
|
package/.changes/v1.0.0-pre2.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
[1.0.0-pre2](https://github.com/paularmstrong/swig/tree/v1.0.0-pre2) / 2013-08-18
|
|
2
|
-
---------------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** Binary: Allow --method-name to be a shortcut for --wrap-start var setting.
|
|
5
|
-
* **Changed** Make reverse filter an alias for `sort(true)`.
|
|
6
|
-
* **Added** Allow asyncronous `compileFile` and `renderFile` operations. [gh-283](https://github.com/paularmstrong/swig/issues/283)
|
|
7
|
-
* **Added** Filter: `sort`.
|
|
8
|
-
* **Added** Allow {% end[tag] tokens... %}. [gh-278](https://github.com/paularmstrong/swig/issues/278)
|
|
9
|
-
* **Added** Built source map for minified browser source.
|
|
10
|
-
* **Added** Contextual support for object method calls. [gh-275](https://github.com/paularmstrong/swig/issues/275)
|
|
11
|
-
* **Added** `parser.on('start'|'end'...` options. [gh-274](https://github.com/paularmstrong/swig/issues/274)
|
|
12
|
-
* **Added** Allow object prototypal inheritance. [gh-273](https://github.com/paularmstrong/swig/issues/273)
|
|
13
|
-
* **Fixed** Prevent circular extends. [gh-282](https://github.com/paularmstrong/swig/issues/282)
|
|
14
|
-
* **Fixed** Throw an error if reserved word is used as var. [gh-276](https://github.com/paularmstrong/swig/issues/276)
|
|
15
|
-
* **Fixed** Add filename to errors if possible. [gh-280](https://github.com/paularmstrong/swig/issues/280)
|
|
16
|
-
* **Fixed** Filters work over arrays/objects if possible. [gh-259](https://github.com/paularmstrong/swig/issues/259)
|
|
17
|
-
* **Fixed** Allow {% parent %} to work in middle parent templates. [gh-277](https://github.com/paularmstrong/swig/issues/277)
|
|
18
|
-
* **Fixed** Allow newlines in tags/vars/comments. [gh-272](https://github.com/paularmstrong/swig/issues/272)
|
package/.changes/v1.0.0-pre3.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
[1.0.0-pre3](https://github.com/paularmstrong/swig/tree/v1.0.0-pre3) / 2013-08-20
|
|
2
|
-
---------------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** Allow tags at block-level if specified. [gh-289](https://github.com/paularmstrong/swig/issues/289)
|
|
5
|
-
* **Fixed** `swig.compileFile` runs callback template is found in cache. [gh-291](https://github.com/paularmstrong/swig/issues/291)
|
|
6
|
-
* **Fixed** Accidental modification of Swig Options Object. [gh-287](https://github.com/paularmstrong/swig/issues/287)
|
|
7
|
-
* **Fixed** Preserve forward-slashes in text chunks. [gh-285](https://github.com/paularmstrong/swig/issues/285)
|
package/.changes/v1.0.0-rc1.md
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
[1.0.0-rc1](https://github.com/paularmstrong/swig/tree/v1.0.0-rc1) / 2013-08-28
|
|
2
|
-
-------------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** `include` tag now accepts `only` (and is preferred, if possible). gh-240
|
|
5
|
-
* **Added** `swig.version` and `-v` to cli
|
|
6
|
-
* **Changed** Deprecated `raw` filter. Use `safe`.
|
|
7
|
-
* **Changed** Allow `import` and `macro` tags to be outside of blocks. gh-299
|
|
8
|
-
* **Changed** Don't escape `macro` output. gh-297
|
|
9
|
-
* **Changed** (Custom) Filters can be marked as `safe` to disable auto-escaping. gh-294
|
|
10
|
-
* **Fixed** `{% for k,v ... %}` tag syntax assigned variables backwards.
|
|
11
|
-
* **Fixed** Filters being applied to empty functions throwing errors. gh-296
|
|
12
|
-
* **Fixed** `include` paths on windows. gh-295
|
package/.changes/v1.0.0-rc2.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
[1.0.0-rc2](https://github.com/paularmstrong/swig/tree/v1.0.0-rc2) / 2013-09-06
|
|
2
|
-
-------------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** Function output from `variable` blocks are no longer auto-escaped. gh-309
|
|
5
|
-
* **Fixed** Allow nested macros to work when importing. gh-310
|
|
6
|
-
* **Fixed** swig.setDefaultTZOffset. gh-311
|
|
7
|
-
* **Changed** `set` tag assigns to the local context, allowing setting within `for` loops, etc. gh-303
|
|
8
|
-
* **Fixed** Standardize variable undefined checking. gh-301
|
|
9
|
-
* **Fixed** Remove multiple redefinition of block-level tags in compiled templates.
|
|
10
|
-
* **Fixed** Performance issue with compile if no default locals are defined.
|
package/.changes/v1.0.0-rc3.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
[1.0.0-rc3](https://github.com/paularmstrong/swig/tree/v1.0.0-rc3) / 2013-09-14
|
|
2
|
-
-------------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** Allow bools in token parser by default. gh-321
|
|
5
|
-
* **Fixed** Allow variables as object values. gh-323
|
|
6
|
-
* **Fixed** Don't partially match logic words. gh-322
|
|
7
|
-
* **Fixed** Parent tag in parent's block with no local block edge case. gh-316
|
package/.changes/v1.0.0.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
[1.0.0](https://github.com/paularmstrong/swig/tree/v1.0.0) / 2013-09-23
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** Allow parent and other tags to work correctly nested in other tags. gh-331
|
|
5
|
-
* **Fixed** Prevent lexer from matching partial logic/words in variables. gh-330
|
|
6
|
-
|
|
7
|
-
Migrating from v0.x.x? The upstream wiki has since been deleted; see the individual breaking-change entries below.
|
package/.changes/v1.1.0.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[1.1.0](https://github.com/paularmstrong/swig/tree/v1.1.0) / 2013-10-02
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** Allow logic in default parsing. gh-326
|
|
5
|
-
* **Fixed** Error when attempting to wrap spaceless tag around macro/function output. gh-336
|
|
6
|
-
* **Fixed** Don't overwrite keys on the locals object. gh-337
|
package/.changes/v1.2.0.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
[1.2.0](https://github.com/paularmstrong/swig/tree/v1.2.0) / 2013-12-01
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** Filepath parameter can be passed to swig.run to allow extends in-browser. gh-349
|
|
5
|
-
* **Changed** Use local-context first for var lookups. gh-344, gh-347
|
|
6
|
-
* **Changed** Allow DOTKEY after functions/objects/filters. gh-355
|
|
7
|
-
* **Changed** Context of for-tags carries into includes. gh-356
|
|
8
|
-
* **Changed** When a callback is passed into compileFile, catch all errors thrown by compile and pass the error to callback. gh-340
|
|
9
|
-
* **Fixed** Instances of Swig retain their options properly. gh-351
|
|
10
|
-
* **Fixed** Fix misc documentation issues. gh-359, gh-358
|
package/.changes/v1.2.1.md
DELETED
package/.changes/v1.2.2.md
DELETED
package/.changes/v1.3.0.md
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
[1.3.0](https://github.com/paularmstrong/swig/tree/v1.3.0) / 2014-01-20
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** Removed official node v0.8.x support
|
|
5
|
-
* **Added** Custom template loader support. gh-377, gh-384, gh-382
|
|
6
|
-
* **Added** Ability to set root path using template loaders. gh-382, gh-293
|
|
7
|
-
* **Added** CLI now accepts custom filter and tag arguments. gh-391
|
|
8
|
-
* **Added** Allow `set` tag to set keys on objects with bracket and dot-notation. gh-388
|
|
9
|
-
* **Added** `groupBy` filter from swig-extras. gh-383
|
|
10
|
-
* **Fixed** `swig.run` `filepath` arg is always optional. gh-402
|
|
11
|
-
* **Fixed** Filters on non-empty functions apply correctly. gh-397
|
|
12
|
-
* **Fixed** Filters applied to functions w/ & w/o dotkeys. gh-365
|
|
13
|
-
* **Fixed** `date` filter `N` option returns correct number. gh-375
|
|
14
|
-
* **Fixed** Ensure getting parent template checks cache if on. gh-378
|
package/.changes/v1.3.2.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[1.3.2](https://github.com/paularmstrong/swig/tree/v1.3.2) / 2014-01-27
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** `for` loop variables on objects. gh-409
|
|
5
|
-
* **Fixed** Misc. IE8 fixes. gh-410
|
|
6
|
-
* **Fixed** `include` files when loaders have base paths. gh-407
|
package/.changes/v1.4.0.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
[1.4.0](https://github.com/paularmstrong/swig/tree/v1.4.0) / 2014-07-03
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** Allow variable tokens to start with `$`. gh-455
|
|
5
|
-
* **Changed** `fs` loader should take `cwd` as default base path. gh-419
|
|
6
|
-
* **Changed** handle errors which occur at the time of rendering. gh-417
|
|
7
|
-
* **Changed** default options in bin (`varControls`, `tagControls`, `cmtControls`). gh-415
|
|
8
|
-
* **Changed** `null` should yield empty string when resolving variable. gh-408
|
|
9
|
-
* **Added** Escape character for `date` filter argument. gh-427, gh-432
|
|
10
|
-
* **Added** Make `if` and `elseif` throw a better error message when a tag body is omitted. gh-425
|
|
11
|
-
* **Fixed** don't throw errors on accessing property of `null` object. gh-471
|
|
12
|
-
* **Fixed** `loop` variables work correctly in nested loops. gh-433
|
|
13
|
-
* **Fixed** Some IE8 compatibility (require es5). gh-428
|
package/.changes/v1.4.1.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
[1.4.1](https://github.com/paularmstrong/swig/tree/v1.4.1) / 2014-07-03
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** `macro` argument names colliding with context variable names. gh-457
|
|
5
|
-
* **Fixed** filter chaining within tags. gh-441
|
package/.changes/v1.4.2.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
[1.4.2](https://github.com/paularmstrong/swig/tree/v1.4.2) / 2014-08-04
|
|
2
|
-
-----------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** Report JS parse errors with template filenames. gh-492
|
|
5
|
-
* **Fixed** Ensure block-level tags (`set`, etc) are parsed in correct order. gh-495
|
|
6
|
-
* **Fixed** Ensure import tag uses current Swig instance's loader. gh-421, gh-503
|
|
7
|
-
* **Fixed** Allow disabling cache on compile/render functions directly. gh-423
|
|
8
|
-
* **Fixed** Ensure compilation does not leak global variables. gh-496
|
|
9
|
-
* **Fixed** Fix for-loops to run on strings. gh-478, gh-479
|
|
10
|
-
* **Fixed** Allow macro output to be assigned using `set` tag. gh-499, gh-502
|
package/.changes/v1.4.3.md
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
[1.4.3](https://github.com/gina-io/swig/tree/v1.4.3) / 2026-04-09
|
|
2
|
-
-----------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Security** Pin `minimist` to `^1.2.8` via npm `overrides` to close CVE-2021-44906 (prototype pollution reachable through `swig` → `optimist@0.6.1` → `minimist@~0.0.1`). Requires npm >= 8.3 to honour the override. gh-swig-cve-2021-44906
|
package/.changes/v1.4.4.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[1.4.4](https://github.com/gina-io/swig/tree/v1.4.4) / 2026-04-10
|
|
2
|
-
-----------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** Replace uglify-js with terser in the Makefile build target -- make build now works on Node >= 14
|
|
5
|
-
|
|
6
|
-
* **Security** Block __proto__, constructor, and prototype access in template variables and set-tag assignments to prevent prototype-chain traversal and arbitrary code execution (CVE-2023-25345)
|
package/.changes/v1.4.5.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
[1.4.5](https://github.com/gina-io/swig/tree/v1.4.5) / 2026-04-10
|
|
2
|
-
-----------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** GitHub Actions CI workflow (lint + test on PRs and pushes)
|
|
5
|
-
|
|
6
|
-
* **Added** Public roadmap (`ROADMAP.md`)
|
|
7
|
-
|
|
8
|
-
* **Changed** Clean up legacy `paularmstrong` references in documentation
|
|
9
|
-
|
|
10
|
-
* **Security** Replace `optimist` with `yargs` in CLI, removing `minimist` from the production dependency tree entirely (CVE-2021-44906 fully resolved)
|
package/.changes/v1.4.6.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[1.4.6](https://github.com/gina-io/swig/tree/v1.4.6) / 2026-04-10
|
|
2
|
-
-----------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** Exclude `.github/` from npm tarball
|
|
5
|
-
|
|
6
|
-
* **Changed** Replace `uglify-js` with `terser` in CLI (`--minify` flag), removing the last Snyk-flagged runtime dependency (ReDoS, CVE in uglify-js@2.4)
|
package/.changes/v1.4.7.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
[1.4.7](https://github.com/gina-io/swig/tree/v1.4.7) / 2026-04-10
|
|
2
|
-
-----------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** Upgrade `yargs` from 3.x to 17.x, replacing unmaintained transitive dependencies (`os-locale`, `window-size`, `number-is-nan`, `ansi-regex@2`, etc.) with actively maintained equivalents
|
|
5
|
-
|
|
6
|
-
* **Changed** Update `engines` field to `node >= 12` (reflects actual minimum required by `terser` and `yargs` 17)
|
|
7
|
-
|
|
8
|
-
* **Fixed** Replace private IP address (`192.168.0.2`) with `localhost:11211` in JSDoc example for template loaders
|
package/.changes/v1.5.0.md
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
[1.5.0](https://github.com/gina-io/swig/tree/v1.5.0) / 2026-04-12
|
|
2
|
-
-----------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Security** Extended CVE-2023-25345 guards to bracket-notation access (`foo["__proto__"]`), for-loop variables, macro names, and import aliases. All five gaps now rejected at parse time.
|
package/.changes/v1.6.0.md
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
[1.6.0](https://github.com/gina-io/swig/tree/v1.6.0) / 2026-04-13
|
|
2
|
-
-----------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** `swig compile --recursive <dir>` walks a directory and emits a single AOT bundle module mapping relative paths to compiled template functions. Honours optional `--ext` extension filter; conflicts with `--method-name` / `--wrap-start` / `--wrap-end`. `extends` / `include` / `import` are still resolved at render time through the consumer's loader.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
[2.0.0-alpha.1](https://github.com/gina-io/swig/tree/v2.0.0-alpha.1) / 2026-04-14
|
|
2
|
-
---------------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** First release on the 2.0.0 track. Internals carved into `@rhinostone/swig-core` (Phase 1). No user-visible API changes vs 1.6.0 — same entry points, same compiled output, same test suite.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
[2.0.0-alpha.2](https://github.com/gina-io/swig/tree/v2.0.0-alpha.2) / 2026-04-15
|
|
2
|
-
---------------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** Phase 2 of the multi-flavor architecture: native frontend now compiles source → IR → backend. All built-in tags (`autoescape`, `filter`, `if`/`elseif`/`else`, `for`, `set`, `block`/`extends`/`parent`, `include`, `import`, `macro`) emit structured IR nodes; `IRLegacyJS` preserves the JS-string `compile` path for userland `setTag` consumers. TokenParser expression-level codegen migrated to IRExpr — every `{{ … }}` output site lowers through `parseOutput` + `parseExpr` (Pratt parser), with a structured fallback to `IRLegacyJS` for shapes the flat IR cannot represent. Filter chains, deep-filter compositions (`{{ a|f(b|g) }}`), and per-operand filter precedence (`{{ a|upper + b|lower }}`) all route through IR via the new `IRFilterCallExpr`. Internal-only carve; no user-visible API changes vs `2.0.0-alpha.1` — same entry points, same compiled-output semantics, all 7 CVE-2023-25345 + 1 CVE-2021-44906 regressions remain green. 526 → 673 Node tests (added IR + parseExpr + parseOutput acceptance suites).
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
[2.0.0-alpha.4](https://github.com/gina-io/swig/tree/v2.0.0-alpha.4) / 2026-04-18
|
|
2
|
-
---------------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** `@rhinostone/swig-twig` gains the `{{ x|date(format[, offset[, abbr]]) }}` filter. Accepts a `Date`, epoch-ms number, or date-compatible string; format spec matches PHP `date()` (backslash escapes literal characters). Wraps the shared `@rhinostone/swig-core/lib/dateformatter`, so `swig.setDefaultTZOffset` applies in Twig templates too. Twig-native `DateTime` / `DateInterval` inputs, timezone-string arguments, and locale-aware month/day names are Phase 4 concerns — today the filter surface matches native swig `date` verbatim.
|
|
5
|
-
|
|
6
|
-
* **Fixed** `@rhinostone/swig@2.0.0-alpha.2` was unusable as a Node consumer — it relied on `@rhinostone/swig-core` at runtime but did not declare the dependency, so a fresh `npm install @rhinostone/swig@alpha` failed with `Cannot find module '@rhinostone/swig-core'`. `2.0.0-alpha.3` adds an exact-version pin (`"@rhinostone/swig-core": "2.0.0-alpha.3"`) and ships all three packages (`@rhinostone/swig-core`, `@rhinostone/swig`, `@rhinostone/swig-twig`) in lockstep. `@rhinostone/swig@2.0.0-alpha.2` has been deprecated on the registry pointing users at alpha.3.
|
|
7
|
-
|
|
8
|
-
* **Changed** Internal carve — `lib/dateformatter.js` moved into `@rhinostone/swig-core/lib/dateformatter`. The old path stays as a shim so every existing `require('./dateformatter')` consumer (including `lib/swig.js` and `lib/filters.js`) resolves to the same exports object via Node's module cache. `swig.setDefaultTZOffset` continues to mutate the shared `tzOffset` binding. No user-visible change.
|
|
9
|
-
|
|
10
|
-
* **Changed** `@rhinostone/swig-twig` soft-deprecates the legacy `exports.parse(source, options)` Path B wrapper. Calling it still returns a parse-tree shape (`{ name, parent, tokens, blocks }`) for backwards compatibility, but emits a one-shot `console.warn` on first invocation. Slated for removal in `2.0.0` stable. Migrate to `new twig.Twig(opts)` and the per-instance `precompile` / `compile` / `render` API installed by `engine.install` — the full-instance path uses closure-captured tag/filter maps and honors `setFilter` / `setTag` overrides, which the Path B wrapper does not.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
[2.0.0-alpha.5](https://github.com/gina-io/swig/tree/v2.0.0-alpha.5) / 2026-04-19
|
|
2
|
-
---------------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** `@rhinostone/swig-core` gains an `IRVarRefExists` IR node + backend emitter carrying a boolean defined-and-non-null signal for VarRef paths. Needed by Twig `is defined` / `is null` tests and by `??` undefined-fallback, both of which cannot use `IRVarRef` directly because `emitVarRef` coerces missing / `null` to `""`. `ir.varRefExists()` factory on the shared IR surface; `emitVarRefExists` dispatches in `emitExpr` and honors the `_dangerousProps` guard per segment. `checkDot` hoisted out of `checkMatchExpr` into a top-level `checkDotExpr` helper so `emitVarRef` and `emitVarRefExists` share the dot-walk shape; `checkMatchExpr`-emitted output stays byte-identical.
|
|
5
|
-
|
|
6
|
-
* **Added** `@rhinostone/swig-twig` `is <test>` / `is not <test>` now routes through `_ext._test_<name>(subject, ...args)`. VarRef subjects with `is defined` / `is null` special-case through `IRVarRefExists` to preserve the defined-or-not-null signal `emitVarRef` would otherwise coerce to `""`. Seven built-in test helpers ship at `packages/swig-twig/lib/tests/index.js` and register on every `Twig` instance via `setExtension`: `defined`, `null`, `empty`, `iterable`, `odd`, `even`, `divisibleby`. Closes the last Phase 4 runtime-parity gap on the render corpus — 11 new `is-*` render fixtures + a `null-coalesce` fixture exercising both branches land under `tests/swig-twig/cases/`.
|
|
7
|
-
|
|
8
|
-
* **Added** `@rhinostone/swig-twig` `..` range operator now lowers through `_utils.range`. Previously the parser lowered to an IR varRef of `_range`, which resolved to `_ctx._range` and silently fell through to `_fn` (returning `""`). Now emits `ir.fnCall(ir.varRef([_utils, range]), [start, end])`; the shared `@rhinostone/swig-core` backend reaches `_utils` via the 4th positional arg of the compiled template function. `@rhinostone/swig-core/lib/utils.js` adds `range(start, end)` with Twig-compatible inclusive-both-ends semantics for numeric + single-char-string bounds (ascending and descending). Three new render fixtures (`range-asc`, `range-desc`, `range-char`) under `tests/swig-twig/cases/`.
|
|
9
|
-
|
|
10
|
-
* **Added** `@rhinostone/swig-twig` end-to-end render-fixture suite at `tests/swig-twig/cases/` (19 `*.test.twig` + `.expectation.html` pairs across operators, Twig-specific tags, filter semantics, and multi-template flows), walked by `tests/swig-twig/templates.test.js`.
|
|
11
|
-
|
|
12
|
-
* **Fixed** `@rhinostone/swig-core` backend now routes Twig / Jinja2 `??` undefined-fallback through `IRVarRefExists` for VarRef LHS, matching Twig-strict semantics (fallback on undefined OR missing property). Before the fix `{{ foo ?? "x" }}` always returned `""` because `emitVarRef` coerces missing paths to `""`, and JavaScript's native `??` only triggers on `null` / `undefined` — the empty-string output was never falsy enough to trip the right-hand expression. `emitBinaryOp` now special-cases VarRef LHS adjacent to `~` and `in`: re-uses the already-emitted `left` string wrapped in an `IRVarRefExists`-gated ternary. Non-VarRef LHS (FnCall, FilterCall, Literal) falls through to bare `left??right` — those emitters do not coerce missing → `""`, so JS-native `??` is sufficient.
|
|
13
|
-
|
|
14
|
-
* **Fixed** `@rhinostone/swig-twig` parser now routes STRING and NUMBER literal LHS through `parsePostfix`, so filter chains like `{{ "hi"|upper }}` and `{{ 42|json_encode }}` parse correctly instead of bailing with `Unexpected token "<filter>"`.
|
|
15
|
-
|
|
16
|
-
* **Fixed** `@rhinostone/swig-core` backend now lowers Twig/Jinja2 `~` (string-concat) to `(String(left) + String(right))`. Bare `<left>~<right>` emission was JS unary bitwise-NOT and threw `SyntaxError` at compile time.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
[2.0.0-alpha.6](https://github.com/gina-io/swig/tree/v2.0.0-alpha.6) / 2026-04-20
|
|
2
|
-
---------------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Added** README.md files for @rhinostone/swig-core and @rhinostone/swig-twig so the npm landing pages and socket.dev have orientation content describing the alpha status, the shared-runtime relationship, and the supported Twig surface. Metadata-only release; no functional changes since 2.0.0-alpha.5.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
[2.0.0-alpha.7](https://github.com/gina-io/swig/tree/v2.0.0-alpha.7) / 2026-04-20
|
|
2
|
-
---------------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** Source-comment cleanup pass across the workspace. No functional or API changes since 2.0.0-alpha.5; this is a metadata-only republish with commit messages and source comments tidied. Supersedes 2.0.0-alpha.6 (unpublished).
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
[2.0.0-alpha.8](https://github.com/gina-io/swig/tree/v2.0.0-alpha.8) / 2026-04-20
|
|
2
|
-
---------------------------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Changed** `@rhinostone/swig-twig` removes the soft-deprecated `exports.parse(source, options)` wrapper (Path B). Soft-deprecated since `2.0.0-alpha.4`; removed now so any remaining consumer surfaces during the alpha.8 bake window before `2.0.0` stable. Migrate to the per-instance API installed by `engine.install`: `new twig.Twig(opts)` (or the default instance `exports.precompile` / `exports.compile` / `exports.render` / `exports.renderFile`). The full-instance path uses closure-captured tag/filter maps and honors per-instance `setFilter` / `setTag` overrides; the Path B wrapper did not. Internal plumbing (`exports.parser.parse`, `exports.parseFile`) is unaffected.
|
package/.changes/v2.0.0.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[2.0.0](https://github.com/gina-io/swig/tree/v2.0.0) / 2026-05-06
|
|
2
|
-
-----------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** Refreshed stale external URL references across documentation surfaces from the 2026-04-13 link-health audit (gina-io/gina#18). `README.md`, `packages/swig-core/README.md`, `packages/swig-twig/README.md` — swapped `www.npmjs.org` for the canonical `www.npmjs.com` in the NPM badges (the old `.org` form now redirects). `README.md` — rewrote the "Swig v0.x → v1.x migration notes" bullet, since the `paularmstrong/swig/wiki/Migrating-from-...` page was deleted upstream (302s to repo root). `HISTORY.md` — dropped the three dead upstream-wiki links around the v1.0.0 / v1.0.0-pre1 entries; the breaking-change prose stays intact. `browser/comments.js` — updated the DateZ `@license` URL from `TomoUniversalis/DateZ` to `ocrybit/DateZ` (the upstream GitHub user was renamed). `packages/swig-core/lib/dateformatter.js` — dropped the dead `http://tomouniversalis.com` parenthetical from the DateZ copyright comment (domain NXDOMAINs). `.changes/v1.0.0.md` and `.changes/v1.0.0-pre1.md` synced to match the rewritten `HISTORY.md` lines so future `changie merge` runs stay idempotent. Documentation and comment-only; no runtime or API change.
|
|
5
|
-
|
|
6
|
-
* **Changed** `2.0.0` stable. Multi-flavor architecture (introduced across `2.0.0-alpha.1` through `2.0.0-alpha.5`) is the production-ready cut. No functional or API changes since `2.0.0-alpha.5`; the `alpha.6`–`alpha.8` cycle was metadata republishes plus removal of the soft-deprecated `exports.parse` Path B wrapper from `@rhinostone/swig-twig`. IR ABI is stable from this release onward; cross-package dependencies pin exact versions and frontends + core release in lockstep. README messaging refreshed across all three packages to reflect production-ready status; package descriptions cleaned of historical internal-tracking references.
|
package/.changes/v2.0.1.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
[2.0.1](https://github.com/gina-io/swig/tree/v2.0.1) / 2026-05-10
|
|
2
|
-
-----------------------------------------------------------------
|
|
3
|
-
|
|
4
|
-
* **Fixed** Fixed bracket-access expressions failing on unspaced binary arithmetic in both `@rhinostone/swig` and `@rhinostone/swig-twig`. The lexer NUMBER rule's optional sign prefix (`[+\-]?`) greedy-ate a leading operator inside bracket expressions — `arr[arr.length-1]` and `arr[idx-1]` lexed as VAR + DOTKEY/VAR + NUMBER(-1) + `]`, and parsePostfix then bailed with "Unexpected closing square bracket". Dropped the optional sign from both `lib/lexer.js` and `packages/swig-twig/lib/lexer.js`; parsePrimary's OPERATOR branch already wraps unary `-` / `+` as IRUnaryOp via parseUnary, so signed-literal paths (`{% set x = -5 %}`, `{{ a + -5 }}`) continue to work and the backend's emitUnaryOp produces byte-identical JS for negative numbers (the `emit('-1.5') === '-1.5'` round-trip is unchanged). Three pre-existing parse/lexer assertions documented the old "NUMBER rule, not UnaryOp" choice and were rewritten to assert the new IRUnaryOp shape; a regression suite covers `arr[arr.length-1]` / `arr[idx-1]` / `arr[idx+0]` / `arr[idx-2]` plus a `*` / `/` round-trip sweep on both render surfaces.
|
|
5
|
-
|
|
6
|
-
* **Fixed** Fixed missing whitespace-control parity in `@rhinostone/swig-twig`. `{{- … -}}` and `{%- … -%}` markers now strip surrounding whitespace at chunk boundaries, matching the native swig surface and the upstream Twig spec. Previously absent — `packages/swig-twig/lib/parser.js` had only a basic strip regex and no `varStripBefore` / `*After` / `tagStripBefore` / `*After` detection regexes, so `{{- foo -}}` either rendered as junk or threw "Unexpected end of expression". Implementation mirrors the native chunk-boundary pattern (`stripPrev` / `stripNext` flags, `stripPrevToken` helper) with the corrected strip-regex shape baked in from day one (`-?` adjacent to the open / close marker only, not after `\s*`), so negative-literal expressions like `{{ -5 }}` and `{{- -5 -}}` compose correctly. New `tests/swig-twig/whitespace.test.js` covers the six mirror-of-native cases (strips before / after / both, on `{{...}}` and `{%...%}`) plus four negative-literal composition cases. Same one-level-deep limitation as native — a `{%- endif %}` strips the trailing whitespace of the immediately enclosing tag's last child only, not deeper.
|
|
7
|
-
|
|
8
|
-
* **Fixed** Fixed `varStrip` / `tagStrip` regexes in `lib/parser.js` greedy-eating the leading `-` of negative-number expressions. The strip patterns were `^{{-?\s*-?|-?\s*-?}}$` (and the tag-form equivalent) — the second `-?` after `\s*` matched the leading `-` of an expression as if it were a whitespace-control marker, so `{{ -5 }}` and `{{ -1.5 }}` rendered as `"5"` / `"1.5"` (the sign was eaten before the lexer ever saw the chunk). Dropped the inner `-?` from both regexes; whitespace-control now fires only when `-` is immediately adjacent to the open / close marker (`{{-`, `-}}`, `{%-`, `-%}`), matching the standard Twig/Jinja2 contract. Existing whitespace strip-control tests continue to pass, and a new regression case covers negative literals plain, with strip-control before / after / both, plus a check that strip-control on regular variables still composes correctly. `@rhinostone/swig-twig` was unaffected — its parser-side strip regex (`packages/swig-twig/lib/parser.js`) is a simpler `^{{ \s*|\s* }}$` with no `-?` markers, so the same shape doesn't apply (a side-effect of the verification surfaced that swig-twig has no whitespace-control support today; tracked separately).
|