diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000000..ba818fe00a --- /dev/null +++ b/.babelrc @@ -0,0 +1,4 @@ +{ + "presets": ["@babel/preset-env", "@babel/preset-flow"], + "plugins": ["babel-plugin-syntax-hermes-parser"] +} \ No newline at end of file diff --git a/.eslintignore b/.eslintignore index b304ee19d8..c806ab03e5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -18,4 +18,5 @@ logs/ .eslintrc test/files *.min.js -install/docker/ \ No newline at end of file +install/docker/ +.stryker-tmp/ \ No newline at end of file diff --git a/.flowconfig b/.flowconfig new file mode 100644 index 0000000000..95fde81def --- /dev/null +++ b/.flowconfig @@ -0,0 +1,14 @@ +[ignore] + +[include] + +[libs] + +[lints] +untyped-type-import=error +internal-type=error +deprecated-type-bool=error + +[options] + +[strict] diff --git a/.github/workflows/azure-deploy-f24.yml b/.github/workflows/azure-deploy-f24.yml index e35e0f7018..314e24d6e2 100644 --- a/.github/workflows/azure-deploy-f24.yml +++ b/.github/workflows/azure-deploy-f24.yml @@ -19,7 +19,7 @@ jobs: ./.github/workflows/test.yaml build-and-deploy: - if: github.repository == 'cmu-313/NodeBB' + if: github.repository == 'CMU-17313Q/nodebb-f24-swifties' needs: lint-and-test runs-on: ubuntu-latest @@ -34,7 +34,7 @@ jobs: - name: Set up NodeBB run: | - ./nodebb setup '{"url":"https://nodebb-f24.azurewebsites.net:443", + ./nodebb setup '{"url":"https://nodebb-swifties.azurewebsites.net:443", "admin:username": "admin", "admin:password": "${{ secrets.ADMIN_PASSWORD }}", "admin:password:confirm": "${{ secrets.ADMIN_PASSWORD }}", @@ -48,7 +48,7 @@ jobs: id: deploy-to-webapp uses: azure/webapps-deploy@v2 with: - app-name: 'nodebb-f24' + app-name: 'nodebb-swifties' slot-name: 'Production' - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_BFAB97B1AB1441ACA7C63280F91AD3F3 }} + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_E1A7D2C03DAB4DB580437D9B40DC6FC8 }} package: . diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c4e8f090bd..1334b04785 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,4 +1,4 @@ -name: Lint and test +name: Lint and Test on: pull_request: @@ -77,6 +77,10 @@ jobs: - name: Run ESLint run: npm run lint + - name: Run Flow for Type Checking + run: npx flow check + # Runs Flow to detect any type inconsistencies before merging + - name: Node tests run: npm test diff --git a/.gitignore b/.gitignore index 42a1b3c705..36f6d5963c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ dist/ yarn.lock npm-debug.log -node_modules/ +node_modules/* +!node_modules/nodebb-theme-harmony sftp-config.json config.json jsconfig.json @@ -72,4 +73,6 @@ link-plugins.sh test.sh .docker/** -!**/.gitkeep \ No newline at end of file +!**/.gitkeep +# stryker temp files +.stryker-tmp/ diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..1b8ac8894b --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +# Ignore artifacts: +build +coverage diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..1a10c07912 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,10 @@ +{ + "semi":"true", + "singleQuote":"true", + "trailingComa":"es5", + "useTabs":"true", + "arrowParens":"avoid", + "printWidth":80, + "tabWidth":2, + "bracketSpacing": true +} diff --git a/ForSaving.tpl b/ForSaving.tpl new file mode 100644 index 0000000000..20fde75b0e --- /dev/null +++ b/ForSaving.tpl @@ -0,0 +1,303 @@ +{{{ if posts.display_moderator_tools }}} +
[[user:consent.lead]]
+[[user:consent.intro]]
+ +[[user:consent.email-intro]]
+ {{{ if digest.enabled }}} +[[user:consent.digest-frequency, {digest.frequency}]]
+ {{{ else }}} +[[user:consent.digest-off]]
+ {{{ end }}} + + +[[user:consent.right-of-access]]
+[[user:consent.right-of-access-description]]
+[[user:consent.right-to-rectification]]
+[[user:consent.right-to-rectification-description]]
+[[user:consent.right-to-erasure]]
+[[user:consent.right-to-erasure-description]]
+[[user:consent.right-to-data-portability]]
+[[user:consent.right-to-data-portability-description]]
+ ++ {{{ if history.flags.targetPurged }}} +
+ [[user:info.banned-reason-label]]: {./reason} +
++ {{{ if ./until }}} + [[user:info.banned-until, {isoTimeToLocaleString(./untilISO, config.userLang)}]] + {{{ else }}} + {{{ if (./type != "unban") }}} + [[user:info.banned-permanently]] + {{{ end }}} + {{{ end }}} +
++ [[user:info.banned-reason-label]]: {./reason} +
++ {{{ if ./until }}} + [[user:info.muted-until, {isoTimeToLocaleString(./untilISO, config.userLang)}]] + {{{ end }}} +
+[[user:sessions.description]]
+[[user:homepage-description]]
+[[user:topic-search-help]]
+ {{{ end }}} + +[[user:digest-description]]
++ | + |
---|---|
+ {./url} + | +
+
+
+
+ |
+
{target.content}+ {{{ end }}} + + {{{ if type_bool.user }}} + +
{{{ if target.aboutme }}}{target.aboutme}{{{ else }}}[[flags:target-aboutme-empty]]{{{ end }}}+ {{{ end }}} + + {{{ if type_bool.empty }}} +
{./value}
+{./content}
+