@ship-cli/core 0.1.10 → 0.1.11

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 (2) hide show
  1. package/dist/bin.js +113 -1
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -39834,6 +39834,67 @@ Project: ${partial2.linear.value.projectId.value}` : ""}`,
39834
39834
  Se("Run 'ship task ready' to see available tasks.");
39835
39835
  return;
39836
39836
  }
39837
+ if (isSome2(partial2.auth) && isSome2(partial2.notion)) {
39838
+ Me(
39839
+ `Provider: Notion
39840
+ Database: ${partial2.notion.value.databaseId}`,
39841
+ "Already initialized"
39842
+ );
39843
+ Se("Run 'ship task ready' to see available tasks.");
39844
+ return;
39845
+ }
39846
+ }
39847
+ const provider = yield* prompts.select({
39848
+ message: "Select task provider",
39849
+ options: [
39850
+ { value: "linear", label: "Linear", hint: "recommended" },
39851
+ { value: "notion", label: "Notion", hint: "use Notion database as task backend" }
39852
+ ]
39853
+ });
39854
+ if (provider === "notion") {
39855
+ Me(
39856
+ "Create an integration at:\nhttps://www.notion.so/my-integrations\n\nThen share your task database with the integration.",
39857
+ "Notion Authentication"
39858
+ );
39859
+ const notionToken = yield* prompts.text({
39860
+ message: "Paste your Notion API token",
39861
+ placeholder: "ntn_... or secret_...",
39862
+ validate: (value5) => {
39863
+ if (!value5) return "API token is required";
39864
+ if (!value5.startsWith("ntn_") && !value5.startsWith("secret_"))
39865
+ return "Token should start with ntn_ or secret_";
39866
+ return void 0;
39867
+ }
39868
+ });
39869
+ const databaseId = yield* prompts.text({
39870
+ message: "Paste your Notion database ID",
39871
+ placeholder: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
39872
+ validate: (value5) => {
39873
+ if (!value5) return "Database ID is required";
39874
+ const cleaned = value5.replace(/-/g, "");
39875
+ if (cleaned.length !== 32) return "Invalid database ID format";
39876
+ return void 0;
39877
+ }
39878
+ });
39879
+ yield* config2.saveAuth({ apiKey: notionToken });
39880
+ yield* config2.saveNotion(
39881
+ new NotionConfig({
39882
+ databaseId: databaseId.replace(/-/g, ""),
39883
+ workspaceId: none2(),
39884
+ propertyMapping: new NotionPropertyMapping({})
39885
+ })
39886
+ );
39887
+ yield* config2.ensureGitignore();
39888
+ yield* config2.ensureOpencodeSkill();
39889
+ Me(
39890
+ `Provider: Notion
39891
+ Database: ${databaseId}
39892
+
39893
+ OpenCode skill created at .opencode/skill/ship-cli/SKILL.md`,
39894
+ "Workspace initialized"
39895
+ );
39896
+ Se("Run 'ship task ready' to see available tasks.");
39897
+ return;
39837
39898
  }
39838
39899
  const isAuth = yield* auth.isAuthenticated();
39839
39900
  if (!isAuth) {
@@ -192754,7 +192815,7 @@ var command = ship.pipe(
192754
192815
  prCommand
192755
192816
  ])
192756
192817
  );
192757
- var version = "0.1.10" ;
192818
+ var version = "0.1.11" ;
192758
192819
  var run9 = run8(command, {
192759
192820
  name: "ship",
192760
192821
  version
@@ -194503,6 +194564,7 @@ var CONFIG_FILE = "config.yaml";
194503
194564
  var OPENCODE_SKILL_DIR = ".opencode/skill/ship-cli";
194504
194565
  var OPENCODE_SKILL_FILE = "SKILL.md";
194505
194566
  var YamlConfig = Struct({
194567
+ provider: optional(Literal2("linear", "notion")),
194506
194568
  linear: optional(
194507
194569
  Struct({
194508
194570
  teamId: String$,
@@ -194510,6 +194572,25 @@ var YamlConfig = Struct({
194510
194572
  projectId: NullOr(String$)
194511
194573
  })
194512
194574
  ),
194575
+ notion: optional(
194576
+ Struct({
194577
+ databaseId: String$,
194578
+ workspaceId: NullOr(String$),
194579
+ propertyMapping: optional(
194580
+ Struct({
194581
+ title: optional(String$),
194582
+ status: optional(String$),
194583
+ priority: optional(String$),
194584
+ description: optional(String$),
194585
+ labels: optional(String$),
194586
+ blockedBy: optional(String$),
194587
+ type: optional(String$),
194588
+ identifier: optional(String$),
194589
+ parent: optional(String$)
194590
+ })
194591
+ )
194592
+ })
194593
+ ),
194513
194594
  auth: optional(
194514
194595
  Struct({
194515
194596
  apiKey: String$
@@ -194738,6 +194819,36 @@ Details: ${e2.message}`,
194738
194819
  };
194739
194820
  yield* writeYaml(yaml);
194740
194821
  });
194822
+ const saveNotion = (notion) => gen2(function* () {
194823
+ const existingYaml = yield* readYaml();
194824
+ const yaml = {};
194825
+ if (existingYaml?.auth) {
194826
+ yaml.auth = { apiKey: existingYaml.auth.apiKey };
194827
+ }
194828
+ if (existingYaml?.git?.defaultBranch)
194829
+ yaml.git = { defaultBranch: existingYaml.git.defaultBranch };
194830
+ if (existingYaml?.pr?.openBrowser !== void 0)
194831
+ yaml.pr = { openBrowser: existingYaml.pr.openBrowser };
194832
+ if (existingYaml?.commit?.conventionalFormat !== void 0)
194833
+ yaml.commit = { conventionalFormat: existingYaml.commit.conventionalFormat };
194834
+ yaml.provider = "notion";
194835
+ yaml.notion = {
194836
+ databaseId: notion.databaseId,
194837
+ workspaceId: isSome2(notion.workspaceId) ? notion.workspaceId.value : null,
194838
+ propertyMapping: {
194839
+ title: notion.propertyMapping.title,
194840
+ status: notion.propertyMapping.status,
194841
+ priority: notion.propertyMapping.priority,
194842
+ description: notion.propertyMapping.description,
194843
+ labels: notion.propertyMapping.labels,
194844
+ blockedBy: notion.propertyMapping.blockedBy,
194845
+ type: notion.propertyMapping.type,
194846
+ identifier: notion.propertyMapping.identifier,
194847
+ parent: notion.propertyMapping.parent
194848
+ }
194849
+ };
194850
+ yield* writeYaml(yaml);
194851
+ });
194741
194852
  const deleteConfig = () => gen2(function* () {
194742
194853
  const configPath = yield* getConfigPath();
194743
194854
  const fileExists = yield* fs.exists(configPath);
@@ -194772,6 +194883,7 @@ Details: ${e2.message}`,
194772
194883
  savePartial,
194773
194884
  saveAuth,
194774
194885
  saveLinear,
194886
+ saveNotion,
194775
194887
  exists: exists3,
194776
194888
  getConfigDir,
194777
194889
  ensureConfigDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ship-cli/core",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Linear + jj workflow CLI for AI agents",