attio 0.0.1-experimental.20240522

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 (94) hide show
  1. package/README.md +9 -0
  2. package/lib/build.d.ts +160 -0
  3. package/lib/build.d.ts.map +1 -0
  4. package/lib/build.js +81 -0
  5. package/lib/build.js.map +1 -0
  6. package/lib/cli.d.ts +3 -0
  7. package/lib/cli.d.ts.map +1 -0
  8. package/lib/cli.js +5 -0
  9. package/lib/cli.js.map +1 -0
  10. package/lib/commands/build.d.ts +4 -0
  11. package/lib/commands/build.d.ts.map +1 -0
  12. package/lib/commands/build.js +28 -0
  13. package/lib/commands/build.js.map +1 -0
  14. package/lib/commands/scaffold.d.ts +10 -0
  15. package/lib/commands/scaffold.d.ts.map +1 -0
  16. package/lib/commands/scaffold.js +95 -0
  17. package/lib/commands/scaffold.js.map +1 -0
  18. package/lib/commands/watch.d.ts +3 -0
  19. package/lib/commands/watch.d.ts.map +1 -0
  20. package/lib/commands/watch.js +56 -0
  21. package/lib/commands/watch.js.map +1 -0
  22. package/lib/components/BuildError.d.ts +12 -0
  23. package/lib/components/BuildError.d.ts.map +1 -0
  24. package/lib/components/BuildError.js +56 -0
  25. package/lib/components/BuildError.js.map +1 -0
  26. package/lib/components/BuildLog.d.ts +7 -0
  27. package/lib/components/BuildLog.d.ts.map +1 -0
  28. package/lib/components/BuildLog.js +7 -0
  29. package/lib/components/BuildLog.js.map +1 -0
  30. package/lib/components/MultiSelect.d.ts +13 -0
  31. package/lib/components/MultiSelect.d.ts.map +1 -0
  32. package/lib/components/MultiSelect.js +66 -0
  33. package/lib/components/MultiSelect.js.map +1 -0
  34. package/lib/components/Select.d.ts +12 -0
  35. package/lib/components/Select.d.ts.map +1 -0
  36. package/lib/components/Select.js +8 -0
  37. package/lib/components/Select.js.map +1 -0
  38. package/lib/components/TypeScriptError.d.ts +11 -0
  39. package/lib/components/TypeScriptError.d.ts.map +1 -0
  40. package/lib/components/TypeScriptError.js +47 -0
  41. package/lib/components/TypeScriptError.js.map +1 -0
  42. package/lib/hooks/useFullScreen.d.ts +3 -0
  43. package/lib/hooks/useFullScreen.d.ts.map +1 -0
  44. package/lib/hooks/useFullScreen.js +17 -0
  45. package/lib/hooks/useFullScreen.js.map +1 -0
  46. package/lib/machines/build-machine.d.ts +60 -0
  47. package/lib/machines/build-machine.d.ts.map +1 -0
  48. package/lib/machines/build-machine.js +64 -0
  49. package/lib/machines/build-machine.js.map +1 -0
  50. package/lib/machines/scaffold-machine.d.ts +311 -0
  51. package/lib/machines/scaffold-machine.d.ts.map +1 -0
  52. package/lib/machines/scaffold-machine.js +260 -0
  53. package/lib/machines/scaffold-machine.js.map +1 -0
  54. package/lib/machines/watch-machine.d.ts +199 -0
  55. package/lib/machines/watch-machine.d.ts.map +1 -0
  56. package/lib/machines/watch-machine.js +218 -0
  57. package/lib/machines/watch-machine.js.map +1 -0
  58. package/lib/templates/common/README.md +19 -0
  59. package/lib/templates/javascript/.eslintignore +4 -0
  60. package/lib/templates/javascript/actions.jsx +12 -0
  61. package/lib/templates/javascript/counter-action.jsx +18 -0
  62. package/lib/templates/javascript/eslint.cjs +1 -0
  63. package/lib/templates/javascript/package.json +24 -0
  64. package/lib/templates/typescript/.eslintignore +4 -0
  65. package/lib/templates/typescript/actions.tsx +12 -0
  66. package/lib/templates/typescript/counter-action.tsx +18 -0
  67. package/lib/templates/typescript/eslint.cjs +6 -0
  68. package/lib/templates/typescript/package.json +25 -0
  69. package/lib/templates/typescript/tsconfig.json +50 -0
  70. package/lib/util/copy-with-replace.d.ts +2 -0
  71. package/lib/util/copy-with-replace.d.ts.map +1 -0
  72. package/lib/util/copy-with-replace.js +29 -0
  73. package/lib/util/copy-with-replace.js.map +1 -0
  74. package/lib/util/create-directory.d.ts +2 -0
  75. package/lib/util/create-directory.d.ts.map +1 -0
  76. package/lib/util/create-directory.js +20 -0
  77. package/lib/util/create-directory.js.map +1 -0
  78. package/lib/util/is-command-available.d.ts +2 -0
  79. package/lib/util/is-command-available.d.ts.map +1 -0
  80. package/lib/util/is-command-available.js +13 -0
  81. package/lib/util/is-command-available.js.map +1 -0
  82. package/lib/util/make-extension-name.d.ts +2 -0
  83. package/lib/util/make-extension-name.d.ts.map +1 -0
  84. package/lib/util/make-extension-name.js +11 -0
  85. package/lib/util/make-extension-name.js.map +1 -0
  86. package/lib/util/typescript.d.ts +41 -0
  87. package/lib/util/typescript.d.ts.map +1 -0
  88. package/lib/util/typescript.js +74 -0
  89. package/lib/util/typescript.js.map +1 -0
  90. package/lib/util/validate-project-name.d.ts +2 -0
  91. package/lib/util/validate-project-name.d.ts.map +1 -0
  92. package/lib/util/validate-project-name.js +27 -0
  93. package/lib/util/validate-project-name.js.map +1 -0
  94. package/package.json +50 -0
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # Attio Extension CLI
2
+
3
+ ## ⚠️ This package is experimental and not yet ready for use. ⚠️
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ npx attio
9
+ ```
package/lib/build.d.ts ADDED
@@ -0,0 +1,160 @@
1
+ import * as esbuild from "esbuild";
2
+ import { z } from "zod";
3
+ export declare const HARDCODED_OUTPUT_FILES: string[];
4
+ export declare const errorSchema: z.ZodObject<{
5
+ errors: z.ZodArray<z.ZodObject<{
6
+ text: z.ZodString;
7
+ location: z.ZodObject<{
8
+ column: z.ZodNumber;
9
+ file: z.ZodString;
10
+ length: z.ZodNumber;
11
+ line: z.ZodNumber;
12
+ lineText: z.ZodString;
13
+ namespace: z.ZodString;
14
+ suggestion: z.ZodString;
15
+ }, "strip", z.ZodTypeAny, {
16
+ length: number;
17
+ column: number;
18
+ file: string;
19
+ line: number;
20
+ lineText: string;
21
+ namespace: string;
22
+ suggestion: string;
23
+ }, {
24
+ length: number;
25
+ column: number;
26
+ file: string;
27
+ line: number;
28
+ lineText: string;
29
+ namespace: string;
30
+ suggestion: string;
31
+ }>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ text: string;
34
+ location: {
35
+ length: number;
36
+ column: number;
37
+ file: string;
38
+ line: number;
39
+ lineText: string;
40
+ namespace: string;
41
+ suggestion: string;
42
+ };
43
+ }, {
44
+ text: string;
45
+ location: {
46
+ length: number;
47
+ column: number;
48
+ file: string;
49
+ line: number;
50
+ lineText: string;
51
+ namespace: string;
52
+ suggestion: string;
53
+ };
54
+ }>, "many">;
55
+ warnings: z.ZodArray<z.ZodObject<{
56
+ text: z.ZodString;
57
+ location: z.ZodObject<{
58
+ column: z.ZodNumber;
59
+ file: z.ZodString;
60
+ length: z.ZodNumber;
61
+ line: z.ZodNumber;
62
+ lineText: z.ZodString;
63
+ namespace: z.ZodString;
64
+ suggestion: z.ZodString;
65
+ }, "strip", z.ZodTypeAny, {
66
+ length: number;
67
+ column: number;
68
+ file: string;
69
+ line: number;
70
+ lineText: string;
71
+ namespace: string;
72
+ suggestion: string;
73
+ }, {
74
+ length: number;
75
+ column: number;
76
+ file: string;
77
+ line: number;
78
+ lineText: string;
79
+ namespace: string;
80
+ suggestion: string;
81
+ }>;
82
+ }, "strip", z.ZodTypeAny, {
83
+ text: string;
84
+ location: {
85
+ length: number;
86
+ column: number;
87
+ file: string;
88
+ line: number;
89
+ lineText: string;
90
+ namespace: string;
91
+ suggestion: string;
92
+ };
93
+ }, {
94
+ text: string;
95
+ location: {
96
+ length: number;
97
+ column: number;
98
+ file: string;
99
+ line: number;
100
+ lineText: string;
101
+ namespace: string;
102
+ suggestion: string;
103
+ };
104
+ }>, "many">;
105
+ }, "strip", z.ZodTypeAny, {
106
+ errors: {
107
+ text: string;
108
+ location: {
109
+ length: number;
110
+ column: number;
111
+ file: string;
112
+ line: number;
113
+ lineText: string;
114
+ namespace: string;
115
+ suggestion: string;
116
+ };
117
+ }[];
118
+ warnings: {
119
+ text: string;
120
+ location: {
121
+ length: number;
122
+ column: number;
123
+ file: string;
124
+ line: number;
125
+ lineText: string;
126
+ namespace: string;
127
+ suggestion: string;
128
+ };
129
+ }[];
130
+ }, {
131
+ errors: {
132
+ text: string;
133
+ location: {
134
+ length: number;
135
+ column: number;
136
+ file: string;
137
+ line: number;
138
+ lineText: string;
139
+ namespace: string;
140
+ suggestion: string;
141
+ };
142
+ }[];
143
+ warnings: {
144
+ text: string;
145
+ location: {
146
+ length: number;
147
+ column: number;
148
+ file: string;
149
+ line: number;
150
+ lineText: string;
151
+ namespace: string;
152
+ suggestion: string;
153
+ };
154
+ }[];
155
+ }>;
156
+ export type BuildError = z.infer<typeof errorSchema>;
157
+ export declare const createBuildConfig: (contents: string) => esbuild.BuildOptions;
158
+ export declare const getAppDir: () => string;
159
+ export declare function generateEntry(log?: (message: string) => void): Promise<string>;
160
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAIlC,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAKrB,eAAO,MAAM,sBAAsB,UAUlC,CAAA;AAoBD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtB,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAEpD,eAAO,MAAM,iBAAiB,aAAc,MAAM,KAAG,QAAQ,YAmB3D,CAAA;AAEF,eAAO,MAAM,SAAS,cAOrB,CAAA;AAED,wBAAsB,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,mBAmClE"}
package/lib/build.js ADDED
@@ -0,0 +1,81 @@
1
+ import globalExternals from "@fal-works/esbuild-plugin-global-externals";
2
+ import { existsSync, readFileSync } from "fs";
3
+ import { stat } from "fs/promises";
4
+ import path from "path";
5
+ import { z } from "zod";
6
+ const ROUTES = ["record/actions.tsx"];
7
+ export const HARDCODED_OUTPUT_FILES = [
8
+ path.resolve("dist", "index.js"),
9
+ path.resolve("..", "..", "runtimes", "client-extension-runtime", "dist", "extension-example.js"),
10
+ ];
11
+ const packageSchema = z.object({
12
+ attio: z.object({
13
+ app: z.string(),
14
+ }),
15
+ });
16
+ const buildErrorSchema = z.object({
17
+ text: z.string(),
18
+ location: z.object({
19
+ column: z.number(),
20
+ file: z.string(),
21
+ length: z.number(),
22
+ line: z.number(),
23
+ lineText: z.string(),
24
+ namespace: z.string(),
25
+ suggestion: z.string(),
26
+ }),
27
+ });
28
+ export const errorSchema = z.object({
29
+ errors: z.array(buildErrorSchema),
30
+ warnings: z.array(buildErrorSchema),
31
+ });
32
+ export const createBuildConfig = (contents) => ({
33
+ stdin: {
34
+ contents,
35
+ resolveDir: ".",
36
+ loader: "tsx",
37
+ },
38
+ logLevel: "silent",
39
+ bundle: true,
40
+ platform: "browser",
41
+ format: "iife",
42
+ plugins: [
43
+ globalExternals({
44
+ "react": "React",
45
+ "@attio/client-extension-sdk": {
46
+ varName: "ATTIO_CLIENT_EXTENSION_SDK",
47
+ type: "cjs",
48
+ },
49
+ }),
50
+ ],
51
+ });
52
+ export const getAppDir = () => {
53
+ const appDir = packageSchema.parse(JSON.parse(readFileSync(path.resolve("package.json"), "utf-8"))).attio.app;
54
+ if (!existsSync(appDir))
55
+ throw new Error(`The directory '${appDir}' does not exist.`);
56
+ return appDir;
57
+ };
58
+ export async function generateEntry(log) {
59
+ const appDir = getAppDir();
60
+ log === null || log === void 0 ? void 0 : log(`💥 Found entry point at ${path.resolve(appDir)}`);
61
+ const routes = (await Promise.all(ROUTES.map(async (route) => {
62
+ try {
63
+ await stat(path.resolve(appDir, route));
64
+ log === null || log === void 0 ? void 0 : log(`📦 Found route "${route}"`);
65
+ return route;
66
+ }
67
+ catch {
68
+ return null;
69
+ }
70
+ }))).filter((module) => module !== null);
71
+ return `
72
+ ${routes
73
+ .map((route, index) => `import C${index} from ${JSON.stringify(`.${path.sep}${path.join(appDir, route)}`)}`)
74
+ .join("\n")}
75
+
76
+ ${routes
77
+ .map((route, index) => `registerExtensionComponent({route: ${JSON.stringify(route)}, component: C${index}})`)
78
+ .join("\n")}
79
+ `;
80
+ }
81
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,4CAA4C,CAAA;AAExE,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,IAAI,CAAA;AAC3C,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAChC,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,MAAM,MAAM,GAAG,CAAC,oBAAoB,CAAU,CAAA;AAG9C,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC;IAChC,IAAI,CAAC,OAAO,CACR,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,0BAA0B,EAC1B,MAAM,EACN,sBAAsB,CACzB;CACJ,CAAA;AAED,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACZ,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;KAClB,CAAC;CACL,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,MAAM,EAAE,C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0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/lib/cli.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import Pastel from "pastel";
3
+ const app = new Pastel({ importMeta: import.meta });
4
+ await app.run();
5
+ //# sourceMappingURL=cli.js.map
package/lib/cli.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,EAAC,UAAU,EAAE,MAAM,CAAC,IAAI,EAAC,CAAC,CAAA;AAEjD,MAAM,GAAG,CAAC,GAAG,EAAE,CAAA"}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ export declare const isDefault = true;
3
+ export default function Build(): React.JSX.Element;
4
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,eAAO,MAAM,SAAS,OAAO,CAAA;AAI7B,MAAM,CAAC,OAAO,UAAU,KAAK,sBAgC5B"}
@@ -0,0 +1,28 @@
1
+ import { useMachine } from "@xstate/react";
2
+ import { Box, Text } from "ink";
3
+ import React from "react";
4
+ import { BuildError } from "../components/BuildError.js";
5
+ import { BuildLog } from "../components/BuildLog.js";
6
+ import { buildMachine } from "../machines/build-machine.js";
7
+ export const isDefault = true;
8
+ export default function Build() {
9
+ const [snapshot] = useMachine(buildMachine);
10
+ switch (snapshot.value) {
11
+ case "Building":
12
+ return (React.createElement(Box, { flexDirection: "column" },
13
+ React.createElement(Box, null,
14
+ React.createElement(Text, null, "Building...")),
15
+ React.createElement(BuildLog, { log: snapshot.context.log })));
16
+ case "Done":
17
+ return (React.createElement(Box, { flexDirection: "column" },
18
+ React.createElement(BuildLog, { log: snapshot.context.log }),
19
+ React.createElement(Box, null,
20
+ React.createElement(Text, null, "\u2705 Built!"))));
21
+ case "Error":
22
+ return snapshot.context.error ? (React.createElement(BuildError, { error: snapshot.context.error })) : (React.createElement(Box, null,
23
+ React.createElement(Text, null, "Unknown error")));
24
+ default:
25
+ return snapshot.value;
26
+ }
27
+ }
28
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAA;AACxC,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAC,QAAQ,EAAC,MAAM,2BAA2B,CAAA;AAClD,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAA;AAEzD,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAA;AAI7B,MAAM,CAAC,OAAO,UAAU,KAAK;IACzB,MAAM,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,CAAA;IAC3C,QAAQ,QAAQ,CAAC,KAAK,EAAE,CAAC;QACrB,KAAK,UAAU;YACX,OAAO,CACH,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ;gBACvB,oBAAC,GAAG;oBACA,oBAAC,IAAI,sBAAmB,CACtB;gBACN,oBAAC,QAAQ,IAAC,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,GAAI,CACrC,CACT,CAAA;QACL,KAAK,MAAM;YACP,OAAO,CACH,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ;gBACvB,oBAAC,QAAQ,IAAC,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,GAAI;gBACvC,oBAAC,GAAG;oBACA,oBAAC,IAAI,wBAAgB,CACnB,CACJ,CACT,CAAA;QACL,KAAK,OAAO;YACR,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAC5B,oBAAC,UAAU,IAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,KAAK,GAAI,CAChD,CAAC,CAAC,CAAC,CACA,oBAAC,GAAG;gBACA,oBAAC,IAAI,wBAAqB,CACxB,CACT,CAAA;QACL;YACI,OAAO,QAAQ,CAAC,KAAqB,CAAA;IAC7C,CAAC;AACL,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { z } from "zod";
3
+ export declare const isDefault = true;
4
+ export declare const args: z.ZodTuple<[z.ZodDefault<z.ZodString>], null>;
5
+ interface Props {
6
+ args: z.infer<typeof args>;
7
+ }
8
+ export default function Scaffold({ args: [argName] }: Props): React.JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=scaffold.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/commands/scaffold.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAMrB,eAAO,MAAM,SAAS,OAAO,CAAA;AAC7B,eAAO,MAAM,IAAI,+CAAoC,CAAA;AAErD,UAAU,KAAK;IACX,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAA;CAC7B;AAID,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAC,EAAE,KAAK,qBAkJxD"}
@@ -0,0 +1,95 @@
1
+ import { useMachine } from "@xstate/react";
2
+ import figures from "figures";
3
+ import { Box, Text } from "ink";
4
+ import BigText from "ink-big-text";
5
+ import Gradient from "ink-gradient";
6
+ import Link from "ink-link";
7
+ import Spinner from "ink-spinner";
8
+ import TextInput from "ink-text-input";
9
+ import React from "react";
10
+ import { z } from "zod";
11
+ import { MultiSelect } from "../components/MultiSelect.js";
12
+ import { Select } from "../components/Select.js";
13
+ import { languages, outlets, packageManagers, scaffoldMachine } from "../machines/scaffold-machine.js";
14
+ export const isDefault = true;
15
+ export const args = z.tuple([z.string().default("")]);
16
+ export default function Scaffold({ args: [argName] }) {
17
+ const [snapshot, send] = useMachine(scaffoldMachine, { input: { name: argName } });
18
+ return (React.createElement(Box, { flexDirection: "column" },
19
+ React.createElement(Box, null,
20
+ React.createElement(Gradient, { name: "morning" },
21
+ React.createElement(BigText, { text: "/. Attio" }))),
22
+ snapshot.matches("Ask For Name") && (React.createElement(Box, { flexDirection: "column" },
23
+ snapshot.context.error && (React.createElement(Box, null,
24
+ React.createElement(Text, { color: "red" }, snapshot.context.error))),
25
+ React.createElement(Box, null,
26
+ React.createElement(Box, { marginRight: 1 },
27
+ React.createElement(Text, null, "What would you like to call your new extension:")),
28
+ React.createElement(Box, null,
29
+ React.createElement(Text, { color: "yellow" },
30
+ React.createElement(TextInput, { value: snapshot.context.name, onChange: (name) => send({ type: "Update Name", name }), onSubmit: () => send({ type: "Submit" }) })))))),
31
+ snapshot.matches("Ask For Language") && (React.createElement(Box, { flexDirection: "column" },
32
+ React.createElement(Box, null,
33
+ React.createElement(Text, null, "What language would you like to use?")),
34
+ React.createElement(Box, null,
35
+ React.createElement(Select, { items: languages, onSelect: (language) => send({ type: "Choose Language", language }) })))),
36
+ snapshot.matches("Detecting Package Managers") && (React.createElement(Box, null,
37
+ React.createElement(Text, null, "Detecting package managers..."),
38
+ React.createElement(Text, { color: "green" },
39
+ React.createElement(Spinner, { type: "dots" })))),
40
+ snapshot.matches("Ask For Package Manager") && (React.createElement(Box, { flexDirection: "column" },
41
+ React.createElement(Box, null,
42
+ React.createElement(Text, null, "What package manager would you like to use?")),
43
+ React.createElement(Box, null,
44
+ React.createElement(Select, { items: packageManagers.filter(({ value }) => snapshot.context.availablePackageManagers.includes(value)), onSelect: (packageManager) => send({ type: "Choose Package Manager", packageManager }) })))),
45
+ snapshot.matches("Ask For Outlets") && (React.createElement(Box, { flexDirection: "column" },
46
+ React.createElement(Box, null,
47
+ React.createElement(Box, { marginRight: 2 },
48
+ React.createElement(Text, null, "Which Attio Outlets would you like to use?")),
49
+ React.createElement(Link, { url: "https://attio.dev/docs/outlets" },
50
+ figures.info,
51
+ " Learn More")),
52
+ React.createElement(Box, null,
53
+ React.createElement(MultiSelect, { items: outlets, onSubmit: (outlets) => send({ type: "Choose Outlets", outlets }), requiredMin: 1 })))),
54
+ snapshot.matches("Creating Project") && (React.createElement(Box, { flexDirection: "column" },
55
+ React.createElement(Box, null,
56
+ React.createElement(Text, null,
57
+ "Creating \"",
58
+ snapshot.context.name,
59
+ "\"... "),
60
+ React.createElement(Text, { color: "green" },
61
+ React.createElement(Spinner, { type: "dots" }))))),
62
+ snapshot.matches("Building") && (React.createElement(Box, { flexDirection: "column" },
63
+ React.createElement(Box, null,
64
+ React.createElement(Text, null,
65
+ "Building \"",
66
+ snapshot.context.name,
67
+ "\" with",
68
+ " ",
69
+ snapshot.context.packageManager,
70
+ "...",
71
+ " "),
72
+ React.createElement(Text, { color: "green" },
73
+ React.createElement(Spinner, { type: "dots" }))))),
74
+ snapshot.matches("Success") && (React.createElement(Box, { flexDirection: "column" },
75
+ React.createElement(Box, null,
76
+ React.createElement(Text, { color: "green" },
77
+ "SUCCESS!! \uD83C\uDF89 Your extension \"",
78
+ snapshot.context.name,
79
+ "\" has been created.")),
80
+ React.createElement(Box, { marginY: 1 },
81
+ React.createElement(Text, null, "To get started, run:")),
82
+ React.createElement(Box, { flexDirection: "column", borderStyle: "round", width: Math.max(20, snapshot.context.name.length + 8), paddingX: 1, marginBottom: 1 },
83
+ React.createElement(Box, null,
84
+ React.createElement(Text, null,
85
+ "cd ",
86
+ snapshot.context.name)),
87
+ React.createElement(Box, null,
88
+ React.createElement(Text, null,
89
+ snapshot.context.packageManager,
90
+ " run dev"))))),
91
+ snapshot.matches("Error") && (React.createElement(Box, { flexDirection: "column" },
92
+ React.createElement(Box, null,
93
+ React.createElement(Text, { color: "red" }, snapshot.context.error))))));
94
+ }
95
+ //# sourceMappingURL=scaffold.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/commands/scaffold.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAA;AACxC,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,QAAQ,MAAM,cAAc,CAAA;AACnC,OAAO,IAAI,MAAM,UAAU,CAAA;AAC3B,OAAO,OAAO,MAAM,aAAa,CAAA;AACjC,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAA;AAErB,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAA;AAC9C,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAC,MAAM,iCAAiC,CAAA;AAEpG,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAA;AAC7B,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAQrD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAQ;IACrD,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,eAAe,EAAE,EAAC,KAAK,EAAE,EAAC,IAAI,EAAE,OA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AQ,CACrC;gBACN,oBAAC,GAAG;oBACA,oBAAC,IAAI;wBAAE,QAAQ,CAAC,OAAO,CAAC,cAAc;mCAAgB,CACpD,CACJ,CACJ,CACT;QACA,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAC1B,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ;YACvB,oBAAC,GAAG;gBACA,oBAAC,IAAI,IAAC,KAAK,EAAC,KAAK,IAAE,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAQ,CAC/C,CACJ,CACT,CACC,CACT,CAAA;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ export default function Watch(): React.JSX.Element;
3
+ //# sourceMappingURL=watch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/commands/watch.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,MAAM,CAAC,OAAO,UAAU,KAAK,sBAiE5B"}
@@ -0,0 +1,56 @@
1
+ import { useMachine } from "@xstate/react";
2
+ import { formatDistanceStrict } from "date-fns";
3
+ import { Box, Text } from "ink";
4
+ import Spinner from "ink-spinner";
5
+ import React from "react";
6
+ import { BuildError } from "../components/BuildError.js";
7
+ import { TypeScriptErrors } from "../components/TypeScriptError.js";
8
+ import { useFullScreen } from "../hooks/useFullScreen.js";
9
+ import { watchMachine } from "../machines/watch-machine.js";
10
+ export default function Watch() {
11
+ const [snapshot] = useMachine(watchMachine);
12
+ const [now, setNow] = React.useState(new Date());
13
+ React.useEffect(() => {
14
+ const interval = setInterval(() => {
15
+ setNow(new Date());
16
+ }, 1000);
17
+ return () => clearInterval(interval);
18
+ }, []);
19
+ const fullScreen = useFullScreen();
20
+ return (React.createElement(Box, { flexDirection: "column", ...fullScreen },
21
+ snapshot.context.lastSuccess && (React.createElement(Box, null,
22
+ React.createElement(Text, null,
23
+ "\u2705 Last successful build was",
24
+ " ",
25
+ formatDistanceStrict(snapshot.context.lastSuccess, now, {
26
+ addSuffix: true,
27
+ }),
28
+ "."))),
29
+ snapshot.context.lastJavaScriptError && (React.createElement(Box, { flexDirection: "column" },
30
+ React.createElement(Box, null,
31
+ React.createElement(Text, null,
32
+ "\u274C Last failed build was",
33
+ " ",
34
+ formatDistanceStrict(snapshot.context.lastJavaScriptError.time, now, {
35
+ addSuffix: true,
36
+ }),
37
+ ".")),
38
+ React.createElement(Box, null,
39
+ React.createElement(BuildError, { error: snapshot.context.lastJavaScriptError.error })))),
40
+ snapshot.context.lastTypeScriptError && (React.createElement(Box, { flexDirection: "column" },
41
+ React.createElement(Box, null,
42
+ React.createElement(Text, null,
43
+ "\u274C Last failed build was",
44
+ " ",
45
+ formatDistanceStrict(snapshot.context.lastTypeScriptError.time, now, {
46
+ addSuffix: true,
47
+ }),
48
+ ".")),
49
+ React.createElement(Box, null,
50
+ React.createElement(TypeScriptErrors, { errors: snapshot.context.lastTypeScriptError.errors })))),
51
+ React.createElement(Box, null,
52
+ React.createElement(Text, null, "\uD83D\uDC40 Watching for changes... "),
53
+ React.createElement(Text, { color: "green" },
54
+ React.createElement(Spinner, { type: "dots" })))));
55
+ }
56
+ //# sourceMappingURL=watch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/commands/watch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAA;AACxC,OAAO,EAAC,oBAAoB,EAAC,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,OAAO,MAAM,aAAa,CAAA;AACjC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAA;AACjE,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAA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mB,CAAC,KAAK,GAAI,CAC/D,CACJ,CACT;QACA,QAAQ,CAAC,OAAO,CAAC,mBAAmB,IAAI,CACrC,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ;YACvB,oBAAC,GAAG;gBACA,oBAAC,IAAI;;oBACuB,GAAG;oBAC1B,oBAAoB,CAAC,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,GAAG,EAAE;wBAClE,SAAS,EAAE,IAAI;qBAClB,CAAC;wBAEC,CACL;YACN,oBAAC,GAAG;gBACA,oBAAC,gBAAgB,IAAC,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,MAAM,GAAI,CACvE,CACJ,CACT;QACD,oBAAC,GAAG;YACA,oBAAC,IAAI,gDAAmC;YACxC,oBAAC,IAAI,IAAC,KAAK,EAAC,OAAO;gBACf,oBAAC,OAAO,IAAC,IAAI,EAAC,MAAM,GAAG,CACpB,CACL,CACJ,CACT,CAAA;AACL,CAAC"}
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { BuildError } from "../build.js";
3
+ export declare function Error({ message, level, }: {
4
+ message: BuildError["errors"][number];
5
+ level: "error" | "warning";
6
+ }): React.JSX.Element;
7
+ interface BuildErrorProps {
8
+ error: BuildError;
9
+ }
10
+ export declare function BuildError({ error: { errors, warnings } }: BuildErrorProps): React.JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=BuildError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildError.d.ts","sourceRoot":"","sources":["../../src/components/BuildError.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAA;AAEtC,wBAAgB,KAAK,CAAC,EAClB,OAAO,EACP,KAAK,GACR,EAAE;IACC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;IACrC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAA;CAC7B,qBA2CA;AAED,UAAU,eAAe;IACrB,KAAK,EAAE,UAAU,CAAA;CACpB;AACD,wBAAgB,UAAU,CAAC,EAAC,KAAK,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAC,EAAC,EAAE,eAAe,qBA6BtE"}
@@ -0,0 +1,56 @@
1
+ import { Box, Text } from "ink";
2
+ import React from "react";
3
+ export function Error({ message, level, }) {
4
+ return (React.createElement(Box, { flexDirection: "column" },
5
+ React.createElement(Box, null,
6
+ React.createElement(Text, { color: level === "error" ? "red" : "yellow" },
7
+ level === "error" ? "❌" : "⚠️",
8
+ " ",
9
+ React.createElement(Text, { backgroundColor: level === "error" ? "red" : "yellow", color: "white" },
10
+ " ",
11
+ level === "error" ? "ERROR" : "WARNING",
12
+ " ")),
13
+ React.createElement(Text, { bold: true }, message.text)),
14
+ React.createElement(Box, { paddingTop: 1, flexDirection: "column" },
15
+ React.createElement(Box, { marginLeft: 4 },
16
+ React.createElement(Text, null,
17
+ message.location.file,
18
+ ":",
19
+ message.location.line,
20
+ ":",
21
+ message.location.column)),
22
+ React.createElement(Box, { marginLeft: 4, marginTop: 1 },
23
+ React.createElement(Box, { flexDirection: "column", marginRight: 1 },
24
+ React.createElement(Text, null, message.location.line)),
25
+ React.createElement(Box, { flexDirection: "column" },
26
+ React.createElement(Text, null,
27
+ "| ",
28
+ message.location.lineText.trim()),
29
+ React.createElement(Box, null,
30
+ React.createElement(Text, null, "|"),
31
+ React.createElement(Box, { paddingLeft: message.location.column +
32
+ message.location.lineText.trim().length -
33
+ message.location.lineText.length +
34
+ 1 },
35
+ React.createElement(Text, { color: "greenBright" }, "^"))))))));
36
+ }
37
+ export function BuildError({ error: { errors, warnings } }) {
38
+ return (React.createElement(Box, { flexDirection: "column" },
39
+ errors.length > 0 && (React.createElement(Box, { flexDirection: "column" },
40
+ React.createElement(Text, { color: "red" },
41
+ errors.length,
42
+ " ERROR",
43
+ errors.length === 1 ? "" : "S",
44
+ ":"),
45
+ errors.map((error, index) => (React.createElement(Box, { key: index, marginY: 1 },
46
+ React.createElement(Error, { message: error, level: "error" })))))),
47
+ warnings.length > 0 && (React.createElement(Box, { flexDirection: "column" },
48
+ React.createElement(Text, { color: "red" },
49
+ warnings.length,
50
+ " WARNING",
51
+ warnings.length === 1 ? "" : "S",
52
+ ":"),
53
+ warnings.map((warning, index) => (React.createElement(Box, { key: index, marginY: 1 },
54
+ React.createElement(Error, { message: warning, level: "warning" }))))))));
55
+ }
56
+ //# sourceMappingURL=BuildError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildError.js","sourceRoot":"","sources":["../../src/components/BuildError.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,UAAU,KAAK,CAAC,EAClB,OAAO,EACP,KAAK,GAIR;IACG,OAAO,CACH,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ;QACvB,oBAAC,GAAG;YACA,oBAAC,IAAI,IAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;gBAC5C,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;gBAAE,GAAG;gBACpC,oBAAC,IAAI,IAAC,eAAe,EAAE,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAC,OAAO;oBACrE,GAAG;oBACH,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;oBAAE,GAAG,CAC1C,CACJ;YACP,oBAAC,IAAI,IAAC,IAAI,UAAE,OAAO,CAAC,IAAI,CAAQ,CAC9B;QACN,oBAAC,GAAG,IAAC,UAAU,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ;YACtC,oB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AAE,CAAC,CAAC,CAAC,GAAG;oBACjD;YACN,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,oBAAC,GAAG,IAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;gBACvB,oBAAC,KAAK,IAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAC,OAAO,GAAG,CACrC,CACT,CAAC,CACA,CACT;QACA,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CACpB,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ;YACvB,oBAAC,IAAI,IAAC,KAAK,EAAC,KAAK;gBACZ,QAAQ,CAAC,MAAM;;gBAAU,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG;oBACvD;YACN,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9B,oBAAC,GAAG,IAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;gBACvB,oBAAC,KAAK,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,SAAS,GAAG,CACzC,CACT,CAAC,CACA,CACT,CACC,CACT,CAAA;AACL,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface BuildLogProps {
3
+ log: Array<string>;
4
+ }
5
+ export declare function BuildLog({ log }: BuildLogProps): React.JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=BuildLog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildLog.d.ts","sourceRoot":"","sources":["../../src/components/BuildLog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,UAAU,aAAa;IACnB,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CACrB;AACD,wBAAgB,QAAQ,CAAC,EAAC,GAAG,EAAC,EAAE,aAAa,qBAU5C"}
@@ -0,0 +1,7 @@
1
+ import { Box, Text } from "ink";
2
+ import React from "react";
3
+ export function BuildLog({ log }) {
4
+ return (React.createElement(Box, { flexDirection: "column" }, log.map((msg, index) => (React.createElement(Box, { key: index },
5
+ React.createElement(Text, null, msg))))));
6
+ }
7
+ //# sourceMappingURL=BuildLog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BuildLog.js","sourceRoot":"","sources":["../../src/components/BuildLog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,UAAU,QAAQ,CAAC,EAAC,GAAG,EAAgB;IACzC,OAAO,CACH,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,IACtB,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CACrB,oBAAC,GAAG,IAAC,GAAG,EAAE,KAAK;QACX,oBAAC,IAAI,QAAE,GAAG,CAAQ,CAChB,CACT,CAAC,CACA,CACT,CAAA;AACL,CAAC"}
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ interface Item<Value extends string> {
3
+ value: Value;
4
+ label: string;
5
+ }
6
+ interface MultiSelectProps<Value extends string> {
7
+ items: ReadonlyArray<Item<Value>>;
8
+ onSubmit: (values: Array<Value>) => void;
9
+ requiredMin?: number;
10
+ }
11
+ export declare function MultiSelect<Value extends string>({ items, requiredMin, onSubmit, }: MultiSelectProps<Value>): React.JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=MultiSelect.d.ts.map