From 7df9a91e3746689df3c21ff6c316958dd0668a8e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 18 Sep 2023 16:07:02 -0500 Subject: [PATCH] Change app/ to src/ in configuration files etc --- .eslintrc.cjs | 4 ++-- .gitlab-ci.yml | 2 +- .lintstagedrc.json | 2 +- dangerfile.ts | 14 +++++++------- docs/development/build-config.md | 2 +- docs/development/developing-backend.md | 4 ++-- package.json | 2 +- tailwind.config.cjs | 2 +- tsconfig.json | 2 +- vite.config.ts | 6 +++--- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index cef3ffffc..efd966cb9 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -49,7 +49,7 @@ module.exports = { ], 'import/resolver': { node: { - paths: ['app'], + paths: ['src'], }, }, polyfills: [ @@ -296,7 +296,7 @@ module.exports = { { // Only enforce JSDoc comments on UI components for now. // https://www.npmjs.com/package/eslint-plugin-jsdoc - files: ['app/soapbox/components/ui/**/*'], + files: ['src/soapbox/components/ui/**/*'], rules: { 'jsdoc/require-jsdoc': ['error', { publicOnly: true, diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dbc17bcb5..729d114c0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,7 +72,7 @@ lint-sass: # changes: # - "**/*.js" # - "**/*.json" -# - "app/soapbox/**/*" +# - "src/soapbox/**/*" # - "webpack/**/*" # - "custom/**/*" # - "jest.config.cjs" diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 97bad7f28..fc508d7e3 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -4,5 +4,5 @@ "*.mjs": "eslint --cache", "*.ts": "eslint --cache", "*.tsx": "eslint --cache", - "app/styles/**/*.scss": "stylelint" + "src/styles/**/*.scss": "stylelint" } diff --git a/dangerfile.ts b/dangerfile.ts index 6ed716fbc..0079123b4 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -1,7 +1,7 @@ import { danger, warn, message } from 'danger'; // App changes -const app = danger.git.fileMatch('app/soapbox/**'); +const app = danger.git.fileMatch('src/soapbox/**'); // Docs changes const docs = danger.git.fileMatch('docs/**/*.md'); @@ -18,24 +18,24 @@ if (app.edited && !changelog.edited) { } // UI components -const uiCode = danger.git.fileMatch('app/soapbox/components/ui/**'); -const uiTests = danger.git.fileMatch('app/soapbox/components/ui/**/__tests__/**'); +const uiCode = danger.git.fileMatch('src/soapbox/components/ui/**'); +const uiTests = danger.git.fileMatch('src/soapbox/components/ui/**/__tests__/**'); if (uiCode.edited && !uiTests.edited) { warn('You have UI changes (`soapbox/components/ui`) without tests.'); } // Actions -const actionsCode = danger.git.fileMatch('app/soapbox/actions/**'); -const actionsTests = danger.git.fileMatch('app/soapbox/actions/**__tests__/**'); +const actionsCode = danger.git.fileMatch('src/soapbox/actions/**'); +const actionsTests = danger.git.fileMatch('src/soapbox/actions/**__tests__/**'); if (actionsCode.edited && !actionsTests.edited) { warn('You have actions changes (`soapbox/actions`) without tests.'); } // Reducers -const reducersCode = danger.git.fileMatch('app/soapbox/reducers/**'); -const reducersTests = danger.git.fileMatch('app/soapbox/reducers/**__tests__/**'); +const reducersCode = danger.git.fileMatch('src/soapbox/reducers/**'); +const reducersTests = danger.git.fileMatch('src/soapbox/reducers/**__tests__/**'); if (reducersCode.edited && !reducersTests.edited) { warn('You have reducer changes (`soapbox/reducers`) without tests.'); diff --git a/docs/development/build-config.md b/docs/development/build-config.md index c00a442fd..293cd5d0e 100644 --- a/docs/development/build-config.md +++ b/docs/development/build-config.md @@ -71,7 +71,7 @@ For example: } ``` -See `app/soapbox/utils/features.js` for the full list of features. +See `src/soapbox/utils/features.js` for the full list of features. ### Embedded app (`custom/app.json`) diff --git a/docs/development/developing-backend.md b/docs/development/developing-backend.md index ee8f5c56a..70dc62e34 100644 --- a/docs/development/developing-backend.md +++ b/docs/development/developing-backend.md @@ -48,7 +48,7 @@ Typically checks are done against `BACKEND_NAME` and `VERSION`. The version string is similar in purpose to a [User-Agent](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent) string. The format was first invented by Pleroma, but is now widely used, including by Pixelfed, Mitra, and Soapbox BE. -See [`features.ts`](https://gitlab.com/soapbox-pub/soapbox/-/blob/main/app/soapbox/utils/features.ts) for the complete list of features. +See [`features.ts`](https://gitlab.com/soapbox-pub/soapbox/-/blob/main/src/soapbox/utils/features.ts) for the complete list of features. ## Forks of other software @@ -73,4 +73,4 @@ For Pleroma forks, the fork name should be in the compat section (eg Soapbox BE) ## Adding support for a new backend -If the backend conforms to the above format, please modify [`features.ts`](https://gitlab.com/soapbox-pub/soapbox/-/blob/main/app/soapbox/utils/features.ts) and submit a merge request to enable features for your backend! +If the backend conforms to the above format, please modify [`features.ts`](https://gitlab.com/soapbox-pub/soapbox/-/blob/main/src/soapbox/utils/features.ts) and submit a merge request to enable features for your backend! diff --git a/package.json b/package.json index c07fcbc1c..3d001c26a 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "test:all": "${npm_execpath} run test:coverage && ${npm_execpath} run lint", "lint": "${npm_execpath} run lint:js && ${npm_execpath} run lint:sass", "lint:js": "npx eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx . --cache", - "lint:sass": "npx stylelint app/styles/**/*.scss", + "lint:sass": "npx stylelint src/styles/**/*.scss", "prepare": "husky install" }, "license": "AGPL-3.0-or-later", diff --git a/tailwind.config.cjs b/tailwind.config.cjs index a59998396..57ff65f3c 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -2,7 +2,7 @@ const { parseColorMatrix } = require('./tailwind/colors.cjs'); /** @type {import('tailwindcss').Config} */ module.exports = { - content: ['./app/**/*.{html,js,ts,tsx}', './custom/instance/**/*.html', './app/index.ejs'], + content: ['./src/**/*.{html,js,ts,tsx}', './custom/instance/**/*.html', './src/index.html'], darkMode: 'class', theme: { screens: { diff --git a/tsconfig.json b/tsconfig.json index 14215616d..33ea901d0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "baseUrl": "app/", + "baseUrl": "src/", "outDir": "build/", "sourceMap": true, "strict": true, diff --git a/vite.config.ts b/vite.config.ts index b9369a895..8a1dd7aad 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -11,7 +11,7 @@ import vitePluginRequire from 'vite-plugin-require'; import { viteStaticCopy } from 'vite-plugin-static-copy'; export default defineConfig({ - root: 'app', + root: 'src', build: { // Relative to the root outDir: '../dist', @@ -79,8 +79,8 @@ export default defineConfig({ ], resolve: { alias: [ - { find: 'soapbox', replacement: path.resolve(__dirname, 'app', 'soapbox') }, - { find: 'assets', replacement: path.resolve(__dirname, 'app', 'assets') }, + { find: 'soapbox', replacement: path.resolve(__dirname, 'src', 'soapbox') }, + { find: 'assets', replacement: path.resolve(__dirname, 'src', 'assets') }, ], }, assetsInclude: ['**/*.oga'],