Skip to content

Commit a69c382

Browse files
cs-rajclaude
andcommitted
feat: migrate @contentstack/cli-cm-regex-validate to cli-plugins monorepo (v1)
Migrates the cli-cm-regex-validate plugin from its standalone repo into the cli-plugins pnpm monorepo targeting v1 CLI dependencies. This is the first npm publication of this package under the @contentstack scope. - Add packages/contentstack-cli-cm-regex-validate with full source - Set version to 1.0.0 (first release), @contentstack/cli-command ^1.8.2 and @contentstack/cli-utilities ^1.18.3 - Upgrade oclif from ^3.17.2 to ^4.23.0 - Move jest from dependencies to devDependencies - Fix jest.config.ts testMatch to cover test/ directory (not just tests/) - Add composite: true and esModuleInterop: true to tsconfig.json - Wire into release-production-plugins.yml (tag: latest) - Wire into unit-test.yml - Update .github/config/release.json with regex-validate: false - Update README.md, AGENTS.md, and add REGEX-VALIDATE-MIGRATION.md - Update .talismanrc with checksums for new files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 137f9ae commit a69c382

53 files changed

Lines changed: 1752 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/config/release.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"launch": false,
2121
"branches": false,
2222
"apps-cli": false,
23+
"regex-validate": false,
2324
"core": false
2425
}
2526
}

.github/workflows/release-production-plugins.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,15 @@ jobs:
143143
package: ./packages/contentstack-query-export/package.json
144144
tag: latest
145145

146-
- name: Create Production Release
146+
# Regex Validate
147+
- name: Publishing regex-validate (Production)
148+
uses: JS-DevTools/npm-publish@v3
149+
with:
150+
token: ${{ secrets.NPM_TOKEN }}
151+
package: ./packages/contentstack-cli-cm-regex-validate/package.json
152+
tag: latest
153+
154+
- name: Create Production Release
147155
id: create_release
148156
env:
149157
GITHUB_TOKEN: ${{ secrets.PKG_TOKEN }}

.github/workflows/unit-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ jobs:
6969
- name: Run tests for Contentstack Apps CLI
7070
working-directory: ./packages/contentstack-apps-cli
7171
run: npm run test:unit:report:json
72+
73+
- name: Run tests for Contentstack Regex Validate plugin
74+
working-directory: ./packages/contentstack-cli-cm-regex-validate
75+
run: npm run test:unit

.talismanrc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
fileignoreconfig:
22
- filename: pnpm-lock.yaml
3-
checksum: 89acb731dc98c886694fa4d267c11c188000b8ecbe5ee6e4809e5bc6ec33a2f3
3+
checksum: fa1dcf412ad0cdab8c7abf4b538cd300c1eb565d8f53721a6ac45a4e7610a9a5
4+
- filename: skills/framework/SKILL.md
5+
checksum: c5746de64b1e7d1df051c4337de5eb32de6a4c85c7297aa408838d304bb2d771
6+
- filename: packages/contentstack-cli-cm-regex-validate/messages/index.json
7+
checksum: 044b311bde624dcc3c12434174d6027dbb6b62eefdfae120570a1748f806c60c
8+
- filename: packages/contentstack-cli-cm-regex-validate/skills/code-review/SKILL.md
9+
checksum: b92ea1c8e2f901c9e1e60f6ef6986d348a40a7869c236e3c1f3ca53b553dbb8e
10+
- filename: packages/contentstack-cli-cm-regex-validate/skills/contentstack-cli/SKILL.md
11+
checksum: 9420a516ba6046b05748683c90e3817d091cef76c46e029cb3745d6c0c350838
12+
- filename: packages/contentstack-cli-cm-regex-validate/skills/dev-workflow/SKILL.md
13+
checksum: b423dd35d0f7f0f25315e2a30198669b50db350f0ab2f917a1d3c4fbb0af0534
14+
- filename: packages/contentstack-cli-cm-regex-validate/src/utils/connect-stack.ts
15+
checksum: c77c7c25efc6d043b26e3dd0a516e22ac50142fa9fa5ff3a53a7c9fb8f24ebd6
16+
- filename: packages/contentstack-cli-cm-regex-validate/test/utils/connect-stack.test.ts
17+
checksum: 8fcd1dc2770a2a3f55ba462b7ffd3fc2e3cf45342c63e5b6dc5c1db4c2bd9738
418
version: '1.0'

AGENTS.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Contentstack CLI plugins – Agent guide
2+
3+
**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`** (per-package).
4+
5+
## What this repo is
6+
7+
| Field | Detail |
8+
| --- | --- |
9+
| **Name:** | Contentstack CLI plugins (pnpm monorepo; root package name `csdx`) |
10+
| **Purpose:** | OCLIF plugins that extend the Contentstack CLI (import/export, clone, migration, seed, audit, variants, Developer Hub apps, regex validation, etc.). |
11+
| **Out of scope (if any):** | The **core** CLI aggregation lives in the separate `cli` monorepo; this repo ships plugin packages only. |
12+
13+
## Tech stack (at a glance)
14+
15+
| Area | Details |
16+
| --- | --- |
17+
| **Language** | TypeScript / JavaScript, Node **>= 18** (`engines` in root `package.json`) |
18+
| **Build** | pnpm workspaces (`packages/*`); per package: `tsc`, OCLIF manifest/readme where applicable → `lib/` |
19+
| **Tests** | Mocha + Chai (most packages); Jest + ts-jest (`contentstack-cli-cm-regex-validate`); layouts under `packages/*/test/` |
20+
| **Lint / coverage** | ESLint in packages that define `lint` scripts; nyc where configured |
21+
| **Other** | OCLIF v4, Husky |
22+
23+
## Commands (quick reference)
24+
25+
| Command type | Command |
26+
| --- | --- |
27+
| **Build** | `pnpm build` |
28+
| **Test** | `pnpm test` |
29+
| **Lint** | `pnpm run lint` in a package that defines `lint` (no root aggregate lint script) |
30+
31+
CI: [.github/workflows/unit-test.yml](.github/workflows/unit-test.yml) and other workflows under [.github/workflows/](.github/workflows/).
32+
33+
## Apps CLI plugin (`@contentstack/apps-cli`)
34+
35+
- **Package path:** [packages/contentstack-apps-cli](packages/contentstack-apps-cli)
36+
- **npm name:** `@contentstack/apps-cli` (unchanged for consumers)
37+
- **Migrated from:** [contentstack/contentstack-apps-cli](https://github.com/contentstack/contentstack-apps-cli) — see [APPS-CLI-MIGRATION.md](APPS-CLI-MIGRATION.md)
38+
- **v1 / v2:** This branch carries the **v1 line** (`@contentstack/cli-command ^1.8.2`, `@contentstack/cli-utilities ^1.18.3`).
39+
- **Docs:** See [packages/contentstack-apps-cli/AGENTS.md](packages/contentstack-apps-cli/AGENTS.md)
40+
41+
## Regex Validate plugin (`@contentstack/cli-cm-regex-validate`)
42+
43+
- **Package path:** [packages/contentstack-cli-cm-regex-validate](packages/contentstack-cli-cm-regex-validate)
44+
- **npm name:** `@contentstack/cli-cm-regex-validate`
45+
- **Migrated from:** [contentstack/cli-cm-regex-validate](https://github.com/contentstack/cli-cm-regex-validate) — see [REGEX-VALIDATE-MIGRATION.md](REGEX-VALIDATE-MIGRATION.md)
46+
- **v1 / v2:** This branch carries the **v1 line** (`@contentstack/cli-command ^1.8.2`, `@contentstack/cli-utilities ^1.18.3`, version `1.0.0`, npm tag `latest`).
47+
- **Tests:** Jest + ts-jest (unlike most other packages which use Mocha + Chai)
48+
- **Command:** Single command `cm:stacks:validate-regex` (short name `RGXVLD`)
49+
- **Docs:** [packages/contentstack-cli-cm-regex-validate/AGENTS.md](packages/contentstack-cli-cm-regex-validate/AGENTS.md)
50+
51+
## Using Cursor (optional)
52+
53+
If you use **Cursor**, [.cursor/rules/README.md](.cursor/rules/README.md) only points to **`AGENTS.md`**—same docs as everyone else.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ To get a more detailed documentation for every command, visit the [CLI section](
5656
## Useful Plugins
5757

5858
- [Generate TypeScript typings from a Stack](https://github.com/Contentstack-Solutions/contentstack-cli-tsgen)
59+
- [Validate regex fields in Content Types and Global Fields](https://github.com/contentstack/cli-plugins/tree/main/packages/contentstack-cli-cm-regex-validate) (`@contentstack/cli-cm-regex-validate`)

REGEX-VALIDATE-MIGRATION.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Regex Validate plugin migration: standalone repo → cli-plugins monorepo
2+
3+
## Summary
4+
5+
The **@contentstack/cli-cm-regex-validate** plugin has moved from the standalone repository [contentstack/cli-cm-regex-validate](https://github.com/contentstack/cli-cm-regex-validate) into the [contentstack/cli-plugins](https://github.com/contentstack/cli-plugins) monorepo at **`packages/contentstack-cli-cm-regex-validate`**.
6+
7+
The **npm package name is unchanged**: `@contentstack/cli-cm-regex-validate`. This is the **first npm release** — the package was previously not published.
8+
9+
First release: **1.0.0** (v1 line) / **2.0.0-beta.0** (v2-beta line).
10+
11+
## Repository and issue tracking
12+
13+
| Before | After |
14+
| --- | --- |
15+
| Source: `github.com/contentstack/cli-cm-regex-validate` | Source: `github.com/contentstack/cli-plugins``packages/contentstack-cli-cm-regex-validate` |
16+
| Issues: cli-cm-regex-validate repo | Issues: [cli-plugins issues](https://github.com/contentstack/cli-plugins/issues) (label or mention `regex-validate`) |
17+
18+
The standalone **cli-cm-regex-validate** repository should be **archived** after the first release from cli-plugins.
19+
20+
## Version lines
21+
22+
| CLI line | cli-plugins branch | Plugin notes |
23+
| --- | --- | --- |
24+
| **1.x** | `v1-dev` / `main` | `@contentstack/cli-command ^1.8.2`, `@contentstack/cli-utilities ^1.18.3`; npm tag `latest`; version `1.0.0` |
25+
| **2.x beta** | `v2-dev` / `v2-beta` | `@contentstack/cli-command ~2.0.0-beta.7`, `@contentstack/cli-utilities ~2.0.0-beta.8`; npm tag `beta`; version `2.0.0-beta.0` |
26+
27+
## Install
28+
29+
```bash
30+
csdx plugins:install @contentstack/cli-cm-regex-validate
31+
```
32+
33+
## Command (unchanged)
34+
35+
| Command | Description |
36+
| --- | --- |
37+
| `csdx cm:stacks:validate-regex` | Validate fields with regex property in Content Types and Global Fields of a Stack |
38+
39+
Flags: `-a` (token alias), `-c` (content types), `-g` (global fields), `-f` (CSV output path).
40+
41+
## Local development
42+
43+
```bash
44+
cd cli-plugins
45+
pnpm install
46+
pnpm --filter @contentstack/cli-cm-regex-validate run build
47+
pnpm --filter @contentstack/cli-cm-regex-validate test
48+
```
49+
50+
## Test framework note
51+
52+
This package uses **Jest + ts-jest** (unlike most other packages in this monorepo which use Mocha + Chai). Tests live under `packages/contentstack-cli-cm-regex-validate/test/` and run via `pnpm test` or `pnpm run test:unit`.
53+
54+
## Related migrations
55+
56+
- Apps CLI: [APPS-CLI-MIGRATION.md](./APPS-CLI-MIGRATION.md)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Cursor (optional)
2+
3+
**Cursor** users: start at **[`AGENTS.md`](../../AGENTS.md)**. All conventions live in **`skills/*/SKILL.md`**.
4+
5+
This folder only points contributors to **`AGENTS.md`** so editor-specific config does not duplicate the canonical docs.
6+
7+
Path from this file to the repo root agent guide: **`../../AGENTS.md`** (two levels up from `.cursor/rules/`).
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/lib

0 commit comments

Comments
 (0)