소스 검색

chore: run prettier & ignore config

httpjamesm 2 년 전
부모
커밋
6789c9dc7f

+ 1 - 3
.lintstagedrc.js

@@ -11,7 +11,5 @@ const buildPrettierCommand = (filenames) =>
 module.exports = {
     'apps/**/*.{js,jsx,ts,tsx}': [buildEslintCommand, buildPrettierCommand],
     'packages/**/*.{js,jsx,ts,tsx}': [buildEslintCommand, buildPrettierCommand],
-    '**/*.{json,css,scss,md,html,yml,yaml}': [
-        buildPrettierCommand,
-    ],
+    '**/*.{json,css,scss,md,html,yml,yaml}': [buildPrettierCommand],
 };

+ 5 - 0
.prettierignore

@@ -0,0 +1,5 @@
+thirdparty/
+public/
+node_modules/
+*.md
+*.yml

+ 1 - 1
apps/photos/next.config.js

@@ -49,7 +49,7 @@ module.exports = (phase) =>
                 '@mui/system',
                 '@mui/icons-material',
                 '@ente/tsconfig',
-                '@ente/eslint-config'
+                '@ente/eslint-config',
             ],
             env: {
                 SENTRY_RELEASE: GIT_SHA,

+ 1 - 1
apps/photos/package.json

@@ -111,4 +111,4 @@
     "standard": {
         "parser": "babel-eslint"
     }
-}
+}

+ 80 - 73
apps/photos/public/manifest.json

@@ -1,76 +1,83 @@
 {
-  "short_name": "ente",
-  "name": "ente | encrypted photo storage",
-  "icons": [
-    {
-      "src": "/images/ente/192.png",
-      "type": "image/png",
-      "sizes": "192x192"
+    "short_name": "ente",
+    "name": "ente | encrypted photo storage",
+    "icons": [
+        {
+            "src": "/images/ente/192.png",
+            "type": "image/png",
+            "sizes": "192x192"
+        },
+        {
+            "src": "/images/ente/256.png",
+            "type": "image/png",
+            "sizes": "256x256"
+        },
+        {
+            "src": "/images/ente/512.png",
+            "type": "image/png",
+            "sizes": "512x512"
+        }
+    ],
+    "start_url": "/",
+    "background_color": "#191919",
+    "display": "standalone",
+    "scope": "/",
+    "theme_color": "#111",
+    "description": "ente provides a simple way to back up your memories.",
+    "prefer_related_applications": true,
+    "related_applications": [
+        {
+            "platform": "play",
+            "url": "https://play.google.com/store/apps/details?id=io.ente.photos",
+            "id": "io.ente.photos"
+        },
+        {
+            "platform": "itunes",
+            "url": "https://apps.apple.com/in/app/ente-photos/id1542026904"
+        }
+    ],
+    "share_target": {
+        "action": "./share-target",
+        "method": "POST",
+        "enctype": "multipart/form-data",
+        "params": {
+            "files": [
+                {
+                    "name": "files",
+                    "accept": [
+                        "image/*",
+                        "video/*",
+                        "application/json"
+                    ]
+                }
+            ]
+        }
     },
-    {
-      "src": "/images/ente/256.png",
-      "type": "image/png",
-      "sizes": "256x256"
-    },
-    {
-      "src": "/images/ente/512.png",
-      "type": "image/png",
-      "sizes": "512x512"
-    }
-  ],
-  "start_url": "/",
-  "background_color": "#191919",
-  "display": "standalone",
-  "scope": "/",
-  "theme_color": "#111",
-  "description": "ente provides a simple way to back up your memories.",
-  "prefer_related_applications": true,
-  "related_applications": [
-      {
-        "platform": "play",
-        "url": "https://play.google.com/store/apps/details?id=io.ente.photos",
-        "id": "io.ente.photos"
-      }, {
-        "platform": "itunes",
-        "url": "https://apps.apple.com/in/app/ente-photos/id1542026904"
-      }
-  ],
-  "share_target": {
-    "action": "./share-target",
-    "method": "POST",
-    "enctype": "multipart/form-data",
-    "params": {
-        "files": [{
-            "name": "files",
-            "accept": ["image/*", "video/*", "application/json"]
-        }]
-    }
-  },
-  "screenshots": [
-    {
-      "src": "/pwa/slide-1.jpg",
-      "type": "image/jpeg",
-      "sizes": "417x760"
-    },
-    {
-      "src": "/pwa/slide-2.jpg",
-      "type": "image/jpeg",
-      "sizes": "378x690"
-    },
-    {
-      "src": "/pwa/slide-3.jpg",
-      "type": "image/jpeg",
-      "sizes": "378x690"
-    },
-    {
-      "src": "/pwa/slide-4.jpg",
-      "type": "image/jpeg",
-      "sizes": "378x690"
-    },
-    {
-      "src": "/pwa/slide-5.jpg",
-      "type": "image/jpeg",
-      "sizes": "378x690"
-    }
-  ]
+    "screenshots": [
+        {
+            "src": "/pwa/slide-1.jpg",
+            "type": "image/jpeg",
+            "sizes": "417x760"
+        },
+        {
+            "src": "/pwa/slide-2.jpg",
+            "type": "image/jpeg",
+            "sizes": "378x690"
+        },
+        {
+            "src": "/pwa/slide-3.jpg",
+            "type": "image/jpeg",
+            "sizes": "378x690"
+        },
+        {
+            "src": "/pwa/slide-4.jpg",
+            "type": "image/jpeg",
+            "sizes": "378x690"
+        },
+        {
+            "src": "/pwa/slide-5.jpg",
+            "type": "image/jpeg",
+            "sizes": "378x690"
+        }
+    ]
 }

+ 54 - 52
apps/photos/src/styles/global.css

@@ -3,39 +3,40 @@
     font-family: 'Inter';
     font-style: normal;
     font-weight: 400;
-    src: local(''),
-         url('/fonts/inter-v11-latin-500.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
-         url('/fonts/inter-v11-latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+    src: local(''), url('/fonts/inter-v11-latin-500.woff2') format('woff2'),
+        /* Chrome 26+, Opera 23+, Firefox 39+ */
+            url('/fonts/inter-v11-latin-500.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
     font-display: swap; /*https://web.dev/font-display/?utm_source=lighthouse&utm_medium=devtools#how-to-avoid-showing-invisible-text*/
-  }
-  
-  /* inter-600 - latin */
-  @font-face {
+}
+
+/* inter-600 - latin */
+@font-face {
     font-family: 'Inter';
     font-style: normal;
     font-weight: 700;
-    src: local(''),
-         url('/fonts/inter-v11-latin-600.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
-         url('/fonts/inter-v11-latin-600.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+    src: local(''), url('/fonts/inter-v11-latin-600.woff2') format('woff2'),
+        /* Chrome 26+, Opera 23+, Firefox 39+ */
+            url('/fonts/inter-v11-latin-600.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
     font-display: swap;
-  }
-  
-  /* inter-800 - latin */
-  @font-face {
+}
+
+/* inter-800 - latin */
+@font-face {
     font-family: 'Inter';
     font-style: normal;
     font-weight: 900;
-    src: local(''),
-         url('/fonts/inter-v11-latin-800.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
-         url('/fonts/inter-v11-latin-800.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
+    src: local(''), url('/fonts/inter-v11-latin-800.woff2') format('woff2'),
+        /* Chrome 26+, Opera 23+, Firefox 39+ */
+            url('/fonts/inter-v11-latin-800.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
     font-display: swap;
-  }
-  
-html, body {
+}
+
+html,
+body {
     height: 100%;
     flex: 1;
     display: flex;
-    flex-direction: column; 
+    flex-direction: column;
 }
 
 #__next {
@@ -44,10 +45,10 @@ html, body {
     flex-direction: column;
 }
 
-.pswp__button--custom{
-    background: none !important;    
-    background-image: none !important;    
-    color:#fff;
+.pswp__button--custom {
+    background: none !important;
+    background-image: none !important;
+    color: #fff;
 }
 
 .pswp__item video {
@@ -71,29 +72,29 @@ html, body {
     max-height: 100%;
 }
 
-.pswp-item-container > img{
+.pswp-item-container > img {
     opacity: 1;
 }
 
-.pswp-item-container > video{
+.pswp-item-container > video {
     opacity: 0;
 }
 
-.pswp-item-container > div.download-banner {      
-    width:100%;
+.pswp-item-container > div.download-banner {
+    width: 100%;
     height: 16vh;
-    padding:2vh 0;
+    padding: 2vh 0;
     background-color: #151414;
-    color:#ddd;
+    color: #ddd;
     display: flex;
-    flex-direction:column;
+    flex-direction: column;
     align-items: center;
     justify-content: space-around;
     opacity: 0.8;
-    font-size:20px;
+    font-size: 20px;
 }
 
-.download-banner > a{
+.download-banner > a {
     width: 130px;
 }
 
@@ -101,26 +102,27 @@ html, body {
     object-fit: contain;
 }
 
-.pswp__button--arrow--left, .pswp__button--arrow--right{
-    color:#fff;
-    background-color: #333333  !important;
+.pswp__button--arrow--left,
+.pswp__button--arrow--right {
+    color: #fff;
+    background-color: #333333 !important;
     border-radius: 50%;
     width: 56px;
     height: 56px;
 }
-.pswp__button--arrow--left::before, .pswp__button--arrow--right::before {
-     background: none !important; 
+.pswp__button--arrow--left::before,
+.pswp__button--arrow--right::before {
+    background: none !important;
 }
 
-.pswp__button--arrow--left{
+.pswp__button--arrow--left {
     margin-left: 20px;
 }
 
-.pswp__button--arrow--right{
+.pswp__button--arrow--right {
     margin-right: 20px;
 }
 
-
 .pswp-custom-caption-container {
     width: 100%;
     display: flex;
@@ -129,7 +131,7 @@ html, body {
     background-color: transparent !important;
 }
 
-.pswp__caption--empty{
+.pswp__caption--empty {
     display: none;
 }
 
@@ -159,25 +161,25 @@ div.otp-input input {
 }
 
 div.otp-input input::placeholder {
-    opacity:0;
+    opacity: 0;
 }
 
-div.otp-input input:not(:placeholder-shown) , div.otp-input input:focus{
+div.otp-input input:not(:placeholder-shown),
+div.otp-input input:focus {
     border: 2px solid #51cd7c;
-    border-radius:1px; 
+    border-radius: 1px;
     -webkit-transition: 0.5s;
     transition: 0.5s;
     outline: none;
 }
 
-.flash-message{
-    padding:16px;
-    display:flex;
-    align-items:center;
+.flash-message {
+    padding: 16px;
+    display: flex;
+    align-items: center;
 }
 
-@-webkit-keyframes rotation 
-{
+@-webkit-keyframes rotation {
     from {
         -webkit-transform: rotate(0deg);
     }

+ 2 - 2
apps/photos/tsconfig.json

@@ -1,8 +1,8 @@
 {
     "extends": "@ente/tsconfig/ente.json",
     "compilerOptions": {
-        "baseUrl": "./src",
+        "baseUrl": "./src"
     },
     "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],
     "exclude": ["node_modules", "out", ".next", "thirdparty"]
-}
+}

+ 52 - 54
packages/eslint-config/index.js

@@ -1,65 +1,63 @@
 module.exports = {
     extends: [
-        "next/core-web-vitals",
-        "eslint:recommended",
-        "plugin:@typescript-eslint/recommended",
-        "plugin:@typescript-eslint/recommended-requiring-type-checking",
-        "prettier"
+        'next/core-web-vitals',
+        'eslint:recommended',
+        'plugin:@typescript-eslint/recommended',
+        'plugin:@typescript-eslint/recommended-requiring-type-checking',
+        'prettier',
     ],
     parserOptions: {
-        "project": "./tsconfig.json",
+        project: './tsconfig.json',
     },
-    plugins: [
-        "@typescript-eslint",
-    ],
+    plugins: ['@typescript-eslint'],
     rules: {
-        "indent": "off",
-        "class-methods-use-this": "off",
-        "react/prop-types": "off",
-        "react/display-name": "off",
-        "react/no-unescaped-entities": "off",
-        "no-unused-vars": "off",
-        "@typescript-eslint/no-unused-vars": ["error"],
-        "require-jsdoc": "off",
-        "valid-jsdoc": "off",
-        "max-len": "off",
-        "new-cap": "off",
-        "no-invalid-this": "off",
-        "eqeqeq": "error",
-        "object-curly-spacing": ["error", "always"],
-        "space-before-function-paren": "off",
-        "operator-linebreak": [
-            "error",
-            "after",
-            { "overrides": { "?": "before", ":": "before" } }
+        indent: 'off',
+        'class-methods-use-this': 'off',
+        'react/prop-types': 'off',
+        'react/display-name': 'off',
+        'react/no-unescaped-entities': 'off',
+        'no-unused-vars': 'off',
+        '@typescript-eslint/no-unused-vars': ['error'],
+        'require-jsdoc': 'off',
+        'valid-jsdoc': 'off',
+        'max-len': 'off',
+        'new-cap': 'off',
+        'no-invalid-this': 'off',
+        eqeqeq: 'error',
+        'object-curly-spacing': ['error', 'always'],
+        'space-before-function-paren': 'off',
+        'operator-linebreak': [
+            'error',
+            'after',
+            { overrides: { '?': 'before', ':': 'before' } },
         ],
-        "import/no-anonymous-default-export": [
-            "error",
+        'import/no-anonymous-default-export': [
+            'error',
             {
-                "allowNew": true
-            }
+                allowNew: true,
+            },
         ],
-        "@typescript-eslint/no-unsafe-member-access": "off",
-        "@typescript-eslint/no-unsafe-return": "off",
-        "@typescript-eslint/no-unsafe-assignment": "off",
-        "@typescript-eslint/no-inferrable-types": "off",
-        "@typescript-eslint/restrict-template-expressions": "off",
-        "@typescript-eslint/ban-types": "off",
-        "@typescript-eslint/no-floating-promises": "off",
-        "@typescript-eslint/no-unsafe-call": "off",
-        "@typescript-eslint/require-await": "off",
-        "@typescript-eslint/restrict-plus-operands": "off",
-        "@typescript-eslint/no-var-requires": "off",
-        "@typescript-eslint/no-empty-interface": "off",
-        "@typescript-eslint/no-misused-promises": "off",
-        "@typescript-eslint/no-empty-function": "off",
-        "@typescript-eslint/explicit-module-boundary-types": "off",
-        "@typescript-eslint/no-explicit-any": "off",
-        "@typescript-eslint/no-unnecessary-type-assertion": "off",
-        "react-hooks/rules-of-hooks": "off",
-        "react-hooks/exhaustive-deps": "off",
-        "@next/next/no-img-element": "off",
-        "@typescript-eslint/no-unsafe-argument": "off",
-        "jsx-a11y/alt-text": "off"
+        '@typescript-eslint/no-unsafe-member-access': 'off',
+        '@typescript-eslint/no-unsafe-return': 'off',
+        '@typescript-eslint/no-unsafe-assignment': 'off',
+        '@typescript-eslint/no-inferrable-types': 'off',
+        '@typescript-eslint/restrict-template-expressions': 'off',
+        '@typescript-eslint/ban-types': 'off',
+        '@typescript-eslint/no-floating-promises': 'off',
+        '@typescript-eslint/no-unsafe-call': 'off',
+        '@typescript-eslint/require-await': 'off',
+        '@typescript-eslint/restrict-plus-operands': 'off',
+        '@typescript-eslint/no-var-requires': 'off',
+        '@typescript-eslint/no-empty-interface': 'off',
+        '@typescript-eslint/no-misused-promises': 'off',
+        '@typescript-eslint/no-empty-function': 'off',
+        '@typescript-eslint/explicit-module-boundary-types': 'off',
+        '@typescript-eslint/no-explicit-any': 'off',
+        '@typescript-eslint/no-unnecessary-type-assertion': 'off',
+        'react-hooks/rules-of-hooks': 'off',
+        'react-hooks/exhaustive-deps': 'off',
+        '@next/next/no-img-element': 'off',
+        '@typescript-eslint/no-unsafe-argument': 'off',
+        'jsx-a11y/alt-text': 'off',
     },
 };

+ 1 - 1
packages/eslint-config/package.json

@@ -15,4 +15,4 @@
         "eslint-config-turbo": "latest",
         "eslint-plugin-react": "latest"
     }
-}
+}

+ 1 - 1
packages/tsconfig/ente.json

@@ -25,4 +25,4 @@
     },
     "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"],
     "exclude": ["node_modules", "out", ".next", "thirdparty"]
-}
+}

+ 1 - 1
packages/tsconfig/package.json

@@ -5,4 +5,4 @@
     "exports": {
         "./ente.json": "./ente.json"
     }
-}
+}

+ 6 - 18
turbo.json

@@ -2,31 +2,19 @@
     "$schema": "https://turbo.build/schema.json",
     "pipeline": {
         "build": {
-            "outputs": [
-                ".next/**",
-                "!.next/cache/**"
-            ]
+            "outputs": [".next/**", "!.next/cache/**"]
         },
         "export": {
-            "dependsOn": [
-                "^build"
-            ],
-            "inputs": [
-                ".next/**",
-                "!.next/cache/**"
-            ]
-        },
-        "lint": {
-            
+            "dependsOn": ["^build"],
+            "inputs": [".next/**", "!.next/cache/**"]
         },
+        "lint": {},
         "dev": {
             "cache": false,
             "persistent": true
         },
         "start": {
-            "dependsOn": [
-                "^build"
-            ]
+            "dependsOn": ["^build"]
         },
         "albums": {
             "cache": false,
@@ -55,4 +43,4 @@
         "NEXT_PUBLIC_SENTRY_DSN",
         "NEXT_PUBLIC_SENTRY_ENV"
     ]
-}
+}

+ 4 - 13
yarn.lock

@@ -2372,11 +2372,7 @@ fastq@^1.6.0:
     reusify "^1.0.4"
 
 "ffmpeg-wasm@file:./apps/photos/thirdparty/ffmpeg-wasm":
-  version "0.10.1"
-  dependencies:
-    is-url "^1.2.4"
-    node-fetch "^2.6.1"
-    regenerator-runtime "^0.13.7"
+  version "0.0.0"
 
 file-entry-cache@^6.0.1:
   version "6.0.1"
@@ -3126,11 +3122,6 @@ is-unicode-supported@^0.1.0:
   resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz"
   integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==
 
-is-url@^1.2.4:
-  version "1.2.4"
-  resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52"
-  integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==
-
 is-weakmap@^2.0.1:
   version "2.0.1"
   resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2"
@@ -3582,7 +3573,7 @@ next@^13.1.2:
     "@next/swc-win32-ia32-msvc" "13.1.3"
     "@next/swc-win32-x64-msvc" "13.1.3"
 
-node-fetch@2.6.7, node-fetch@^2.6.1, node-fetch@~2.6.1:
+node-fetch@2.6.7, node-fetch@~2.6.1:
   version "2.6.7"
   resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
   integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
@@ -3854,7 +3845,7 @@ peek-readable@^4.0.1:
   integrity sha512-7qmhptnR0WMSpxT5rMHG9bW/mYSR1uqaPFj2MHvT+y/aOUu6msJijpKt5SkTDKySwg65OWG2JwTMBlgcbwMHrQ==
 
 "photoswipe@file:./apps/photos/thirdparty/photoswipe":
-  version "4.1.6"
+  version "0.0.0"
 
 picocolors@^1.0.0:
   version "1.0.0"
@@ -4219,7 +4210,7 @@ regenerator-runtime@^0.13.11:
   resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
   integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==
 
-regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7:
+regenerator-runtime@^0.13.4:
   version "0.13.9"
   resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz"
   integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==