Merge branch 'src' into 'main'

Rename app/ to src/, flatten src directory

See merge request soapbox-pub/soapbox!2704
This commit is contained in:
Alex Gleason
2023-09-18 23:10:24 +00:00
1439 changed files with 96 additions and 105 deletions

View File

@ -48,9 +48,8 @@ module.exports = {
'\\.(css|scss|json)$',
],
'import/resolver': {
node: {
paths: ['app'],
},
typescript: true,
node: true,
},
polyfills: [
'es:all', // core-js
@ -296,7 +295,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/components/ui/**/*'],
rules: {
'jsdoc/require-jsdoc': ['error', {
publicOnly: true,

1
.gitignore vendored
View File

@ -10,6 +10,7 @@
yarn-error.log*
/junit.xml
*.timestamp-*
*.bundled_*
/dist/
/static/

View File

@ -72,7 +72,7 @@ lint-sass:
# changes:
# - "**/*.js"
# - "**/*.json"
# - "app/soapbox/**/*"
# - "src/**/*"
# - "webpack/**/*"
# - "custom/**/*"
# - "jest.config.cjs"

View File

@ -4,5 +4,5 @@
"*.mjs": "eslint --cache",
"*.ts": "eslint --cache",
"*.tsx": "eslint --cache",
"app/styles/**/*.scss": "stylelint"
"src/styles/**/*.scss": "stylelint"
}

View File

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, user-scalable=no">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<link href="/manifest.json" rel="manifest">
<!--server-generated-meta-->
<%= snippets %>
</head>
<body class="theme-mode-light no-reduce-motion">
<div id="soapbox" class="h-full">
<div class="loading-indicator-wrapper">
<div class="loading-indicator">
<div class="loading-indicator__container">
<div class="loading-indicator__figure"></div>
</div>
</div>
</div>
</div>
<noscript>To use this website, please enable JavaScript.</noscript>
</body>
</html>

View File

@ -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/**');
// 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/components/ui/**');
const uiTests = danger.git.fileMatch('src/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/actions/**');
const actionsTests = danger.git.fileMatch('src/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/reducers/**');
const reducersTests = danger.git.fileMatch('src/reducers/**__tests__/**');
if (reducersCode.edited && !reducersTests.edited) {
warn('You have reducer changes (`soapbox/reducers`) without tests.');

View File

@ -71,7 +71,7 @@ For example:
}
```
See `app/soapbox/utils/features.js` for the full list of features.
See `src/utils/features.js` for the full list of features.
### Embedded app (`custom/app.json`)

View File

@ -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/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/utils/features.ts) and submit a merge request to enable features for your backend!

View File

@ -7,7 +7,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<link href="/manifest.json" rel="manifest">
<!--server-generated-meta-->
<script type="module" src="./soapbox/main.tsx"></script>
<script type="module" src="./src/main.tsx"></script>
</head>
<body class="theme-mode-light no-reduce-motion">
<div id="soapbox" class="h-full">

View File

@ -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",
@ -188,6 +188,7 @@
"cross-env": "^7.0.3",
"danger": "^11.0.7",
"eslint": "^8.49.0",
"eslint-import-resolver-typescript": "^3.6.0",
"eslint-plugin-compat": "^4.2.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsdoc": "^46.8.1",

Some files were not shown because too many files have changed in this diff Show More