Skip to content

Commit 0ba7885

Browse files
radenkovicAaronDDM
andauthored
Introduce @nylas/react package (#22)
Co-authored-by: Aaron de Mello <[email protected]>
1 parent f01da14 commit 0ba7885

35 files changed

+9463
-167
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
"@nylas/react": major
3+
"@nylas/connect": patch
4+
---
5+
6+
Add `@nylas/react` to the monorepo with initial components, hooks, and build setup.
7+
8+
- Introduces React utilities for integrating with the Nylas platform
9+
- Includes basic docs and distribution configuration
10+
11+
Cosmetic updates to `@nylas/connect`.
12+
13+
- Style and documentation polish; no functional changes
14+
15+

nx.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
},
2626
"typecheck": {
2727
"cache": true,
28-
"inputs": ["default", "^default"]
28+
"inputs": ["default", "^default"],
29+
"dependsOn": ["^build"]
2930
},
3031
"clean": {
3132
"cache": false

packages/nylas-connect/.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

packages/nylas-connect/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"scripts": {
2020
"dev": "vite",
2121
"build": "tsc && vite build",
22-
"build:watch": "vite build --watch",
2322
"preview": "vite preview",
2423
"typecheck": "tsc --noEmit",
2524
"format": "pnpm --workspace-root prettier --write packages/nylas-connect/",
@@ -41,6 +40,10 @@
4140
"popup",
4241
"inline"
4342
],
43+
"repository": {
44+
"type": "git",
45+
"url": "git+https://github.com/nylas/nylas.git"
46+
},
4447
"author": "Nylas Inc.",
4548
"license": "MIT",
4649
"publishConfig": {
@@ -50,7 +53,7 @@
5053
"devDependencies": {
5154
"@types/node": "^20.11.13",
5255
"@vitest/coverage-v8": "^2.1.9",
53-
"happy-dom": "^15.10.2",
56+
"jsdom": "^26.0.0",
5457
"typescript": "^5.3.3",
5558
"vite": "^5.4.21",
5659
"vite-plugin-dts": "^3.7.0",

packages/nylas-connect/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"resolveJsonModule": true,
1010
"isolatedModules": true,
1111
"noEmit": true,
12+
"types": ["vitest/globals"],
1213

1314
// Relaxed strictness
1415
"noImplicitAny": false,

packages/nylas-connect/vite.config.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ export default defineConfig({
1010
formats: ["es"],
1111
fileName: "index",
1212
},
13-
rollupOptions: {
14-
external: ["react", "react-dom"],
15-
output: {
16-
globals: {
17-
react: "React",
18-
"react-dom": "ReactDOM",
19-
},
20-
},
21-
},
2213
sourcemap: true,
2314
minify: "esbuild",
2415
target: "es2022",

packages/nylas-connect/vitest.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import { defineConfig } from "vitest/config";
22

33
export default defineConfig({
44
test: {
5-
environment: "happy-dom",
5+
globals: true,
6+
environment: "jsdom",
67
include: ["src/**/*.test.ts"],
78
setupFiles: ["./vitest.setup.ts"],
89
coverage: {
Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +0,0 @@
1-
// Minimal polyfills for tests
2-
import { webcrypto as nodeWebcrypto } from "node:crypto";
3-
4-
if (!globalThis.crypto) {
5-
Object.defineProperty(globalThis, "crypto", { value: nodeWebcrypto });
6-
}
7-
8-
// Polyfill btoa/atob if missing (Node)
9-
if (typeof globalThis.btoa !== "function") {
10-
globalThis.btoa = (data: string) =>
11-
Buffer.from(data, "binary").toString("base64");
12-
}
13-
if (typeof globalThis.atob !== "function") {
14-
globalThis.atob = (data: string) =>
15-
Buffer.from(data, "base64").toString("binary");
16-
}

packages/react/.gitignore

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/node
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=node
3+
4+
### Node ###
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
.pnpm-debug.log*
13+
14+
# Diagnostic reports (https://nodejs.org/api/report.html)
15+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
16+
17+
# Runtime data
18+
pids
19+
*.pid
20+
*.seed
21+
*.pid.lock
22+
23+
# Directory for instrumented libs generated by jscoverage/JSCover
24+
lib-cov
25+
26+
# Coverage directory used by tools like istanbul
27+
coverage
28+
*.lcov
29+
30+
# nyc test coverage
31+
.nyc_output
32+
33+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
34+
.grunt
35+
36+
# Bower dependency directory (https://bower.io/)
37+
bower_components
38+
39+
# node-waf configuration
40+
.lock-wscript
41+
42+
# Compiled binary addons (https://nodejs.org/api/addons.html)
43+
build/Release
44+
45+
# Dependency directories
46+
node_modules/
47+
jspm_packages/
48+
49+
# Snowpack dependency directory (https://snowpack.dev/)
50+
web_modules/
51+
52+
# TypeScript cache
53+
*.tsbuildinfo
54+
55+
# Optional npm cache directory
56+
.npm
57+
58+
# Optional eslint cache
59+
.eslintcache
60+
61+
# Optional stylelint cache
62+
.stylelintcache
63+
64+
# Microbundle cache
65+
.rpt2_cache/
66+
.rts2_cache_cjs/
67+
.rts2_cache_es/
68+
.rts2_cache_umd/
69+
70+
# Optional REPL history
71+
.node_repl_history
72+
73+
# Output of 'npm pack'
74+
*.tgz
75+
76+
# Yarn Integrity file
77+
.yarn-integrity
78+
79+
# dotenv environment variable files
80+
.env
81+
.env.development.local
82+
.env.test.local
83+
.env.production.local
84+
.env.local
85+
86+
# parcel-bundler cache (https://parceljs.org/)
87+
.cache
88+
.parcel-cache
89+
90+
# Next.js build output
91+
.next
92+
out
93+
94+
# Nuxt.js build / generate output
95+
.nuxt
96+
dist
97+
98+
# Gatsby files
99+
.cache/
100+
# Comment in the public line in if your project uses Gatsby and not Next.js
101+
# https://nextjs.org/blog/next-9-1#public-directory-support
102+
# public
103+
104+
# vuepress build output
105+
.vuepress/dist
106+
107+
# vuepress v2.x temp and cache directory
108+
.temp
109+
110+
# Docusaurus cache and generated files
111+
.docusaurus
112+
113+
# Serverless directories
114+
.serverless/
115+
116+
# FuseBox cache
117+
.fusebox/
118+
119+
# DynamoDB Local files
120+
.dynamodb/
121+
122+
# TernJS port file
123+
.tern-port
124+
125+
# Stores VSCode versions used for testing VSCode extensions
126+
.vscode-test
127+
128+
# yarn v2
129+
.yarn/cache
130+
.yarn/unplugged
131+
.yarn/build-state.yml
132+
.yarn/install-state.gz
133+
.pnp.*
134+
135+
### Node Patch ###
136+
# Serverless Webpack directories
137+
.webpack/
138+
139+
# Optional stylelint cache
140+
141+
# SvelteKit build / generate output
142+
.svelte-kit
143+
144+
# End of https://www.toptal.com/developers/gitignore/api/node

packages/react/.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)