attio 0.0.1-experimental.20250212 → 0.0.1-experimental.20250213

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.
@@ -47,11 +47,7 @@ export const createVersionMachine = setup({
47
47
  token,
48
48
  devSlug,
49
49
  appId: config.id,
50
- major: upgradeType === "initial"
51
- ? 1
52
- : upgradeType === "major"
53
- ? config.major + 1
54
- : config.major,
50
+ major: upgradeType === "initial" ? 1 : config.major,
55
51
  cliVersion: packageJson.version,
56
52
  });
57
53
  spinner.success("Version created");
@@ -274,55 +270,6 @@ export const createVersionMachine = setup({
274
270
  },
275
271
  },
276
272
  },
277
- "Choose Version Type": {
278
- invoke: {
279
- src: "askForUpgradeType",
280
- input: ({ context }) => ({
281
- choices: [
282
- {
283
- value: "minor",
284
- name: `Minor (v${context.config.major}.${context.config.minor + 1}) – with bug fixes and/or new features`,
285
- },
286
- {
287
- value: "major",
288
- name: `Major (v${context.config.major + 1}.0) – 🚨 WITH BREAKING CHANGES 🚨`,
289
- },
290
- ],
291
- message: "Is this a major version or a minor version?",
292
- required: true,
293
- }),
294
- onDone: [
295
- {
296
- target: "Confirm Major Version",
297
- actions: { type: "setUpgradeType", params: ({ event }) => event },
298
- reenter: true,
299
- guard: { type: "is major", params: ({ event }) => event },
300
- },
301
- {
302
- target: "Creating version",
303
- reenter: true,
304
- },
305
- ],
306
- },
307
- },
308
- "Confirm Major Version": {
309
- invoke: {
310
- src: "confirm",
311
- input: {
312
- message: `Are you sure you want to create a major version with breaking changes?`,
313
- },
314
- onDone: [
315
- {
316
- target: "Creating version",
317
- guard: { type: "confirmed", params: ({ event }) => event },
318
- },
319
- {
320
- target: "Choose Version Type",
321
- reenter: true,
322
- },
323
- ],
324
- },
325
- },
326
273
  "Determine if first version": {
327
274
  always: [
328
275
  {
@@ -335,7 +282,15 @@ export const createVersionMachine = setup({
335
282
  },
336
283
  description: `We're publishing v1.0`,
337
284
  },
338
- "Choose Version Type",
285
+ {
286
+ target: "Creating version",
287
+ actions: {
288
+ type: "setUpgradeType",
289
+ params: { output: "minor" },
290
+ },
291
+ reenter: true,
292
+ description: `It's a minor version`,
293
+ },
339
294
  ],
340
295
  },
341
296
  "Fetching Versions": {
@@ -34,6 +34,7 @@ module.exports = [
34
34
  "react-hooks/exhaustive-deps": "error",
35
35
  "attio/attio-client-import": "error",
36
36
  "attio/server-default-export": "error",
37
+ "attio/form-submit-button": "error",
37
38
  },
38
39
  settings: {
39
40
  react: {
@@ -42,6 +42,7 @@ module.exports = [
42
42
  "@typescript-eslint/ban-ts-comment": "off",
43
43
  "attio/attio-client-import": "error",
44
44
  "attio/server-default-export": "error",
45
+ "attio/form-submit-button": "error",
45
46
  },
46
47
  settings: {
47
48
  react: {
package/lint.cjs CHANGED
@@ -75,5 +75,57 @@ module.exports = {
75
75
  }
76
76
  },
77
77
  },
78
+ "form-submit-button": {
79
+ meta: {
80
+ type: "problem",
81
+ docs: {
82
+ description: "Ensure <Form/> components have exactly one <SubmitButton/> as a direct child, and <SubmitButton/> components only appear as direct children of <Form/> components",
83
+ category: "Possible Errors",
84
+ recommended: true,
85
+ },
86
+ fixable: null,
87
+ },
88
+ create(context) {
89
+ return {
90
+ JSXElement(node) {
91
+ // Check if this is a Form component
92
+ if (node.openingElement.name.name === "Form") {
93
+ let submitButtonCount = 0
94
+
95
+ // Check direct children only
96
+ node.children.forEach(child => {
97
+ if (child.type === "JSXElement") {
98
+ if (child.openingElement.name.name === "SubmitButton") {
99
+ submitButtonCount++
100
+ }
101
+ }
102
+ })
103
+
104
+ if (submitButtonCount === 0) {
105
+ context.report({
106
+ node,
107
+ message: "<Form/> component must have exactly one <SubmitButton/> as a direct child",
108
+ })
109
+ } else if (submitButtonCount > 1) {
110
+ context.report({
111
+ node,
112
+ message: "<Form/> component must not have multiple <SubmitButton/> children",
113
+ })
114
+ }
115
+ }
116
+ // Check if this is a SubmitButton that's not a direct child of Form
117
+ else if (node.openingElement.name.name === "SubmitButton") {
118
+ const parent = node.parent
119
+ if (!parent || parent.type !== "JSXElement" || parent.openingElement.name.name !== "Form") {
120
+ context.report({
121
+ node,
122
+ message: "<SubmitButton/> must be a direct child of a <Form/> component",
123
+ })
124
+ }
125
+ }
126
+ },
127
+ }
128
+ },
129
+ },
78
130
  },
79
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attio",
3
- "version": "0.0.1-experimental.20250212",
3
+ "version": "0.0.1-experimental.20250213",
4
4
  "bin": "lib/attio.js",
5
5
  "type": "module",
6
6
  "files": [