attio 0.0.1-experimental.20250408 → 0.0.1-experimental.20250414

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 (59) hide show
  1. package/lib/api/api.js +99 -31
  2. package/lib/api/fetcher.js +31 -27
  3. package/lib/api/schemas.js +6 -0
  4. package/lib/auth/auth.js +135 -97
  5. package/lib/auth/keychain.js +86 -43
  6. package/lib/build/server/generate-server-entry.js +6 -6
  7. package/lib/build.js +2 -2
  8. package/lib/commands/build/build-javascript.js +1 -1
  9. package/lib/commands/build/validate-typescript.js +1 -1
  10. package/lib/commands/build.js +2 -2
  11. package/lib/commands/dev/boot.js +9 -9
  12. package/lib/commands/dev/bundle-javascript.js +1 -1
  13. package/lib/commands/dev/onboarding.js +3 -3
  14. package/lib/commands/dev/prepare-build-contexts.js +1 -1
  15. package/lib/commands/dev/upload.js +4 -21
  16. package/lib/commands/dev.js +5 -4
  17. package/lib/commands/init/create-project.js +7 -39
  18. package/lib/commands/init.js +6 -14
  19. package/lib/commands/login.js +8 -2
  20. package/lib/commands/logout.js +8 -2
  21. package/lib/commands/version/create/bundle-javascript.js +3 -3
  22. package/lib/commands/version/create.js +14 -14
  23. package/lib/commands/version/list.js +4 -4
  24. package/lib/commands/whoami.js +7 -8
  25. package/lib/errors.js +1 -0
  26. package/lib/print-errors.js +165 -0
  27. package/lib/spinners/determine-workspace.spinner.js +3 -26
  28. package/lib/spinners/get-app-info.spinner.js +2 -2
  29. package/lib/spinners/get-app-slug-from-package-json.js +1 -20
  30. package/lib/spinners/get-versions.spinner.js +2 -2
  31. package/lib/util/copy-with-replace.js +2 -2
  32. package/lib/util/create-directory.js +1 -1
  33. package/lib/util/load-attio-cli-version.js +1 -26
  34. package/lib/util/upload-bundle.js +1 -1
  35. package/package.json +1 -1
  36. package/lib/auth/ensure-authed.js +0 -14
  37. package/lib/commands/dev/start-graphql-server.js +0 -32
  38. package/lib/commands/init/ask-language.js +0 -11
  39. package/lib/templates/javascript/.env +0 -12
  40. package/lib/templates/javascript/eslint.config.js +0 -48
  41. package/lib/templates/javascript/package.json +0 -26
  42. package/lib/templates/javascript/src/assets/icon.png +0 -0
  43. package/lib/templates/javascript/src/cat-fact.jsx +0 -16
  44. package/lib/templates/javascript/src/get-cat-fact.server.js +0 -6
  45. package/lib/templates/javascript/src/hello-world-action.jsx +0 -17
  46. package/lib/templates/javascript/src/hello-world-dialog.jsx +0 -26
  47. package/lib/templates/typescript/.eslintignore +0 -3
  48. package/lib/templates/typescript/src/assets/icon.png +0 -0
  49. /package/lib/{templates/typescript → template}/.env +0 -0
  50. /package/lib/{templates/javascript → template}/.eslintignore +0 -0
  51. /package/lib/{templates/common → template}/README.md +0 -0
  52. /package/lib/{templates/typescript → template}/eslint.config.js +0 -0
  53. /package/lib/{templates/typescript → template}/package.json +0 -0
  54. /package/lib/{templates/common → template}/src/assets/icon.png +0 -0
  55. /package/lib/{templates/typescript → template}/src/cat-fact.tsx +0 -0
  56. /package/lib/{templates/typescript → template}/src/get-cat-fact.server.ts +0 -0
  57. /package/lib/{templates/typescript → template}/src/hello-world-action.tsx +0 -0
  58. /package/lib/{templates/typescript → template}/src/hello-world-dialog.tsx +0 -0
  59. /package/lib/{templates/typescript → template}/tsconfig.json +0 -0
@@ -1,26 +0,0 @@
1
- {
2
- "name": "slug-to-be-replaced",
3
- "description": "title-to-be-replaced",
4
- "private": true,
5
- "version": "0.0.1",
6
- "scripts": {
7
- "attio": "attio",
8
- "dev": "attio dev",
9
- "build": "attio build",
10
- "format": "yarn run -T prettier --ignore-path $(yarn run -T find-up .prettierignore) --check ./",
11
- "format-fix": "yarn run format --write ./",
12
- "clean": "rm -rf dist",
13
- "lint": "ATTIO_LINT_MODE='exhaustive' eslint 'src/**/*.{js,jsx}'"
14
- },
15
- "devDependencies": {
16
- "eslint": "^8.57.1",
17
- "eslint-plugin-react": "^7.37.4",
18
- "eslint-plugin-react-hooks": "^5.1.0"
19
- },
20
- "dependencies": {
21
- "@eslint/eslintrc": "^3.2.0",
22
- "@eslint/js": "^9.19.0",
23
- "attio": "latest",
24
- "react": "19.0.0"
25
- }
26
- }
@@ -1,16 +0,0 @@
1
- import React from "react"
2
- import {TextBlock, useAsyncCache} from "attio/client"
3
- import getCatFact from "./get-cat-fact.server"
4
-
5
- export function CatFact({recordId}) {
6
- // By passing in the recordId, the result will be cached for each recordId
7
- const {
8
- values: {catFact},
9
- // ^^^^^^^– this key matches
10
- // vvvvvvv– this key
11
- } = useAsyncCache({catFact: [getCatFact, recordId]})
12
- // ^^^^^^^^^^ ^^^^^^^^
13
- // async fn parameter(s)
14
-
15
- return <TextBlock align="center">{`"${catFact}"`}</TextBlock>
16
- }
@@ -1,6 +0,0 @@
1
- export default async function getCatFact(recordId) {
2
- // We don't really need the recordId for this API, but this is how we could use a parameter
3
- const response = await fetch(`https://catfact.ninja/fact?${recordId}`)
4
- const data = await response.json()
5
- return data.fact
6
- }
@@ -1,17 +0,0 @@
1
- import React from "react"
2
- import { showDialog } from "attio/client"
3
- import { HelloWorldDialog } from "./hello-world-dialog"
4
-
5
- export const recordAction = {
6
- id: "slug-to-be-replaced",
7
- label: "title-to-be-replaced",
8
- onTrigger: async ({recordId}) => {
9
- showDialog({
10
- title: "title-to-be-replaced",
11
- Dialog: () => {
12
- // This is a React component. It can use hooks and render other components.
13
- return <HelloWorldDialog recordId={recordId} />
14
- }
15
- })
16
- },
17
- }
@@ -1,26 +0,0 @@
1
- import React from "react"
2
- import {TextBlock} from "attio/client"
3
- import {CatFact} from "./cat-fact"
4
-
5
- const Loading = () => <TextBlock>Loading cat fact...</TextBlock>
6
-
7
- export function HelloWorldDialog({recordId}) {
8
- // A simple counter to demonstrate that this is just regular React code.
9
- const [seconds, setSeconds] = React.useState(0)
10
- React.useEffect(() => {
11
- const timeout = setTimeout(() => setSeconds(seconds + 1), 1000)
12
- return () => clearTimeout(timeout)
13
- }, [seconds])
14
-
15
- return (
16
- <>
17
- <TextBlock align="left">
18
- I am a dialog. I have been open for: {seconds} second{seconds === 1 ? "" : "s"}
19
- </TextBlock>
20
- {/* The hook in CatFact will suspend until the cat fact is loaded. */}
21
- <React.Suspense fallback={<Loading />}>
22
- <CatFact recordId={recordId} />
23
- </React.Suspense>
24
- </>
25
- )
26
- }
@@ -1,3 +0,0 @@
1
- package.json
2
- dist/**
3
- node_modules/**
File without changes
File without changes