From 0d2a93f0f431d950248eeed32e32ce071bd56633 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Tue, 25 Jun 2024 20:26:34 +0900 Subject: [PATCH] fix: cannot resolve vue-i18n and petite-vue-i18n in monorepo --- package.json | 2 +- .../__snapshots__/codegen.test.ts.snap | 12 +- .../generator/__snapshots__/js.test.ts.snap | 168 ++--- .../generator/__snapshots__/json.test.ts.snap | 330 ++++----- .../__snapshots__/json5.test.ts.snap | 110 +-- .../generator/__snapshots__/yaml.test.ts.snap | 212 +++--- packages/unplugin-vue-i18n/package.json | 1 + packages/unplugin-vue-i18n/src/utils/index.ts | 1 + packages/unplugin-vue-i18n/src/utils/pkg.ts | 139 ++++ .../unplugin-vue-i18n/src/utils/resolver.ts | 13 +- .../test/fixtures/packages/no-pkg/.gitkeep | 0 .../test/fixtures/packages/package.json | 4 + .../test/fixtures/packages/pkg1/package.json | 4 + packages/unplugin-vue-i18n/test/pkg.test.ts | 37 + .../__snapshots__/custom-block.test.ts.snap | 4 +- .../translation-directive.test.ts.snap | 100 +-- .../__snapshots__/custom-block.test.ts.snap | 4 +- pnpm-lock.yaml | 677 +++++++++++++++--- 18 files changed, 1258 insertions(+), 560 deletions(-) create mode 100644 packages/unplugin-vue-i18n/src/utils/pkg.ts create mode 100644 packages/unplugin-vue-i18n/test/fixtures/packages/no-pkg/.gitkeep create mode 100644 packages/unplugin-vue-i18n/test/fixtures/packages/package.json create mode 100644 packages/unplugin-vue-i18n/test/fixtures/packages/pkg1/package.json create mode 100644 packages/unplugin-vue-i18n/test/pkg.test.ts diff --git a/package.json b/package.json index 7becf1b..958dbf3 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "ts-jest": "^27.0.5", "typescript": "^4.9.3", "vite": "^4.4.9", - "vitest": "^0.34.0", + "vitest": "^1.6.0", "vue": "^3.2.25", "vue-i18n": "next", "vue-loader": "^16.3.0", diff --git a/packages/bundle-utils/test/generator/__snapshots__/codegen.test.ts.snap b/packages/bundle-utils/test/generator/__snapshots__/codegen.test.ts.snap index ffd2672..7d004ce 100644 --- a/packages/bundle-utils/test/generator/__snapshots__/codegen.test.ts.snap +++ b/packages/bundle-utils/test/generator/__snapshots__/codegen.test.ts.snap @@ -57,7 +57,7 @@ exports[`generateMessageFunction > development 1`] = ` "start": 0, "type": 0, }, - "code": "(()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello\\"])};fn.source=\\"hello\\";return fn;})()", + "code": "(()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello"])};fn.source="hello";return fn;})()", "errors": [], "map": { "mappings": "mEAAAA", @@ -75,9 +75,9 @@ exports[`generateMessageFunction > development 1`] = ` } `; -exports[`generateMessageFunction > escapeHtml > default: should not be escaped 1`] = `"(()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"

hello

\\"])};fn.source=\\"

hello

\\";return fn;})()"`; +exports[`generateMessageFunction > escapeHtml > default: should not be escaped 1`] = `"(()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["

hello

"])};fn.source="

hello

";return fn;})()"`; -exports[`generateMessageFunction > escapeHtml > true: should be escaped 1`] = `"(()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"<p>hello</p>\\"])};fn.source=\\"

hello

\\";return fn;})()"`; +exports[`generateMessageFunction > escapeHtml > true: should be escaped 1`] = `"(()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["<p>hello</p>"])};fn.source="

hello

";return fn;})()"`; exports[`generateMessageFunction > production 1`] = ` { @@ -136,7 +136,7 @@ exports[`generateMessageFunction > production 1`] = ` "start": 0, "type": 0, }, - "code": "(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello\\"])}", + "code": "(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello"])}", "errors": [], "map": undefined, } @@ -199,7 +199,7 @@ exports[`generateResourceAst > development 1`] = ` "start": 0, "type": 0, }, - "code": "{\\"type\\":0,\\"start\\":0,\\"end\\":5,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":6,\\"offset\\":5},\\"source\\":\\"hello\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":5,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":6,\\"offset\\":5}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":5,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":6,\\"offset\\":5}},\\"value\\":\\"hello\\"}]}}", + "code": "{"type":0,"start":0,"end":5,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":6,"offset":5},"source":"hello"},"body":{"type":2,"start":0,"end":5,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":6,"offset":5}},"items":[{"type":3,"start":0,"end":5,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":6,"offset":5}},"value":"hello"}]}}", "errors": [], "map": undefined, } @@ -219,7 +219,7 @@ exports[`generateResourceAst > production 1`] = ` }, "t": 0, }, - "code": "{\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"hello\\"}}", + "code": "{"t":0,"b":{"t":2,"i":[{"t":3}],"s":"hello"}}", "errors": [], "map": undefined, } diff --git a/packages/bundle-utils/test/generator/__snapshots__/js.test.ts.snap b/packages/bundle-utils/test/generator/__snapshots__/js.test.ts.snap index 431eedb..c9983d3 100644 --- a/packages/bundle-utils/test/generator/__snapshots__/js.test.ts.snap +++ b/packages/bundle-utils/test/generator/__snapshots__/js.test.ts.snap @@ -2,7 +2,7 @@ exports[`'allowDynamic' option > generate > code 1`] = ` "const resource = { - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"こんにちは\\"])};fn.source=\\"こんにちは\\";return fn;})() + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["こんにちは"])};fn.source="こんにちは";return fn;})() } export default resource" `; @@ -194,13 +194,13 @@ Node { exports[`AST code generation > code 1`] = ` "const resource = { - \\"hi\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"hi there!\\"}}, - \\"hello\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"hello world!\\"}}, - \\"named\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3,\\"v\\":\\"hi, \\"},{\\"t\\":4,\\"k\\":\\"name\\"},{\\"t\\":3,\\"v\\":\\" !\\"}]}}, - \\"list\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3,\\"v\\":\\"hi, \\"},{\\"t\\":5,\\"i\\":0},{\\"t\\":3,\\"v\\":\\" !\\"}]}}, - \\"literal\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3},{\\"t\\":9},{\\"t\\":3}],\\"s\\":\\"hi, kazupon !\\"}}, - \\"linked\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3,\\"v\\":\\"hi, \\"},{\\"t\\":6,\\"k\\":{\\"t\\":7,\\"v\\":\\"name\\"}},{\\"t\\":3,\\"v\\":\\" !\\"}]}}, - \\"plural\\": {\\"t\\":0,\\"b\\":{\\"t\\":1,\\"c\\":[{\\"t\\":2,\\"i\\":[{\\"t\\":6,\\"k\\":{\\"t\\":9,\\"v\\":\\"no apples\\"},\\"m\\":{\\"t\\":8,\\"v\\":\\"caml\\"}}]},{\\"t\\":2,\\"i\\":[{\\"t\\":5,\\"i\\":0},{\\"t\\":3,\\"v\\":\\" apple\\"}]},{\\"t\\":2,\\"i\\":[{\\"t\\":4,\\"k\\":\\"n\\"},{\\"t\\":3,\\"v\\":\\" apples\\"}]}]}} + "hi": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"hi there!"}}, + "hello": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"hello world!"}}, + "named": {"t":0,"b":{"t":2,"i":[{"t":3,"v":"hi, "},{"t":4,"k":"name"},{"t":3,"v":" !"}]}}, + "list": {"t":0,"b":{"t":2,"i":[{"t":3,"v":"hi, "},{"t":5,"i":0},{"t":3,"v":" !"}]}}, + "literal": {"t":0,"b":{"t":2,"i":[{"t":3},{"t":9},{"t":3}],"s":"hi, kazupon !"}}, + "linked": {"t":0,"b":{"t":2,"i":[{"t":3,"v":"hi, "},{"t":6,"k":{"t":7,"v":"name"}},{"t":3,"v":" !"}]}}, + "plural": {"t":0,"b":{"t":1,"c":[{"t":2,"i":[{"t":6,"k":{"t":9,"v":"no apples"},"m":{"t":8,"v":"caml"}}]},{"t":2,"i":[{"t":5,"i":0},{"t":3,"v":" apple"}]},{"t":2,"i":[{"t":4,"k":"n"},{"t":3,"v":" apples"}]}]}} } export default resource" `; @@ -210,15 +210,15 @@ exports[`array basic > code 1`] = ` const _Component = Component _Component.__i18n = _Component.__i18n || [] _Component.__i18n.push({ - \\"locale\\": \\"\\", - \\"resource\\": { - \\"foo\\": [ + "locale": "", + "resource": { + "foo": [ [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"bar\\"])};fn.source=\\"bar\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["bar"])};fn.source="bar";return fn;})(), ], [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"baz\\"])};fn.source=\\"baz\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["baz"])};fn.source="baz";return fn;})(), ] ] @@ -242,25 +242,25 @@ exports[`array mixed > code 1`] = ` const _Component = Component _Component.__i18n = _Component.__i18n || [] _Component.__i18n.push({ - \\"locale\\": \\"\\", - \\"resource\\": { - \\"foo\\": [ + "locale": "", + "resource": { + "foo": [ { - \\"foo\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"foo\\"])};fn.source=\\"foo\\";return fn;})() + "foo": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["foo"])};fn.source="foo";return fn;})() }, [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"bar\\"])};fn.source=\\"bar\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["bar"])};fn.source="bar";return fn;})(), [ { - \\"foo\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"foo\\"])};fn.source=\\"foo\\";return fn;})() + "foo": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["foo"])};fn.source="foo";return fn;})() }, - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hoge\\"])};fn.source=\\"hoge\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hoge"])};fn.source="hoge";return fn;})(), ] ], - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"baz\\"])};fn.source=\\"baz\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["baz"])};fn.source="baz";return fn;})(), [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"buz\\"])};fn.source=\\"buz\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["buz"])};fn.source="buz";return fn;})(), ] ] @@ -281,7 +281,7 @@ exports[`array mixed > map 1`] = ` exports[`bare > code 1`] = ` "{ - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello world!\\"])};fn.source=\\"hello world!\\";return fn;})() + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello world!"])};fn.source="hello world!";return fn;})() }" `; @@ -296,32 +296,32 @@ exports[`bare > map 1`] = ` exports[`complex > code 1`] = ` "const resource = { - \\"hi\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hi there!\\"])};fn.source=\\"hi there!\\";return fn;})(), - \\"nested\\": { - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello world!\\"])};fn.source=\\"hello world!\\";return fn;})(), - \\"more\\": { - \\"plural\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked(\\"no apples\\", \\"caml\\", _type)]), _normalize([_interpolate(_list(0)), \\" apple\\"]), _normalize([_interpolate(_named(\\"n\\")), \\" apples\\"])])};fn.source=\\"@.caml:{'no apples'} | {0} apple | {n} apples\\";return fn;})() + "hi": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hi there!"])};fn.source="hi there!";return fn;})(), + "nested": { + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello world!"])};fn.source="hello world!";return fn;})(), + "more": { + "plural": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked("no apples", "caml", _type)]), _normalize([_interpolate(_list(0)), " apple"]), _normalize([_interpolate(_named("n")), " apples"])])};fn.source="@.caml:{'no apples'} | {0} apple | {n} apples";return fn;})() }, - \\"list\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize([\\"hi, \\", _interpolate(_list(0)), \\" !\\"])};fn.source=\\"hi, {0} !\\";return fn;})() + "list": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize(["hi, ", _interpolate(_list(0)), " !"])};fn.source="hi, {0} !";return fn;})() }, - \\"template\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello world!\\"])};fn.source=\\"hello world!\\";return fn;})(), - \\"こんにちは\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"こんにちは!\\"])};fn.source=\\"こんにちは!\\";return fn;})(), - \\"single-quote\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"I don't know!\\"])};fn.source=\\"I don't know!\\";return fn;})(), - \\"emoji\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"😺\\"])};fn.source=\\"😺\\";return fn;})(), - \\"unicode\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"A\\"])};fn.source=\\"A\\";return fn;})(), - \\"unicode-escape\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\u0041\\"])};fn.source=\\"\\\\\\\\u0041\\";return fn;})(), - \\"backslash-single-quote\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\'\\"])};fn.source=\\"\\\\\\\\'\\";return fn;})(), - \\"backslash-backslash\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\\\\\\\\\\\"])};fn.source=\\"\\\\\\\\\\\\\\\\\\";return fn;})(), - \\"errors\\": [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"ERROR1001\\"])};fn.source=\\"ERROR1001\\";return fn;})(), - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"ERROR1002\\"])};fn.source=\\"ERROR1002\\";return fn;})(), + "template": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello world!"])};fn.source="hello world!";return fn;})(), + "こんにちは": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["こんにちは!"])};fn.source="こんにちは!";return fn;})(), + "single-quote": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["I don't know!"])};fn.source="I don't know!";return fn;})(), + "emoji": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["😺"])};fn.source="😺";return fn;})(), + "unicode": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["A"])};fn.source="A";return fn;})(), + "unicode-escape": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\u0041"])};fn.source="\\\\u0041";return fn;})(), + "backslash-single-quote": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\'"])};fn.source="\\\\'";return fn;})(), + "backslash-backslash": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\\\\\"])};fn.source="\\\\\\\\";return fn;})(), + "errors": [ + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["ERROR1001"])};fn.source="ERROR1001";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["ERROR1002"])};fn.source="ERROR1002";return fn;})(), ], - \\"complex\\": { - \\"warnings\\": [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"NOTE: This is warning\\"])};fn.source=\\"NOTE: This is warning\\";return fn;})(), + "complex": { + "warnings": [ + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["NOTE: This is warning"])};fn.source="NOTE: This is warning";return fn;})(), { - \\"named-waring\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize([\\"this is \\", _interpolate(_named(\\"type\\")), \\" warining\\"])};fn.source=\\"this is {type} warining\\";return fn;})() + "named-waring": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize(["this is ", _interpolate(_named("type")), " warining"])};fn.source="this is {type} warining";return fn;})() } ] } @@ -340,20 +340,20 @@ exports[`complex > map 1`] = ` exports[`force stringify > code 1`] = ` "const resource = { - \\"trueValue\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"true\\"])};fn.source=\\"true\\";return fn;})(), - \\"falseValue\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"false\\"])};fn.source=\\"false\\";return fn;})(), - \\"nullValue\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"null\\"])};fn.source=\\"null\\";return fn;})(), - \\"numberValue\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"1\\"])};fn.source=\\"1\\";return fn;})(), - \\"funcValue1\\": function () { + "trueValue": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["true"])};fn.source="true";return fn;})(), + "falseValue": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["false"])};fn.source="false";return fn;})(), + "nullValue": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["null"])};fn.source="null";return fn;})(), + "numberValue": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["1"])};fn.source="1";return fn;})(), + "funcValue1": function () { }, - \\"funcValue2\\": () => { + "funcValue2": () => { }, - \\"items\\": [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"null\\"])};fn.source=\\"null\\";return fn;})(), - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"1\\"])};fn.source=\\"1\\";return fn;})(), + "items": [ + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["null"])};fn.source="null";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["1"])};fn.source="1";return fn;})(), { - \\"nullValue\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"null\\"])};fn.source=\\"null\\";return fn;})(), - \\"numberValue\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"1\\"])};fn.source=\\"1\\";return fn;})(), + "nullValue": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["null"])};fn.source="null";return fn;})(), + "numberValue": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["1"])};fn.source="1";return fn;})(), }, @@ -373,8 +373,8 @@ exports[`force stringify > map 1`] = ` exports[`html tag in message > code 1`] = ` "{ - \\"hi\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"<p>hi there!</p>\\"])};fn.source=\\"

hi there!

\\";return fn;})(), - \\"alert\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"<script>window.alert('hi there!')</script>\\"])};fn.source=\\"\\";return fn;})() + "hi": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["<p>hi there!</p>"])};fn.source="

hi there!

";return fn;})(), + "alert": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["<script>window.alert('hi there!')</script>"])};fn.source="";return fn;})() }" `; @@ -395,13 +395,13 @@ exports[`html tag in message > errors 1`] = ` exports[`include function > code 1`] = ` "const resource = { - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello\\"])};fn.source=\\"hello\\";return fn;})(), - \\"pagination\\": { - \\"pages\\": ({named}) => \`\${ named('number') }/page\`, - \\"total\\": ({named}) => \`\${ named('number') } records in total\` + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello"])};fn.source="hello";return fn;})(), + "pagination": { + "pages": ({named}) => \`\${ named('number') }/page\`, + "total": ({named}) => \`\${ named('number') } records in total\` }, - \\"foo\\": { - \\"bar\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"bar\\"])};fn.source=\\"bar\\";return fn;})() + "foo": { + "bar": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["bar"])};fn.source="bar";return fn;})() } } export default resource" @@ -418,12 +418,12 @@ exports[`include function > map 1`] = ` exports[`invalid message syntax > code 1`] = ` "{ - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"こんにちは\\"])};fn.source=\\"こんにちは\\";return fn;})(), - \\"this-is-invalid\\": \`@\`, - \\"nested\\": { - \\"array\\": [ + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["こんにちは"])};fn.source="こんにちは";return fn;})(), + "this-is-invalid": \`@\`, + "nested": { + "array": [ { - \\"this-is-invalid\\": \`@\` + "this-is-invalid": \`@\` } ] } @@ -522,13 +522,13 @@ exports[`invalid message syntax > map 1`] = ` exports[`simple > code 1`] = ` "const resource = { - \\"hi\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hi there!\\"])};fn.source=\\"hi there!\\";return fn;})(), - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello world!\\"])};fn.source=\\"hello world!\\";return fn;})(), - \\"named\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize([\\"hi, \\", _interpolate(_named(\\"name\\")), \\" !\\"])};fn.source=\\"hi, {name} !\\";return fn;})(), - \\"list\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize([\\"hi, \\", _interpolate(_list(0)), \\" !\\"])};fn.source=\\"hi, {0} !\\";return fn;})(), - \\"literal\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hi, \\", \\"kazupon\\", \\" !\\"])};fn.source=\\"hi, { 'kazupon' } !\\";return fn;})(), - \\"linked\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type } = ctx;return _normalize([\\"hi, \\", _linked(\\"name\\", undefined, _type), \\" !\\"])};fn.source=\\"hi, @:name !\\";return fn;})(), - \\"plural\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked(\\"no apples\\", \\"caml\\", _type)]), _normalize([_interpolate(_list(0)), \\" apple\\"]), _normalize([_interpolate(_named(\\"n\\")), \\" apples\\"])])};fn.source=\\"@.caml:{'no apples'} | {0} apple | {n} apples\\";return fn;})() + "hi": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hi there!"])};fn.source="hi there!";return fn;})(), + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello world!"])};fn.source="hello world!";return fn;})(), + "named": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize(["hi, ", _interpolate(_named("name")), " !"])};fn.source="hi, {name} !";return fn;})(), + "list": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize(["hi, ", _interpolate(_list(0)), " !"])};fn.source="hi, {0} !";return fn;})(), + "literal": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hi, ", "kazupon", " !"])};fn.source="hi, { 'kazupon' } !";return fn;})(), + "linked": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type } = ctx;return _normalize(["hi, ", _linked("name", undefined, _type), " !"])};fn.source="hi, @:name !";return fn;})(), + "plural": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked("no apples", "caml", _type)]), _normalize([_interpolate(_list(0)), " apple"]), _normalize([_interpolate(_named("n")), " apples"])])};fn.source="@.caml:{'no apples'} | {0} apple | {n} apples";return fn;})() } export default resource" `; @@ -544,20 +544,20 @@ exports[`simple > map 1`] = ` exports[`unhandling > code 1`] = ` "const resource = { - \\"trueValue\\": true, - \\"falseValue\\": false, - \\"nullValue\\": null, - \\"numberValue\\": 1, - \\"funcValue1\\": function () { + "trueValue": true, + "falseValue": false, + "nullValue": null, + "numberValue": 1, + "funcValue1": function () { }, - \\"funcValue2\\": () => { + "funcValue2": () => { }, - \\"items\\": [ + "items": [ null, 1, { - \\"nullValue\\": null, - \\"numberValue\\": 1, + "nullValue": null, + "numberValue": 1, }, diff --git a/packages/bundle-utils/test/generator/__snapshots__/json.test.ts.snap b/packages/bundle-utils/test/generator/__snapshots__/json.test.ts.snap index ced2967..148043d 100644 --- a/packages/bundle-utils/test/generator/__snapshots__/json.test.ts.snap +++ b/packages/bundle-utils/test/generator/__snapshots__/json.test.ts.snap @@ -5,15 +5,15 @@ exports[`AST code generation > array basic > code 1`] = ` const _Component = Component _Component.__i18n = _Component.__i18n || [] _Component.__i18n.push({ - \\"locale\\": \\"\\", - \\"resource\\": { - \\"foo\\": [ + "locale": "", + "resource": { + "foo": [ [ - {\\"type\\":0,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3},\\"source\\":\\"bar\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}}}],\\"static\\":\\"bar\\"}}, + {"type":0,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3},"source":"bar"},"body":{"type":2,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}},"items":[{"type":3,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}}}],"static":"bar"}}, ], [ - {\\"type\\":0,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3},\\"source\\":\\"baz\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}}}],\\"static\\":\\"baz\\"}}, + {"type":0,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3},"source":"baz"},"body":{"type":2,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}},"items":[{"type":3,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}}}],"static":"baz"}}, ] ] @@ -30,25 +30,25 @@ exports[`AST code generation > array mixed > code 1`] = ` const _Component = Component _Component.__i18n = _Component.__i18n || [] _Component.__i18n.push({ - \\"locale\\": \\"\\", - \\"resource\\": { - \\"foo\\": [ + "locale": "", + "resource": { + "foo": [ { - \\"foo\\": {\\"type\\":0,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3},\\"source\\":\\"foo\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}}}],\\"static\\":\\"foo\\"}} + "foo": {"type":0,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3},"source":"foo"},"body":{"type":2,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}},"items":[{"type":3,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}}}],"static":"foo"}} }, [ - {\\"type\\":0,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3},\\"source\\":\\"bar\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}}}],\\"static\\":\\"bar\\"}}, + {"type":0,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3},"source":"bar"},"body":{"type":2,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}},"items":[{"type":3,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}}}],"static":"bar"}}, [ { - \\"foo\\": {\\"type\\":0,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3},\\"source\\":\\"foo\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}}}],\\"static\\":\\"foo\\"}} + "foo": {"type":0,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3},"source":"foo"},"body":{"type":2,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}},"items":[{"type":3,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}}}],"static":"foo"}} }, - {\\"type\\":0,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4},\\"source\\":\\"hoge\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4}}}],\\"static\\":\\"hoge\\"}}, + {"type":0,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4},"source":"hoge"},"body":{"type":2,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4}},"items":[{"type":3,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4}}}],"static":"hoge"}}, ] ], - {\\"type\\":0,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3},\\"source\\":\\"baz\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}}}],\\"static\\":\\"baz\\"}}, + {"type":0,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3},"source":"baz"},"body":{"type":2,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}},"items":[{"type":3,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}}}],"static":"baz"}}, [ - {\\"type\\":0,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3},\\"source\\":\\"buz\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":3,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":4,\\"offset\\":3}}}],\\"static\\":\\"buz\\"}}, + {"type":0,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3},"source":"buz"},"body":{"type":2,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}},"items":[{"type":3,"start":0,"end":3,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":4,"offset":3}}}],"static":"buz"}}, ] ] @@ -62,37 +62,37 @@ exports[`AST code generation > array mixed > map 1`] = `undefined`; exports[`AST code generation > bare > code 1`] = ` "{ - \\"hello\\": {\\"type\\":0,\\"start\\":0,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12},\\"source\\":\\"hello world!\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12}}}],\\"static\\":\\"hello world!\\"}} + "hello": {"type":0,"start":0,"end":12,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":13,"offset":12},"source":"hello world!"},"body":{"type":2,"start":0,"end":12,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":13,"offset":12}},"items":[{"type":3,"start":0,"end":12,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":13,"offset":12}}}],"static":"hello world!"}} }" `; exports[`AST code generation > complex > code 1`] = ` "const resource = { - \\"hi\\": {\\"type\\":0,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9},\\"source\\":\\"hi there!\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9}}}],\\"static\\":\\"hi there!\\"}}, - \\"nested\\": { - \\"hello\\": {\\"type\\":0,\\"start\\":0,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12},\\"source\\":\\"hello world!\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12}}}],\\"static\\":\\"hello world!\\"}}, - \\"more\\": { - \\"plural\\": {\\"type\\":0,\\"start\\":0,\\"end\\":45,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":46,\\"offset\\":45},\\"source\\":\\"@.caml:{\\\\u0027no apples\\\\u0027} | {0} apple | {n} apples\\"},\\"body\\":{\\"type\\":1,\\"start\\":0,\\"end\\":45,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":46,\\"offset\\":45}},\\"cases\\":[{\\"type\\":2,\\"start\\":0,\\"end\\":19,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":21,\\"offset\\":20}},\\"items\\":[{\\"type\\":6,\\"start\\":0,\\"end\\":20,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":21,\\"offset\\":20}},\\"modifier\\":{\\"type\\":8,\\"start\\":1,\\"end\\":6,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":2,\\"offset\\":1},\\"end\\":{\\"line\\":1,\\"column\\":7,\\"offset\\":6}},\\"value\\":\\"caml\\"},\\"key\\":{\\"type\\":9,\\"start\\":7,\\"end\\":20,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":8,\\"offset\\":7},\\"end\\":{\\"line\\":1,\\"column\\":21,\\"offset\\":20}},\\"value\\":\\"no apples\\"}}]},{\\"type\\":2,\\"start\\":23,\\"end\\":26,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":24,\\"offset\\":23},\\"end\\":{\\"line\\":1,\\"column\\":33,\\"offset\\":32}},\\"items\\":[{\\"type\\":5,\\"start\\":23,\\"end\\":26,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":24,\\"offset\\":23},\\"end\\":{\\"line\\":1,\\"column\\":27,\\"offset\\":26}},\\"index\\":0},{\\"type\\":3,\\"start\\":26,\\"end\\":32,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":27,\\"offset\\":26},\\"end\\":{\\"line\\":1,\\"column\\":33,\\"offset\\":32}},\\"value\\":\\" apple\\"}]},{\\"type\\":2,\\"start\\":35,\\"end\\":45,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":36,\\"offset\\":35},\\"end\\":{\\"line\\":1,\\"column\\":46,\\"offset\\":45}},\\"items\\":[{\\"type\\":4,\\"start\\":35,\\"end\\":38,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":36,\\"offset\\":35},\\"end\\":{\\"line\\":1,\\"column\\":39,\\"offset\\":38}},\\"key\\":\\"n\\"},{\\"type\\":3,\\"start\\":38,\\"end\\":45,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":39,\\"offset\\":38},\\"end\\":{\\"line\\":1,\\"column\\":46,\\"offset\\":45}},\\"value\\":\\" apples\\"}]}]}} + "hi": {"type":0,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9},"source":"hi there!"},"body":{"type":2,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9}},"items":[{"type":3,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9}}}],"static":"hi there!"}}, + "nested": { + "hello": {"type":0,"start":0,"end":12,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":13,"offset":12},"source":"hello world!"},"body":{"type":2,"start":0,"end":12,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":13,"offset":12}},"items":[{"type":3,"start":0,"end":12,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":13,"offset":12}}}],"static":"hello world!"}}, + "more": { + "plural": {"type":0,"start":0,"end":45,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":46,"offset":45},"source":"@.caml:{\\u0027no apples\\u0027} | {0} apple | {n} apples"},"body":{"type":1,"start":0,"end":45,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":46,"offset":45}},"cases":[{"type":2,"start":0,"end":19,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":21,"offset":20}},"items":[{"type":6,"start":0,"end":20,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":21,"offset":20}},"modifier":{"type":8,"start":1,"end":6,"loc":{"start":{"line":1,"column":2,"offset":1},"end":{"line":1,"column":7,"offset":6}},"value":"caml"},"key":{"type":9,"start":7,"end":20,"loc":{"start":{"line":1,"column":8,"offset":7},"end":{"line":1,"column":21,"offset":20}},"value":"no apples"}}]},{"type":2,"start":23,"end":26,"loc":{"start":{"line":1,"column":24,"offset":23},"end":{"line":1,"column":33,"offset":32}},"items":[{"type":5,"start":23,"end":26,"loc":{"start":{"line":1,"column":24,"offset":23},"end":{"line":1,"column":27,"offset":26}},"index":0},{"type":3,"start":26,"end":32,"loc":{"start":{"line":1,"column":27,"offset":26},"end":{"line":1,"column":33,"offset":32}},"value":" apple"}]},{"type":2,"start":35,"end":45,"loc":{"start":{"line":1,"column":36,"offset":35},"end":{"line":1,"column":46,"offset":45}},"items":[{"type":4,"start":35,"end":38,"loc":{"start":{"line":1,"column":36,"offset":35},"end":{"line":1,"column":39,"offset":38}},"key":"n"},{"type":3,"start":38,"end":45,"loc":{"start":{"line":1,"column":39,"offset":38},"end":{"line":1,"column":46,"offset":45}},"value":" apples"}]}]}} }, - \\"list\\": {\\"type\\":0,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9},\\"source\\":\\"hi, {0} !\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4}},\\"value\\":\\"hi, \\"},{\\"type\\":5,\\"start\\":4,\\"end\\":7,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4},\\"end\\":{\\"line\\":1,\\"column\\":8,\\"offset\\":7}},\\"index\\":0},{\\"type\\":3,\\"start\\":7,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":8,\\"offset\\":7},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9}},\\"value\\":\\" !\\"}]}} + "list": {"type":0,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9},"source":"hi, {0} !"},"body":{"type":2,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9}},"items":[{"type":3,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4}},"value":"hi, "},{"type":5,"start":4,"end":7,"loc":{"start":{"line":1,"column":5,"offset":4},"end":{"line":1,"column":8,"offset":7}},"index":0},{"type":3,"start":7,"end":9,"loc":{"start":{"line":1,"column":8,"offset":7},"end":{"line":1,"column":10,"offset":9}},"value":" !"}]}} }, - \\"こんにちは\\": {\\"type\\":0,\\"start\\":0,\\"end\\":6,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":7,\\"offset\\":6},\\"source\\":\\"こんにちは!\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":6,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":7,\\"offset\\":6}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":6,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":7,\\"offset\\":6}}}],\\"static\\":\\"こんにちは!\\"}}, - \\"single-quote\\": {\\"type\\":0,\\"start\\":0,\\"end\\":13,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":14,\\"offset\\":13},\\"source\\":\\"I don\\\\u0027t know!\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":13,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":14,\\"offset\\":13}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":13,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":14,\\"offset\\":13}}}],\\"static\\":\\"I don\\\\u0027t know!\\"}}, - \\"emoji\\": {\\"type\\":0,\\"start\\":0,\\"end\\":2,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":3,\\"offset\\":2},\\"source\\":\\"😺\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":2,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":3,\\"offset\\":2}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":2,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":3,\\"offset\\":2}}}],\\"static\\":\\"😺\\"}}, - \\"unicode\\": {\\"type\\":0,\\"start\\":0,\\"end\\":1,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":2,\\"offset\\":1},\\"source\\":\\"A\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":1,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":2,\\"offset\\":1}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":1,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":2,\\"offset\\":1}}}],\\"static\\":\\"A\\"}}, - \\"unicode-escape\\": {\\"type\\":0,\\"start\\":0,\\"end\\":6,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":7,\\"offset\\":6},\\"source\\":\\"\\\\\\\\u0041\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":6,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":7,\\"offset\\":6}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":6,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":7,\\"offset\\":6}}}],\\"static\\":\\"\\\\\\\\u0041\\"}}, - \\"backslash-single-quote\\": {\\"type\\":0,\\"start\\":0,\\"end\\":2,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":3,\\"offset\\":2},\\"source\\":\\"\\\\\\\\\\\\u0027\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":2,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":3,\\"offset\\":2}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":2,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":3,\\"offset\\":2}}}],\\"static\\":\\"\\\\\\\\\\\\u0027\\"}}, - \\"backslash-backslash\\": {\\"type\\":0,\\"start\\":0,\\"end\\":2,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":3,\\"offset\\":2},\\"source\\":\\"\\\\\\\\\\\\\\\\\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":2,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":3,\\"offset\\":2}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":2,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":3,\\"offset\\":2}}}],\\"static\\":\\"\\\\\\\\\\\\\\\\\\"}}, - \\"errors\\": [ - {\\"type\\":0,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9},\\"source\\":\\"ERROR1001\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9}}}],\\"static\\":\\"ERROR1001\\"}}, - {\\"type\\":0,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9},\\"source\\":\\"ERROR1002\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9}}}],\\"static\\":\\"ERROR1002\\"}}, + "こんにちは": {"type":0,"start":0,"end":6,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":7,"offset":6},"source":"こんにちは!"},"body":{"type":2,"start":0,"end":6,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":7,"offset":6}},"items":[{"type":3,"start":0,"end":6,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":7,"offset":6}}}],"static":"こんにちは!"}}, + "single-quote": {"type":0,"start":0,"end":13,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":14,"offset":13},"source":"I don\\u0027t know!"},"body":{"type":2,"start":0,"end":13,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":14,"offset":13}},"items":[{"type":3,"start":0,"end":13,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":14,"offset":13}}}],"static":"I don\\u0027t know!"}}, + "emoji": {"type":0,"start":0,"end":2,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":3,"offset":2},"source":"😺"},"body":{"type":2,"start":0,"end":2,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":3,"offset":2}},"items":[{"type":3,"start":0,"end":2,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":3,"offset":2}}}],"static":"😺"}}, + "unicode": {"type":0,"start":0,"end":1,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":2,"offset":1},"source":"A"},"body":{"type":2,"start":0,"end":1,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":2,"offset":1}},"items":[{"type":3,"start":0,"end":1,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":2,"offset":1}}}],"static":"A"}}, + "unicode-escape": {"type":0,"start":0,"end":6,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":7,"offset":6},"source":"\\\\u0041"},"body":{"type":2,"start":0,"end":6,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":7,"offset":6}},"items":[{"type":3,"start":0,"end":6,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":7,"offset":6}}}],"static":"\\\\u0041"}}, + "backslash-single-quote": {"type":0,"start":0,"end":2,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":3,"offset":2},"source":"\\\\\\u0027"},"body":{"type":2,"start":0,"end":2,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":3,"offset":2}},"items":[{"type":3,"start":0,"end":2,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":3,"offset":2}}}],"static":"\\\\\\u0027"}}, + "backslash-backslash": {"type":0,"start":0,"end":2,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":3,"offset":2},"source":"\\\\\\\\"},"body":{"type":2,"start":0,"end":2,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":3,"offset":2}},"items":[{"type":3,"start":0,"end":2,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":3,"offset":2}}}],"static":"\\\\\\\\"}}, + "errors": [ + {"type":0,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9},"source":"ERROR1001"},"body":{"type":2,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9}},"items":[{"type":3,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9}}}],"static":"ERROR1001"}}, + {"type":0,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9},"source":"ERROR1002"},"body":{"type":2,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9}},"items":[{"type":3,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9}}}],"static":"ERROR1002"}}, ], - \\"complex\\": { - \\"warnings\\": [ - {\\"type\\":0,\\"start\\":0,\\"end\\":21,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":22,\\"offset\\":21},\\"source\\":\\"NOTE: This is warning\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":21,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":22,\\"offset\\":21}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":21,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":22,\\"offset\\":21}}}],\\"static\\":\\"NOTE: This is warning\\"}}, + "complex": { + "warnings": [ + {"type":0,"start":0,"end":21,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":22,"offset":21},"source":"NOTE: This is warning"},"body":{"type":2,"start":0,"end":21,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":22,"offset":21}},"items":[{"type":3,"start":0,"end":21,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":22,"offset":21}}}],"static":"NOTE: This is warning"}}, { - \\"named-waring\\": {\\"type\\":0,\\"start\\":0,\\"end\\":23,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":24,\\"offset\\":23},\\"source\\":\\"this is {type} warining\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":23,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":24,\\"offset\\":23}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":8,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":9,\\"offset\\":8}},\\"value\\":\\"this is \\"},{\\"type\\":4,\\"start\\":8,\\"end\\":14,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":9,\\"offset\\":8},\\"end\\":{\\"line\\":1,\\"column\\":15,\\"offset\\":14}},\\"key\\":\\"type\\"},{\\"type\\":3,\\"start\\":14,\\"end\\":23,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":15,\\"offset\\":14},\\"end\\":{\\"line\\":1,\\"column\\":24,\\"offset\\":23}},\\"value\\":\\" warining\\"}]}} + "named-waring": {"type":0,"start":0,"end":23,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":24,"offset":23},"source":"this is {type} warining"},"body":{"type":2,"start":0,"end":23,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":24,"offset":23}},"items":[{"type":3,"start":0,"end":8,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":9,"offset":8}},"value":"this is "},{"type":4,"start":8,"end":14,"loc":{"start":{"line":1,"column":9,"offset":8},"end":{"line":1,"column":15,"offset":14}},"key":"type"},{"type":3,"start":14,"end":23,"loc":{"start":{"line":1,"column":15,"offset":14},"end":{"line":1,"column":24,"offset":23}},"value":" warining"}]}} } ] } @@ -102,10 +102,10 @@ export default resource" exports[`AST code generation > force stringify > code 1`] = ` "const resource = { - \\"trueValue\\": {\\"type\\":0,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4},\\"source\\":\\"true\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4}}}],\\"static\\":\\"true\\"}}, - \\"falseValue\\": {\\"type\\":0,\\"start\\":0,\\"end\\":5,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":6,\\"offset\\":5},\\"source\\":\\"false\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":5,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":6,\\"offset\\":5}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":5,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":6,\\"offset\\":5}}}],\\"static\\":\\"false\\"}}, - \\"nullValue\\": {\\"type\\":0,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4},\\"source\\":\\"null\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4}}}],\\"static\\":\\"null\\"}}, - \\"numberValue\\": {\\"type\\":0,\\"start\\":0,\\"end\\":1,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":2,\\"offset\\":1},\\"source\\":\\"1\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":1,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":2,\\"offset\\":1}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":1,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":2,\\"offset\\":1}}}],\\"static\\":\\"1\\"}} + "trueValue": {"type":0,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4},"source":"true"},"body":{"type":2,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4}},"items":[{"type":3,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4}}}],"static":"true"}}, + "falseValue": {"type":0,"start":0,"end":5,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":6,"offset":5},"source":"false"},"body":{"type":2,"start":0,"end":5,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":6,"offset":5}},"items":[{"type":3,"start":0,"end":5,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":6,"offset":5}}}],"static":"false"}}, + "nullValue": {"type":0,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4},"source":"null"},"body":{"type":2,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4}},"items":[{"type":3,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4}}}],"static":"null"}}, + "numberValue": {"type":0,"start":0,"end":1,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":2,"offset":1},"source":"1"},"body":{"type":2,"start":0,"end":1,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":2,"offset":1}},"items":[{"type":3,"start":0,"end":1,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":2,"offset":1}}}],"static":"1"}} } export default resource" `; @@ -127,12 +127,12 @@ exports[`AST code generation > html tag in message > errors 1`] = ` exports[`AST code generation > invalid message syntax > code 1`] = ` "{ - \\"hello\\": {\\"type\\":0,\\"start\\":0,\\"end\\":5,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":6,\\"offset\\":5},\\"source\\":\\"こんにちは\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":5,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":6,\\"offset\\":5}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":5,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":6,\\"offset\\":5}}}],\\"static\\":\\"こんにちは\\"}}, - \\"this-is-invalid\\": \`@\`, - \\"nested\\": { - \\"array\\": [ + "hello": {"type":0,"start":0,"end":5,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":6,"offset":5},"source":"こんにちは"},"body":{"type":2,"start":0,"end":5,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":6,"offset":5}},"items":[{"type":3,"start":0,"end":5,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":6,"offset":5}}}],"static":"こんにちは"}}, + "this-is-invalid": \`@\`, + "nested": { + "array": [ { - \\"this-is-invalid\\": \`@\` + "this-is-invalid": \`@\` } ] } @@ -224,36 +224,36 @@ exports[`AST code generation > invalid message syntax > map 1`] = `undefined`; exports[`AST code generation > production > code 1`] = ` "const resource = { - \\"hi\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"hi there!\\"}}, - \\"hello\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"hello world!\\"}}, - \\"named\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3,\\"v\\":\\"hi, \\"},{\\"t\\":4,\\"k\\":\\"name\\"},{\\"t\\":3,\\"v\\":\\" !\\"}]}}, - \\"list\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3,\\"v\\":\\"hi, \\"},{\\"t\\":5,\\"i\\":0},{\\"t\\":3,\\"v\\":\\" !\\"}]}}, - \\"literal\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3},{\\"t\\":9},{\\"t\\":3}],\\"s\\":\\"hi, kazupon !\\"}}, - \\"linked\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3,\\"v\\":\\"hi, \\"},{\\"t\\":6,\\"k\\":{\\"t\\":7,\\"v\\":\\"name\\"}},{\\"t\\":3,\\"v\\":\\" !\\"}]}}, - \\"plural\\": {\\"t\\":0,\\"b\\":{\\"t\\":1,\\"c\\":[{\\"t\\":2,\\"i\\":[{\\"t\\":6,\\"k\\":{\\"t\\":9,\\"v\\":\\"no apples\\"},\\"m\\":{\\"t\\":8,\\"v\\":\\"caml\\"}}]},{\\"t\\":2,\\"i\\":[{\\"t\\":5,\\"i\\":0},{\\"t\\":3,\\"v\\":\\" apple\\"}]},{\\"t\\":2,\\"i\\":[{\\"t\\":4,\\"k\\":\\"n\\"},{\\"t\\":3,\\"v\\":\\" apples\\"}]}]}} + "hi": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"hi there!"}}, + "hello": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"hello world!"}}, + "named": {"t":0,"b":{"t":2,"i":[{"t":3,"v":"hi, "},{"t":4,"k":"name"},{"t":3,"v":" !"}]}}, + "list": {"t":0,"b":{"t":2,"i":[{"t":3,"v":"hi, "},{"t":5,"i":0},{"t":3,"v":" !"}]}}, + "literal": {"t":0,"b":{"t":2,"i":[{"t":3},{"t":9},{"t":3}],"s":"hi, kazupon !"}}, + "linked": {"t":0,"b":{"t":2,"i":[{"t":3,"v":"hi, "},{"t":6,"k":{"t":7,"v":"name"}},{"t":3,"v":" !"}]}}, + "plural": {"t":0,"b":{"t":1,"c":[{"t":2,"i":[{"t":6,"k":{"t":9,"v":"no apples"},"m":{"t":8,"v":"caml"}}]},{"t":2,"i":[{"t":5,"i":0},{"t":3,"v":" apple"}]},{"t":2,"i":[{"t":4,"k":"n"},{"t":3,"v":" apples"}]}]}} } export default resource" `; exports[`AST code generation > simple > code 1`] = ` "const resource = { - \\"hi\\": {\\"type\\":0,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9},\\"source\\":\\"hi there!\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9}}}],\\"static\\":\\"hi there!\\"}}, - \\"hello\\": {\\"type\\":0,\\"start\\":0,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12},\\"source\\":\\"hello world!\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12}}}],\\"static\\":\\"hello world!\\"}}, - \\"named\\": {\\"type\\":0,\\"start\\":0,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12},\\"source\\":\\"hi, {name} !\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4}},\\"value\\":\\"hi, \\"},{\\"type\\":4,\\"start\\":4,\\"end\\":10,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4},\\"end\\":{\\"line\\":1,\\"column\\":11,\\"offset\\":10}},\\"key\\":\\"name\\"},{\\"type\\":3,\\"start\\":10,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":11,\\"offset\\":10},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12}},\\"value\\":\\" !\\"}]}}, - \\"list\\": {\\"type\\":0,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9},\\"source\\":\\"hi, {0} !\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4}},\\"value\\":\\"hi, \\"},{\\"type\\":5,\\"start\\":4,\\"end\\":7,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4},\\"end\\":{\\"line\\":1,\\"column\\":8,\\"offset\\":7}},\\"index\\":0},{\\"type\\":3,\\"start\\":7,\\"end\\":9,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":8,\\"offset\\":7},\\"end\\":{\\"line\\":1,\\"column\\":10,\\"offset\\":9}},\\"value\\":\\" !\\"}]}}, - \\"literal\\": {\\"type\\":0,\\"start\\":0,\\"end\\":21,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":22,\\"offset\\":21},\\"source\\":\\"hi, { \\\\u0027kazupon\\\\u0027 } !\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":21,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":22,\\"offset\\":21}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4}}},{\\"type\\":9,\\"start\\":4,\\"end\\":19,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4},\\"end\\":{\\"line\\":1,\\"column\\":20,\\"offset\\":19}}},{\\"type\\":3,\\"start\\":19,\\"end\\":21,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":20,\\"offset\\":19},\\"end\\":{\\"line\\":1,\\"column\\":22,\\"offset\\":21}}}],\\"static\\":\\"hi, kazupon !\\"}}, - \\"linked\\": {\\"type\\":0,\\"start\\":0,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12},\\"source\\":\\"hi, @:name !\\"},\\"body\\":{\\"type\\":2,\\"start\\":0,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12}},\\"items\\":[{\\"type\\":3,\\"start\\":0,\\"end\\":4,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4}},\\"value\\":\\"hi, \\"},{\\"type\\":6,\\"start\\":4,\\"end\\":10,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":5,\\"offset\\":4},\\"end\\":{\\"line\\":1,\\"column\\":11,\\"offset\\":10}},\\"key\\":{\\"type\\":7,\\"start\\":6,\\"end\\":10,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":7,\\"offset\\":6},\\"end\\":{\\"line\\":1,\\"column\\":11,\\"offset\\":10}},\\"value\\":\\"name\\"}},{\\"type\\":3,\\"start\\":10,\\"end\\":12,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":11,\\"offset\\":10},\\"end\\":{\\"line\\":1,\\"column\\":13,\\"offset\\":12}},\\"value\\":\\" !\\"}]}}, - \\"plural\\": {\\"type\\":0,\\"start\\":0,\\"end\\":45,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":46,\\"offset\\":45},\\"source\\":\\"@.caml:{\\\\u0027no apples\\\\u0027} | {0} apple | {n} apples\\"},\\"body\\":{\\"type\\":1,\\"start\\":0,\\"end\\":45,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":46,\\"offset\\":45}},\\"cases\\":[{\\"type\\":2,\\"start\\":0,\\"end\\":19,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":21,\\"offset\\":20}},\\"items\\":[{\\"type\\":6,\\"start\\":0,\\"end\\":20,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":1,\\"offset\\":0},\\"end\\":{\\"line\\":1,\\"column\\":21,\\"offset\\":20}},\\"modifier\\":{\\"type\\":8,\\"start\\":1,\\"end\\":6,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":2,\\"offset\\":1},\\"end\\":{\\"line\\":1,\\"column\\":7,\\"offset\\":6}},\\"value\\":\\"caml\\"},\\"key\\":{\\"type\\":9,\\"start\\":7,\\"end\\":20,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":8,\\"offset\\":7},\\"end\\":{\\"line\\":1,\\"column\\":21,\\"offset\\":20}},\\"value\\":\\"no apples\\"}}]},{\\"type\\":2,\\"start\\":23,\\"end\\":26,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":24,\\"offset\\":23},\\"end\\":{\\"line\\":1,\\"column\\":33,\\"offset\\":32}},\\"items\\":[{\\"type\\":5,\\"start\\":23,\\"end\\":26,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":24,\\"offset\\":23},\\"end\\":{\\"line\\":1,\\"column\\":27,\\"offset\\":26}},\\"index\\":0},{\\"type\\":3,\\"start\\":26,\\"end\\":32,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":27,\\"offset\\":26},\\"end\\":{\\"line\\":1,\\"column\\":33,\\"offset\\":32}},\\"value\\":\\" apple\\"}]},{\\"type\\":2,\\"start\\":35,\\"end\\":45,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":36,\\"offset\\":35},\\"end\\":{\\"line\\":1,\\"column\\":46,\\"offset\\":45}},\\"items\\":[{\\"type\\":4,\\"start\\":35,\\"end\\":38,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":36,\\"offset\\":35},\\"end\\":{\\"line\\":1,\\"column\\":39,\\"offset\\":38}},\\"key\\":\\"n\\"},{\\"type\\":3,\\"start\\":38,\\"end\\":45,\\"loc\\":{\\"start\\":{\\"line\\":1,\\"column\\":39,\\"offset\\":38},\\"end\\":{\\"line\\":1,\\"column\\":46,\\"offset\\":45}},\\"value\\":\\" apples\\"}]}]}} + "hi": {"type":0,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9},"source":"hi there!"},"body":{"type":2,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9}},"items":[{"type":3,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9}}}],"static":"hi there!"}}, + "hello": {"type":0,"start":0,"end":12,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":13,"offset":12},"source":"hello world!"},"body":{"type":2,"start":0,"end":12,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":13,"offset":12}},"items":[{"type":3,"start":0,"end":12,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":13,"offset":12}}}],"static":"hello world!"}}, + "named": {"type":0,"start":0,"end":12,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":13,"offset":12},"source":"hi, {name} !"},"body":{"type":2,"start":0,"end":12,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":13,"offset":12}},"items":[{"type":3,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4}},"value":"hi, "},{"type":4,"start":4,"end":10,"loc":{"start":{"line":1,"column":5,"offset":4},"end":{"line":1,"column":11,"offset":10}},"key":"name"},{"type":3,"start":10,"end":12,"loc":{"start":{"line":1,"column":11,"offset":10},"end":{"line":1,"column":13,"offset":12}},"value":" !"}]}}, + "list": {"type":0,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9},"source":"hi, {0} !"},"body":{"type":2,"start":0,"end":9,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":10,"offset":9}},"items":[{"type":3,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4}},"value":"hi, "},{"type":5,"start":4,"end":7,"loc":{"start":{"line":1,"column":5,"offset":4},"end":{"line":1,"column":8,"offset":7}},"index":0},{"type":3,"start":7,"end":9,"loc":{"start":{"line":1,"column":8,"offset":7},"end":{"line":1,"column":10,"offset":9}},"value":" !"}]}}, + "literal": {"type":0,"start":0,"end":21,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":22,"offset":21},"source":"hi, { \\u0027kazupon\\u0027 } !"},"body":{"type":2,"start":0,"end":21,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":22,"offset":21}},"items":[{"type":3,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4}}},{"type":9,"start":4,"end":19,"loc":{"start":{"line":1,"column":5,"offset":4},"end":{"line":1,"column":20,"offset":19}}},{"type":3,"start":19,"end":21,"loc":{"start":{"line":1,"column":20,"offset":19},"end":{"line":1,"column":22,"offset":21}}}],"static":"hi, kazupon !"}}, + "linked": {"type":0,"start":0,"end":12,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":13,"offset":12},"source":"hi, @:name !"},"body":{"type":2,"start":0,"end":12,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":13,"offset":12}},"items":[{"type":3,"start":0,"end":4,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":5,"offset":4}},"value":"hi, "},{"type":6,"start":4,"end":10,"loc":{"start":{"line":1,"column":5,"offset":4},"end":{"line":1,"column":11,"offset":10}},"key":{"type":7,"start":6,"end":10,"loc":{"start":{"line":1,"column":7,"offset":6},"end":{"line":1,"column":11,"offset":10}},"value":"name"}},{"type":3,"start":10,"end":12,"loc":{"start":{"line":1,"column":11,"offset":10},"end":{"line":1,"column":13,"offset":12}},"value":" !"}]}}, + "plural": {"type":0,"start":0,"end":45,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":46,"offset":45},"source":"@.caml:{\\u0027no apples\\u0027} | {0} apple | {n} apples"},"body":{"type":1,"start":0,"end":45,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":46,"offset":45}},"cases":[{"type":2,"start":0,"end":19,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":21,"offset":20}},"items":[{"type":6,"start":0,"end":20,"loc":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":21,"offset":20}},"modifier":{"type":8,"start":1,"end":6,"loc":{"start":{"line":1,"column":2,"offset":1},"end":{"line":1,"column":7,"offset":6}},"value":"caml"},"key":{"type":9,"start":7,"end":20,"loc":{"start":{"line":1,"column":8,"offset":7},"end":{"line":1,"column":21,"offset":20}},"value":"no apples"}}]},{"type":2,"start":23,"end":26,"loc":{"start":{"line":1,"column":24,"offset":23},"end":{"line":1,"column":33,"offset":32}},"items":[{"type":5,"start":23,"end":26,"loc":{"start":{"line":1,"column":24,"offset":23},"end":{"line":1,"column":27,"offset":26}},"index":0},{"type":3,"start":26,"end":32,"loc":{"start":{"line":1,"column":27,"offset":26},"end":{"line":1,"column":33,"offset":32}},"value":" apple"}]},{"type":2,"start":35,"end":45,"loc":{"start":{"line":1,"column":36,"offset":35},"end":{"line":1,"column":46,"offset":45}},"items":[{"type":4,"start":35,"end":38,"loc":{"start":{"line":1,"column":36,"offset":35},"end":{"line":1,"column":39,"offset":38}},"key":"n"},{"type":3,"start":38,"end":45,"loc":{"start":{"line":1,"column":39,"offset":38},"end":{"line":1,"column":46,"offset":45}},"value":" apples"}]}]}} } export default resource" `; exports[`AST code generation > unhandling > code 1`] = ` "const resource = { - \\"trueValue\\": true, - \\"falseValue\\": false, - \\"nullValue\\": null, - \\"numberValue\\": 1 + "trueValue": true, + "falseValue": false, + "nullValue": null, + "numberValue": 1 } export default resource" `; @@ -263,15 +263,15 @@ exports[`code generation > array basic > code 1`] = ` const _Component = Component _Component.__i18n = _Component.__i18n || [] _Component.__i18n.push({ - \\"locale\\": \\"\\", - \\"resource\\": { - \\"foo\\": [ + "locale": "", + "resource": { + "foo": [ [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"bar\\"])};fn.source=\\"bar\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["bar"])};fn.source="bar";return fn;})(), ], [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"baz\\"])};fn.source=\\"baz\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["baz"])};fn.source="baz";return fn;})(), ] ] @@ -293,7 +293,7 @@ exports[`code generation > array basic > map 1`] = ` ], "sourcesContent": [ "{ - \\"foo\\": [[\\"bar\\"], [\\"baz\\"]] + "foo": [["bar"], ["baz"]] } ", ], @@ -306,25 +306,25 @@ exports[`code generation > array mixed > code 1`] = ` const _Component = Component _Component.__i18n = _Component.__i18n || [] _Component.__i18n.push({ - \\"locale\\": \\"\\", - \\"resource\\": { - \\"foo\\": [ + "locale": "", + "resource": { + "foo": [ { - \\"foo\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"foo\\"])};fn.source=\\"foo\\";return fn;})() + "foo": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["foo"])};fn.source="foo";return fn;})() }, [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"bar\\"])};fn.source=\\"bar\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["bar"])};fn.source="bar";return fn;})(), [ { - \\"foo\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"foo\\"])};fn.source=\\"foo\\";return fn;})() + "foo": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["foo"])};fn.source="foo";return fn;})() }, - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hoge\\"])};fn.source=\\"hoge\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hoge"])};fn.source="hoge";return fn;})(), ] ], - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"baz\\"])};fn.source=\\"baz\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["baz"])};fn.source="baz";return fn;})(), [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"buz\\"])};fn.source=\\"buz\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["buz"])};fn.source="buz";return fn;})(), ] ] @@ -349,21 +349,21 @@ exports[`code generation > array mixed > map 1`] = ` ], "sourcesContent": [ "{ - \\"foo\\": [ + "foo": [ { - \\"foo\\": \\"foo\\" + "foo": "foo" }, [ - \\"bar\\", + "bar", [ { - \\"foo\\": \\"foo\\" + "foo": "foo" }, - \\"hoge\\" + "hoge" ] ], - \\"baz\\", - [\\"buz\\"] + "baz", + ["buz"] ] } ", @@ -374,7 +374,7 @@ exports[`code generation > array mixed > map 1`] = ` exports[`code generation > bare > code 1`] = ` "{ - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello world!\\"])};fn.source=\\"hello world!\\";return fn;})() + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello world!"])};fn.source="hello world!";return fn;})() }" `; @@ -389,7 +389,7 @@ exports[`code generation > bare > map 1`] = ` ], "sourcesContent": [ "{ - \\"hello\\": \\"hello world!\\" + "hello": "hello world!" } ", ], @@ -399,31 +399,31 @@ exports[`code generation > bare > map 1`] = ` exports[`code generation > complex > code 1`] = ` "const resource = { - \\"hi\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hi there!\\"])};fn.source=\\"hi there!\\";return fn;})(), - \\"nested\\": { - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello world!\\"])};fn.source=\\"hello world!\\";return fn;})(), - \\"more\\": { - \\"plural\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked(\\"no apples\\", \\"caml\\", _type)]), _normalize([_interpolate(_list(0)), \\" apple\\"]), _normalize([_interpolate(_named(\\"n\\")), \\" apples\\"])])};fn.source=\\"@.caml:{'no apples'} | {0} apple | {n} apples\\";return fn;})() + "hi": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hi there!"])};fn.source="hi there!";return fn;})(), + "nested": { + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello world!"])};fn.source="hello world!";return fn;})(), + "more": { + "plural": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked("no apples", "caml", _type)]), _normalize([_interpolate(_list(0)), " apple"]), _normalize([_interpolate(_named("n")), " apples"])])};fn.source="@.caml:{'no apples'} | {0} apple | {n} apples";return fn;})() }, - \\"list\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize([\\"hi, \\", _interpolate(_list(0)), \\" !\\"])};fn.source=\\"hi, {0} !\\";return fn;})() + "list": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize(["hi, ", _interpolate(_list(0)), " !"])};fn.source="hi, {0} !";return fn;})() }, - \\"こんにちは\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"こんにちは!\\"])};fn.source=\\"こんにちは!\\";return fn;})(), - \\"single-quote\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"I don't know!\\"])};fn.source=\\"I don't know!\\";return fn;})(), - \\"emoji\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"😺\\"])};fn.source=\\"😺\\";return fn;})(), - \\"unicode\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"A\\"])};fn.source=\\"A\\";return fn;})(), - \\"unicode-escape\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\u0041\\"])};fn.source=\\"\\\\\\\\u0041\\";return fn;})(), - \\"backslash-single-quote\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\'\\"])};fn.source=\\"\\\\\\\\'\\";return fn;})(), - \\"backslash-backslash\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\\\\\\\\\\\"])};fn.source=\\"\\\\\\\\\\\\\\\\\\";return fn;})(), - \\"errors\\": [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"ERROR1001\\"])};fn.source=\\"ERROR1001\\";return fn;})(), - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"ERROR1002\\"])};fn.source=\\"ERROR1002\\";return fn;})(), + "こんにちは": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["こんにちは!"])};fn.source="こんにちは!";return fn;})(), + "single-quote": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["I don't know!"])};fn.source="I don't know!";return fn;})(), + "emoji": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["😺"])};fn.source="😺";return fn;})(), + "unicode": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["A"])};fn.source="A";return fn;})(), + "unicode-escape": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\u0041"])};fn.source="\\\\u0041";return fn;})(), + "backslash-single-quote": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\'"])};fn.source="\\\\'";return fn;})(), + "backslash-backslash": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\\\\\"])};fn.source="\\\\\\\\";return fn;})(), + "errors": [ + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["ERROR1001"])};fn.source="ERROR1001";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["ERROR1002"])};fn.source="ERROR1002";return fn;})(), ], - \\"complex\\": { - \\"warnings\\": [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"NOTE: This is warning\\"])};fn.source=\\"NOTE: This is warning\\";return fn;})(), + "complex": { + "warnings": [ + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["NOTE: This is warning"])};fn.source="NOTE: This is warning";return fn;})(), { - \\"named-waring\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize([\\"this is \\", _interpolate(_named(\\"type\\")), \\" warining\\"])};fn.source=\\"this is {type} warining\\";return fn;})() + "named-waring": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize(["this is ", _interpolate(_named("type")), " warining"])};fn.source="this is {type} warining";return fn;})() } ] } @@ -449,9 +449,9 @@ exports[`code generation > complex > map 1`] = ` "I don't know!", "😺", "A", - "\\\\u0041", - "\\\\'", - "\\\\\\\\", + "\\u0041", + "\\'", + "\\\\", "ERROR1001", "ERROR1002", "NOTE: This is warning", @@ -464,27 +464,27 @@ exports[`code generation > complex > map 1`] = ` ], "sourcesContent": [ "{ - \\"hi\\": \\"hi there!\\", - \\"nested\\": { - \\"hello\\": \\"hello world!\\", - \\"more\\": { - \\"plural\\": \\"@.caml:{'no apples'} | {0} apple | {n} apples\\" + "hi": "hi there!", + "nested": { + "hello": "hello world!", + "more": { + "plural": "@.caml:{'no apples'} | {0} apple | {n} apples" }, - \\"list\\": \\"hi, {0} !\\" + "list": "hi, {0} !" }, - \\"こんにちは\\": \\"こんにちは!\\", - \\"single-quote\\": \\"I don't know!\\", - \\"emoji\\": \\"😺\\", - \\"unicode\\": \\"\\\\u0041\\", - \\"unicode-escape\\": \\"\\\\\\\\u0041\\", - \\"backslash-single-quote\\": \\"\\\\\\\\'\\", - \\"backslash-backslash\\": \\"\\\\\\\\\\\\\\\\\\", - \\"errors\\": [\\"ERROR1001\\", \\"ERROR1002\\"], - \\"complex\\": { - \\"warnings\\": [ - \\"NOTE: This is warning\\", + "こんにちは": "こんにちは!", + "single-quote": "I don't know!", + "emoji": "😺", + "unicode": "\\u0041", + "unicode-escape": "\\\\u0041", + "backslash-single-quote": "\\\\'", + "backslash-backslash": "\\\\\\\\", + "errors": ["ERROR1001", "ERROR1002"], + "complex": { + "warnings": [ + "NOTE: This is warning", { - \\"named-waring\\": \\"this is {type} warining\\" + "named-waring": "this is {type} warining" } ] } @@ -497,10 +497,10 @@ exports[`code generation > complex > map 1`] = ` exports[`code generation > force stringify > code 1`] = ` "const resource = { - \\"trueValue\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"true\\"])};fn.source=\\"true\\";return fn;})(), - \\"falseValue\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"false\\"])};fn.source=\\"false\\";return fn;})(), - \\"nullValue\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"null\\"])};fn.source=\\"null\\";return fn;})(), - \\"numberValue\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"1\\"])};fn.source=\\"1\\";return fn;})() + "trueValue": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["true"])};fn.source="true";return fn;})(), + "falseValue": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["false"])};fn.source="false";return fn;})(), + "nullValue": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["null"])};fn.source="null";return fn;})(), + "numberValue": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["1"])};fn.source="1";return fn;})() } export default resource" `; @@ -519,10 +519,10 @@ exports[`code generation > force stringify > map 1`] = ` ], "sourcesContent": [ "{ - \\"trueValue\\": true, - \\"falseValue\\": false, - \\"nullValue\\": null, - \\"numberValue\\": 1 + "trueValue": true, + "falseValue": false, + "nullValue": null, + "numberValue": 1 } ", ], @@ -532,8 +532,8 @@ exports[`code generation > force stringify > map 1`] = ` exports[`code generation > html tag in message > code 1`] = ` "{ - \\"hi\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"<p>hi there!</p>\\"])};fn.source=\\"

hi there!

\\";return fn;})(), - \\"alert\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"<script>window.alert('hi there!')</script>\\"])};fn.source=\\"\\";return fn;})() + "hi": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["<p>hi there!</p>"])};fn.source="

hi there!

";return fn;})(), + "alert": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["<script>window.alert('hi there!')</script>"])};fn.source="";return fn;})() }" `; @@ -554,12 +554,12 @@ exports[`code generation > html tag in message > errors 1`] = ` exports[`code generation > invalid message syntax > code 1`] = ` "{ - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"こんにちは\\"])};fn.source=\\"こんにちは\\";return fn;})(), - \\"this-is-invalid\\": \`@\`, - \\"nested\\": { - \\"array\\": [ + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["こんにちは"])};fn.source="こんにちは";return fn;})(), + "this-is-invalid": \`@\`, + "nested": { + "array": [ { - \\"this-is-invalid\\": \`@\` + "this-is-invalid": \`@\` } ] } @@ -659,12 +659,12 @@ exports[`code generation > invalid message syntax > map 1`] = ` ], "sourcesContent": [ "{ - \\"hello\\": \\"こんにちは\\", - \\"this-is-invalid\\": \\"@\\", - \\"nested\\": { - \\"array\\": [ + "hello": "こんにちは", + "this-is-invalid": "@", + "nested": { + "array": [ { - \\"this-is-invalid\\": \\"@\\" + "this-is-invalid": "@" } ] } @@ -677,13 +677,13 @@ exports[`code generation > invalid message syntax > map 1`] = ` exports[`code generation > simple > code 1`] = ` "const resource = { - \\"hi\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hi there!\\"])};fn.source=\\"hi there!\\";return fn;})(), - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello world!\\"])};fn.source=\\"hello world!\\";return fn;})(), - \\"named\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize([\\"hi, \\", _interpolate(_named(\\"name\\")), \\" !\\"])};fn.source=\\"hi, {name} !\\";return fn;})(), - \\"list\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize([\\"hi, \\", _interpolate(_list(0)), \\" !\\"])};fn.source=\\"hi, {0} !\\";return fn;})(), - \\"literal\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hi, \\", \\"kazupon\\", \\" !\\"])};fn.source=\\"hi, { 'kazupon' } !\\";return fn;})(), - \\"linked\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type } = ctx;return _normalize([\\"hi, \\", _linked(\\"name\\", undefined, _type), \\" !\\"])};fn.source=\\"hi, @:name !\\";return fn;})(), - \\"plural\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked(\\"no apples\\", \\"caml\\", _type)]), _normalize([_interpolate(_list(0)), \\" apple\\"]), _normalize([_interpolate(_named(\\"n\\")), \\" apples\\"])])};fn.source=\\"@.caml:{'no apples'} | {0} apple | {n} apples\\";return fn;})() + "hi": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hi there!"])};fn.source="hi there!";return fn;})(), + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello world!"])};fn.source="hello world!";return fn;})(), + "named": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize(["hi, ", _interpolate(_named("name")), " !"])};fn.source="hi, {name} !";return fn;})(), + "list": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize(["hi, ", _interpolate(_list(0)), " !"])};fn.source="hi, {0} !";return fn;})(), + "literal": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hi, ", "kazupon", " !"])};fn.source="hi, { 'kazupon' } !";return fn;})(), + "linked": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type } = ctx;return _normalize(["hi, ", _linked("name", undefined, _type), " !"])};fn.source="hi, @:name !";return fn;})(), + "plural": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked("no apples", "caml", _type)]), _normalize([_interpolate(_list(0)), " apple"]), _normalize([_interpolate(_named("n")), " apples"])])};fn.source="@.caml:{'no apples'} | {0} apple | {n} apples";return fn;})() } export default resource" `; @@ -710,13 +710,13 @@ exports[`code generation > simple > map 1`] = ` ], "sourcesContent": [ "{ - \\"hi\\": \\"hi there!\\", - \\"hello\\": \\"hello world!\\", - \\"named\\": \\"hi, {name} !\\", - \\"list\\": \\"hi, {0} !\\", - \\"literal\\": \\"hi, { 'kazupon' } !\\", - \\"linked\\": \\"hi, @:name !\\", - \\"plural\\": \\"@.caml:{'no apples'} | {0} apple | {n} apples\\" + "hi": "hi there!", + "hello": "hello world!", + "named": "hi, {name} !", + "list": "hi, {0} !", + "literal": "hi, { 'kazupon' } !", + "linked": "hi, @:name !", + "plural": "@.caml:{'no apples'} | {0} apple | {n} apples" } ", ], @@ -726,10 +726,10 @@ exports[`code generation > simple > map 1`] = ` exports[`code generation > unhandling > code 1`] = ` "const resource = { - \\"trueValue\\": true, - \\"falseValue\\": false, - \\"nullValue\\": null, - \\"numberValue\\": 1 + "trueValue": true, + "falseValue": false, + "nullValue": null, + "numberValue": 1 } export default resource" `; diff --git a/packages/bundle-utils/test/generator/__snapshots__/json5.test.ts.snap b/packages/bundle-utils/test/generator/__snapshots__/json5.test.ts.snap index dd838ec..7e4772d 100644 --- a/packages/bundle-utils/test/generator/__snapshots__/json5.test.ts.snap +++ b/packages/bundle-utils/test/generator/__snapshots__/json5.test.ts.snap @@ -2,31 +2,31 @@ exports[`AST code generation > code 1`] = ` "const resource = { - \\"hi\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"hi there!\\"}}, - \\"nested\\": { - \\"hello\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"hello world!\\"}}, - \\"more\\": { - \\"plural\\": {\\"t\\":0,\\"b\\":{\\"t\\":1,\\"c\\":[{\\"t\\":2,\\"i\\":[{\\"t\\":6,\\"k\\":{\\"t\\":9,\\"v\\":\\"no apples\\"},\\"m\\":{\\"t\\":8,\\"v\\":\\"caml\\"}}]},{\\"t\\":2,\\"i\\":[{\\"t\\":5,\\"i\\":0},{\\"t\\":3,\\"v\\":\\" apple\\"}]},{\\"t\\":2,\\"i\\":[{\\"t\\":4,\\"k\\":\\"n\\"},{\\"t\\":3,\\"v\\":\\" apples\\"}]}]}} + "hi": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"hi there!"}}, + "nested": { + "hello": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"hello world!"}}, + "more": { + "plural": {"t":0,"b":{"t":1,"c":[{"t":2,"i":[{"t":6,"k":{"t":9,"v":"no apples"},"m":{"t":8,"v":"caml"}}]},{"t":2,"i":[{"t":5,"i":0},{"t":3,"v":" apple"}]},{"t":2,"i":[{"t":4,"k":"n"},{"t":3,"v":" apples"}]}]}} }, - \\"list\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3,\\"v\\":\\"hi, \\"},{\\"t\\":5,\\"i\\":0},{\\"t\\":3,\\"v\\":\\" !\\"}]}} + "list": {"t":0,"b":{"t":2,"i":[{"t":3,"v":"hi, "},{"t":5,"i":0},{"t":3,"v":" !"}]}} }, - \\"こんにちは\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"こんにちは!\\"}}, - \\"single-quote\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"I don\\\\u0027t know!\\"}}, - \\"emoji\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"😺\\"}}, - \\"unicode\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"A\\"}}, - \\"unicode-escape\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"\\\\\\\\u0041\\"}}, - \\"backslash-single-quote\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"\\\\\\\\\\\\u0027\\"}}, - \\"backslash-backslash\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"\\\\\\\\\\\\\\\\\\"}}, - \\"errors\\": [ - {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"ERROR1001\\"}}, - {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"ERROR1002\\"}}, + "こんにちは": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"こんにちは!"}}, + "single-quote": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"I don\\u0027t know!"}}, + "emoji": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"😺"}}, + "unicode": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"A"}}, + "unicode-escape": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"\\\\u0041"}}, + "backslash-single-quote": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"\\\\\\u0027"}}, + "backslash-backslash": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"\\\\\\\\"}}, + "errors": [ + {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"ERROR1001"}}, + {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"ERROR1002"}}, ], - \\"complex\\": { - \\"warnings\\": [ - {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"NOTE: This is warning\\"}}, + "complex": { + "warnings": [ + {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"NOTE: This is warning"}}, { - \\"named-waring\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3,\\"v\\":\\"this is \\"},{\\"t\\":4,\\"k\\":\\"type\\"},{\\"t\\":3,\\"v\\":\\" warining\\"}]}} + "named-waring": {"t":0,"b":{"t":2,"i":[{"t":3,"v":"this is "},{"t":4,"k":"type"},{"t":3,"v":" warining"}]}} } ] } @@ -36,31 +36,31 @@ export default resource" exports[`json5 > code 1`] = ` "const resource = { - \\"hi\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hi there!\\"])};fn.source=\\"hi there!\\";return fn;})(), - \\"nested\\": { - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello world!\\"])};fn.source=\\"hello world!\\";return fn;})(), - \\"more\\": { - \\"plural\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked(\\"no apples\\", \\"caml\\", _type)]), _normalize([_interpolate(_list(0)), \\" apple\\"]), _normalize([_interpolate(_named(\\"n\\")), \\" apples\\"])])};fn.source=\\"@.caml:{'no apples'} | {0} apple | {n} apples\\";return fn;})() + "hi": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hi there!"])};fn.source="hi there!";return fn;})(), + "nested": { + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello world!"])};fn.source="hello world!";return fn;})(), + "more": { + "plural": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked("no apples", "caml", _type)]), _normalize([_interpolate(_list(0)), " apple"]), _normalize([_interpolate(_named("n")), " apples"])])};fn.source="@.caml:{'no apples'} | {0} apple | {n} apples";return fn;})() }, - \\"list\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize([\\"hi, \\", _interpolate(_list(0)), \\" !\\"])};fn.source=\\"hi, {0} !\\";return fn;})() + "list": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize(["hi, ", _interpolate(_list(0)), " !"])};fn.source="hi, {0} !";return fn;})() }, - \\"こんにちは\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"こんにちは!\\"])};fn.source=\\"こんにちは!\\";return fn;})(), - \\"single-quote\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"I don't know!\\"])};fn.source=\\"I don't know!\\";return fn;})(), - \\"emoji\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"😺\\"])};fn.source=\\"😺\\";return fn;})(), - \\"unicode\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"A\\"])};fn.source=\\"A\\";return fn;})(), - \\"unicode-escape\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\u0041\\"])};fn.source=\\"\\\\\\\\u0041\\";return fn;})(), - \\"backslash-single-quote\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\'\\"])};fn.source=\\"\\\\\\\\'\\";return fn;})(), - \\"backslash-backslash\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\\\\\\\\\\\"])};fn.source=\\"\\\\\\\\\\\\\\\\\\";return fn;})(), - \\"errors\\": [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"ERROR1001\\"])};fn.source=\\"ERROR1001\\";return fn;})(), - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"ERROR1002\\"])};fn.source=\\"ERROR1002\\";return fn;})(), + "こんにちは": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["こんにちは!"])};fn.source="こんにちは!";return fn;})(), + "single-quote": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["I don't know!"])};fn.source="I don't know!";return fn;})(), + "emoji": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["😺"])};fn.source="😺";return fn;})(), + "unicode": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["A"])};fn.source="A";return fn;})(), + "unicode-escape": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\u0041"])};fn.source="\\\\u0041";return fn;})(), + "backslash-single-quote": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\'"])};fn.source="\\\\'";return fn;})(), + "backslash-backslash": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\\\\\"])};fn.source="\\\\\\\\";return fn;})(), + "errors": [ + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["ERROR1001"])};fn.source="ERROR1001";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["ERROR1002"])};fn.source="ERROR1002";return fn;})(), ], - \\"complex\\": { - \\"warnings\\": [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"NOTE: This is warning\\"])};fn.source=\\"NOTE: This is warning\\";return fn;})(), + "complex": { + "warnings": [ + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["NOTE: This is warning"])};fn.source="NOTE: This is warning";return fn;})(), { - \\"named-waring\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize([\\"this is \\", _interpolate(_named(\\"type\\")), \\" warining\\"])};fn.source=\\"this is {type} warining\\";return fn;})() + "named-waring": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize(["this is ", _interpolate(_named("type")), " warining"])};fn.source="this is {type} warining";return fn;})() } ] } @@ -86,9 +86,9 @@ exports[`json5 > map 1`] = ` "I don't know!", "😺", "A", - "\\\\u0041", - "\\\\'", - "\\\\\\\\", + "\\u0041", + "\\'", + "\\\\", "ERROR1001", "ERROR1002", "NOTE: This is warning", @@ -101,22 +101,22 @@ exports[`json5 > map 1`] = ` ], "sourcesContent": [ "{ - hi: \\"hi there!\\", + hi: "hi there!", nested: { - hello: \\"hello world!\\", + hello: "hello world!", more: { - plural: \\"@.caml:{'no apples'} | {0} apple | {n} apples\\" + plural: "@.caml:{'no apples'} | {0} apple | {n} apples" }, - list: \\"hi, {0} !\\" + list: "hi, {0} !" }, // comment - \\"こんにちは\\": \\"こんにちは!\\", - \\"single-quote\\": \\"I don't know!\\", - emoji: \\"😺\\", - unicode: \\"\\\\u0041\\", - \\"unicode-escape\\": \\"\\\\\\\\u0041\\", - \\"backslash-single-quote\\": \\"\\\\\\\\'\\", - \\"backslash-backslash\\": \\"\\\\\\\\\\\\\\\\\\", + "こんにちは": "こんにちは!", + "single-quote": "I don't know!", + emoji: "😺", + unicode: "\\u0041", + "unicode-escape": "\\\\u0041", + "backslash-single-quote": "\\\\'", + "backslash-backslash": "\\\\\\\\", errors: [ 'ERROR1001', 'ERROR1002' ], @@ -124,7 +124,7 @@ exports[`json5 > map 1`] = ` warnings: [ 'NOTE: This is warning', { - \\"named-waring\\": 'this is {type} warining' + "named-waring": 'this is {type} warining' } ] } diff --git a/packages/bundle-utils/test/generator/__snapshots__/yaml.test.ts.snap b/packages/bundle-utils/test/generator/__snapshots__/yaml.test.ts.snap index ad38353..4bceace 100644 --- a/packages/bundle-utils/test/generator/__snapshots__/yaml.test.ts.snap +++ b/packages/bundle-utils/test/generator/__snapshots__/yaml.test.ts.snap @@ -2,31 +2,31 @@ exports[`AST code generation > code 1`] = ` "const resource = { - \\"hi\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"hi there!\\"}}, - \\"nested\\": { - \\"hello\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"hello world!\\"}}, - \\"more\\": { - \\"plural\\": {\\"t\\":0,\\"b\\":{\\"t\\":1,\\"c\\":[{\\"t\\":2,\\"i\\":[{\\"t\\":6,\\"k\\":{\\"t\\":9,\\"v\\":\\"no apples\\"},\\"m\\":{\\"t\\":8,\\"v\\":\\"caml\\"}}]},{\\"t\\":2,\\"i\\":[{\\"t\\":5,\\"i\\":0},{\\"t\\":3,\\"v\\":\\" apple\\"}]},{\\"t\\":2,\\"i\\":[{\\"t\\":4,\\"k\\":\\"n\\"},{\\"t\\":3,\\"v\\":\\" apples\\"}]}]}} + "hi": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"hi there!"}}, + "nested": { + "hello": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"hello world!"}}, + "more": { + "plural": {"t":0,"b":{"t":1,"c":[{"t":2,"i":[{"t":6,"k":{"t":9,"v":"no apples"},"m":{"t":8,"v":"caml"}}]},{"t":2,"i":[{"t":5,"i":0},{"t":3,"v":" apple"}]},{"t":2,"i":[{"t":4,"k":"n"},{"t":3,"v":" apples"}]}]}} }, - \\"list\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3,\\"v\\":\\"hi, \\"},{\\"t\\":5,\\"i\\":0},{\\"t\\":3,\\"v\\":\\" !\\"}]}} + "list": {"t":0,"b":{"t":2,"i":[{"t":3,"v":"hi, "},{"t":5,"i":0},{"t":3,"v":" !"}]}} }, - \\"こんにちは\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"こんにちは!\\"}}, - \\"single-quote\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"I don\\\\u0027t know!\\"}}, - \\"emoji\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"😺\\"}}, - \\"unicode\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"A\\"}}, - \\"unicode-escape\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"\\\\\\\\u0041\\"}}, - \\"backslash-single-quote\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"\\\\\\\\\\\\u0027\\"}}, - \\"backslash-backslash\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"\\\\\\\\\\\\\\\\\\"}}, - \\"errors\\": [ - {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"ERROR1001\\"}}, - {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"ERROR1002\\"}}, + "こんにちは": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"こんにちは!"}}, + "single-quote": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"I don\\u0027t know!"}}, + "emoji": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"😺"}}, + "unicode": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"A"}}, + "unicode-escape": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"\\\\u0041"}}, + "backslash-single-quote": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"\\\\\\u0027"}}, + "backslash-backslash": {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"\\\\\\\\"}}, + "errors": [ + {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"ERROR1001"}}, + {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"ERROR1002"}}, ], - \\"complex\\": { - \\"warnings\\": [ - {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3}],\\"s\\":\\"NOTE: This is warning\\"}}, + "complex": { + "warnings": [ + {"t":0,"b":{"t":2,"i":[{"t":3}],"s":"NOTE: This is warning"}}, { - \\"named-waring\\": {\\"t\\":0,\\"b\\":{\\"t\\":2,\\"i\\":[{\\"t\\":3,\\"v\\":\\"this is \\"},{\\"t\\":4,\\"k\\":\\"type\\"},{\\"t\\":3,\\"v\\":\\" warining\\"}]}} + "named-waring": {"t":0,"b":{"t":2,"i":[{"t":3,"v":"this is "},{"t":4,"k":"type"},{"t":3,"v":" warining"}]}} } ] } @@ -39,15 +39,15 @@ exports[`array basic > code 1`] = ` const _Component = Component _Component.__i18n = _Component.__i18n || [] _Component.__i18n.push({ - \\"locale\\": \\"\\", - \\"resource\\": { - \\"foo\\": [ + "locale": "", + "resource": { + "foo": [ [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"bar\\"])};fn.source=\\"bar\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["bar"])};fn.source="bar";return fn;})(), ], [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"baz\\"])};fn.source=\\"baz\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["baz"])};fn.source="baz";return fn;})(), ] ] @@ -81,25 +81,25 @@ exports[`array mixed > code 1`] = ` const _Component = Component _Component.__i18n = _Component.__i18n || [] _Component.__i18n.push({ - \\"locale\\": \\"\\", - \\"resource\\": { - \\"foo\\": [ + "locale": "", + "resource": { + "foo": [ { - \\"foo\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"foo\\"])};fn.source=\\"foo\\";return fn;})() + "foo": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["foo"])};fn.source="foo";return fn;})() }, [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"bar\\"])};fn.source=\\"bar\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["bar"])};fn.source="bar";return fn;})(), [ { - \\"foo\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"foo\\"])};fn.source=\\"foo\\";return fn;})() + "foo": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["foo"])};fn.source="foo";return fn;})() }, - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hoge\\"])};fn.source=\\"hoge\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hoge"])};fn.source="hoge";return fn;})(), ] ], - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"baz\\"])};fn.source=\\"baz\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["baz"])};fn.source="baz";return fn;})(), [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"buz\\"])};fn.source=\\"buz\\";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["buz"])};fn.source="buz";return fn;})(), ] ] @@ -137,7 +137,7 @@ exports[`array mixed > map 1`] = ` exports[`bare > code 1`] = ` "{ - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello world!\\"])};fn.source=\\"hello world!\\";return fn;})() + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello world!"])};fn.source="hello world!";return fn;})() }" `; @@ -160,8 +160,8 @@ exports[`bare > map 1`] = ` exports[`html tag in message > code 1`] = ` "{ - \\"hi\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"<p>hi there!</p>\\"])};fn.source=\\"

hi there!

\\";return fn;})(), - \\"alert\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"<script>window.alert('hi there!')</script>\\"])};fn.source=\\"\\";return fn;})() + "hi": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["<p>hi there!</p>"])};fn.source="

hi there!

";return fn;})(), + "alert": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["<script>window.alert('hi there!')</script>"])};fn.source="";return fn;})() }" `; @@ -182,12 +182,12 @@ exports[`html tag in message > errors 1`] = ` exports[`invalid message syntax > code 1`] = ` "{ - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"こんにちは\\"])};fn.source=\\"こんにちは\\";return fn;})(), - \\"this-is-invalid\\": \`@\`, - \\"nested\\": { - \\"array\\": [ + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["こんにちは"])};fn.source="こんにちは";return fn;})(), + "this-is-invalid": \`@\`, + "nested": { + "array": [ { - \\"this-is-invalid\\": \`@\` + "this-is-invalid": \`@\` } ] } @@ -299,31 +299,31 @@ nested: exports[`yaml > code 1`] = ` "const resource = { - \\"hi\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hi there!\\"])};fn.source=\\"hi there!\\";return fn;})(), - \\"nested\\": { - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello world!\\"])};fn.source=\\"hello world!\\";return fn;})(), - \\"more\\": { - \\"plural\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked(\\"no apples\\", \\"caml\\", _type)]), _normalize([_interpolate(_list(0)), \\" apple\\"]), _normalize([_interpolate(_named(\\"n\\")), \\" apples\\"])])};fn.source=\\"@.caml:{'no apples'} | {0} apple | {n} apples\\";return fn;})() + "hi": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hi there!"])};fn.source="hi there!";return fn;})(), + "nested": { + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello world!"])};fn.source="hello world!";return fn;})(), + "more": { + "plural": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked("no apples", "caml", _type)]), _normalize([_interpolate(_list(0)), " apple"]), _normalize([_interpolate(_named("n")), " apples"])])};fn.source="@.caml:{'no apples'} | {0} apple | {n} apples";return fn;})() }, - \\"list\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize([\\"hi, \\", _interpolate(_list(0)), \\" !\\"])};fn.source=\\"hi, {0} !\\";return fn;})() + "list": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize(["hi, ", _interpolate(_list(0)), " !"])};fn.source="hi, {0} !";return fn;})() }, - \\"こんにちは\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"こんにちは!\\"])};fn.source=\\"こんにちは!\\";return fn;})(), - \\"single-quote\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"I don't know!\\"])};fn.source=\\"I don't know!\\";return fn;})(), - \\"emoji\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"😺\\"])};fn.source=\\"😺\\";return fn;})(), - \\"unicode\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"A\\"])};fn.source=\\"A\\";return fn;})(), - \\"unicode-escape\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\u0041\\"])};fn.source=\\"\\\\\\\\u0041\\";return fn;})(), - \\"backslash-single-quote\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\'\\"])};fn.source=\\"\\\\\\\\'\\";return fn;})(), - \\"backslash-backslash\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\\\\\\\\\\\"])};fn.source=\\"\\\\\\\\\\\\\\\\\\";return fn;})(), - \\"errors\\": [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"ERROR1001\\"])};fn.source=\\"ERROR1001\\";return fn;})(), - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"ERROR1002\\"])};fn.source=\\"ERROR1002\\";return fn;})(), + "こんにちは": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["こんにちは!"])};fn.source="こんにちは!";return fn;})(), + "single-quote": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["I don't know!"])};fn.source="I don't know!";return fn;})(), + "emoji": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["😺"])};fn.source="😺";return fn;})(), + "unicode": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["A"])};fn.source="A";return fn;})(), + "unicode-escape": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\u0041"])};fn.source="\\\\u0041";return fn;})(), + "backslash-single-quote": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\'"])};fn.source="\\\\'";return fn;})(), + "backslash-backslash": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\\\\\"])};fn.source="\\\\\\\\";return fn;})(), + "errors": [ + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["ERROR1001"])};fn.source="ERROR1001";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["ERROR1002"])};fn.source="ERROR1002";return fn;})(), ], - \\"complex\\": { - \\"warnings\\": [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"NOTE: This is warning\\"])};fn.source=\\"NOTE: This is warning\\";return fn;})(), + "complex": { + "warnings": [ + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["NOTE: This is warning"])};fn.source="NOTE: This is warning";return fn;})(), { - \\"named-waring\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize([\\"this is \\", _interpolate(_named(\\"type\\")), \\" warining\\"])};fn.source=\\"this is {type} warining\\";return fn;})() + "named-waring": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize(["this is ", _interpolate(_named("type")), " warining"])};fn.source="this is {type} warining";return fn;})() } ] } @@ -349,9 +349,9 @@ exports[`yaml > map 1`] = ` "I don't know!", "😺", "A", - "\\\\u0041", - "\\\\'", - "\\\\\\\\", + "\\u0041", + "\\'", + "\\\\", "ERROR1001", "ERROR1002", "NOTE: This is warning", @@ -365,24 +365,24 @@ exports[`yaml > map 1`] = ` "sourcesContent": [ "hi: hi there! nested: - \\"hello\\": \\"hello world!\\" + "hello": "hello world!" more: - plural: \\"@.caml:{'no apples'} | {0} apple | {n} apples\\" + plural: "@.caml:{'no apples'} | {0} apple | {n} apples" list: hi, {0} ! -こんにちは: \\"こんにちは!\\" -single-quote: \\"I don't know!\\" +こんにちは: "こんにちは!" +single-quote: "I don't know!" emoji: 😺 -unicode: \\"\\\\u0041\\" -unicode-escape: \\"\\\\\\\\u0041\\" -backslash-single-quote: \\\\' -backslash-backslash: \\\\\\\\ +unicode: "\\u0041" +unicode-escape: "\\\\u0041" +backslash-single-quote: \\' +backslash-backslash: \\\\ errors: - ERROR1001 - ERROR1002 complex: warnings: - 'NOTE: This is warning' - - named-waring: \\"this is {type} warining\\" + - named-waring: "this is {type} warining" ", ], "version": 3, @@ -391,31 +391,31 @@ complex: exports[`yml > code 1`] = ` "const resource = { - \\"hi\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hi there!\\"])};fn.source=\\"hi there!\\";return fn;})(), - \\"nested\\": { - \\"hello\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"hello world!\\"])};fn.source=\\"hello world!\\";return fn;})(), - \\"more\\": { - \\"plural\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked(\\"no apples\\", \\"caml\\", _type)]), _normalize([_interpolate(_list(0)), \\" apple\\"]), _normalize([_interpolate(_named(\\"n\\")), \\" apples\\"])])};fn.source=\\"@.caml:{'no apples'} | {0} apple | {n} apples\\";return fn;})() + "hi": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hi there!"])};fn.source="hi there!";return fn;})(), + "nested": { + "hello": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["hello world!"])};fn.source="hello world!";return fn;})(), + "more": { + "plural": (()=>{const fn=(ctx) => {const { normalize: _normalize, linked: _linked, type: _type, interpolate: _interpolate, list: _list, named: _named, plural: _plural } = ctx;return _plural([_normalize([_linked("no apples", "caml", _type)]), _normalize([_interpolate(_list(0)), " apple"]), _normalize([_interpolate(_named("n")), " apples"])])};fn.source="@.caml:{'no apples'} | {0} apple | {n} apples";return fn;})() }, - \\"list\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize([\\"hi, \\", _interpolate(_list(0)), \\" !\\"])};fn.source=\\"hi, {0} !\\";return fn;})() + "list": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize(["hi, ", _interpolate(_list(0)), " !"])};fn.source="hi, {0} !";return fn;})() }, - \\"こんにちは\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"こんにちは!\\"])};fn.source=\\"こんにちは!\\";return fn;})(), - \\"single-quote\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"I don't know!\\"])};fn.source=\\"I don't know!\\";return fn;})(), - \\"emoji\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"😺\\"])};fn.source=\\"😺\\";return fn;})(), - \\"unicode\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"A\\"])};fn.source=\\"A\\";return fn;})(), - \\"unicode-escape\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\u0041\\"])};fn.source=\\"\\\\\\\\u0041\\";return fn;})(), - \\"backslash-single-quote\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\'\\"])};fn.source=\\"\\\\\\\\'\\";return fn;})(), - \\"backslash-backslash\\": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"\\\\\\\\\\\\\\\\\\"])};fn.source=\\"\\\\\\\\\\\\\\\\\\";return fn;})(), - \\"errors\\": [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"ERROR1001\\"])};fn.source=\\"ERROR1001\\";return fn;})(), - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"ERROR1002\\"])};fn.source=\\"ERROR1002\\";return fn;})(), + "こんにちは": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["こんにちは!"])};fn.source="こんにちは!";return fn;})(), + "single-quote": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["I don't know!"])};fn.source="I don't know!";return fn;})(), + "emoji": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["😺"])};fn.source="😺";return fn;})(), + "unicode": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["A"])};fn.source="A";return fn;})(), + "unicode-escape": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\u0041"])};fn.source="\\\\u0041";return fn;})(), + "backslash-single-quote": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\'"])};fn.source="\\\\'";return fn;})(), + "backslash-backslash": (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["\\\\\\\\"])};fn.source="\\\\\\\\";return fn;})(), + "errors": [ + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["ERROR1001"])};fn.source="ERROR1001";return fn;})(), + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["ERROR1002"])};fn.source="ERROR1002";return fn;})(), ], - \\"complex\\": { - \\"warnings\\": [ - (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize([\\"NOTE: This is warning\\"])};fn.source=\\"NOTE: This is warning\\";return fn;})(), + "complex": { + "warnings": [ + (()=>{const fn=(ctx) => {const { normalize: _normalize } = ctx;return _normalize(["NOTE: This is warning"])};fn.source="NOTE: This is warning";return fn;})(), { - \\"named-waring\\": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize([\\"this is \\", _interpolate(_named(\\"type\\")), \\" warining\\"])};fn.source=\\"this is {type} warining\\";return fn;})() + "named-waring": (()=>{const fn=(ctx) => {const { normalize: _normalize, interpolate: _interpolate, named: _named } = ctx;return _normalize(["this is ", _interpolate(_named("type")), " warining"])};fn.source="this is {type} warining";return fn;})() } ] } @@ -441,9 +441,9 @@ exports[`yml > map 1`] = ` "I don't know!", "😺", "A", - "\\\\u0041", - "\\\\'", - "\\\\\\\\", + "\\u0041", + "\\'", + "\\\\", "ERROR1001", "ERROR1002", "NOTE: This is warning", @@ -457,24 +457,24 @@ exports[`yml > map 1`] = ` "sourcesContent": [ "hi: hi there! nested: - \\"hello\\": \\"hello world!\\" + "hello": "hello world!" more: - plural: \\"@.caml:{'no apples'} | {0} apple | {n} apples\\" + plural: "@.caml:{'no apples'} | {0} apple | {n} apples" list: hi, {0} ! -こんにちは: \\"こんにちは!\\" -single-quote: \\"I don't know!\\" +こんにちは: "こんにちは!" +single-quote: "I don't know!" emoji: 😺 -unicode: \\"\\\\u0041\\" -unicode-escape: \\"\\\\\\\\u0041\\" -backslash-single-quote: \\\\' -backslash-backslash: \\\\\\\\ +unicode: "\\u0041" +unicode-escape: "\\\\u0041" +backslash-single-quote: \\' +backslash-backslash: \\\\ errors: - ERROR1001 - ERROR1002 complex: warnings: - 'NOTE: This is warning' - - named-waring: \\"this is {type} warining\\" + - named-waring: "this is {type} warining" ", ], "version": 3, diff --git a/packages/unplugin-vue-i18n/package.json b/packages/unplugin-vue-i18n/package.json index 67ede57..661a724 100644 --- a/packages/unplugin-vue-i18n/package.json +++ b/packages/unplugin-vue-i18n/package.json @@ -34,6 +34,7 @@ "fast-glob": "^3.2.12", "js-yaml": "^4.1.0", "json5": "^2.2.3", + "mlly": "^1.7.1", "pathe": "^1.0.0", "picocolors": "^1.0.0", "source-map-js": "^1.0.2", diff --git a/packages/unplugin-vue-i18n/src/utils/index.ts b/packages/unplugin-vue-i18n/src/utils/index.ts index 0377e80..f37e65d 100644 --- a/packages/unplugin-vue-i18n/src/utils/index.ts +++ b/packages/unplugin-vue-i18n/src/utils/index.ts @@ -1,3 +1,4 @@ export * from './log' export * from './plugin' export * from './resolver' +export * from './pkg' diff --git a/packages/unplugin-vue-i18n/src/utils/pkg.ts b/packages/unplugin-vue-i18n/src/utils/pkg.ts new file mode 100644 index 0000000..4ee6137 --- /dev/null +++ b/packages/unplugin-vue-i18n/src/utils/pkg.ts @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: MIT +// Modified by: kazuya kawaguchi (a.k.a. kazupon) +// Auther: Pooya Parsa (https://github.com/pi0) +// Forked from: https://github.com/unjs/pkg-types +// Note: Modified to work as a synchronous API + +import { statSync } from 'node:fs' +import { join, resolve, isAbsolute } from 'pathe' +import { resolvePathSync } from 'mlly' + +import type { ResolveOptions as _ResolveOptions } from 'mlly' + +export interface FindFileOptions { + /** + * The starting directory for the search. + * @default . (same as `process.cwd()`) + */ + startingFrom?: string + /** + * A pattern to match a path segment above which you don't want to ascend + * @default /^node_modules$/ + */ + rootPattern?: RegExp + /** + * If true, search starts from root level descending into subdirectories + */ + reverse?: boolean + /** + * A matcher that can evaluate whether the given path is a valid file (for example, + * by testing whether the file path exists. + * + * @default fs.statSync(path).isFile() + */ + test?: (filePath: string) => boolean | undefined +} + +const defaultFindOptions: Required = { + startingFrom: '.', + rootPattern: /^node_modules$/, + reverse: false, + test: (filePath: string) => { + try { + if (statSync(filePath).isFile()) { + return true + } + } catch { + // Ignore + } + } +} + +/** + * Asynchronously finds a file by name, starting from the specified directory and traversing up (or down if reverse). + * @param filename - The name of the file to find. + * @param _options - Options to customise the search behaviour. + * @returns a promise that resolves to the path of the file found. + * @throws Will throw an error if the file cannot be found. + */ +function findFile( + filename: string | string[], + _options: FindFileOptions = {} +): string { + const filenames = Array.isArray(filename) ? filename : [filename] + const options = { ...defaultFindOptions, ..._options } + const basePath = resolve(options.startingFrom) + const leadingSlash = basePath[0] === '/' + const segments = basePath.split('/').filter(Boolean) + + // Restore leading slash + if (leadingSlash) { + segments[0] = '/' + segments[0] + } + + // Limit to node_modules scope if it exists + let root = segments.findIndex(r => r.match(options.rootPattern)) + if (root === -1) { + root = 0 + } + + if (options.reverse) { + for (let index = root + 1; index <= segments.length; index++) { + for (const filename of filenames) { + const filePath = join(...segments.slice(0, index), filename) + if (options.test(filePath)) { + return filePath + } + } + } + } else { + for (let index = segments.length; index > root; index--) { + for (const filename of filenames) { + const filePath = join(...segments.slice(0, index), filename) + if (options.test(filePath)) { + return filePath + } + } + } + } + + throw new Error( + `Cannot find matching ${filename} in ${options.startingFrom} or parent directories` + ) +} + +/** + * Asynchronously finds the next file with the given name, starting in the given directory and moving up. + * Alias for findFile without reversing the search. + * @param filename - The name of the file to find. + * @param _options - Options to customise the search behaviour. + * @returns A promise that resolves to the path of the next file found. + */ +function findNearestFile( + filename: string | string[], + _options: FindFileOptions = {} +): string { + return findFile(filename, _options) +} + +/** + * Represents the options for resolving paths with additional file finding capabilities. + */ +export type ResolveOptions = _ResolveOptions & FindFileOptions + +/** + * Resolves the path to the nearest `package.json` file from a given directory. + * @param id - The base path for the search, defaults to the current working directory. + * @param options - Options to modify the search behaviour. See {@link ResolveOptions}. + * @returns A promise resolving to the path of the nearest `package.json` file. + */ +export function resolvePackageJSON( + id: string = process.cwd(), + options: ResolveOptions = {} +): string { + const resolvedPath = isAbsolute(id) ? id : resolvePathSync(id, options) + return findNearestFile('package.json', { + startingFrom: resolvedPath, + ...options + }) +} diff --git a/packages/unplugin-vue-i18n/src/utils/resolver.ts b/packages/unplugin-vue-i18n/src/utils/resolver.ts index 9fd2b3c..6aec6b6 100644 --- a/packages/unplugin-vue-i18n/src/utils/resolver.ts +++ b/packages/unplugin-vue-i18n/src/utils/resolver.ts @@ -2,6 +2,7 @@ import fs from 'node:fs' import createDebug from 'debug' import module from 'node:module' import path from 'node:path' +import { resolvePackageJSON } from './pkg' const SUPPORT_PACKAGES = ['vue-i18n', 'petite-vue-i18n'] as const @@ -40,11 +41,13 @@ function resolvePkgPath( * Assuming the case of using npm alias `npm:`, * get the installed package name from `package.json` */ - const resolvedPath = _require.resolve(id) - const pkgPath = path.dirname(resolvedPath) - const pkgJson = JSON.parse( - fs.readFileSync(path.join(pkgPath, 'package.json'), 'utf-8') - ) as { name: string } + const modPath = _require.resolve(id) + debug('modPath:', modPath, id) + const pkgJsonPath = resolvePackageJSON(modPath) + debug('pkgJsonPath:', pkgJsonPath) + const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf-8')) as { + name: string + } const pkgName: string = pkgJson.name.startsWith('vue-i18n') ? 'vue-i18n' : pkgJson.name.startsWith('petite-vue-i18n') diff --git a/packages/unplugin-vue-i18n/test/fixtures/packages/no-pkg/.gitkeep b/packages/unplugin-vue-i18n/test/fixtures/packages/no-pkg/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/unplugin-vue-i18n/test/fixtures/packages/package.json b/packages/unplugin-vue-i18n/test/fixtures/packages/package.json new file mode 100644 index 0000000..c4daf95 --- /dev/null +++ b/packages/unplugin-vue-i18n/test/fixtures/packages/package.json @@ -0,0 +1,4 @@ +{ + "name": "root", + "version": "1.0.0" +} diff --git a/packages/unplugin-vue-i18n/test/fixtures/packages/pkg1/package.json b/packages/unplugin-vue-i18n/test/fixtures/packages/pkg1/package.json new file mode 100644 index 0000000..d1ecc81 --- /dev/null +++ b/packages/unplugin-vue-i18n/test/fixtures/packages/pkg1/package.json @@ -0,0 +1,4 @@ +{ + "name": "pkg1", + "version": "1.0.0" +} diff --git a/packages/unplugin-vue-i18n/test/pkg.test.ts b/packages/unplugin-vue-i18n/test/pkg.test.ts new file mode 100644 index 0000000..a18bc2e --- /dev/null +++ b/packages/unplugin-vue-i18n/test/pkg.test.ts @@ -0,0 +1,37 @@ +import { fileURLToPath } from 'node:url' +import { dirname, resolve } from 'pathe' +import { promises as fs } from 'node:fs' +import { resolvePackageJSON } from '../src/utils' + +const fixtureDir = resolve( + dirname(fileURLToPath(import.meta.url)), + 'fixtures/packages' +) +const resolveFixture = (...p: string[]) => resolve(fixtureDir, ...p) + +async function readJSON(file: string) { + return JSON.parse(await fs.readFile(file, 'utf-8')) as { name: string } +} + +describe('resolvePackageJSON', () => { + test('in current', async () => { + const { name } = await readJSON( + await resolvePackageJSON(resolveFixture('.')) + ) + expect(name).toEqual('root') + }) + + test('in pkg1', async () => { + const { name } = await readJSON( + await resolvePackageJSON(resolveFixture('./pkg1')) + ) + expect(name).toEqual('pkg1') + }) + + test('do not have package.json', async () => { + const { name } = await readJSON( + await resolvePackageJSON(resolveFixture('./no-pkg')) + ) + expect(name).toEqual('root') + }) +}) diff --git a/packages/unplugin-vue-i18n/test/vite/__snapshots__/custom-block.test.ts.snap b/packages/unplugin-vue-i18n/test/vite/__snapshots__/custom-block.test.ts.snap index 45ffd1f..4c45094 100644 --- a/packages/unplugin-vue-i18n/test/vite/__snapshots__/custom-block.test.ts.snap +++ b/packages/unplugin-vue-i18n/test/vite/__snapshots__/custom-block.test.ts.snap @@ -1315,7 +1315,7 @@ exports[`special characters 1`] = ` }, "start": 0, "static": "hello -great \\"world\\"", +great "world"", "type": 2, }, "end": 19, @@ -1326,7 +1326,7 @@ great \\"world\\"", "offset": 19, }, "source": "hello -great \\"world\\"", +great "world"", "start": { "column": 1, "line": 1, diff --git a/packages/unplugin-vue-i18n/test/vite/__snapshots__/translation-directive.test.ts.snap b/packages/unplugin-vue-i18n/test/vite/__snapshots__/translation-directive.test.ts.snap index 4649ba0..38ea123 100644 --- a/packages/unplugin-vue-i18n/test/vite/__snapshots__/translation-directive.test.ts.snap +++ b/packages/unplugin-vue-i18n/test/vite/__snapshots__/translation-directive.test.ts.snap @@ -7,16 +7,16 @@ exports[`translation directive > script-setup-alias 1`] = ` null, [ createBaseVNode( - \\"h1\\", + "h1", null, - toDisplayString$1(($setup.translation || _ctx.$t)(\\"hello\\", {}, {})), + toDisplayString$1(($setup.translation || _ctx.$t)("hello", {}, {})), 1 /* TEXT */ ), createBaseVNode( - \\"p\\", + "p", null, - toDisplayString$1($setup.count) + \\" \\" + toDisplayString$1($setup.translation(\\"hello\\")), + toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.translation("hello")), 1 /* TEXT */ ) @@ -34,16 +34,16 @@ exports[`translation directive > script-setup-global-option 1`] = ` null, [ createBaseVNode( - \\"h1\\", + "h1", null, - toDisplayString$1(($setup.t || _ctx.$t)(\\"hello\\", {}, {})), + toDisplayString$1(($setup.t || _ctx.$t)("hello", {}, {})), 1 /* TEXT */ ), createBaseVNode( - \\"p\\", + "p", null, - toDisplayString$1($setup.count) + \\" \\" + toDisplayString$1($setup.t(\\"hello\\")), + toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.t("hello")), 1 /* TEXT */ ) @@ -61,16 +61,16 @@ exports[`translation directive > script-setup-local-option 1`] = ` null, [ createBaseVNode( - \\"h1\\", + "h1", null, - toDisplayString$1(($setup.t || _ctx.$t)(\\"count\\", {}, {})), + toDisplayString$1(($setup.t || _ctx.$t)("count", {}, {})), 1 /* TEXT */ ), createBaseVNode( - \\"p\\", + "p", null, - toDisplayString$1($setup.count) + \\" \\" + toDisplayString$1($setup.t(\\"hello\\")), + toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.t("hello")), 1 /* TEXT */ ) @@ -88,16 +88,16 @@ exports[`translation directive > script-setup-no-option 1`] = ` null, [ createBaseVNode( - \\"h1\\", + "h1", null, - toDisplayString$1(($setup.t || _ctx.$t)(\\"hello\\", {}, {})), + toDisplayString$1(($setup.t || _ctx.$t)("hello", {}, {})), 1 /* TEXT */ ), createBaseVNode( - \\"p\\", + "p", null, - toDisplayString$1($setup.count) + \\" \\" + toDisplayString$1($setup.t(\\"hello\\")), + toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.t("hello")), 1 /* TEXT */ ) @@ -115,14 +115,14 @@ exports[`translation directive > script-setup-no-use 1`] = ` null, [ createBaseVNode( - \\"h1\\", + "h1", null, - toDisplayString(_ctx.$t(\\"hello\\", {}, {})), + toDisplayString(_ctx.$t("hello", {}, {})), 1 /* TEXT */ ), createBaseVNode( - \\"p\\", + "p", null, toDisplayString($setup.count), 1 @@ -142,16 +142,16 @@ exports[`translation directive > script-setup-obj 1`] = ` null, [ createBaseVNode( - \\"h1\\", + "h1", null, - toDisplayString$1(($setup.i18n.t || _ctx.$t)(\\"hello\\", {}, {})), + toDisplayString$1(($setup.i18n.t || _ctx.$t)("hello", {}, {})), 1 /* TEXT */ ), createBaseVNode( - \\"p\\", + "p", null, - toDisplayString$1($setup.count) + \\" \\" + toDisplayString$1($setup.i18n.t(\\"hello\\")), + toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.i18n.t("hello")), 1 /* TEXT */ ) @@ -169,16 +169,16 @@ exports[`translation directive > setup-alias 1`] = ` null, [ createBaseVNode( - \\"h1\\", + "h1", null, - toDisplayString$1(($setup.translation || _ctx.$t)(\\"hello\\", {}, {})), + toDisplayString$1(($setup.translation || _ctx.$t)("hello", {}, {})), 1 /* TEXT */ ), createBaseVNode( - \\"p\\", + "p", null, - toDisplayString$1($setup.count) + \\" \\" + toDisplayString$1($setup.translation(\\"hello\\")), + toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.translation("hello")), 1 /* TEXT */ ) @@ -196,16 +196,16 @@ exports[`translation directive > setup-global-option 1`] = ` null, [ createBaseVNode( - \\"h1\\", + "h1", null, - toDisplayString$1(($setup.t || _ctx.$t)(\\"hello\\", {}, {})), + toDisplayString$1(($setup.t || _ctx.$t)("hello", {}, {})), 1 /* TEXT */ ), createBaseVNode( - \\"p\\", + "p", null, - toDisplayString$1($setup.count) + \\" \\" + toDisplayString$1($setup.t(\\"hello\\")), + toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.t("hello")), 1 /* TEXT */ ) @@ -223,16 +223,16 @@ exports[`translation directive > setup-local-option 1`] = ` null, [ createBaseVNode( - \\"h1\\", + "h1", null, - toDisplayString$1(($setup.t || _ctx.$t)(\\"count\\", {}, {})), + toDisplayString$1(($setup.t || _ctx.$t)("count", {}, {})), 1 /* TEXT */ ), createBaseVNode( - \\"p\\", + "p", null, - toDisplayString$1($setup.count) + \\" \\" + toDisplayString$1($setup.t(\\"hello\\")), + toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.t("hello")), 1 /* TEXT */ ) @@ -250,16 +250,16 @@ exports[`translation directive > setup-no-option 1`] = ` null, [ createBaseVNode( - \\"h1\\", + "h1", null, - toDisplayString$1(($setup.t || _ctx.$t)(\\"hello\\", {}, {})), + toDisplayString$1(($setup.t || _ctx.$t)("hello", {}, {})), 1 /* TEXT */ ), createBaseVNode( - \\"p\\", + "p", null, - toDisplayString$1($setup.count) + \\" \\" + toDisplayString$1($setup.t(\\"hello\\")), + toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.t("hello")), 1 /* TEXT */ ) @@ -277,14 +277,14 @@ exports[`translation directive > setup-no-use 1`] = ` null, [ createBaseVNode( - \\"h1\\", + "h1", null, - toDisplayString(_ctx.$t(\\"hello\\", {}, {})), + toDisplayString(_ctx.$t("hello", {}, {})), 1 /* TEXT */ ), createBaseVNode( - \\"p\\", + "p", null, toDisplayString($setup.count), 1 @@ -304,16 +304,16 @@ exports[`translation directive > setup-return-alias 1`] = ` null, [ createBaseVNode( - \\"h1\\", + "h1", null, - toDisplayString$1(($setup.translation || _ctx.$t)(\\"hello\\", {}, {})), + toDisplayString$1(($setup.translation || _ctx.$t)("hello", {}, {})), 1 /* TEXT */ ), createBaseVNode( - \\"p\\", + "p", null, - toDisplayString$1($setup.count) + \\" \\" + toDisplayString$1($setup.translation(\\"hello\\")), + toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.translation("hello")), 1 /* TEXT */ ) @@ -331,16 +331,16 @@ exports[`translation directive > setup-return-alias-with-obj 1`] = ` null, [ createBaseVNode( - \\"h1\\", + "h1", null, - toDisplayString$1(($setup.translation || _ctx.$t)(\\"hello\\", {}, {})), + toDisplayString$1(($setup.translation || _ctx.$t)("hello", {}, {})), 1 /* TEXT */ ), createBaseVNode( - \\"p\\", + "p", null, - toDisplayString$1($setup.count) + \\" \\" + toDisplayString$1($setup.translation(\\"hello\\")), + toDisplayString$1($setup.count) + " " + toDisplayString$1($setup.translation("hello")), 1 /* TEXT */ ) diff --git a/packages/unplugin-vue-i18n/test/webpack/__snapshots__/custom-block.test.ts.snap b/packages/unplugin-vue-i18n/test/webpack/__snapshots__/custom-block.test.ts.snap index 0fa120a..3a62303 100644 --- a/packages/unplugin-vue-i18n/test/webpack/__snapshots__/custom-block.test.ts.snap +++ b/packages/unplugin-vue-i18n/test/webpack/__snapshots__/custom-block.test.ts.snap @@ -1088,7 +1088,7 @@ exports[`special characters 1`] = ` }, "start": 0, "static": "hello -great \\"world\\"", +great "world"", "type": 2, }, "end": 19, @@ -1099,7 +1099,7 @@ great \\"world\\"", "offset": 19, }, "source": "hello -great \\"world\\"", +great "world"", "start": { "column": 1, "line": 1, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 31515c8..9f0c9ac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -189,8 +189,8 @@ importers: specifier: ^4.4.9 version: 4.5.3(@types/node@20.14.5)(terser@5.31.1) vitest: - specifier: ^0.34.0 - version: 0.34.6(jsdom@16.7.0)(playwright@1.44.1)(terser@5.31.1) + specifier: ^1.6.0 + version: 1.6.0(@types/node@20.14.5)(jsdom@16.7.0)(terser@5.31.1) vue: specifier: ^3.2.25 version: 3.4.29(typescript@4.9.5) @@ -281,7 +281,7 @@ importers: version: 6.2.0(@intlify/shared@10.0.0-beta.1)(@vue/compiler-dom@3.4.29)(vue-i18n@9.13.1(vue@3.4.29(typescript@4.9.5)))(vue@3.4.29(typescript@4.9.5)) '@rollup/pluginutils': specifier: ^5.1.0 - version: 5.1.0(rollup@3.29.4) + version: 5.1.0(rollup@4.18.0) '@typescript-eslint/scope-manager': specifier: ^7.13.0 version: 7.13.1 @@ -300,6 +300,9 @@ importers: json5: specifier: ^2.2.3 version: 2.2.3 + mlly: + specifier: ^1.7.1 + version: 1.7.1 pathe: specifier: ^1.0.0 version: 1.1.2 @@ -519,6 +522,12 @@ packages: cpu: [ppc64] os: [aix] + '@esbuild/aix-ppc64@0.21.5': + resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + '@esbuild/android-arm64@0.18.20': resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} @@ -537,6 +546,12 @@ packages: cpu: [arm64] os: [android] + '@esbuild/android-arm64@0.21.5': + resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm@0.18.20': resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} @@ -555,6 +570,12 @@ packages: cpu: [arm] os: [android] + '@esbuild/android-arm@0.21.5': + resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + '@esbuild/android-x64@0.18.20': resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} @@ -573,6 +594,12 @@ packages: cpu: [x64] os: [android] + '@esbuild/android-x64@0.21.5': + resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + '@esbuild/darwin-arm64@0.18.20': resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} @@ -591,6 +618,12 @@ packages: cpu: [arm64] os: [darwin] + '@esbuild/darwin-arm64@0.21.5': + resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-x64@0.18.20': resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} @@ -609,6 +642,12 @@ packages: cpu: [x64] os: [darwin] + '@esbuild/darwin-x64@0.21.5': + resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + '@esbuild/freebsd-arm64@0.18.20': resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} @@ -627,6 +666,12 @@ packages: cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-arm64@0.21.5': + resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-x64@0.18.20': resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} @@ -645,6 +690,12 @@ packages: cpu: [x64] os: [freebsd] + '@esbuild/freebsd-x64@0.21.5': + resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + '@esbuild/linux-arm64@0.18.20': resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} @@ -663,6 +714,12 @@ packages: cpu: [arm64] os: [linux] + '@esbuild/linux-arm64@0.21.5': + resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm@0.18.20': resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} @@ -681,6 +738,12 @@ packages: cpu: [arm] os: [linux] + '@esbuild/linux-arm@0.21.5': + resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + '@esbuild/linux-ia32@0.18.20': resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} @@ -699,6 +762,12 @@ packages: cpu: [ia32] os: [linux] + '@esbuild/linux-ia32@0.21.5': + resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-loong64@0.18.20': resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} @@ -717,6 +786,12 @@ packages: cpu: [loong64] os: [linux] + '@esbuild/linux-loong64@0.21.5': + resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-mips64el@0.18.20': resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} @@ -735,6 +810,12 @@ packages: cpu: [mips64el] os: [linux] + '@esbuild/linux-mips64el@0.21.5': + resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-ppc64@0.18.20': resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} @@ -753,6 +834,12 @@ packages: cpu: [ppc64] os: [linux] + '@esbuild/linux-ppc64@0.21.5': + resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-riscv64@0.18.20': resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} @@ -771,6 +858,12 @@ packages: cpu: [riscv64] os: [linux] + '@esbuild/linux-riscv64@0.21.5': + resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-s390x@0.18.20': resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} @@ -789,6 +882,12 @@ packages: cpu: [s390x] os: [linux] + '@esbuild/linux-s390x@0.21.5': + resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-x64@0.18.20': resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} @@ -807,6 +906,12 @@ packages: cpu: [x64] os: [linux] + '@esbuild/linux-x64@0.21.5': + resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + '@esbuild/netbsd-x64@0.18.20': resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} @@ -825,6 +930,12 @@ packages: cpu: [x64] os: [netbsd] + '@esbuild/netbsd-x64@0.21.5': + resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + '@esbuild/openbsd-x64@0.18.20': resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} @@ -843,6 +954,12 @@ packages: cpu: [x64] os: [openbsd] + '@esbuild/openbsd-x64@0.21.5': + resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + '@esbuild/sunos-x64@0.18.20': resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} @@ -861,6 +978,12 @@ packages: cpu: [x64] os: [sunos] + '@esbuild/sunos-x64@0.21.5': + resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + '@esbuild/win32-arm64@0.18.20': resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} @@ -879,6 +1002,12 @@ packages: cpu: [arm64] os: [win32] + '@esbuild/win32-arm64@0.21.5': + resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-ia32@0.18.20': resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} @@ -897,6 +1026,12 @@ packages: cpu: [ia32] os: [win32] + '@esbuild/win32-ia32@0.21.5': + resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-x64@0.18.20': resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} @@ -915,6 +1050,12 @@ packages: cpu: [x64] os: [win32] + '@esbuild/win32-x64@0.21.5': + resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + '@eslint-community/eslint-utils@4.4.0': resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1260,6 +1401,86 @@ packages: rollup: optional: true + '@rollup/rollup-android-arm-eabi@4.18.0': + resolution: {integrity: sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.18.0': + resolution: {integrity: sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.18.0': + resolution: {integrity: sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.18.0': + resolution: {integrity: sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-linux-arm-gnueabihf@4.18.0': + resolution: {integrity: sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm-musleabihf@4.18.0': + resolution: {integrity: sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.18.0': + resolution: {integrity: sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.18.0': + resolution: {integrity: sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-powerpc64le-gnu@4.18.0': + resolution: {integrity: sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.18.0': + resolution: {integrity: sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-s390x-gnu@4.18.0': + resolution: {integrity: sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==} + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.18.0': + resolution: {integrity: sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.18.0': + resolution: {integrity: sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-win32-arm64-msvc@4.18.0': + resolution: {integrity: sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.18.0': + resolution: {integrity: sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.18.0': + resolution: {integrity: sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==} + cpu: [x64] + os: [win32] + '@secretlint/config-creator@3.3.0': resolution: {integrity: sha512-B6mzD3jqXi8rwJ10K/21AV7cvVJhfu2HT8JgIdROgaNB5DMFWOGwDRrBsjOddANo6yF3dwcBgqhUqKkkobTCbA==} @@ -1378,12 +1599,6 @@ packages: '@types/bonjour@3.5.13': resolution: {integrity: sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ==} - '@types/chai-subset@1.3.5': - resolution: {integrity: sha512-c2mPnw+xHtXDoHmdtcCXGwyLMiauiAyxWMzhGpqHC4nqI/Y5G2XhTampslK2rb59kpcuHon03UH8W6iYUzw88A==} - - '@types/chai@4.3.16': - resolution: {integrity: sha512-PatH4iOdyh3MyWtmHVFXLWCCIhUbopaltqddG9BzB+gMIzee2MJrvd+jouii9Z3wzQJruGWAm7WOMjgfG8hQlQ==} - '@types/connect-history-api-fallback@1.5.4': resolution: {integrity: sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw==} @@ -1643,20 +1858,20 @@ packages: vite: ^5.0.0 vue: ^3.2.25 - '@vitest/expect@0.34.6': - resolution: {integrity: sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==} + '@vitest/expect@1.6.0': + resolution: {integrity: sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==} - '@vitest/runner@0.34.6': - resolution: {integrity: sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==} + '@vitest/runner@1.6.0': + resolution: {integrity: sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==} - '@vitest/snapshot@0.34.6': - resolution: {integrity: sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==} + '@vitest/snapshot@1.6.0': + resolution: {integrity: sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==} - '@vitest/spy@0.34.6': - resolution: {integrity: sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==} + '@vitest/spy@1.6.0': + resolution: {integrity: sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==} - '@vitest/utils@0.34.6': - resolution: {integrity: sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==} + '@vitest/utils@1.6.0': + resolution: {integrity: sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==} '@vue/compiler-core@3.4.29': resolution: {integrity: sha512-TFKiRkKKsRCKvg/jTSSKK7mYLJEQdUiUfykbG49rubC9SfDyvT2JrzTReopWlz2MxqeLyxh9UZhvxEIBgAhtrg==} @@ -2850,6 +3065,11 @@ packages: engines: {node: '>=12'} hasBin: true + esbuild@0.21.5: + resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} + engines: {node: '>=12'} + hasBin: true + escalade@3.1.2: resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} engines: {node: '>=6'} @@ -2955,6 +3175,9 @@ packages: estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -2982,6 +3205,10 @@ packages: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} + execa@8.0.1: + resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} + engines: {node: '>=16.17'} + execall@2.0.0: resolution: {integrity: sha512-0FU2hZ5Hh6iQnarpRtQurM/aAvp3RIbfvgLHrcqJYzhXyV2KFruhuChf9NC6waAhiUR7FFtlugkI4p7f2Fqlow==} engines: {node: '>=8'} @@ -3215,6 +3442,10 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} + get-tsconfig@4.7.5: resolution: {integrity: sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==} @@ -3409,6 +3640,10 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} + human-signals@5.0.0: + resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} + engines: {node: '>=16.17.0'} + humanize-ms@1.2.1: resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} @@ -3605,6 +3840,10 @@ packages: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} + is-stream@3.0.0: + resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + is-typedarray@1.0.0: resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} @@ -3818,6 +4057,9 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-tokens@9.0.0: + resolution: {integrity: sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==} + js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true @@ -3948,8 +4190,8 @@ packages: resolution: {integrity: sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==} engines: {node: '>=8.9.0'} - local-pkg@0.4.3: - resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} + local-pkg@0.5.0: + resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} engines: {node: '>=14'} locate-path@5.0.0: @@ -4106,6 +4348,10 @@ packages: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} + mimic-fn@4.0.0: + resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} + engines: {node: '>=12'} + min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -4286,6 +4532,10 @@ packages: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} + npm-run-path@5.3.0: + resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} @@ -4325,6 +4575,10 @@ packages: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} + onetime@6.0.0: + resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} + engines: {node: '>=12'} + open@8.4.2: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} engines: {node: '>=12'} @@ -4353,9 +4607,9 @@ packages: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} - p-limit@4.0.0: - resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + p-limit@5.0.0: + resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==} + engines: {node: '>=18'} p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} @@ -4425,6 +4679,10 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + path-key@4.0.0: + resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} + engines: {node: '>=12'} + path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -4976,6 +5234,11 @@ packages: engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true + rollup@4.18.0: + resolution: {integrity: sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -5112,6 +5375,10 @@ packages: signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -5274,6 +5541,10 @@ packages: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} + strip-final-newline@3.0.0: + resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} + engines: {node: '>=12'} + strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} @@ -5286,8 +5557,8 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - strip-literal@1.3.0: - resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==} + strip-literal@2.1.0: + resolution: {integrity: sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==} structured-source@3.0.2: resolution: {integrity: sha512-Ap7JHfKgmH40SUjumqyKTHYHNZ8GvGQskP34ks0ElHCDEig+bYGpmXVksxPSrgcY9rkJqhVMzfeg5GIpZelfpQ==} @@ -5418,8 +5689,8 @@ packages: tinybench@2.8.0: resolution: {integrity: sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==} - tinypool@0.7.0: - resolution: {integrity: sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==} + tinypool@0.8.4: + resolution: {integrity: sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==} engines: {node: '>=14.0.0'} tinyspy@2.2.1: @@ -5630,9 +5901,9 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - vite-node@0.34.6: - resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} - engines: {node: '>=v14.18.0'} + vite-node@1.6.0: + resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true vite@4.5.3: @@ -5663,22 +5934,50 @@ packages: terser: optional: true - vitest@0.34.6: - resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==} - engines: {node: '>=v14.18.0'} + vite@5.3.1: + resolution: {integrity: sha512-XBmSKRLXLxiaPYamLv3/hnP/KXDai1NDexN0FpkTaZXTfycHvkRHoenpgl/fvuK/kPbB6xAgoyiryAhQNxYmAQ==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + + vitest@1.6.0: + resolution: {integrity: sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' - '@vitest/browser': '*' - '@vitest/ui': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': 1.6.0 + '@vitest/ui': 1.6.0 happy-dom: '*' jsdom: '*' - playwright: '*' - safaridriver: '*' - webdriverio: '*' peerDependenciesMeta: '@edge-runtime/vm': optional: true + '@types/node': + optional: true '@vitest/browser': optional: true '@vitest/ui': @@ -5687,12 +5986,6 @@ packages: optional: true jsdom: optional: true - playwright: - optional: true - safaridriver: - optional: true - webdriverio: - optional: true vue-eslint-parser@9.4.3: resolution: {integrity: sha512-2rYRLWlIpaiN8xbPiDyXZXRgLGOtWxERV7ND5fFAv5qo1D2N9Fu9MNajBNc6o13lZ+24DAWCkQCvj4klgmcITg==} @@ -6251,6 +6544,9 @@ snapshots: '@esbuild/aix-ppc64@0.20.2': optional: true + '@esbuild/aix-ppc64@0.21.5': + optional: true + '@esbuild/android-arm64@0.18.20': optional: true @@ -6260,6 +6556,9 @@ snapshots: '@esbuild/android-arm64@0.20.2': optional: true + '@esbuild/android-arm64@0.21.5': + optional: true + '@esbuild/android-arm@0.18.20': optional: true @@ -6269,6 +6568,9 @@ snapshots: '@esbuild/android-arm@0.20.2': optional: true + '@esbuild/android-arm@0.21.5': + optional: true + '@esbuild/android-x64@0.18.20': optional: true @@ -6278,6 +6580,9 @@ snapshots: '@esbuild/android-x64@0.20.2': optional: true + '@esbuild/android-x64@0.21.5': + optional: true + '@esbuild/darwin-arm64@0.18.20': optional: true @@ -6287,6 +6592,9 @@ snapshots: '@esbuild/darwin-arm64@0.20.2': optional: true + '@esbuild/darwin-arm64@0.21.5': + optional: true + '@esbuild/darwin-x64@0.18.20': optional: true @@ -6296,6 +6604,9 @@ snapshots: '@esbuild/darwin-x64@0.20.2': optional: true + '@esbuild/darwin-x64@0.21.5': + optional: true + '@esbuild/freebsd-arm64@0.18.20': optional: true @@ -6305,6 +6616,9 @@ snapshots: '@esbuild/freebsd-arm64@0.20.2': optional: true + '@esbuild/freebsd-arm64@0.21.5': + optional: true + '@esbuild/freebsd-x64@0.18.20': optional: true @@ -6314,6 +6628,9 @@ snapshots: '@esbuild/freebsd-x64@0.20.2': optional: true + '@esbuild/freebsd-x64@0.21.5': + optional: true + '@esbuild/linux-arm64@0.18.20': optional: true @@ -6323,6 +6640,9 @@ snapshots: '@esbuild/linux-arm64@0.20.2': optional: true + '@esbuild/linux-arm64@0.21.5': + optional: true + '@esbuild/linux-arm@0.18.20': optional: true @@ -6332,6 +6652,9 @@ snapshots: '@esbuild/linux-arm@0.20.2': optional: true + '@esbuild/linux-arm@0.21.5': + optional: true + '@esbuild/linux-ia32@0.18.20': optional: true @@ -6341,6 +6664,9 @@ snapshots: '@esbuild/linux-ia32@0.20.2': optional: true + '@esbuild/linux-ia32@0.21.5': + optional: true + '@esbuild/linux-loong64@0.18.20': optional: true @@ -6350,6 +6676,9 @@ snapshots: '@esbuild/linux-loong64@0.20.2': optional: true + '@esbuild/linux-loong64@0.21.5': + optional: true + '@esbuild/linux-mips64el@0.18.20': optional: true @@ -6359,6 +6688,9 @@ snapshots: '@esbuild/linux-mips64el@0.20.2': optional: true + '@esbuild/linux-mips64el@0.21.5': + optional: true + '@esbuild/linux-ppc64@0.18.20': optional: true @@ -6368,6 +6700,9 @@ snapshots: '@esbuild/linux-ppc64@0.20.2': optional: true + '@esbuild/linux-ppc64@0.21.5': + optional: true + '@esbuild/linux-riscv64@0.18.20': optional: true @@ -6377,6 +6712,9 @@ snapshots: '@esbuild/linux-riscv64@0.20.2': optional: true + '@esbuild/linux-riscv64@0.21.5': + optional: true + '@esbuild/linux-s390x@0.18.20': optional: true @@ -6386,6 +6724,9 @@ snapshots: '@esbuild/linux-s390x@0.20.2': optional: true + '@esbuild/linux-s390x@0.21.5': + optional: true + '@esbuild/linux-x64@0.18.20': optional: true @@ -6395,6 +6736,9 @@ snapshots: '@esbuild/linux-x64@0.20.2': optional: true + '@esbuild/linux-x64@0.21.5': + optional: true + '@esbuild/netbsd-x64@0.18.20': optional: true @@ -6404,6 +6748,9 @@ snapshots: '@esbuild/netbsd-x64@0.20.2': optional: true + '@esbuild/netbsd-x64@0.21.5': + optional: true + '@esbuild/openbsd-x64@0.18.20': optional: true @@ -6413,6 +6760,9 @@ snapshots: '@esbuild/openbsd-x64@0.20.2': optional: true + '@esbuild/openbsd-x64@0.21.5': + optional: true + '@esbuild/sunos-x64@0.18.20': optional: true @@ -6422,6 +6772,9 @@ snapshots: '@esbuild/sunos-x64@0.20.2': optional: true + '@esbuild/sunos-x64@0.21.5': + optional: true + '@esbuild/win32-arm64@0.18.20': optional: true @@ -6431,6 +6784,9 @@ snapshots: '@esbuild/win32-arm64@0.20.2': optional: true + '@esbuild/win32-arm64@0.21.5': + optional: true + '@esbuild/win32-ia32@0.18.20': optional: true @@ -6440,6 +6796,9 @@ snapshots: '@esbuild/win32-ia32@0.20.2': optional: true + '@esbuild/win32-ia32@0.21.5': + optional: true + '@esbuild/win32-x64@0.18.20': optional: true @@ -6449,6 +6808,9 @@ snapshots: '@esbuild/win32-x64@0.20.2': optional: true + '@esbuild/win32-x64@0.21.5': + optional: true + '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': dependencies: eslint: 8.57.0 @@ -6913,6 +7275,62 @@ snapshots: optionalDependencies: rollup: 3.29.4 + '@rollup/pluginutils@5.1.0(rollup@4.18.0)': + dependencies: + '@types/estree': 1.0.5 + estree-walker: 2.0.2 + picomatch: 2.3.1 + optionalDependencies: + rollup: 4.18.0 + + '@rollup/rollup-android-arm-eabi@4.18.0': + optional: true + + '@rollup/rollup-android-arm64@4.18.0': + optional: true + + '@rollup/rollup-darwin-arm64@4.18.0': + optional: true + + '@rollup/rollup-darwin-x64@4.18.0': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.18.0': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.18.0': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.18.0': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.18.0': + optional: true + + '@rollup/rollup-linux-powerpc64le-gnu@4.18.0': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.18.0': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.18.0': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.18.0': + optional: true + + '@rollup/rollup-linux-x64-musl@4.18.0': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.18.0': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.18.0': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.18.0': + optional: true + '@secretlint/config-creator@3.3.0': dependencies: '@secretlint/types': 3.3.0 @@ -7124,12 +7542,6 @@ snapshots: dependencies: '@types/node': 20.14.5 - '@types/chai-subset@1.3.5': - dependencies: - '@types/chai': 4.3.16 - - '@types/chai@4.3.16': {} - '@types/connect-history-api-fallback@1.5.4': dependencies: '@types/express-serve-static-core': 4.19.3 @@ -7455,31 +7867,32 @@ snapshots: vite: 4.5.3(@types/node@20.14.5)(terser@5.31.1) vue: 3.4.29(typescript@4.9.5) - '@vitest/expect@0.34.6': + '@vitest/expect@1.6.0': dependencies: - '@vitest/spy': 0.34.6 - '@vitest/utils': 0.34.6 + '@vitest/spy': 1.6.0 + '@vitest/utils': 1.6.0 chai: 4.4.1 - '@vitest/runner@0.34.6': + '@vitest/runner@1.6.0': dependencies: - '@vitest/utils': 0.34.6 - p-limit: 4.0.0 + '@vitest/utils': 1.6.0 + p-limit: 5.0.0 pathe: 1.1.2 - '@vitest/snapshot@0.34.6': + '@vitest/snapshot@1.6.0': dependencies: magic-string: 0.30.10 pathe: 1.1.2 pretty-format: 29.7.0 - '@vitest/spy@0.34.6': + '@vitest/spy@1.6.0': dependencies: tinyspy: 2.2.1 - '@vitest/utils@0.34.6': + '@vitest/utils@1.6.0': dependencies: diff-sequences: 29.6.3 + estree-walker: 3.0.3 loupe: 2.3.7 pretty-format: 29.7.0 @@ -8730,6 +9143,32 @@ snapshots: '@esbuild/win32-ia32': 0.20.2 '@esbuild/win32-x64': 0.20.2 + esbuild@0.21.5: + optionalDependencies: + '@esbuild/aix-ppc64': 0.21.5 + '@esbuild/android-arm': 0.21.5 + '@esbuild/android-arm64': 0.21.5 + '@esbuild/android-x64': 0.21.5 + '@esbuild/darwin-arm64': 0.21.5 + '@esbuild/darwin-x64': 0.21.5 + '@esbuild/freebsd-arm64': 0.21.5 + '@esbuild/freebsd-x64': 0.21.5 + '@esbuild/linux-arm': 0.21.5 + '@esbuild/linux-arm64': 0.21.5 + '@esbuild/linux-ia32': 0.21.5 + '@esbuild/linux-loong64': 0.21.5 + '@esbuild/linux-mips64el': 0.21.5 + '@esbuild/linux-ppc64': 0.21.5 + '@esbuild/linux-riscv64': 0.21.5 + '@esbuild/linux-s390x': 0.21.5 + '@esbuild/linux-x64': 0.21.5 + '@esbuild/netbsd-x64': 0.21.5 + '@esbuild/openbsd-x64': 0.21.5 + '@esbuild/sunos-x64': 0.21.5 + '@esbuild/win32-arm64': 0.21.5 + '@esbuild/win32-ia32': 0.21.5 + '@esbuild/win32-x64': 0.21.5 + escalade@3.1.2: {} escape-html@1.0.3: {} @@ -8861,6 +9300,10 @@ snapshots: estree-walker@2.0.2: {} + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.5 + esutils@2.0.3: {} etag@1.8.1: {} @@ -8901,6 +9344,18 @@ snapshots: signal-exit: 3.0.7 strip-final-newline: 2.0.0 + execa@8.0.1: + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.3.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + execall@2.0.0: dependencies: clone-regexp: 2.2.0 @@ -9161,6 +9616,8 @@ snapshots: get-stream@6.0.1: {} + get-stream@8.0.1: {} + get-tsconfig@4.7.5: dependencies: resolve-pkg-maps: 1.0.0 @@ -9386,6 +9843,8 @@ snapshots: human-signals@2.1.0: {} + human-signals@5.0.0: {} + humanize-ms@1.2.1: dependencies: ms: 2.1.3 @@ -9531,6 +9990,8 @@ snapshots: is-stream@2.0.1: {} + is-stream@3.0.0: {} + is-typedarray@1.0.0: {} is-windows@0.2.0: {} @@ -9996,6 +10457,8 @@ snapshots: js-tokens@4.0.0: {} + js-tokens@9.0.0: {} + js-yaml@3.14.1: dependencies: argparse: 1.0.10 @@ -10159,7 +10622,10 @@ snapshots: emojis-list: 3.0.0 json5: 2.2.3 - local-pkg@0.4.3: {} + local-pkg@0.5.0: + dependencies: + mlly: 1.7.1 + pkg-types: 1.1.1 locate-path@5.0.0: dependencies: @@ -10325,6 +10791,8 @@ snapshots: mimic-fn@2.1.0: {} + mimic-fn@4.0.0: {} + min-indent@1.0.1: {} minimalistic-assert@1.0.1: {} @@ -10512,6 +10980,10 @@ snapshots: dependencies: path-key: 3.1.1 + npm-run-path@5.3.0: + dependencies: + path-key: 4.0.0 + nth-check@2.1.1: dependencies: boolbase: 1.0.0 @@ -10542,6 +11014,10 @@ snapshots: dependencies: mimic-fn: 2.1.0 + onetime@6.0.0: + dependencies: + mimic-fn: 4.0.0 + open@8.4.2: dependencies: define-lazy-prop: 2.0.0 @@ -10571,7 +11047,7 @@ snapshots: dependencies: yocto-queue: 0.1.0 - p-limit@4.0.0: + p-limit@5.0.0: dependencies: yocto-queue: 1.0.0 @@ -10631,6 +11107,8 @@ snapshots: path-key@3.1.1: {} + path-key@4.0.0: {} + path-parse@1.0.7: {} path-to-regexp@0.1.7: {} @@ -11150,6 +11628,28 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + rollup@4.18.0: + dependencies: + '@types/estree': 1.0.5 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.18.0 + '@rollup/rollup-android-arm64': 4.18.0 + '@rollup/rollup-darwin-arm64': 4.18.0 + '@rollup/rollup-darwin-x64': 4.18.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.18.0 + '@rollup/rollup-linux-arm-musleabihf': 4.18.0 + '@rollup/rollup-linux-arm64-gnu': 4.18.0 + '@rollup/rollup-linux-arm64-musl': 4.18.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.18.0 + '@rollup/rollup-linux-riscv64-gnu': 4.18.0 + '@rollup/rollup-linux-s390x-gnu': 4.18.0 + '@rollup/rollup-linux-x64-gnu': 4.18.0 + '@rollup/rollup-linux-x64-musl': 4.18.0 + '@rollup/rollup-win32-arm64-msvc': 4.18.0 + '@rollup/rollup-win32-ia32-msvc': 4.18.0 + '@rollup/rollup-win32-x64-msvc': 4.18.0 + fsevents: 2.3.3 + run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 @@ -11342,6 +11842,8 @@ snapshots: signal-exit@3.0.7: {} + signal-exit@4.1.0: {} + sisteransi@1.0.5: {} slash@3.0.0: {} @@ -11511,6 +12013,8 @@ snapshots: strip-final-newline@2.0.0: {} + strip-final-newline@3.0.0: {} + strip-indent@3.0.0: dependencies: min-indent: 1.0.1 @@ -11519,9 +12023,9 @@ snapshots: strip-json-comments@3.1.1: {} - strip-literal@1.3.0: + strip-literal@2.1.0: dependencies: - acorn: 8.12.0 + js-tokens: 9.0.0 structured-source@3.0.2: dependencies: @@ -11670,7 +12174,7 @@ snapshots: tinybench@2.8.0: {} - tinypool@0.7.0: {} + tinypool@0.8.4: {} tinyspy@2.2.1: {} @@ -11886,14 +12390,13 @@ snapshots: vary@1.1.2: {} - vite-node@0.34.6(@types/node@20.14.5)(terser@5.31.1): + vite-node@1.6.0(@types/node@20.14.5)(terser@5.31.1): dependencies: cac: 6.7.14 debug: 4.3.5(supports-color@8.1.1) - mlly: 1.7.1 pathe: 1.1.2 picocolors: 1.0.1 - vite: 4.5.3(@types/node@20.14.5)(terser@5.31.1) + vite: 5.3.1(@types/node@20.14.5)(terser@5.31.1) transitivePeerDependencies: - '@types/node' - less @@ -11914,35 +12417,41 @@ snapshots: fsevents: 2.3.3 terser: 5.31.1 - vitest@0.34.6(jsdom@16.7.0)(playwright@1.44.1)(terser@5.31.1): + vite@5.3.1(@types/node@20.14.5)(terser@5.31.1): dependencies: - '@types/chai': 4.3.16 - '@types/chai-subset': 1.3.5 + esbuild: 0.21.5 + postcss: 8.4.38 + rollup: 4.18.0 + optionalDependencies: '@types/node': 20.14.5 - '@vitest/expect': 0.34.6 - '@vitest/runner': 0.34.6 - '@vitest/snapshot': 0.34.6 - '@vitest/spy': 0.34.6 - '@vitest/utils': 0.34.6 - acorn: 8.12.0 + fsevents: 2.3.3 + terser: 5.31.1 + + vitest@1.6.0(@types/node@20.14.5)(jsdom@16.7.0)(terser@5.31.1): + dependencies: + '@vitest/expect': 1.6.0 + '@vitest/runner': 1.6.0 + '@vitest/snapshot': 1.6.0 + '@vitest/spy': 1.6.0 + '@vitest/utils': 1.6.0 acorn-walk: 8.3.3 - cac: 6.7.14 chai: 4.4.1 debug: 4.3.5(supports-color@8.1.1) - local-pkg: 0.4.3 + execa: 8.0.1 + local-pkg: 0.5.0 magic-string: 0.30.10 pathe: 1.1.2 picocolors: 1.0.1 std-env: 3.7.0 - strip-literal: 1.3.0 + strip-literal: 2.1.0 tinybench: 2.8.0 - tinypool: 0.7.0 - vite: 4.5.3(@types/node@20.14.5)(terser@5.31.1) - vite-node: 0.34.6(@types/node@20.14.5)(terser@5.31.1) + tinypool: 0.8.4 + vite: 5.3.1(@types/node@20.14.5)(terser@5.31.1) + vite-node: 1.6.0(@types/node@20.14.5)(terser@5.31.1) why-is-node-running: 2.2.2 optionalDependencies: + '@types/node': 20.14.5 jsdom: 16.7.0 - playwright: 1.44.1 transitivePeerDependencies: - less - lightningcss