diff --git a/README.md b/README.md index 9be2b18..9884807 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,19 @@ -# Getting Started with Create React App +# Internxt Send -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). +A secure, privacy-focused file sharing web app built with React, TypeScript, and Vite.\ +This document describes how to set up and run the development environment. -## Available Scripts +# Getting Started -In the project directory, you can run: +## Installation -### `npm start` +- Create a `.npmrc` file by copying the `.npmrc.template` provided in the repo. +- Fill the `.env` file using `.env.template`. +- Use `yarn` to install project dependencies. + +## Scripts + +### `yarn run dev` Runs the app in the development mode.\ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. @@ -14,27 +21,59 @@ Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.\ You will also see any lint errors in the console. -### `npm test` +### `yarn run start` + +Serves the built application locally to preview the production output. +Open [http://localhost:3000](http://localhost:3000) to view it in the browser. + +- Useful for testing the result of a production build. +- No hot reloading or development tools included. + +> The preview command serves the latest build output, so if you haven't run build beforehand, it will either fail or serve outdated files. -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. +### `yarn run lint` -### `npm run build` +- Runs eslint linter + +### `yarn test` + +- Runs unit tests with [Vitest](https://vitest.dev/) + +### `yarn build` Builds the app for production to the `dist` folder.\ It correctly bundles React in production mode and optimizes the build for the best performance. -The build is minified and obfuscated, and the filenames include the hashes.\ +The build is minified, obfuscated, and the filenames include the hashes.\ Your app is ready to be deployed! -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. -### `npm run eject` +## Configuring TailwindCSS Purge + +It is important to add in the tailwind.config.js file, within the purge property, the list of classes that we are overriding within a Tailwind layer (components, utilities or base) for third-party packages (such as react-bootstrap) + +For example, with this snippet we are telling to purge that we are overriding the react-bootstrap Dropdown and Tabs classes: -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** +```javascript + purge: { + content: ["./src/**/*.tsx"], + options: { + safelist: [ + 'dropdown-menu', 'dropdown-item', + 'nav-item', 'nav-link', 'tab-content', 'tab-pane' + ] + } + } +``` -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. +## Recommended VSCode Extensions -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. +To speed up the development and maintenance of the project, it is recommended to use the following extensions for the IDE: -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. +- Better Comments +- ESLint +- Stylelint +- PostCSS Language Support +- SCSS Formatter +- Tailwind CSS IntelliSense +- GitLens diff --git a/package.json b/package.json index f4fbe10..b9dc48f 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,6 @@ "build": "yarn clean && vite build", "test": "vitest run --coverage", "clean": "rimraf dist coverage .wrangler tsconfig.tsbuildinfo", - "add:npmrc": "cp .npmrc.template .npmrc", - "vercel:install": "yarn run add:npmrc && yarn install", "lint": "eslint .", "pretty": "prettier --write **/*.{js,jsx,tsx,ts}", "prepare": "husky", @@ -68,7 +66,7 @@ ] }, "devDependencies": { - "@cloudflare/vite-plugin": "1.13.18", + "@cloudflare/vite-plugin": "1.13.19", "@internxt/eslint-config-internxt": "2.0.1", "@internxt/prettier-config": "internxt/prettier-config#v1.0.2", "@rollup/plugin-replace": "6.0.3", @@ -97,7 +95,7 @@ "vite-plugin-node-polyfills": "0.24.0", "vite-plugin-svgr": "4.5.0", "vitest": "4.0.6", - "wrangler": "4.45.3" + "wrangler": "4.45.4" }, "lint-staged": { "*.{js,jsx,tsx,ts}": [ diff --git a/yarn.lock b/yarn.lock index e521d0b..3bb5567 100644 --- a/yarn.lock +++ b/yarn.lock @@ -204,24 +204,24 @@ dependencies: mime "^3.0.0" -"@cloudflare/unenv-preset@2.7.8": - version "2.7.8" - resolved "https://registry.yarnpkg.com/@cloudflare/unenv-preset/-/unenv-preset-2.7.8.tgz#8eaaca11cab436acdd2bed431f4c0a445f79d1cb" - integrity sha512-Ky929MfHh+qPhwCapYrRPwPVHtA2Ioex/DbGZyskGyNRDe9Ru3WThYZivyNVaPy5ergQSgMs9OKrM9Ajtz9F6w== +"@cloudflare/unenv-preset@2.7.9": + version "2.7.9" + resolved "https://registry.yarnpkg.com/@cloudflare/unenv-preset/-/unenv-preset-2.7.9.tgz#6f5c1c8a02720eae66a4f3828e991ce8f81541c2" + integrity sha512-Drm7qlTKnvncEv+DANiQNEonq0H0LyIsoFZYJ6tJ8OhAoy5udIE8yp6BsVDYcIjcYLIybp4M7c/P7ly/56SoHg== -"@cloudflare/vite-plugin@1.13.18": - version "1.13.18" - resolved "https://registry.yarnpkg.com/@cloudflare/vite-plugin/-/vite-plugin-1.13.18.tgz#5380fa27579fff8a88bfc35a85dccda8737de23f" - integrity sha512-1NO7oQWdO3hQMRAYIEd1yiGrd3hVvmLNeSHzTcpURMGh8LMbDGCPUsNWHdF6AoMGH3xC411o0FiwDh16nxWtqg== +"@cloudflare/vite-plugin@1.13.19": + version "1.13.19" + resolved "https://registry.yarnpkg.com/@cloudflare/vite-plugin/-/vite-plugin-1.13.19.tgz#f9c3e589d98d3136f0df9425ada028b232ebf3de" + integrity sha512-3ndsoSHL9Ttjj7CaYfYg5dY6vy1tl/1+dXdK4Ilr78sQbKA+Ni/KXHgqi8vw9L5LeB8ZbdeJ7vQTKfMN9Qh+AA== dependencies: - "@cloudflare/unenv-preset" "2.7.8" + "@cloudflare/unenv-preset" "2.7.9" "@remix-run/node-fetch-server" "^0.8.0" get-port "^7.1.0" - miniflare "4.20251011.1" + miniflare "4.20251011.2" picocolors "^1.1.1" tinyglobby "^0.2.12" - unenv "2.0.0-rc.21" - wrangler "4.45.3" + unenv "2.0.0-rc.24" + wrangler "4.45.4" ws "8.18.0" "@cloudflare/workerd-darwin-64@1.20251011.0": @@ -2582,11 +2582,6 @@ define-properties@^1.1.3, define-properties@^1.2.1: has-property-descriptors "^1.0.0" object-keys "^1.1.1" -defu@^6.1.4: - version "6.1.4" - resolved "https://registry.yarnpkg.com/defu/-/defu-6.1.4.tgz#4e0c9cf9ff68fe5f3d7f2765cc1a012dfdcb0479" - integrity sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg== - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -3000,11 +2995,6 @@ expect-type@^1.2.2: resolved "https://registry.yarnpkg.com/expect-type/-/expect-type-1.2.2.tgz#c030a329fb61184126c8447585bc75a7ec6fbff3" integrity sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA== -exsolve@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/exsolve/-/exsolve-1.0.7.tgz#3b74e4c7ca5c5f9a19c3626ca857309fa99f9e9e" - integrity sha512-VO5fQUzZtI6C+vx4w/4BWJpg3s/5l+6pRQEHzFRM8WFi4XffSP1Z+4qi7GbjWbvRQEbdIco5mIMq+zX4rPuLrw== - extend@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -4353,10 +4343,10 @@ min-indent@^1.0.0: resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== -miniflare@4.20251011.1: - version "4.20251011.1" - resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-4.20251011.1.tgz#a07f8222c99236160b2b5124fd477ca5758c7e3d" - integrity sha512-Qbw1Z8HTYM1adWl6FAtzhrj34/6dPRDPwdYOx21dkae8a/EaxbMzRIPbb4HKVGMVvtqbK1FaRCgDLVLolNzGHg== +miniflare@4.20251011.2: + version "4.20251011.2" + resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-4.20251011.2.tgz#85e502bed3b9d3d3d031a9fd8ee3400458eeb383" + integrity sha512-5oAaz6lqZus4QFwzEJiNtgpjZR2TBVwBeIhOW33V4gu+l23EukpKja831tFIX2o6sOD/hqZmKZHplOrWl3YGtQ== dependencies: "@cspotcode/source-map-support" "0.8.1" acorn "8.14.0" @@ -4534,11 +4524,6 @@ object.assign@^4.1.4: has-symbols "^1.1.0" object-keys "^1.1.1" -ohash@^2.0.11: - version "2.0.11" - resolved "https://registry.yarnpkg.com/ohash/-/ohash-2.0.11.tgz#60b11e8cff62ca9dee88d13747a5baa145f5900b" - integrity sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ== - onetime@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-7.0.0.tgz#9f16c92d8c9ef5120e3acd9dd9957cceecc1ab60" @@ -5643,11 +5628,6 @@ typescript@5.9.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.3.tgz#5b4f59e15310ab17a216f5d6cf53ee476ede670f" integrity sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw== -ufo@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.6.1.tgz#ac2db1d54614d1b22c1d603e3aef44a85d8f146b" - integrity sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA== - undici-types@~7.16.0: version "7.16.0" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.16.0.tgz#ffccdff36aea4884cbfce9a750a0580224f58a46" @@ -5658,16 +5638,12 @@ undici@7.14.0: resolved "https://registry.yarnpkg.com/undici/-/undici-7.14.0.tgz#7e616eeb3900deb1c4dda0e51384303975eec72c" integrity sha512-Vqs8HTzjpQXZeXdpsfChQTlafcMQaaIwnGwLam1wudSSjlJeQ3bw1j+TLPePgrCnCpUXx7Ba5Pdpf5OBih62NQ== -unenv@2.0.0-rc.21: - version "2.0.0-rc.21" - resolved "https://registry.yarnpkg.com/unenv/-/unenv-2.0.0-rc.21.tgz#cc6082ef32370eb7098cb2f86ca7af3ef4c2c49f" - integrity sha512-Wj7/AMtE9MRnAXa6Su3Lk0LNCfqDYgfwVjwRFVum9U7wsto1imuHqk4kTm7Jni+5A0Hn7dttL6O/zjvUvoo+8A== +unenv@2.0.0-rc.24: + version "2.0.0-rc.24" + resolved "https://registry.yarnpkg.com/unenv/-/unenv-2.0.0-rc.24.tgz#dd0035c3e93fedfa12c8454e34b7f17fe83efa2e" + integrity sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw== dependencies: - defu "^6.1.4" - exsolve "^1.0.7" - ohash "^2.0.11" pathe "^2.0.3" - ufo "^1.6.1" unified@^11.0.0: version "11.0.5" @@ -5945,18 +5921,18 @@ workerd@1.20251011.0: "@cloudflare/workerd-linux-arm64" "1.20251011.0" "@cloudflare/workerd-windows-64" "1.20251011.0" -wrangler@4.45.3: - version "4.45.3" - resolved "https://registry.yarnpkg.com/wrangler/-/wrangler-4.45.3.tgz#6e13bda27b53b36531120b188b320aeb74ee82fe" - integrity sha512-0ddEA9t4HeBgSVTVTcqtBHl7Z5CorWZ8tGgTQCP5XuL+9E1TJRwS6t/zzG51Ruwjb17SZYCaLchoM8V629S8cw== +wrangler@4.45.4: + version "4.45.4" + resolved "https://registry.yarnpkg.com/wrangler/-/wrangler-4.45.4.tgz#540f81433d9df5edaa2f07522f0ddf46beafaff4" + integrity sha512-niXT7B463wQi7WXIHjYK8txgWhuKQLrGmhjoR58SnPhlkq4wGjd3rFrkVyRc/O58clGTfs672BSGOph4XMoQKw== dependencies: "@cloudflare/kv-asset-handler" "0.4.0" - "@cloudflare/unenv-preset" "2.7.8" + "@cloudflare/unenv-preset" "2.7.9" blake3-wasm "2.1.5" esbuild "0.25.4" - miniflare "4.20251011.1" + miniflare "4.20251011.2" path-to-regexp "6.3.0" - unenv "2.0.0-rc.21" + unenv "2.0.0-rc.24" workerd "1.20251011.0" optionalDependencies: fsevents "~2.3.2"