@contractspec/example.project-management-sync 0.0.0-canary-20260206014742
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$bundle.log +33 -0
- package/.turbo/turbo-build.log +34 -0
- package/CHANGELOG.md +27 -0
- package/LICENSE +21 -0
- package/README.md +35 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -0
- package/dist/docs/project-management-sync.docblock.d.ts +1 -0
- package/dist/docs/project-management-sync.docblock.js +46 -0
- package/dist/docs/project-management-sync.docblock.js.map +1 -0
- package/dist/example.d.ts +7 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +46 -0
- package/dist/example.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5 -0
- package/dist/run.d.ts +1 -0
- package/dist/run.js +12 -0
- package/dist/run.js.map +1 -0
- package/dist/sync.d.ts +24 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +107 -0
- package/dist/sync.js.map +1 -0
- package/package.json +59 -0
- package/src/docs/index.ts +1 -0
- package/src/docs/project-management-sync.docblock.ts +43 -0
- package/src/example.ts +32 -0
- package/src/index.ts +3 -0
- package/src/run.ts +10 -0
- package/src/sync.ts +159 -0
- package/tsconfig.json +9 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/tsdown.config.js +6 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
$ tsdown
|
|
2
|
+
[34mℹ[39m tsdown [2mv0.20.3[22m powered by rolldown [2mv1.0.0-rc.3[22m
|
|
3
|
+
[34mℹ[39m config file: [4m/home/runner/work/contractspec/contractspec/packages/examples/project-management-sync/tsdown.config.js[24m
|
|
4
|
+
[34mℹ[39m entry: [34msrc/example.ts, src/index.ts, src/run.ts, src/sync.ts, src/docs/index.ts, src/docs/project-management-sync.docblock.ts[39m
|
|
5
|
+
[34mℹ[39m target: [34mesnext[39m
|
|
6
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
7
|
+
[34mℹ[39m Build start
|
|
8
|
+
[34mℹ[39m Cleaning 19 files
|
|
9
|
+
[34mℹ[39m [2mdist/[22m[1msync.js[22m [2m3.95 kB[22m [2m│ gzip: 1.53 kB[22m
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/project-management-sync.docblock.js[22m [2m1.60 kB[22m [2m│ gzip: 0.77 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m1.04 kB[22m [2m│ gzip: 0.52 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m0.41 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[1mrun.js[22m [2m0.30 kB[22m [2m│ gzip: 0.22 kB[22m
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m0.05 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
15
|
+
[34mℹ[39m [2mdist/[22msync.js.map [2m7.29 kB[22m [2m│ gzip: 2.43 kB[22m
|
|
16
|
+
[34mℹ[39m [2mdist/[22mdocs/project-management-sync.docblock.js.map [2m2.12 kB[22m [2m│ gzip: 0.97 kB[22m
|
|
17
|
+
[34mℹ[39m [2mdist/[22mexample.js.map [2m1.51 kB[22m [2m│ gzip: 0.72 kB[22m
|
|
18
|
+
[34mℹ[39m [2mdist/[22msync.d.ts.map [2m0.57 kB[22m [2m│ gzip: 0.28 kB[22m
|
|
19
|
+
[34mℹ[39m [2mdist/[22mrun.js.map [2m0.50 kB[22m [2m│ gzip: 0.34 kB[22m
|
|
20
|
+
[34mℹ[39m [2mdist/[22mexample.d.ts.map [2m0.13 kB[22m [2m│ gzip: 0.13 kB[22m
|
|
21
|
+
[34mℹ[39m [2mdist/[22m[32m[1msync.d.ts[22m[39m [2m1.52 kB[22m [2m│ gzip: 0.44 kB[22m
|
|
22
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m0.56 kB[22m [2m│ gzip: 0.19 kB[22m
|
|
23
|
+
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m0.25 kB[22m [2m│ gzip: 0.17 kB[22m
|
|
24
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/index.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
25
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/project-management-sync.docblock.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
26
|
+
[34mℹ[39m [2mdist/[22m[32m[1mrun.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
27
|
+
[34mℹ[39m 18 files, total: 21.83 kB
|
|
28
|
+
[33m[PLUGIN_TIMINGS] Warning:[0m Your build spent significant time in plugins. Here is a breakdown:
|
|
29
|
+
- rolldown-plugin-dts:generate (50%)
|
|
30
|
+
- tsdown:external (50%)
|
|
31
|
+
See https://rolldown.rs/options/checks#plugintimings for more details.
|
|
32
|
+
|
|
33
|
+
[32m✔[39m Build complete in [32m29792ms[39m
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
$ bun build:types && bun build:bundle
|
|
2
|
+
$ tsc --noEmit
|
|
3
|
+
$ tsdown
|
|
4
|
+
[34mℹ[39m tsdown [2mv0.20.3[22m powered by rolldown [2mv1.0.0-rc.3[22m
|
|
5
|
+
[34mℹ[39m config file: [4m/home/runner/work/contractspec/contractspec/packages/examples/project-management-sync/tsdown.config.js[24m
|
|
6
|
+
[34mℹ[39m entry: [34msrc/example.ts, src/index.ts, src/run.ts, src/sync.ts, src/docs/index.ts, src/docs/project-management-sync.docblock.ts[39m
|
|
7
|
+
[34mℹ[39m target: [34mesnext[39m
|
|
8
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
|
+
[34mℹ[39m Build start
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1msync.js[22m [2m3.95 kB[22m [2m│ gzip: 1.53 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/project-management-sync.docblock.js[22m [2m1.60 kB[22m [2m│ gzip: 0.77 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[1mexample.js[22m [2m1.04 kB[22m [2m│ gzip: 0.52 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m0.41 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[1mrun.js[22m [2m0.30 kB[22m [2m│ gzip: 0.22 kB[22m
|
|
15
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m0.05 kB[22m [2m│ gzip: 0.07 kB[22m
|
|
16
|
+
[34mℹ[39m [2mdist/[22msync.js.map [2m7.29 kB[22m [2m│ gzip: 2.43 kB[22m
|
|
17
|
+
[34mℹ[39m [2mdist/[22mdocs/project-management-sync.docblock.js.map [2m2.12 kB[22m [2m│ gzip: 0.97 kB[22m
|
|
18
|
+
[34mℹ[39m [2mdist/[22mexample.js.map [2m1.51 kB[22m [2m│ gzip: 0.72 kB[22m
|
|
19
|
+
[34mℹ[39m [2mdist/[22msync.d.ts.map [2m0.57 kB[22m [2m│ gzip: 0.28 kB[22m
|
|
20
|
+
[34mℹ[39m [2mdist/[22mrun.js.map [2m0.50 kB[22m [2m│ gzip: 0.34 kB[22m
|
|
21
|
+
[34mℹ[39m [2mdist/[22mexample.d.ts.map [2m0.13 kB[22m [2m│ gzip: 0.13 kB[22m
|
|
22
|
+
[34mℹ[39m [2mdist/[22m[32m[1msync.d.ts[22m[39m [2m1.52 kB[22m [2m│ gzip: 0.44 kB[22m
|
|
23
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m0.56 kB[22m [2m│ gzip: 0.19 kB[22m
|
|
24
|
+
[34mℹ[39m [2mdist/[22m[32m[1mexample.d.ts[22m[39m [2m0.25 kB[22m [2m│ gzip: 0.17 kB[22m
|
|
25
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/index.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
26
|
+
[34mℹ[39m [2mdist/[22m[32m[1mdocs/project-management-sync.docblock.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
27
|
+
[34mℹ[39m [2mdist/[22m[32m[1mrun.d.ts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
28
|
+
[34mℹ[39m 18 files, total: 21.83 kB
|
|
29
|
+
[33m[PLUGIN_TIMINGS] Warning:[0m Your build spent significant time in plugins. Here is a breakdown:
|
|
30
|
+
- rolldown-plugin-dts:generate (50%)
|
|
31
|
+
- tsdown:external (50%)
|
|
32
|
+
See https://rolldown.rs/options/checks#plugintimings for more details.
|
|
33
|
+
|
|
34
|
+
[32m✔[39m Build complete in [32m21571ms[39m
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# @contractspec/example.project-management-sync
|
|
2
|
+
|
|
3
|
+
## 0.0.0-canary-20260206014742
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7cb7e0a: Add a project management sync example using Linear, Jira, and Notion providers.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [47c48c2]
|
|
12
|
+
- Updated dependencies [a119963]
|
|
13
|
+
- Updated dependencies [11a5a05]
|
|
14
|
+
- @contractspec/lib.contracts@0.0.0-canary-20260206014742
|
|
15
|
+
- @contractspec/integration.providers-impls@0.0.0-canary-20260206014742
|
|
16
|
+
|
|
17
|
+
## 1.56.1
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- Initial project management sync example.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
- @contractspec/integration.providers-impls@1.56.1
|
|
27
|
+
- @contractspec/lib.contracts@1.56.1
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Chaman Ventures, SASU
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
### Integration Example - Project Management Sync
|
|
2
|
+
|
|
3
|
+
Website: https://contractspec.io/
|
|
4
|
+
|
|
5
|
+
This example shows how to create work items in Linear, Jira Cloud, and Notion using the project-management providers.
|
|
6
|
+
|
|
7
|
+
Files included:
|
|
8
|
+
|
|
9
|
+
- `example.ts` – example metadata for the catalog.
|
|
10
|
+
- `sync.ts` – helper to build sample work items and sync them to a provider.
|
|
11
|
+
- `docs/project-management-sync.docblock.ts` – documentation blocks for MCP/docs.
|
|
12
|
+
|
|
13
|
+
Usage:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
export CONTRACTSPEC_PM_PROVIDER="linear" # linear | jira | notion
|
|
17
|
+
export CONTRACTSPEC_PM_DRY_RUN="true" # set to false to create real items
|
|
18
|
+
|
|
19
|
+
# Linear
|
|
20
|
+
export LINEAR_API_KEY="your_key"
|
|
21
|
+
export LINEAR_TEAM_ID="team_id"
|
|
22
|
+
|
|
23
|
+
# Jira Cloud
|
|
24
|
+
# export JIRA_SITE_URL="https://acme.atlassian.net"
|
|
25
|
+
# export JIRA_EMAIL="user@acme.com"
|
|
26
|
+
# export JIRA_API_TOKEN="jira_token"
|
|
27
|
+
# export JIRA_PROJECT_KEY="PM"
|
|
28
|
+
|
|
29
|
+
# Notion
|
|
30
|
+
# export NOTION_API_KEY="secret"
|
|
31
|
+
# export NOTION_DATABASE_ID="database_id"
|
|
32
|
+
# export NOTION_SUMMARY_PARENT_PAGE_ID="parent_page_id" # optional
|
|
33
|
+
|
|
34
|
+
bun tsx packages/examples/project-management-sync/src/run.ts
|
|
35
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./project-management-sync.docblock.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/project-management-sync.docblock.ts
|
|
4
|
+
registerDocBlocks([{
|
|
5
|
+
id: "docs.examples.project-management-sync",
|
|
6
|
+
title: "Project Management Sync (example)",
|
|
7
|
+
summary: "Create a shared payload of work items and sync it to Linear, Jira Cloud, or Notion.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/examples/project-management-sync",
|
|
11
|
+
tags: [
|
|
12
|
+
"project-management",
|
|
13
|
+
"linear",
|
|
14
|
+
"jira",
|
|
15
|
+
"notion",
|
|
16
|
+
"example"
|
|
17
|
+
],
|
|
18
|
+
body: `## What this example shows
|
|
19
|
+
- Build a provider-agnostic payload of work items.
|
|
20
|
+
- Resolve the target provider from environment variables.
|
|
21
|
+
- Run in dry-run mode for preview output.
|
|
22
|
+
|
|
23
|
+
## Guardrails
|
|
24
|
+
- Keep secrets in env or secret providers only.
|
|
25
|
+
- Use dry-run to validate payloads before writing.
|
|
26
|
+
- Start with a small batch of tasks to validate setup.`
|
|
27
|
+
}, {
|
|
28
|
+
id: "docs.examples.project-management-sync.usage",
|
|
29
|
+
title: "Project Management Sync - Usage",
|
|
30
|
+
summary: "How to run the sync with env-driven provider settings.",
|
|
31
|
+
kind: "usage",
|
|
32
|
+
visibility: "public",
|
|
33
|
+
route: "/docs/examples/project-management-sync/usage",
|
|
34
|
+
tags: ["project-management", "usage"],
|
|
35
|
+
body: `## Usage
|
|
36
|
+
- Set CONTRACTSPEC_PM_PROVIDER to linear, jira, or notion.
|
|
37
|
+
- Set CONTRACTSPEC_PM_DRY_RUN=true to preview payloads.
|
|
38
|
+
- Provide provider-specific env vars (API keys, project IDs).
|
|
39
|
+
|
|
40
|
+
## Example
|
|
41
|
+
- Call runProjectManagementSyncFromEnv() from sync.ts or import it in your app.
|
|
42
|
+
- The helper builds a sample payload and calls the provider client.`
|
|
43
|
+
}]);
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
//# sourceMappingURL=project-management-sync.docblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-management-sync.docblock.js","names":[],"sources":["../../src/docs/project-management-sync.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst blocks: DocBlock[] = [\n {\n id: 'docs.examples.project-management-sync',\n title: 'Project Management Sync (example)',\n summary:\n 'Create a shared payload of work items and sync it to Linear, Jira Cloud, or Notion.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/project-management-sync',\n tags: ['project-management', 'linear', 'jira', 'notion', 'example'],\n body: `## What this example shows\n- Build a provider-agnostic payload of work items.\n- Resolve the target provider from environment variables.\n- Run in dry-run mode for preview output.\n\n## Guardrails\n- Keep secrets in env or secret providers only.\n- Use dry-run to validate payloads before writing.\n- Start with a small batch of tasks to validate setup.`,\n },\n {\n id: 'docs.examples.project-management-sync.usage',\n title: 'Project Management Sync - Usage',\n summary: 'How to run the sync with env-driven provider settings.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/project-management-sync/usage',\n tags: ['project-management', 'usage'],\n body: `## Usage\n- Set CONTRACTSPEC_PM_PROVIDER to linear, jira, or notion.\n- Set CONTRACTSPEC_PM_DRY_RUN=true to preview payloads.\n- Provide provider-specific env vars (API keys, project IDs).\n\n## Example\n- Call runProjectManagementSyncFromEnv() from sync.ts or import it in your app.\n- The helper builds a sample payload and calls the provider client.`,\n },\n];\n\nregisterDocBlocks(blocks);\n"],"mappings":";;;AA0CA,kBAvC2B,CACzB;CACE,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EAAC;EAAsB;EAAU;EAAQ;EAAU;EAAU;CACnE,MAAM;;;;;;;;;CASP,EACD;CACE,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM,CAAC,sBAAsB,QAAQ;CACrC,MAAM;;;;;;;;CAQP,CACF,CAEwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"mappings":";;;cAEM,OAAA,EA2BJ,4BAAA,CA3BW,WAAA"}
|
package/dist/example.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineExample } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/example.ts
|
|
4
|
+
const example = defineExample({
|
|
5
|
+
meta: {
|
|
6
|
+
key: "project-management-sync",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
title: "Project Management Sync",
|
|
9
|
+
description: "Create project-management work items in Linear, Jira Cloud, or Notion from a shared payload.",
|
|
10
|
+
kind: "integration",
|
|
11
|
+
visibility: "public",
|
|
12
|
+
stability: "experimental",
|
|
13
|
+
owners: ["@platform.integrations"],
|
|
14
|
+
tags: [
|
|
15
|
+
"project-management",
|
|
16
|
+
"linear",
|
|
17
|
+
"jira",
|
|
18
|
+
"notion",
|
|
19
|
+
"integrations"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
docs: {
|
|
23
|
+
rootDocId: "docs.examples.project-management-sync",
|
|
24
|
+
usageDocId: "docs.examples.project-management-sync.usage"
|
|
25
|
+
},
|
|
26
|
+
entrypoints: {
|
|
27
|
+
packageName: "@contractspec/example.project-management-sync",
|
|
28
|
+
docs: "./docs"
|
|
29
|
+
},
|
|
30
|
+
surfaces: {
|
|
31
|
+
templates: true,
|
|
32
|
+
sandbox: {
|
|
33
|
+
enabled: true,
|
|
34
|
+
modes: ["markdown", "specs"]
|
|
35
|
+
},
|
|
36
|
+
studio: {
|
|
37
|
+
enabled: true,
|
|
38
|
+
installable: true
|
|
39
|
+
},
|
|
40
|
+
mcp: { enabled: true }
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { example as default };
|
|
46
|
+
//# sourceMappingURL=example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["import { defineExample } from '@contractspec/lib.contracts';\n\nconst example = defineExample({\n meta: {\n key: 'project-management-sync',\n version: '1.0.0',\n title: 'Project Management Sync',\n description:\n 'Create project-management work items in Linear, Jira Cloud, or Notion from a shared payload.',\n kind: 'integration',\n visibility: 'public',\n stability: 'experimental',\n owners: ['@platform.integrations'],\n tags: ['project-management', 'linear', 'jira', 'notion', 'integrations'],\n },\n docs: {\n rootDocId: 'docs.examples.project-management-sync',\n usageDocId: 'docs.examples.project-management-sync.usage',\n },\n entrypoints: {\n packageName: '@contractspec/example.project-management-sync',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: { enabled: true, modes: ['markdown', 'specs'] },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n});\n\nexport default example;\n"],"mappings":";;;AAEA,MAAM,UAAU,cAAc;CAC5B,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,YAAY;EACZ,WAAW;EACX,QAAQ,CAAC,yBAAyB;EAClC,MAAM;GAAC;GAAsB;GAAU;GAAQ;GAAU;GAAe;EACzE;CACD,MAAM;EACJ,WAAW;EACX,YAAY;EACb;CACD,aAAa;EACX,aAAa;EACb,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GAAE,SAAS;GAAM,OAAO,CAAC,YAAY,QAAQ;GAAE;EACxD,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import example from "./example.js";
|
|
2
|
+
import { ProjectManagementProviderName, ProjectManagementSyncInput, ProjectManagementSyncOutput, buildSampleSummary, buildSampleWorkItems, createProviderFromEnv, resolveProviderName, runProjectManagementSyncFromEnv, syncProjectManagementWorkItems } from "./sync.js";
|
|
3
|
+
export { ProjectManagementProviderName, ProjectManagementSyncInput, ProjectManagementSyncOutput, buildSampleSummary, buildSampleWorkItems, createProviderFromEnv, example, resolveProviderName, runProjectManagementSyncFromEnv, syncProjectManagementWorkItems };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import example from "./example.js";
|
|
2
|
+
import { buildSampleSummary, buildSampleWorkItems, createProviderFromEnv, resolveProviderName, runProjectManagementSyncFromEnv, syncProjectManagementWorkItems } from "./sync.js";
|
|
3
|
+
import "./docs/index.js";
|
|
4
|
+
|
|
5
|
+
export { buildSampleSummary, buildSampleWorkItems, createProviderFromEnv, example, resolveProviderName, runProjectManagementSyncFromEnv, syncProjectManagementWorkItems };
|
package/dist/run.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/run.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { runProjectManagementSyncFromEnv } from "./sync.js";
|
|
2
|
+
|
|
3
|
+
//#region src/run.ts
|
|
4
|
+
runProjectManagementSyncFromEnv().then((result) => {
|
|
5
|
+
console.log(JSON.stringify(result, null, 2));
|
|
6
|
+
}).catch((error) => {
|
|
7
|
+
console.error(error);
|
|
8
|
+
process.exitCode = 1;
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
//# sourceMappingURL=run.js.map
|
package/dist/run.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","names":[],"sources":["../src/run.ts"],"sourcesContent":["import { runProjectManagementSyncFromEnv } from './sync';\n\nrunProjectManagementSyncFromEnv()\n .then((result) => {\n console.log(JSON.stringify(result, null, 2));\n })\n .catch((error) => {\n console.error(error);\n process.exitCode = 1;\n });\n"],"mappings":";;;AAEA,iCAAiC,CAC9B,MAAM,WAAW;AAChB,SAAQ,IAAI,KAAK,UAAU,QAAQ,MAAM,EAAE,CAAC;EAC5C,CACD,OAAO,UAAU;AAChB,SAAQ,MAAM,MAAM;AACpB,SAAQ,WAAW;EACnB"}
|
package/dist/sync.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ProjectManagementProvider, ProjectManagementWorkItem, ProjectManagementWorkItemInput } from "@contractspec/integration.providers-impls/project-management";
|
|
2
|
+
|
|
3
|
+
//#region src/sync.d.ts
|
|
4
|
+
type ProjectManagementProviderName = 'linear' | 'jira' | 'notion';
|
|
5
|
+
interface ProjectManagementSyncInput {
|
|
6
|
+
provider: ProjectManagementProviderName;
|
|
7
|
+
providerClient?: ProjectManagementProvider;
|
|
8
|
+
items?: ProjectManagementWorkItemInput[];
|
|
9
|
+
summary?: ProjectManagementWorkItemInput;
|
|
10
|
+
dryRun?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface ProjectManagementSyncOutput {
|
|
13
|
+
summary?: ProjectManagementWorkItem | ProjectManagementWorkItemInput;
|
|
14
|
+
items: ProjectManagementWorkItem[] | ProjectManagementWorkItemInput[];
|
|
15
|
+
}
|
|
16
|
+
declare function syncProjectManagementWorkItems(input: ProjectManagementSyncInput): Promise<ProjectManagementSyncOutput>;
|
|
17
|
+
declare function runProjectManagementSyncFromEnv(): Promise<ProjectManagementSyncOutput>;
|
|
18
|
+
declare function buildSampleWorkItems(): ProjectManagementWorkItemInput[];
|
|
19
|
+
declare function buildSampleSummary(): ProjectManagementWorkItemInput;
|
|
20
|
+
declare function createProviderFromEnv(provider: ProjectManagementProviderName): ProjectManagementProvider;
|
|
21
|
+
declare function resolveProviderName(): ProjectManagementProviderName;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { ProjectManagementProviderName, ProjectManagementSyncInput, ProjectManagementSyncOutput, buildSampleSummary, buildSampleWorkItems, createProviderFromEnv, resolveProviderName, runProjectManagementSyncFromEnv, syncProjectManagementWorkItems };
|
|
24
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","names":[],"sources":["../src/sync.ts"],"mappings":";;;KAWY,6BAAA;AAAA,UAEK,0BAAA;EACf,QAAA,EAAU,6BAAA;EACV,cAAA,GAAiB,yBAAA;EACjB,KAAA,GAAQ,8BAAA;EACR,OAAA,GAAU,8BAAA;EACV,MAAA;AAAA;AAAA,UAGe,2BAAA;EACf,OAAA,GAAU,yBAAA,GAA4B,8BAAA;EACtC,KAAA,EAAO,yBAAA,KAA8B,8BAAA;AAAA;AAAA,iBAGjB,8BAAA,CACpB,KAAA,EAAO,0BAAA,GACN,OAAA,CAAQ,2BAAA;AAAA,iBAkBW,+BAAA,CAAA,GAAmC,OAAA,CAAQ,2BAAA;AAAA,iBAWjD,oBAAA,CAAA,GAAwB,8BAAA;AAAA,iBA8BxB,kBAAA,CAAA,GAAsB,8BAAA;AAAA,iBAUtB,qBAAA,CACd,QAAA,EAAU,6BAAA,GACT,yBAAA;AAAA,iBAoCa,mBAAA,CAAA,GAAuB,6BAAA"}
|
package/dist/sync.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { JiraProjectManagementProvider, LinearProjectManagementProvider, NotionProjectManagementProvider } from "@contractspec/integration.providers-impls/impls";
|
|
2
|
+
|
|
3
|
+
//#region src/sync.ts
|
|
4
|
+
async function syncProjectManagementWorkItems(input) {
|
|
5
|
+
const items = input.items ?? buildSampleWorkItems();
|
|
6
|
+
const summary = input.summary;
|
|
7
|
+
if (input.dryRun ?? false) return {
|
|
8
|
+
summary,
|
|
9
|
+
items
|
|
10
|
+
};
|
|
11
|
+
const provider = input.providerClient ?? createProviderFromEnv(input.provider);
|
|
12
|
+
return {
|
|
13
|
+
summary: summary ? await provider.createWorkItem(summary) : void 0,
|
|
14
|
+
items: await provider.createWorkItems(items)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
async function runProjectManagementSyncFromEnv() {
|
|
18
|
+
const provider = resolveProviderName();
|
|
19
|
+
const dryRun = process.env.CONTRACTSPEC_PM_DRY_RUN === "true";
|
|
20
|
+
return syncProjectManagementWorkItems({
|
|
21
|
+
provider,
|
|
22
|
+
summary: provider === "notion" ? buildSampleSummary() : void 0,
|
|
23
|
+
dryRun
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function buildSampleWorkItems() {
|
|
27
|
+
return [
|
|
28
|
+
{
|
|
29
|
+
title: "Review onboarding drop-off",
|
|
30
|
+
description: "Analyze activation funnel to identify the highest drop-off step and propose fixes.",
|
|
31
|
+
type: "task",
|
|
32
|
+
priority: "high",
|
|
33
|
+
tags: ["onboarding", "insights"]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
title: "Ship first-run checklist",
|
|
37
|
+
description: "Create a guided checklist with 3-5 steps to help new users reach first value.",
|
|
38
|
+
type: "task",
|
|
39
|
+
priority: "medium",
|
|
40
|
+
tags: ["activation", "ux"],
|
|
41
|
+
dueDate: /* @__PURE__ */ new Date("2026-02-15")
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: "Define success metrics",
|
|
45
|
+
description: "Agree on activation success metrics and instrument key events.",
|
|
46
|
+
type: "task",
|
|
47
|
+
priority: "low",
|
|
48
|
+
tags: ["analytics", "tracking"]
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
function buildSampleSummary() {
|
|
53
|
+
return {
|
|
54
|
+
title: "Product Intent Summary",
|
|
55
|
+
description: "This summary aggregates the onboarding tasks and highlights the activation improvements to prioritize.",
|
|
56
|
+
type: "summary",
|
|
57
|
+
tags: ["product-intent", "summary"]
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function createProviderFromEnv(provider) {
|
|
61
|
+
if (provider === "linear") return new LinearProjectManagementProvider({
|
|
62
|
+
apiKey: requireEnv("LINEAR_API_KEY"),
|
|
63
|
+
teamId: requireEnv("LINEAR_TEAM_ID"),
|
|
64
|
+
projectId: process.env.LINEAR_PROJECT_ID,
|
|
65
|
+
stateId: process.env.LINEAR_STATE_ID,
|
|
66
|
+
assigneeId: process.env.LINEAR_ASSIGNEE_ID,
|
|
67
|
+
labelIds: splitList(process.env.LINEAR_LABEL_IDS)
|
|
68
|
+
});
|
|
69
|
+
if (provider === "jira") return new JiraProjectManagementProvider({
|
|
70
|
+
siteUrl: requireEnv("JIRA_SITE_URL"),
|
|
71
|
+
email: requireEnv("JIRA_EMAIL"),
|
|
72
|
+
apiToken: requireEnv("JIRA_API_TOKEN"),
|
|
73
|
+
projectKey: process.env.JIRA_PROJECT_KEY,
|
|
74
|
+
issueType: process.env.JIRA_ISSUE_TYPE,
|
|
75
|
+
defaultLabels: splitList(process.env.JIRA_DEFAULT_LABELS)
|
|
76
|
+
});
|
|
77
|
+
return new NotionProjectManagementProvider({
|
|
78
|
+
apiKey: requireEnv("NOTION_API_KEY"),
|
|
79
|
+
databaseId: process.env.NOTION_DATABASE_ID,
|
|
80
|
+
summaryParentPageId: process.env.NOTION_SUMMARY_PARENT_PAGE_ID,
|
|
81
|
+
titleProperty: process.env.NOTION_TITLE_PROPERTY,
|
|
82
|
+
statusProperty: process.env.NOTION_STATUS_PROPERTY,
|
|
83
|
+
priorityProperty: process.env.NOTION_PRIORITY_PROPERTY,
|
|
84
|
+
tagsProperty: process.env.NOTION_TAGS_PROPERTY,
|
|
85
|
+
dueDateProperty: process.env.NOTION_DUE_DATE_PROPERTY,
|
|
86
|
+
descriptionProperty: process.env.NOTION_DESCRIPTION_PROPERTY
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function resolveProviderName() {
|
|
90
|
+
const raw = (process.env.CONTRACTSPEC_PM_PROVIDER ?? "linear").toLowerCase();
|
|
91
|
+
if (raw === "linear" || raw === "jira" || raw === "notion") return raw;
|
|
92
|
+
throw new Error(`Unsupported provider: ${raw}. Use one of: linear, jira, notion`);
|
|
93
|
+
}
|
|
94
|
+
function requireEnv(key) {
|
|
95
|
+
const value = process.env[key];
|
|
96
|
+
if (!value) throw new Error(`Missing required env var: ${key}`);
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
function splitList(value) {
|
|
100
|
+
if (!value) return void 0;
|
|
101
|
+
const items = value.split(",").map((item) => item.trim()).filter(Boolean);
|
|
102
|
+
return items.length > 0 ? items : void 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
export { buildSampleSummary, buildSampleWorkItems, createProviderFromEnv, resolveProviderName, runProjectManagementSyncFromEnv, syncProjectManagementWorkItems };
|
|
107
|
+
//# sourceMappingURL=sync.js.map
|
package/dist/sync.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","names":[],"sources":["../src/sync.ts"],"sourcesContent":["import {\n JiraProjectManagementProvider,\n LinearProjectManagementProvider,\n NotionProjectManagementProvider,\n} from '@contractspec/integration.providers-impls/impls';\nimport type {\n ProjectManagementProvider,\n ProjectManagementWorkItem,\n ProjectManagementWorkItemInput,\n} from '@contractspec/integration.providers-impls/project-management';\n\nexport type ProjectManagementProviderName = 'linear' | 'jira' | 'notion';\n\nexport interface ProjectManagementSyncInput {\n provider: ProjectManagementProviderName;\n providerClient?: ProjectManagementProvider;\n items?: ProjectManagementWorkItemInput[];\n summary?: ProjectManagementWorkItemInput;\n dryRun?: boolean;\n}\n\nexport interface ProjectManagementSyncOutput {\n summary?: ProjectManagementWorkItem | ProjectManagementWorkItemInput;\n items: ProjectManagementWorkItem[] | ProjectManagementWorkItemInput[];\n}\n\nexport async function syncProjectManagementWorkItems(\n input: ProjectManagementSyncInput\n): Promise<ProjectManagementSyncOutput> {\n const items = input.items ?? buildSampleWorkItems();\n const summary = input.summary;\n const dryRun = input.dryRun ?? false;\n\n if (dryRun) {\n return { summary, items };\n }\n\n const provider =\n input.providerClient ?? createProviderFromEnv(input.provider);\n const createdSummary = summary\n ? await provider.createWorkItem(summary)\n : undefined;\n const createdItems = await provider.createWorkItems(items);\n return { summary: createdSummary, items: createdItems };\n}\n\nexport async function runProjectManagementSyncFromEnv(): Promise<ProjectManagementSyncOutput> {\n const provider = resolveProviderName();\n const dryRun = process.env.CONTRACTSPEC_PM_DRY_RUN === 'true';\n const summary = provider === 'notion' ? buildSampleSummary() : undefined;\n return syncProjectManagementWorkItems({\n provider,\n summary,\n dryRun,\n });\n}\n\nexport function buildSampleWorkItems(): ProjectManagementWorkItemInput[] {\n return [\n {\n title: 'Review onboarding drop-off',\n description:\n 'Analyze activation funnel to identify the highest drop-off step and propose fixes.',\n type: 'task',\n priority: 'high',\n tags: ['onboarding', 'insights'],\n },\n {\n title: 'Ship first-run checklist',\n description:\n 'Create a guided checklist with 3-5 steps to help new users reach first value.',\n type: 'task',\n priority: 'medium',\n tags: ['activation', 'ux'],\n dueDate: new Date('2026-02-15'),\n },\n {\n title: 'Define success metrics',\n description:\n 'Agree on activation success metrics and instrument key events.',\n type: 'task',\n priority: 'low',\n tags: ['analytics', 'tracking'],\n },\n ];\n}\n\nexport function buildSampleSummary(): ProjectManagementWorkItemInput {\n return {\n title: 'Product Intent Summary',\n description:\n 'This summary aggregates the onboarding tasks and highlights the activation improvements to prioritize.',\n type: 'summary',\n tags: ['product-intent', 'summary'],\n };\n}\n\nexport function createProviderFromEnv(\n provider: ProjectManagementProviderName\n): ProjectManagementProvider {\n if (provider === 'linear') {\n return new LinearProjectManagementProvider({\n apiKey: requireEnv('LINEAR_API_KEY'),\n teamId: requireEnv('LINEAR_TEAM_ID'),\n projectId: process.env.LINEAR_PROJECT_ID,\n stateId: process.env.LINEAR_STATE_ID,\n assigneeId: process.env.LINEAR_ASSIGNEE_ID,\n labelIds: splitList(process.env.LINEAR_LABEL_IDS),\n });\n }\n\n if (provider === 'jira') {\n return new JiraProjectManagementProvider({\n siteUrl: requireEnv('JIRA_SITE_URL'),\n email: requireEnv('JIRA_EMAIL'),\n apiToken: requireEnv('JIRA_API_TOKEN'),\n projectKey: process.env.JIRA_PROJECT_KEY,\n issueType: process.env.JIRA_ISSUE_TYPE,\n defaultLabels: splitList(process.env.JIRA_DEFAULT_LABELS),\n });\n }\n\n return new NotionProjectManagementProvider({\n apiKey: requireEnv('NOTION_API_KEY'),\n databaseId: process.env.NOTION_DATABASE_ID,\n summaryParentPageId: process.env.NOTION_SUMMARY_PARENT_PAGE_ID,\n titleProperty: process.env.NOTION_TITLE_PROPERTY,\n statusProperty: process.env.NOTION_STATUS_PROPERTY,\n priorityProperty: process.env.NOTION_PRIORITY_PROPERTY,\n tagsProperty: process.env.NOTION_TAGS_PROPERTY,\n dueDateProperty: process.env.NOTION_DUE_DATE_PROPERTY,\n descriptionProperty: process.env.NOTION_DESCRIPTION_PROPERTY,\n });\n}\n\nexport function resolveProviderName(): ProjectManagementProviderName {\n const raw = (process.env.CONTRACTSPEC_PM_PROVIDER ?? 'linear').toLowerCase();\n if (raw === 'linear' || raw === 'jira' || raw === 'notion') return raw;\n throw new Error(\n `Unsupported provider: ${raw}. Use one of: linear, jira, notion`\n );\n}\n\nfunction requireEnv(key: string): string {\n const value = process.env[key];\n if (!value) {\n throw new Error(`Missing required env var: ${key}`);\n }\n return value;\n}\n\nfunction splitList(value?: string): string[] | undefined {\n if (!value) return undefined;\n const items = value\n .split(',')\n .map((item) => item.trim())\n .filter(Boolean);\n return items.length > 0 ? items : undefined;\n}\n"],"mappings":";;;AA0BA,eAAsB,+BACpB,OACsC;CACtC,MAAM,QAAQ,MAAM,SAAS,sBAAsB;CACnD,MAAM,UAAU,MAAM;AAGtB,KAFe,MAAM,UAAU,MAG7B,QAAO;EAAE;EAAS;EAAO;CAG3B,MAAM,WACJ,MAAM,kBAAkB,sBAAsB,MAAM,SAAS;AAK/D,QAAO;EAAE,SAJc,UACnB,MAAM,SAAS,eAAe,QAAQ,GACtC;EAE8B,OADb,MAAM,SAAS,gBAAgB,MAAM;EACH;;AAGzD,eAAsB,kCAAwE;CAC5F,MAAM,WAAW,qBAAqB;CACtC,MAAM,SAAS,QAAQ,IAAI,4BAA4B;AAEvD,QAAO,+BAA+B;EACpC;EACA,SAHc,aAAa,WAAW,oBAAoB,GAAG;EAI7D;EACD,CAAC;;AAGJ,SAAgB,uBAAyD;AACvE,QAAO;EACL;GACE,OAAO;GACP,aACE;GACF,MAAM;GACN,UAAU;GACV,MAAM,CAAC,cAAc,WAAW;GACjC;EACD;GACE,OAAO;GACP,aACE;GACF,MAAM;GACN,UAAU;GACV,MAAM,CAAC,cAAc,KAAK;GAC1B,yBAAS,IAAI,KAAK,aAAa;GAChC;EACD;GACE,OAAO;GACP,aACE;GACF,MAAM;GACN,UAAU;GACV,MAAM,CAAC,aAAa,WAAW;GAChC;EACF;;AAGH,SAAgB,qBAAqD;AACnE,QAAO;EACL,OAAO;EACP,aACE;EACF,MAAM;EACN,MAAM,CAAC,kBAAkB,UAAU;EACpC;;AAGH,SAAgB,sBACd,UAC2B;AAC3B,KAAI,aAAa,SACf,QAAO,IAAI,gCAAgC;EACzC,QAAQ,WAAW,iBAAiB;EACpC,QAAQ,WAAW,iBAAiB;EACpC,WAAW,QAAQ,IAAI;EACvB,SAAS,QAAQ,IAAI;EACrB,YAAY,QAAQ,IAAI;EACxB,UAAU,UAAU,QAAQ,IAAI,iBAAiB;EAClD,CAAC;AAGJ,KAAI,aAAa,OACf,QAAO,IAAI,8BAA8B;EACvC,SAAS,WAAW,gBAAgB;EACpC,OAAO,WAAW,aAAa;EAC/B,UAAU,WAAW,iBAAiB;EACtC,YAAY,QAAQ,IAAI;EACxB,WAAW,QAAQ,IAAI;EACvB,eAAe,UAAU,QAAQ,IAAI,oBAAoB;EAC1D,CAAC;AAGJ,QAAO,IAAI,gCAAgC;EACzC,QAAQ,WAAW,iBAAiB;EACpC,YAAY,QAAQ,IAAI;EACxB,qBAAqB,QAAQ,IAAI;EACjC,eAAe,QAAQ,IAAI;EAC3B,gBAAgB,QAAQ,IAAI;EAC5B,kBAAkB,QAAQ,IAAI;EAC9B,cAAc,QAAQ,IAAI;EAC1B,iBAAiB,QAAQ,IAAI;EAC7B,qBAAqB,QAAQ,IAAI;EAClC,CAAC;;AAGJ,SAAgB,sBAAqD;CACnE,MAAM,OAAO,QAAQ,IAAI,4BAA4B,UAAU,aAAa;AAC5E,KAAI,QAAQ,YAAY,QAAQ,UAAU,QAAQ,SAAU,QAAO;AACnE,OAAM,IAAI,MACR,yBAAyB,IAAI,oCAC9B;;AAGH,SAAS,WAAW,KAAqB;CACvC,MAAM,QAAQ,QAAQ,IAAI;AAC1B,KAAI,CAAC,MACH,OAAM,IAAI,MAAM,6BAA6B,MAAM;AAErD,QAAO;;AAGT,SAAS,UAAU,OAAsC;AACvD,KAAI,CAAC,MAAO,QAAO;CACnB,MAAM,QAAQ,MACX,MAAM,IAAI,CACV,KAAK,SAAS,KAAK,MAAM,CAAC,CAC1B,OAAO,QAAQ;AAClB,QAAO,MAAM,SAAS,IAAI,QAAQ"}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@contractspec/example.project-management-sync",
|
|
3
|
+
"version": "0.0.0-canary-20260206014742",
|
|
4
|
+
"description": "Project management sync example: Linear, Jira, and Notion work item creation.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./dist/index.js",
|
|
9
|
+
"./docs": "./dist/docs/index.js",
|
|
10
|
+
"./docs/project-management-sync.docblock": "./dist/docs/project-management-sync.docblock.js",
|
|
11
|
+
"./example": "./dist/example.js",
|
|
12
|
+
"./run": "./dist/run.js",
|
|
13
|
+
"./sync": "./dist/sync.js",
|
|
14
|
+
"./*": "./*"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
18
|
+
"publish:pkg:canary": "bun publish:pkg --tag canary",
|
|
19
|
+
"build": "bun build:types && bun build:bundle",
|
|
20
|
+
"build:bundle": "tsdown",
|
|
21
|
+
"build:types": "tsc --noEmit",
|
|
22
|
+
"dev": "bun build:bundle --watch",
|
|
23
|
+
"clean": "rimraf dist .turbo",
|
|
24
|
+
"lint": "bun lint:fix",
|
|
25
|
+
"lint:fix": "eslint src --fix",
|
|
26
|
+
"lint:check": "eslint src",
|
|
27
|
+
"test": "bun test"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@contractspec/integration.providers-impls": "0.0.0-canary-20260206014742",
|
|
31
|
+
"@contractspec/lib.contracts": "0.0.0-canary-20260206014742"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@contractspec/tool.tsdown": "0.0.0-canary-20260206014742",
|
|
35
|
+
"@contractspec/tool.typescript": "0.0.0-canary-20260206014742",
|
|
36
|
+
"tsdown": "^0.20.3",
|
|
37
|
+
"typescript": "^5.9.3"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public",
|
|
41
|
+
"exports": {
|
|
42
|
+
".": "./dist/index.js",
|
|
43
|
+
"./docs": "./dist/docs/index.js",
|
|
44
|
+
"./docs/project-management-sync.docblock": "./dist/docs/project-management-sync.docblock.js",
|
|
45
|
+
"./example": "./dist/example.js",
|
|
46
|
+
"./run": "./dist/run.js",
|
|
47
|
+
"./sync": "./dist/sync.js",
|
|
48
|
+
"./*": "./*"
|
|
49
|
+
},
|
|
50
|
+
"registry": "https://registry.npmjs.org/"
|
|
51
|
+
},
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "https://github.com/lssm-tech/contractspec.git",
|
|
56
|
+
"directory": "packages/examples/project-management-sync"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://contractspec.io"
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './project-management-sync.docblock';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { DocBlock } from '@contractspec/lib.contracts/docs';
|
|
2
|
+
import { registerDocBlocks } from '@contractspec/lib.contracts/docs';
|
|
3
|
+
|
|
4
|
+
const blocks: DocBlock[] = [
|
|
5
|
+
{
|
|
6
|
+
id: 'docs.examples.project-management-sync',
|
|
7
|
+
title: 'Project Management Sync (example)',
|
|
8
|
+
summary:
|
|
9
|
+
'Create a shared payload of work items and sync it to Linear, Jira Cloud, or Notion.',
|
|
10
|
+
kind: 'reference',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
route: '/docs/examples/project-management-sync',
|
|
13
|
+
tags: ['project-management', 'linear', 'jira', 'notion', 'example'],
|
|
14
|
+
body: `## What this example shows
|
|
15
|
+
- Build a provider-agnostic payload of work items.
|
|
16
|
+
- Resolve the target provider from environment variables.
|
|
17
|
+
- Run in dry-run mode for preview output.
|
|
18
|
+
|
|
19
|
+
## Guardrails
|
|
20
|
+
- Keep secrets in env or secret providers only.
|
|
21
|
+
- Use dry-run to validate payloads before writing.
|
|
22
|
+
- Start with a small batch of tasks to validate setup.`,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 'docs.examples.project-management-sync.usage',
|
|
26
|
+
title: 'Project Management Sync - Usage',
|
|
27
|
+
summary: 'How to run the sync with env-driven provider settings.',
|
|
28
|
+
kind: 'usage',
|
|
29
|
+
visibility: 'public',
|
|
30
|
+
route: '/docs/examples/project-management-sync/usage',
|
|
31
|
+
tags: ['project-management', 'usage'],
|
|
32
|
+
body: `## Usage
|
|
33
|
+
- Set CONTRACTSPEC_PM_PROVIDER to linear, jira, or notion.
|
|
34
|
+
- Set CONTRACTSPEC_PM_DRY_RUN=true to preview payloads.
|
|
35
|
+
- Provide provider-specific env vars (API keys, project IDs).
|
|
36
|
+
|
|
37
|
+
## Example
|
|
38
|
+
- Call runProjectManagementSyncFromEnv() from sync.ts or import it in your app.
|
|
39
|
+
- The helper builds a sample payload and calls the provider client.`,
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
registerDocBlocks(blocks);
|
package/src/example.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineExample } from '@contractspec/lib.contracts';
|
|
2
|
+
|
|
3
|
+
const example = defineExample({
|
|
4
|
+
meta: {
|
|
5
|
+
key: 'project-management-sync',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
title: 'Project Management Sync',
|
|
8
|
+
description:
|
|
9
|
+
'Create project-management work items in Linear, Jira Cloud, or Notion from a shared payload.',
|
|
10
|
+
kind: 'integration',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
stability: 'experimental',
|
|
13
|
+
owners: ['@platform.integrations'],
|
|
14
|
+
tags: ['project-management', 'linear', 'jira', 'notion', 'integrations'],
|
|
15
|
+
},
|
|
16
|
+
docs: {
|
|
17
|
+
rootDocId: 'docs.examples.project-management-sync',
|
|
18
|
+
usageDocId: 'docs.examples.project-management-sync.usage',
|
|
19
|
+
},
|
|
20
|
+
entrypoints: {
|
|
21
|
+
packageName: '@contractspec/example.project-management-sync',
|
|
22
|
+
docs: './docs',
|
|
23
|
+
},
|
|
24
|
+
surfaces: {
|
|
25
|
+
templates: true,
|
|
26
|
+
sandbox: { enabled: true, modes: ['markdown', 'specs'] },
|
|
27
|
+
studio: { enabled: true, installable: true },
|
|
28
|
+
mcp: { enabled: true },
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export default example;
|
package/src/index.ts
ADDED
package/src/run.ts
ADDED