diff --git a/.gitignore b/.gitignore index 932d850627a..10e612508cd 100644 --- a/.gitignore +++ b/.gitignore @@ -61,8 +61,10 @@ .ruby-gemset .tool-versions -# Likewise, there is a .vscode-sample for VSCode config -.vscode +# Likewise, there are sample files for VSCode config +/.vscode/* +!/.vscode/extensions.json +!/.vscode/*.sample # Front-end dist diff --git a/.vscode-sample/extensions.json b/.vscode-sample/extensions.json deleted file mode 100644 index 86c6cd8f91c..00000000000 --- a/.vscode-sample/extensions.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. - // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp - - // List of extensions which should be recommended for users of this workspace. - "recommendations": [ - "esbenp.prettier-vscode", - "typed-ember.glint-vscode", - "chiragpat.vscode-glimmer", - "dbaeumer.vscode-eslint" - ] -} diff --git a/.vscode-sample/launch.json b/.vscode-sample/launch.json deleted file mode 100644 index e1231a270ff..00000000000 --- a/.vscode-sample/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Discourse", - "type": "Ruby", - "request": "launch", - "cwd": "/home/discourse/workspace/discourse", - // run bundle install before rails server - "preLaunchTask": "Prepare discourse", - "env": { "DISCOURSE_DEV_HOSTS": "${env:CLOUDENV_ENVIRONMENT_ID}-9292.apps.codespaces.githubusercontent.com", "UNICORN_BIND_ALL": "1", "UNICORN_WORKERS": "4", "DISCOURSE_DEV_ALLOW_ANON_TO_IMPERSONATE": "1" }, - "program": "bin/unicorn", - "args": ["-x"], - } - ] -} diff --git a/.vscode-sample/settings.json b/.vscode-sample/settings.json deleted file mode 100644 index 5650eb57a33..00000000000 --- a/.vscode-sample/settings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "[gjs]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[gts]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "eslint.validate": [ - "glimmer-js", - "glimmer-ts" - ] -} diff --git a/.vscode-sample/tasks.json b/.vscode-sample/tasks.json deleted file mode 100644 index ad8af2fea27..00000000000 --- a/.vscode-sample/tasks.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "Prepare discourse", - "type": "shell", - "command": "cd /home/discourse/workspace/discourse && bundle install && yarn && bin/rake db:migrate" - }, - ], -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000000..3ea3050050f --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + "Shopify.ruby-lsp", + "esbenp.prettier-vscode", + "dbaeumer.vscode-eslint", + "ruby-syntax-tree.vscode-syntax-tree", + "lifeart.vscode-glimmer-syntax" + ] +} diff --git a/.vscode/settings.json.sample b/.vscode/settings.json.sample new file mode 100644 index 00000000000..b11a0f3352a --- /dev/null +++ b/.vscode/settings.json.sample @@ -0,0 +1,36 @@ +{ + // Enable gjs support for eslint + "eslint.validate": [ + "glimmer-js", + ], + + // Formatter configuration: + "[scss]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[glimmer-js]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[ruby]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "ruby-syntax-tree.vscode-syntax-tree" + }, + "[handlebars]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + + // eslint fix on save + "editor.codeActionsOnSave": { + "source.fixAll": "explicit" + }, + + "task.autoDetect": "off", + "eslint.debug": false, +} diff --git a/.vscode/tasks.json.sample b/.vscode/tasks.json.sample new file mode 100644 index 00000000000..ea802ffa622 --- /dev/null +++ b/.vscode/tasks.json.sample @@ -0,0 +1,87 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "deps/yarn", + "type": "shell", + "command": "yarn install", + "presentation": { + "reveal": "always", + "group": "deps", + "close": true + }, + "problemMatcher": [] + }, + { + "label": "deps/bundle", + "type": "shell", + "command": "bundle install", + "presentation": { + "reveal": "always", + "group": "deps", + "close": true + }, + "problemMatcher": [] + }, + { + "label": "deps/all", + "dependsOn": [ + "deps/yarn", + "deps/bundle" + ], + "problemMatcher": [] + }, + { + "label": "dev/migrate", + "type": "shell", + "command": "bin/rake db:create db:migrate", + "options": { + "env":{ + "SKIP_MULTISITE": "1", + "SKIP_TEST_DATABASE": "1" + } + }, + "problemMatcher": [] + }, + { + "label": "dev/server", + "type": "shell", + "command": "bin/ember-cli -u", + "options": { + "env":{ + "DISCOURSE_DEV_ALLOW_ANON_TO_IMPERSONATE": "1" + } + }, + "problemMatcher": [], + "isBackground": true + }, + { + "label": "shortcuts/boot-dev", + "dependsOn": [ + "deps/all", + "dev/migrate", + "dev/server" + ], + "dependsOrder": "sequence", + "problemMatcher": [], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "spec/migrate", + "type": "shell", + "command": "RAILS_ENV=test bin/rake db:create db:migrate parallel:create parallel:migrate", + "problemMatcher": [], + }, + { + "label": "spec/run-all", + "type": "shell", + "command": "bin/turbo_rspec", + "problemMatcher": [], + }, + ], +}