@tolgee/cli 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,7 +49,7 @@ function compareKeys(local, remote) {
49
49
  // Added keys
50
50
  const namespaces = [...Object.keys(local), runner_1.NullNamespace];
51
51
  for (const namespace of namespaces) {
52
- if (local[namespace].size) {
52
+ if (namespace in local && local[namespace].size) {
53
53
  for (const [keyName, defaultValue] of local[namespace].entries()) {
54
54
  result.added.push({
55
55
  keyName: keyName,
@@ -600,7 +600,9 @@ exports.default = (0, xstate_1.createMachine)({
600
600
  // But we DO want the namespace to be overridable
601
601
  keyName: ctx.key.keyName || evt.data.keyName,
602
602
  defaultValue: ctx.key.defaultValue || evt.data.defaultValue || undefined,
603
- namespace: evt.data.namespace ?? ctx.key.namespace,
603
+ namespace: evt.data.namespace === ''
604
+ ? undefined
605
+ : evt.data.namespace ?? ctx.key.namespace,
604
606
  line: ctx.line,
605
607
  }),
606
608
  warnings: (ctx, evt) => {
@@ -105,6 +105,14 @@ exports.default = (0, xstate_1.createMachine)({
105
105
  },
106
106
  value_string: {
107
107
  on: {
108
+ 'punctuation.definition.string.end.ts': {
109
+ target: 'idle',
110
+ actions: ['storeEmptyPropertyValue', 'clearPropertyType'],
111
+ },
112
+ 'punctuation.definition.string.template.end.ts': {
113
+ target: 'idle',
114
+ actions: ['storeEmptyPropertyValue', 'clearPropertyType'],
115
+ },
108
116
  '*': [
109
117
  {
110
118
  target: 'idle',
@@ -198,6 +206,13 @@ exports.default = (0, xstate_1.createMachine)({
198
206
  defaultValue: (ctx, evt) => ctx.property === 'defaultValue' ? evt.token : ctx.defaultValue,
199
207
  namespace: (ctx, evt) => ctx.property === 'ns' ? evt.token : ctx.namespace,
200
208
  }),
209
+ storeEmptyPropertyValue: (0, xstate_1.assign)({
210
+ keyName: (ctx) => ctx.property === 'key' || ctx.property === 'keyName'
211
+ ? ''
212
+ : ctx.keyName,
213
+ defaultValue: (ctx) => ctx.property === 'defaultValue' ? '' : ctx.defaultValue,
214
+ namespace: (ctx) => (ctx.property === 'ns' ? '' : ctx.namespace),
215
+ }),
201
216
  markPropertyAsDynamic: (0, xstate_1.assign)({
202
217
  keyName: (ctx, _evt) => ctx.property === 'key' || ctx.property === 'keyName'
203
218
  ? false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tolgee/cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "commonjs",
5
5
  "description": "A tool to interact with the Tolgee Platform through CLI",
6
6
  "bin": {