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.
- package/lib/api/api.js +99 -31
- package/lib/api/fetcher.js +31 -27
- package/lib/api/schemas.js +6 -0
- package/lib/auth/auth.js +135 -97
- package/lib/auth/keychain.js +86 -43
- package/lib/build/server/generate-server-entry.js +6 -6
- package/lib/build.js +2 -2
- package/lib/commands/build/build-javascript.js +1 -1
- package/lib/commands/build/validate-typescript.js +1 -1
- package/lib/commands/build.js +2 -2
- package/lib/commands/dev/boot.js +9 -9
- package/lib/commands/dev/bundle-javascript.js +1 -1
- package/lib/commands/dev/onboarding.js +3 -3
- package/lib/commands/dev/prepare-build-contexts.js +1 -1
- package/lib/commands/dev/upload.js +4 -21
- package/lib/commands/dev.js +5 -4
- package/lib/commands/init/create-project.js +7 -39
- package/lib/commands/init.js +6 -14
- package/lib/commands/login.js +8 -2
- package/lib/commands/logout.js +8 -2
- package/lib/commands/version/create/bundle-javascript.js +3 -3
- package/lib/commands/version/create.js +14 -14
- package/lib/commands/version/list.js +4 -4
- package/lib/commands/whoami.js +7 -8
- package/lib/errors.js +1 -0
- package/lib/print-errors.js +165 -0
- package/lib/spinners/determine-workspace.spinner.js +3 -26
- package/lib/spinners/get-app-info.spinner.js +2 -2
- package/lib/spinners/get-app-slug-from-package-json.js +1 -20
- package/lib/spinners/get-versions.spinner.js +2 -2
- package/lib/util/copy-with-replace.js +2 -2
- package/lib/util/create-directory.js +1 -1
- package/lib/util/load-attio-cli-version.js +1 -26
- package/lib/util/upload-bundle.js +1 -1
- package/package.json +1 -1
- package/lib/auth/ensure-authed.js +0 -14
- package/lib/commands/dev/start-graphql-server.js +0 -32
- package/lib/commands/init/ask-language.js +0 -11
- package/lib/templates/javascript/.env +0 -12
- package/lib/templates/javascript/eslint.config.js +0 -48
- package/lib/templates/javascript/package.json +0 -26
- package/lib/templates/javascript/src/assets/icon.png +0 -0
- package/lib/templates/javascript/src/cat-fact.jsx +0 -16
- package/lib/templates/javascript/src/get-cat-fact.server.js +0 -6
- package/lib/templates/javascript/src/hello-world-action.jsx +0 -17
- package/lib/templates/javascript/src/hello-world-dialog.jsx +0 -26
- package/lib/templates/typescript/.eslintignore +0 -3
- package/lib/templates/typescript/src/assets/icon.png +0 -0
- /package/lib/{templates/typescript → template}/.env +0 -0
- /package/lib/{templates/javascript → template}/.eslintignore +0 -0
- /package/lib/{templates/common → template}/README.md +0 -0
- /package/lib/{templates/typescript → template}/eslint.config.js +0 -0
- /package/lib/{templates/typescript → template}/package.json +0 -0
- /package/lib/{templates/common → template}/src/assets/icon.png +0 -0
- /package/lib/{templates/typescript → template}/src/cat-fact.tsx +0 -0
- /package/lib/{templates/typescript → template}/src/get-cat-fact.server.ts +0 -0
- /package/lib/{templates/typescript → template}/src/hello-world-action.tsx +0 -0
- /package/lib/{templates/typescript → template}/src/hello-world-dialog.tsx +0 -0
- /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
|
-
}
|
|
Binary file
|
|
@@ -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
|
-
}
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|