attio 0.0.1-experimental.20250401 → 0.0.1-experimental.20250402

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.
@@ -4,7 +4,7 @@ import chalk from "chalk";
4
4
  import boxen from "boxen";
5
5
  import { existsSync } from "fs";
6
6
  import { createDirectory } from "../../util/create-directory.js";
7
- import { canWrite } from "../../util/validate-slug.js";
7
+ import { canWrite } from "../../util/can-write.js";
8
8
  import { copyWithTransform } from "../../util/copy-with-replace.js";
9
9
  import { printMessage } from "../../util/print-message.js";
10
10
  import { Spinner } from "../../util/spinner.js";
@@ -4,6 +4,7 @@ import chalk from "chalk";
4
4
  import { boot } from "./init/boot.js";
5
5
  import { createProject } from "./init/create-project.js";
6
6
  import { askLanguage } from "./init/ask-language.js";
7
+ import { printLogo } from "../util/print-logo.js";
7
8
  export const argsSchema = z.string();
8
9
  export const optionsSchema = z.object({
9
10
  language: z.enum(["javascript", "typescript"]).optional(),
@@ -16,6 +17,7 @@ export const init = new Command("init")
16
17
  .addOption(new Option("--workspace <slug>", "The slug of the workspace to use"))
17
18
  .action(async (unparsedArgs, unparsedOptions) => {
18
19
  try {
20
+ printLogo();
19
21
  const appSlug = argsSchema.parse(unparsedArgs);
20
22
  const { language: cliLanguage, workspace: workspaceSlug } = optionsSchema.parse(unparsedOptions);
21
23
  const { appId, appInfo } = await boot({ workspaceSlug, appSlug });
@@ -1,6 +1,5 @@
1
1
  import { accessSync, constants } from "fs";
2
2
  import { resolve } from "path";
3
- const slugRegex = /^(?!-)[a-z0-9\-]*(?<!-)$/;
4
3
  export const canWrite = (path) => {
5
4
  try {
6
5
  accessSync(resolve(path), constants.W_OK);
@@ -10,4 +9,3 @@ export const canWrite = (path) => {
10
9
  return false;
11
10
  }
12
11
  };
13
- export const isValidSlug = (slug) => slugRegex.test(slug);
@@ -0,0 +1,5 @@
1
+ import { attioLogoAndName } from "../attio-logo.js";
2
+ import { textGradient } from "./text-gradient.js";
3
+ export function printLogo() {
4
+ process.stdout.write(`\n${textGradient(attioLogoAndName, "#ff5f6d", "#ffc371")}\n\n`);
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attio",
3
- "version": "0.0.1-experimental.20250401",
3
+ "version": "0.0.1-experimental.20250402",
4
4
  "bin": "lib/attio.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -30,6 +30,9 @@
30
30
  "default": "./lint.cjs"
31
31
  }
32
32
  },
33
+ "peerDependencies": {
34
+ "react": "^18"
35
+ },
33
36
  "dependencies": {
34
37
  "@babel/code-frame": "7.24.7",
35
38
  "@fal-works/esbuild-plugin-global-externals": "^2.1.2",
@@ -43,7 +46,6 @@
43
46
  "chalk": "^5.4.1",
44
47
  "chokidar": "^3.6.0",
45
48
  "cli-table3": "^0.6.5",
46
- "clipboardy": "^4.0.0",
47
49
  "commander": "^13.0.0",
48
50
  "date-fns": "^2.21.1",
49
51
  "dotenv": "^16.4.5",
@@ -52,25 +54,14 @@
52
54
  "glob": "^11.0.1",
53
55
  "graphql": "16.9.0",
54
56
  "hono": "4.6.18",
55
- "immer": "^5.0.0",
56
- "ini": "^4.1.3",
57
- "inquirer": "^12.3.0",
58
57
  "keytar": "^7.9.0",
59
58
  "node-notifier": "^10.0.1",
60
59
  "open": "^7.0.0",
61
- "prettier": "^3.4.1",
62
- "react": "18.3.1",
63
60
  "stdin-blocker": "^2.0.0",
64
61
  "tiny-cursor": "^2.0.0",
65
62
  "tmp-promise": "^3.0.3",
66
63
  "ts-morph": "^24.0.0",
67
64
  "typescript": "5.6.3",
68
- "uuid": "^9.0.1",
69
- "zod": "^3.22.3",
70
- "zod-to-json-schema": "3.23.1",
71
- "zod-validation-error": "3.3.0"
72
- },
73
- "peerDependencies": {
74
- "react": "^18"
65
+ "zod": "^3.22.3"
75
66
  }
76
67
  }
@@ -1,36 +0,0 @@
1
- import { v4 as uuid } from "uuid";
2
- import { z } from "zod";
3
- import { API } from "../env.js";
4
- import { handleError } from "./handle-error.js";
5
- import { makeHeaders } from "./make-headers.js";
6
- const isTest = process.env.NODE_ENV === "test";
7
- const createDeveloperAccountSchema = z.object({
8
- developer_account: z.object({
9
- developer_account_id: z.string(),
10
- }),
11
- developer_account_member: z.object({
12
- developer_account_member_id: z.string(),
13
- }),
14
- });
15
- export async function createDeveloperAccount({ token, developerSlug, }) {
16
- const accountId = uuid();
17
- if (isTest) {
18
- return createDeveloperAccountSchema.parse({
19
- developer_account: { developer_account_id: accountId },
20
- developer_account_member: { developer_account_member_id: accountId },
21
- });
22
- }
23
- const response = await fetch(`${API}/developer-accounts/${accountId}`, {
24
- method: "PUT",
25
- headers: makeHeaders(token),
26
- body: JSON.stringify({ slug: developerSlug, title: developerSlug }),
27
- });
28
- await handleError(response);
29
- const json = await response.json();
30
- try {
31
- return createDeveloperAccountSchema.parse(json);
32
- }
33
- catch {
34
- throw new Error(JSON.stringify(json));
35
- }
36
- }
@@ -1,8 +0,0 @@
1
- export function setTerminalTitle(title) {
2
- if (process.platform === "win32") {
3
- process.title = title;
4
- }
5
- else {
6
- process.stdout.write(`\x1B]2;${title}\x1B\x5C`);
7
- }
8
- }