xgic-payload-cms-cli 0.2.3__tar.gz → 0.2.4__tar.gz

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.
Files changed (18) hide show
  1. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/PKG-INFO +2 -2
  2. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/README.md +1 -1
  3. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/pyproject.toml +1 -1
  4. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/src/xgic/cli/payload/__init__.py +1 -1
  5. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/src/xgic/cli/payload/project.py +28 -7
  6. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/.gitignore +0 -0
  7. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/LICENSE +0 -0
  8. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/NOTICE +0 -0
  9. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/src/xgic/cli/payload/commands/__init__.py +0 -0
  10. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/src/xgic/cli/payload/commands/dev.py +0 -0
  11. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/src/xgic/cli/payload/commands/payload_env.py +0 -0
  12. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/src/xgic/cli/payload/commands/reset.py +0 -0
  13. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/src/xgic/cli/payload/commands/schema.py +0 -0
  14. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/src/xgic/cli/payload/commands/setup.py +0 -0
  15. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/src/xgic/cli/payload/config.py +0 -0
  16. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/src/xgic/cli/payload/env_helpers.py +0 -0
  17. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/src/xgic/cli/payload/layout.py +0 -0
  18. {xgic_payload_cms_cli-0.2.3 → xgic_payload_cms_cli-0.2.4}/src/xgic/cli/payload/plugin.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: xgic-payload-cms-cli
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: XGIC CLI Payload CMS module - product commands and helpers (xgic.cli.payload).
5
5
  Project-URL: Homepage, https://github.com/xgic/payload-cms-cli
6
6
  Project-URL: Repository, https://github.com/xgic/payload-cms-cli
@@ -90,7 +90,7 @@ One brand (`xgic`), clear ownership, and dry-run-friendly destructive paths.
90
90
  uv pip install \
91
91
  "xgic-cli>=0.2.0,<0.3" \
92
92
  "xgic-dev-cli>=0.2.0,<0.3" \
93
- "xgic-payload-cms-cli>=0.2.3,<0.3"
93
+ "xgic-payload-cms-cli>=0.2.4,<0.3"
94
94
  xgic payload --help
95
95
  ```
96
96
 
@@ -55,7 +55,7 @@ One brand (`xgic`), clear ownership, and dry-run-friendly destructive paths.
55
55
  uv pip install \
56
56
  "xgic-cli>=0.2.0,<0.3" \
57
57
  "xgic-dev-cli>=0.2.0,<0.3" \
58
- "xgic-payload-cms-cli>=0.2.3,<0.3"
58
+ "xgic-payload-cms-cli>=0.2.4,<0.3"
59
59
  xgic payload --help
60
60
  ```
61
61
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "xgic-payload-cms-cli"
7
- version = "0.2.3"
7
+ version = "0.2.4"
8
8
  description = "XGIC CLI Payload CMS module - product commands and helpers (xgic.cli.payload)."
9
9
  readme = "README.md"
10
10
  license = { text = "Apache-2.0" }
@@ -21,7 +21,7 @@ from xgic.cli.payload.project import (
21
21
  load_create_payload_config,
22
22
  )
23
23
 
24
- __version__ = "0.2.3"
24
+ __version__ = "0.2.4"
25
25
 
26
26
  __all__ = [
27
27
  "DEFAULT_COMPOSE_PROJECT",
@@ -117,6 +117,27 @@ def merge_package_json_only_built(
117
117
  return json.dumps(data, indent=2) + "\n"
118
118
 
119
119
 
120
+ def yaml_map_key(name: str) -> str:
121
+ """Quote YAML mapping keys that are not plain scalars (e.g. ``@swc/core``)."""
122
+ if not name or name[0] in "@`&*!|>%{}[]'\"" or any(
123
+ ch in name for ch in ":#"
124
+ ):
125
+ return json.dumps(name)
126
+ return name
127
+
128
+
129
+ def parse_yaml_map_key(raw: str) -> str:
130
+ """Strip optional YAML quotes from a mapping key token."""
131
+ raw = raw.strip()
132
+ if len(raw) >= 2 and raw[0] == raw[-1] and raw[0] in "\"'":
133
+ return raw[1:-1]
134
+ return raw
135
+
136
+
137
+ def _allow_builds_block(names: list[str]) -> list[str]:
138
+ return ["allowBuilds:"] + [f" {yaml_map_key(n)}: true" for n in names]
139
+
140
+
120
141
  def merge_workspace_allow_builds(
121
142
  text: str, names: tuple[str, ...] = NATIVE_PNPM_BUILDS
122
143
  ) -> str:
@@ -124,6 +145,7 @@ def merge_workspace_allow_builds(
124
145
 
125
146
  Avoids a YAML dependency: only handles the generated website-template
126
147
  shape (a top-level ``allowBuilds:`` mapping of ``name: true``).
148
+ Always re-emits the block so unquoted ``@`` keys from 0.2.3 are repaired.
127
149
  """
128
150
  normalized = text if text.endswith("\n") or text == "" else text + "\n"
129
151
  lines = normalized.splitlines()
@@ -132,7 +154,7 @@ def merge_workspace_allow_builds(
132
154
  None,
133
155
  )
134
156
  if start is None:
135
- extra = ["allowBuilds:"] + [f" {n}: true" for n in names]
157
+ extra = _allow_builds_block(list(names))
136
158
  return normalized + "\n".join(extra) + "\n"
137
159
 
138
160
  existing: list[str] = []
@@ -143,15 +165,14 @@ def merge_workspace_allow_builds(
143
165
  end += 1
144
166
  continue
145
167
  if ln.startswith(" ") or ln.startswith("\t"):
146
- existing.append(ln.strip().split(":", 1)[0].strip())
168
+ key_raw = ln.strip().split(":", 1)[0]
169
+ existing.append(parse_yaml_map_key(key_raw))
147
170
  end += 1
148
171
  continue
149
172
  break
150
- missing = [n for n in names if n not in existing]
151
- if not missing:
152
- return normalized
153
- insert = [f" {n}: true" for n in missing]
154
- new_lines = lines[:end] + insert + lines[end:]
173
+ merged = list(dict.fromkeys([*existing, *names]))
174
+ block = _allow_builds_block(merged)
175
+ new_lines = lines[:start] + block + lines[end:]
155
176
  return "\n".join(new_lines) + "\n"
156
177
 
157
178