Initial commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
name: Create new d-compat branch
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
uses: discourse/.github/.github/workflows/create-d-compat-branch.yml@v1
|
||||
@@ -0,0 +1,11 @@
|
||||
name: Discourse Plugin
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
uses: discourse/.github/.github/workflows/discourse-plugin.yml@v1
|
||||
@@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
/gems
|
||||
/auto_generated
|
||||
.eslintcache
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require("@discourse/lint-configs/prettier");
|
||||
@@ -0,0 +1,2 @@
|
||||
inherit_gem:
|
||||
rubocop-discourse: stree-compat.yml
|
||||
@@ -0,0 +1,2 @@
|
||||
--print-width=100
|
||||
--plugins=plugin/trailing_comma,plugin/disable_auto_ternary
|
||||
@@ -0,0 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
group :development do
|
||||
gem "rubocop-discourse"
|
||||
gem "syntax_tree"
|
||||
end
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activesupport (8.1.3)
|
||||
base64
|
||||
bigdecimal
|
||||
concurrent-ruby (~> 1.0, >= 1.3.1)
|
||||
connection_pool (>= 2.2.5)
|
||||
drb
|
||||
i18n (>= 1.6, < 2)
|
||||
json
|
||||
logger (>= 1.4.2)
|
||||
minitest (>= 5.1)
|
||||
securerandom (>= 0.3)
|
||||
tzinfo (~> 2.0, >= 2.0.5)
|
||||
uri (>= 0.13.1)
|
||||
ast (2.4.3)
|
||||
base64 (0.3.0)
|
||||
bigdecimal (4.1.2)
|
||||
concurrent-ruby (1.3.7)
|
||||
connection_pool (3.0.2)
|
||||
drb (2.2.3)
|
||||
i18n (1.15.2)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.20.0)
|
||||
language_server-protocol (3.17.0.6)
|
||||
lint_roller (1.1.0)
|
||||
logger (1.7.0)
|
||||
minitest (6.0.6)
|
||||
drb (~> 2.0)
|
||||
prism (~> 1.5)
|
||||
parallel (2.1.0)
|
||||
parser (3.3.11.1)
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
prettier_print (1.2.1)
|
||||
prism (1.9.0)
|
||||
racc (1.8.1)
|
||||
rack (3.2.6)
|
||||
rainbow (3.1.1)
|
||||
regexp_parser (2.12.0)
|
||||
rubocop (1.88.2)
|
||||
json (~> 2.3)
|
||||
language_server-protocol (~> 3.17.0.2)
|
||||
lint_roller (~> 1.1.0)
|
||||
parallel (>= 1.10)
|
||||
parser (>= 3.3.0.2)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 2.9.3, < 3.0)
|
||||
rubocop-ast (>= 1.49.0, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 2.4.0, < 4.0)
|
||||
rubocop-ast (1.50.0)
|
||||
parser (>= 3.3.7.2)
|
||||
prism (~> 1.7)
|
||||
rubocop-capybara (3.0.0)
|
||||
lint_roller (~> 1.1)
|
||||
rubocop (~> 1.81)
|
||||
rubocop-discourse (3.18.0)
|
||||
activesupport (>= 6.1)
|
||||
lint_roller (>= 1.1.0)
|
||||
rubocop-capybara (>= 2.23.0)
|
||||
rubocop-discourse-base (>= 1.0.0)
|
||||
rubocop-factory_bot (>= 2.27.0)
|
||||
rubocop-rails (>= 2.30.3)
|
||||
rubocop-rspec (>= 3.0.1)
|
||||
rubocop-rspec_rails (>= 2.31.0)
|
||||
rubocop-discourse-base (1.0.0)
|
||||
rubocop (>= 1.80.0)
|
||||
rubocop-factory_bot (2.28.0)
|
||||
lint_roller (~> 1.1)
|
||||
rubocop (~> 1.72, >= 1.72.1)
|
||||
rubocop-rails (2.35.5)
|
||||
activesupport (>= 4.2.0)
|
||||
lint_roller (~> 1.1)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.75.0, < 2.0)
|
||||
rubocop-ast (>= 1.44.0, < 2.0)
|
||||
rubocop-rspec (3.10.2)
|
||||
lint_roller (~> 1.1)
|
||||
regexp_parser (>= 2.0)
|
||||
rubocop (~> 1.86, >= 1.86.2)
|
||||
rubocop-rspec_rails (2.32.0)
|
||||
lint_roller (~> 1.1)
|
||||
rubocop (~> 1.72, >= 1.72.1)
|
||||
rubocop-rspec (~> 3.5)
|
||||
ruby-progressbar (1.13.0)
|
||||
securerandom (0.4.1)
|
||||
syntax_tree (6.3.0)
|
||||
prettier_print (>= 1.2.0)
|
||||
tzinfo (2.0.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
unicode-display_width (3.2.0)
|
||||
unicode-emoji (~> 4.1)
|
||||
unicode-emoji (4.2.0)
|
||||
uri (1.1.1)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
rubocop-discourse
|
||||
syntax_tree
|
||||
|
||||
BUNDLED WITH
|
||||
4.0.15
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Civilized Discourse Construction Kit, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,5 @@
|
||||
# **Plugin Name** Plugin
|
||||
|
||||
**Plugin Summary**
|
||||
|
||||
For more information, please see: **url to meta topic**
|
||||
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ::MyPluginModule
|
||||
class ExamplesController < ::ApplicationController
|
||||
requires_plugin PLUGIN_NAME
|
||||
|
||||
def index
|
||||
render json: { hello: "world" }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
en:
|
||||
admin_js:
|
||||
admin:
|
||||
site_settings:
|
||||
categories:
|
||||
TODO_plugin_name: "Plugin Name"
|
||||
js:
|
||||
discourse_plugin_name:
|
||||
placeholder: placeholder
|
||||
@@ -0,0 +1 @@
|
||||
en:
|
||||
@@ -0,0 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
MyPluginModule::Engine.routes.draw do
|
||||
get "/examples" => "examples#index"
|
||||
# define routes here
|
||||
end
|
||||
|
||||
Discourse::Application.routes.draw { mount ::MyPluginModule::Engine, at: "my-plugin" }
|
||||
@@ -0,0 +1,4 @@
|
||||
TODO_plugin_name:
|
||||
plugin_name_enabled:
|
||||
default: false
|
||||
client: true
|
||||
@@ -0,0 +1,3 @@
|
||||
import DiscourseRecommended from "@discourse/lint-configs/eslint";
|
||||
|
||||
export default [...DiscourseRecommended];
|
||||
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ::MyPluginModule
|
||||
class Engine < ::Rails::Engine
|
||||
engine_name PLUGIN_NAME
|
||||
isolate_namespace MyPluginModule
|
||||
config.autoload_paths << File.join(config.root, "lib")
|
||||
scheduled_job_dir = "#{config.root}/app/jobs/scheduled"
|
||||
config.to_prepare do
|
||||
Rails.autoloaders.main.eager_load_dir(scheduled_job_dir) if Dir.exist?(scheduled_job_dir)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@discourse/lint-configs": "3.2.0",
|
||||
"@glint/ember-tsc": "1.8.11",
|
||||
"concurrently": "^9.2.3",
|
||||
"discourse": "npm:@discourse/types@2026.3.0-d02b2966",
|
||||
"eslint": "10.6.0",
|
||||
"lint-to-the-future": "^2.6.4",
|
||||
"lint-to-the-future-eslint": "^3.3.0",
|
||||
"prettier": "3.8.1",
|
||||
"stylelint": "17.5.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
|
||||
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"",
|
||||
"lint:css": "pnpm stylelint 'assets/stylesheets/**/*.scss' --allow-empty-input",
|
||||
"lint:css:fix": "pnpm stylelint 'assets/stylesheets/**/*.scss' --fix --allow-empty-input",
|
||||
"lint:js": "eslint {assets,admin/assets,test}/javascripts --cache --no-error-on-unmatched-pattern",
|
||||
"lint:js:fix": "eslint {assets,admin/assets,test}/javascripts --fix --no-error-on-unmatched-pattern",
|
||||
"lint:prettier": "pnpm prettier 'assets/stylesheets/**/*.scss' '{assets,admin/assets,test}/javascripts/**/*.{js,gjs,ts,gts,mts,cts}' --check --no-error-on-unmatched-pattern",
|
||||
"lint:prettier:fix": "pnpm prettier 'assets/stylesheets/**/*.scss' '{assets,admin/assets,test}/javascripts/**/*.{js,gjs,ts,gts,mts,cts}' -w --no-error-on-unmatched-pattern",
|
||||
"lint:types": "ember-tsc -b",
|
||||
"lttf:ignore": "lint-to-the-future ignore",
|
||||
"update-skeleton": "pnpx @discourse/update-skeleton@latest"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 22",
|
||||
"npm": "please-use-pnpm",
|
||||
"yarn": "please-use-pnpm",
|
||||
"pnpm": "^10"
|
||||
},
|
||||
"packageManager": "pnpm@10.28.0"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# name: discourse-plugin-name
|
||||
# about: TODO
|
||||
# meta_topic_id: TODO
|
||||
# version: 0.0.1
|
||||
# authors: Discourse
|
||||
# url: TODO
|
||||
# required_version: 2.7.0
|
||||
|
||||
enabled_site_setting :plugin_name_enabled
|
||||
|
||||
module ::MyPluginModule
|
||||
PLUGIN_NAME = "discourse-plugin-name"
|
||||
end
|
||||
|
||||
require_relative "lib/my_plugin_module/engine"
|
||||
|
||||
after_initialize do
|
||||
# Code which should run after Rails has finished booting
|
||||
end
|
||||
Generated
+3639
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Parts of the core features examples can be skipped like so:
|
||||
# it_behaves_like "having working core features", skip_examples: %i[login likes]
|
||||
#
|
||||
# List of keywords for skipping examples:
|
||||
# login, likes, profile, topics, topics:read, topics:reply, topics:create,
|
||||
# search, search:quick_search, search:full_page
|
||||
#
|
||||
# For more details, see https://meta.discourse.org/t/-/361381
|
||||
RSpec.describe "Core features" do
|
||||
before { enable_current_plugin }
|
||||
|
||||
it_behaves_like "having working core features"
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
extends: ["@discourse/lint-configs/stylelint"],
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"extends": "discourse/tsconfig-plugin",
|
||||
"include": [
|
||||
"admin/assets/javascripts/**/*",
|
||||
"assets/javascripts/**/*",
|
||||
"test/javascripts/**/*",
|
||||
"node_modules/discourse/declarations/**/*"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
"discourse/plugins/discourse-plugin-skeleton/*": [
|
||||
"./assets/javascripts/*"
|
||||
],
|
||||
"discourse/plugins/discourse-plugin-skeleton/admin/*": [
|
||||
"./admin/assets/javascripts/admin/*"
|
||||
],
|
||||
"admin/*": ["./node_modules/discourse/declarations/admin/*"],
|
||||
"float-kit/*": ["./node_modules/discourse/declarations/float-kit/*"],
|
||||
"select-kit/*": ["./node_modules/discourse/declarations/select-kit/*"],
|
||||
"truth-helpers": [
|
||||
"./node_modules/discourse/declarations/truth-helpers/index.d.ts"
|
||||
],
|
||||
"truth-helpers/*": [
|
||||
"./node_modules/discourse/declarations/truth-helpers/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user