mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 13:09:18 +08:00
This reverts commit 49a1e1cd0e
.
Is causing issues in prod-adjacent environments (Jenkins)
This commit is contained in:
parent
49a1e1cd0e
commit
43e0025141
6
.github/workflows/licenses.yml
vendored
6
.github/workflows/licenses.yml
vendored
|
@ -79,3 +79,9 @@ jobs:
|
|||
yarn global add licensee
|
||||
yarn global upgrade licensee
|
||||
licensee --errors-only
|
||||
|
||||
- name: Check Ember CLI Workspace Licenses
|
||||
if: ${{ !cancelled() }}
|
||||
working-directory: ./app/assets/javascripts
|
||||
run: |
|
||||
licensee --errors-only
|
||||
|
|
|
@ -5,32 +5,14 @@
|
|||
"CC0-1.0",
|
||||
"CC-BY-3.0",
|
||||
"CC-BY-4.0",
|
||||
"Apache-2.0 WITH LLVM-exception",
|
||||
"ISC"
|
||||
"Apache-2.0 WITH LLVM-exception"
|
||||
]
|
||||
},
|
||||
"packages": {
|
||||
"@fortawesome/fontawesome-free": "*",
|
||||
"component-bind": "1.0.0",
|
||||
"component-inherit": "0.0.3",
|
||||
"duplex": "1.0.0",
|
||||
"ember-template-lint-plugin-discourse": "*",
|
||||
"glob": "3.1.21",
|
||||
"indexof": "0.0.1",
|
||||
"inherits": "1.0.2",
|
||||
"jsonify": "0.0.0",
|
||||
"line-stream": "0.0.0",
|
||||
"messageformat": "0.1.5",
|
||||
"regenerator-transform": "0.10.1",
|
||||
"source-map": "0.1.43",
|
||||
"sourcemap-validator": "1.1.1",
|
||||
"squoosh": "2.0.0",
|
||||
"taffydb": "2.6.2"
|
||||
},
|
||||
"corrections": true,
|
||||
"ignore": [
|
||||
{
|
||||
"author": "Discourse"
|
||||
}
|
||||
]
|
||||
"corrections": true
|
||||
}
|
32
app/assets/javascripts/.licensee.json
Normal file
32
app/assets/javascripts/.licensee.json
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"licenses": {
|
||||
"blueOak": "bronze",
|
||||
"spdx": [
|
||||
"CC0-1.0",
|
||||
"CC-BY-3.0",
|
||||
"CC-BY-4.0",
|
||||
"Apache-2.0 WITH LLVM-exception",
|
||||
"ISC"
|
||||
]
|
||||
},
|
||||
"packages": {
|
||||
"component-bind": "1.0.0",
|
||||
"component-inherit": "0.0.3",
|
||||
"duplex": "1.0.0",
|
||||
"glob": "3.1.21",
|
||||
"indexof": "0.0.1",
|
||||
"inherits": "1.0.2",
|
||||
"jsonify": "0.0.0",
|
||||
"messageformat": "0.1.5",
|
||||
"line-stream": "0.0.0",
|
||||
"regenerator-transform": "0.10.1",
|
||||
"source-map": "0.1.43",
|
||||
"sourcemap-validator": "1.1.1"
|
||||
},
|
||||
"corrections": true,
|
||||
"ignore": [
|
||||
{
|
||||
"author": "Discourse"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -18,7 +18,7 @@ module.exports = function prettyTextEngine(app) {
|
|||
|
||||
const engineTree = babelAddon.transpileTree(namespacedTree);
|
||||
|
||||
let markdownIt = funnel("../../../../node_modules/markdown-it/dist", {
|
||||
let markdownIt = funnel("../node_modules/markdown-it/dist", {
|
||||
files: ["markdown-it.js"],
|
||||
});
|
||||
return concat(mergeTrees([engineTree, markdownIt]), {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"build": "ember build",
|
||||
"start": "ember serve",
|
||||
"test": "ember test",
|
||||
"postinstall": "yarn --silent --cwd ../../../.. patch-package --patch-dir app/assets/javascripts/patches"
|
||||
"postinstall": "yarn --silent --cwd .. patch-package"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.21.4",
|
||||
|
@ -103,11 +103,6 @@
|
|||
"wizard": "1.0.0",
|
||||
"xss": "^1.0.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ember-cached-decorator-polyfill": "^1.0.1",
|
||||
"ember-cli-deprecation-workflow": "^2.1.0",
|
||||
"ember-exam": "^8.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "16.* || >= 18",
|
||||
"npm": "please-use-yarn",
|
||||
|
@ -115,5 +110,10 @@
|
|||
},
|
||||
"ember": {
|
||||
"edition": "default"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ember-cached-decorator-polyfill": "^1.0.1",
|
||||
"ember-cli-deprecation-workflow": "^2.1.0",
|
||||
"ember-exam": "^8.0.0"
|
||||
}
|
||||
}
|
||||
|
|
34
app/assets/javascripts/package.json
Normal file
34
app/assets/javascripts/package.json
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"postinstall": "patch-package"
|
||||
},
|
||||
"workspaces": [
|
||||
"admin",
|
||||
"bootstrap-json",
|
||||
"dialog-holder",
|
||||
"discourse",
|
||||
"discourse-common",
|
||||
"discourse-hbr",
|
||||
"discourse-plugins",
|
||||
"discourse-widget-hbs",
|
||||
"ember-cli-progress-ci",
|
||||
"ember-production-deprecations",
|
||||
"pretty-text",
|
||||
"select-kit",
|
||||
"truth-helpers",
|
||||
"wizard"
|
||||
],
|
||||
"resolutions": {
|
||||
"**/babel-plugin-debug-macros": "npm:@discourse/babel-plugin-debug-macros@0.4.0-pre1",
|
||||
"**/babel-plugin-ember-template-compilation": "2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"patch-package": "^6.5.1",
|
||||
"postinstall-postinstall": "^2.1.0"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"notes": {
|
||||
"deps vs devDeps": "this project doesn't use dev dependencies when building the app, so all dependencies affecting the build of the UI (ember-cli, webpack, etc), need to be in 'dependencies', not 'devDependencies' (yarn install --production is used)"
|
||||
}
|
||||
}
|
9989
app/assets/javascripts/yarn.lock
Normal file
9989
app/assets/javascripts/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -27,7 +27,7 @@
|
|||
<meta name="discourse/config/environment" content="<%=u discourse_config_environment(testing: true) %>" />
|
||||
|
||||
<style>
|
||||
<%= File.read("#{Rails.root}/node_modules/qunit/qunit/qunit.css").html_safe %>
|
||||
<%= File.read("#{Rails.root}/app/assets/javascripts/node_modules/qunit/qunit/qunit.css").html_safe %>
|
||||
</style>
|
||||
|
||||
<%= discourse_stylesheet_link_tag(:desktop, theme_id: nil) %>
|
||||
|
|
|
@ -106,7 +106,7 @@ class DiscourseJsProcessor
|
|||
end
|
||||
|
||||
def self.load_file_in_context(ctx, path, wrap_in_module: nil)
|
||||
contents = File.read(path)
|
||||
contents = File.read("#{Rails.root}/app/assets/javascripts/#{path}")
|
||||
contents = <<~JS if wrap_in_module
|
||||
define(#{wrap_in_module.to_json}, ["exports", "require", "module"], function(exports, require, module){
|
||||
#{contents}
|
||||
|
@ -134,10 +134,10 @@ class DiscourseJsProcessor
|
|||
JS
|
||||
|
||||
# define/require support
|
||||
load_file_in_context(ctx, "#{Rails.root}/node_modules/loader.js/dist/loader/loader.js")
|
||||
load_file_in_context(ctx, "node_modules/loader.js/dist/loader/loader.js")
|
||||
|
||||
# Babel
|
||||
load_file_in_context(ctx, "#{Rails.root}/node_modules/@babel/standalone/babel.js")
|
||||
load_file_in_context(ctx, "node_modules/@babel/standalone/babel.js")
|
||||
ctx.eval <<~JS
|
||||
globalThis.rawBabelTransform = function(){
|
||||
return Babel.transform(...arguments).code;
|
||||
|
@ -145,42 +145,39 @@ class DiscourseJsProcessor
|
|||
JS
|
||||
|
||||
# Terser
|
||||
load_file_in_context(ctx, "#{Rails.root}/node_modules/source-map/dist/source-map.js")
|
||||
load_file_in_context(ctx, "#{Rails.root}/node_modules/terser/dist/bundle.min.js")
|
||||
load_file_in_context(ctx, "node_modules/source-map/dist/source-map.js")
|
||||
load_file_in_context(ctx, "node_modules/terser/dist/bundle.min.js")
|
||||
|
||||
# Template Compiler
|
||||
load_file_in_context(ctx, "node_modules/ember-source/dist/ember-template-compiler.js")
|
||||
load_file_in_context(
|
||||
ctx,
|
||||
"#{Rails.root}/node_modules/ember-source/dist/ember-template-compiler.js",
|
||||
)
|
||||
load_file_in_context(
|
||||
ctx,
|
||||
"#{Rails.root}/node_modules/babel-plugin-ember-template-compilation/src/plugin.js",
|
||||
"node_modules/babel-plugin-ember-template-compilation/src/plugin.js",
|
||||
wrap_in_module: "babel-plugin-ember-template-compilation/index",
|
||||
)
|
||||
load_file_in_context(
|
||||
ctx,
|
||||
"#{Rails.root}/node_modules/babel-plugin-ember-template-compilation/src/expression-parser.js",
|
||||
"node_modules/babel-plugin-ember-template-compilation/src/expression-parser.js",
|
||||
wrap_in_module: "babel-plugin-ember-template-compilation/expression-parser",
|
||||
)
|
||||
load_file_in_context(
|
||||
ctx,
|
||||
"#{Rails.root}/node_modules/babel-plugin-ember-template-compilation/src/js-utils.js",
|
||||
"node_modules/babel-plugin-ember-template-compilation/src/js-utils.js",
|
||||
wrap_in_module: "babel-plugin-ember-template-compilation/js-utils",
|
||||
)
|
||||
load_file_in_context(
|
||||
ctx,
|
||||
"#{Rails.root}/node_modules/babel-plugin-ember-template-compilation/src/public-types.js",
|
||||
"node_modules/babel-plugin-ember-template-compilation/src/public-types.js",
|
||||
wrap_in_module: "babel-plugin-ember-template-compilation/public-types",
|
||||
)
|
||||
load_file_in_context(
|
||||
ctx,
|
||||
"#{Rails.root}/node_modules/babel-import-util/src/index.js",
|
||||
"node_modules/babel-import-util/src/index.js",
|
||||
wrap_in_module: "babel-import-util",
|
||||
)
|
||||
load_file_in_context(
|
||||
ctx,
|
||||
"#{Rails.root}/node_modules/ember-cli-htmlbars/lib/colocated-babel-plugin.js",
|
||||
"node_modules/ember-cli-htmlbars/lib/colocated-babel-plugin.js",
|
||||
wrap_in_module: "colocated-babel-plugin",
|
||||
)
|
||||
|
||||
|
@ -205,7 +202,7 @@ class DiscourseJsProcessor
|
|||
# Raw HBS compiler
|
||||
load_file_in_context(
|
||||
ctx,
|
||||
"#{Rails.root}/node_modules/handlebars/dist/handlebars.js",
|
||||
"node_modules/handlebars/dist/handlebars.js",
|
||||
wrap_in_module: "handlebars",
|
||||
)
|
||||
|
||||
|
@ -229,7 +226,7 @@ class DiscourseJsProcessor
|
|||
# Theme template AST transformation plugins
|
||||
load_file_in_context(
|
||||
ctx,
|
||||
"#{Rails.root}/app/assets/javascripts/discourse-js-processor.js",
|
||||
"discourse-js-processor.js",
|
||||
wrap_in_module: "discourse-js-processor",
|
||||
)
|
||||
|
||||
|
|
|
@ -31,7 +31,9 @@ module EmberCli
|
|||
return @@chunk_infos if defined?(@@chunk_infos)
|
||||
|
||||
raw_chunk_infos =
|
||||
JSON.parse(File.read("#{Rails.root}/app/assets/javascripts/discourse/dist/chunks.json"))
|
||||
JSON.parse(
|
||||
File.read("#{Rails.configuration.root}/app/assets/javascripts/discourse/dist/chunks.json"),
|
||||
)
|
||||
|
||||
chunk_infos =
|
||||
raw_chunk_infos["scripts"]
|
||||
|
@ -55,7 +57,8 @@ module EmberCli
|
|||
def self.ember_version
|
||||
@version ||=
|
||||
begin
|
||||
ember_source_package_raw = File.read("#{Rails.root}/node_modules/ember-source/package.json")
|
||||
ember_source_package_raw =
|
||||
File.read("#{Rails.root}/app/assets/javascripts/node_modules/ember-source/package.json")
|
||||
JSON.parse(ember_source_package_raw)["version"]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -91,22 +91,22 @@ module PrettyText
|
|||
ctx.attach("__helpers.#{method}", PrettyText::Helpers.method(method))
|
||||
end
|
||||
|
||||
workspace_path = "#{Rails.root}/app/assets/javascripts/"
|
||||
ctx.load("#{Rails.root}/node_modules/loader.js/dist/loader/loader.js")
|
||||
ctx.load("#{workspace_path}handlebars-shim.js")
|
||||
ctx.load("#{Rails.root}/node_modules/xss/dist/xss.js")
|
||||
root_path = "#{Rails.root}/app/assets/javascripts/"
|
||||
ctx_load(ctx, "#{root_path}/node_modules/loader.js/dist/loader/loader.js")
|
||||
ctx_load(ctx, "#{root_path}/handlebars-shim.js")
|
||||
ctx_load(ctx, "#{root_path}/node_modules/xss/dist/xss.js")
|
||||
ctx.load("#{Rails.root}/lib/pretty_text/vendor-shims.js")
|
||||
ctx_load_directory(ctx, "pretty-text/addon")
|
||||
ctx_load_directory(ctx, "pretty-text/engines/discourse-markdown")
|
||||
ctx.load("#{Rails.root}/node_modules/markdown-it/dist/markdown-it.js")
|
||||
ctx_load(ctx, "#{root_path}/node_modules/markdown-it/dist/markdown-it.js")
|
||||
|
||||
apply_es6_file(ctx, workspace_path, "discourse-common/addon/lib/get-url")
|
||||
apply_es6_file(ctx, workspace_path, "discourse-common/addon/lib/object")
|
||||
apply_es6_file(ctx, workspace_path, "discourse-common/addon/lib/deprecated")
|
||||
apply_es6_file(ctx, workspace_path, "discourse-common/addon/lib/escape")
|
||||
apply_es6_file(ctx, workspace_path, "discourse-common/addon/utils/watched-words")
|
||||
apply_es6_file(ctx, workspace_path, "discourse/app/lib/to-markdown")
|
||||
apply_es6_file(ctx, workspace_path, "discourse/app/lib/utilities")
|
||||
apply_es6_file(ctx, root_path, "discourse-common/addon/lib/get-url")
|
||||
apply_es6_file(ctx, root_path, "discourse-common/addon/lib/object")
|
||||
apply_es6_file(ctx, root_path, "discourse-common/addon/lib/deprecated")
|
||||
apply_es6_file(ctx, root_path, "discourse-common/addon/lib/escape")
|
||||
apply_es6_file(ctx, root_path, "discourse-common/addon/utils/watched-words")
|
||||
apply_es6_file(ctx, root_path, "discourse/app/lib/to-markdown")
|
||||
apply_es6_file(ctx, root_path, "discourse/app/lib/utilities")
|
||||
|
||||
ctx.load("#{Rails.root}/lib/pretty_text/shims.js")
|
||||
ctx.eval("__setUnicode(#{Emoji.unicode_replacements_json})")
|
||||
|
@ -664,7 +664,7 @@ module PrettyText
|
|||
end
|
||||
|
||||
def self.ctx_load(ctx, *files)
|
||||
files.each { |file| ctx.load(file) }
|
||||
files.each { |file| ctx.load(app_root + file) }
|
||||
end
|
||||
|
||||
private
|
||||
|
|
30
package.json
30
package.json
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"name": "discourse",
|
||||
"version": "1.0.0",
|
||||
"repository": "https://github.com/discourse/discourse",
|
||||
"main": "index.js",
|
||||
"repository": "git@github.com:discourse/discourse.git",
|
||||
"author": "Discourse",
|
||||
"license": "GPL-2.0-only",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@discourse/moment-timezone-names-translations": "^1.0.0",
|
||||
"@fortawesome/fontawesome-free": "5.15.4",
|
||||
|
@ -18,9 +18,7 @@
|
|||
"magnific-popup": "1.1.0",
|
||||
"moment": "2.29.4",
|
||||
"moment-timezone": "0.5.39",
|
||||
"patch-package": "^6.5.1",
|
||||
"pikaday": "1.8.2",
|
||||
"postinstall-postinstall": "^2.1.0",
|
||||
"squoosh": "discourse/squoosh#dc9649d",
|
||||
"workbox-cacheable-response": "^4.3.1",
|
||||
"workbox-core": "^4.3.1",
|
||||
|
@ -60,29 +58,7 @@
|
|||
"lttf:ignore": "lint-to-the-future ignore",
|
||||
"lttf:output": "lint-to-the-future output -o ./lint-progress/",
|
||||
"lint-progress": "yarn lttf:output && npx html-pages ./lint-progress --no-cache",
|
||||
"postinstall": "patch-package --patch-dir app/assets/javascripts/patches"
|
||||
},
|
||||
"workspaces": [
|
||||
"app/assets/javascripts/admin",
|
||||
"app/assets/javascripts/bootstrap-json",
|
||||
"app/assets/javascripts/dialog-holder",
|
||||
"app/assets/javascripts/discourse",
|
||||
"app/assets/javascripts/discourse-common",
|
||||
"app/assets/javascripts/discourse-hbr",
|
||||
"app/assets/javascripts/discourse-plugins",
|
||||
"app/assets/javascripts/discourse-widget-hbs",
|
||||
"app/assets/javascripts/ember-cli-progress-ci",
|
||||
"app/assets/javascripts/ember-production-deprecations",
|
||||
"app/assets/javascripts/pretty-text",
|
||||
"app/assets/javascripts/select-kit",
|
||||
"app/assets/javascripts/truth-helpers",
|
||||
"app/assets/javascripts/wizard"
|
||||
],
|
||||
"resolutions": {
|
||||
"**/babel-plugin-debug-macros": "npm:@discourse/babel-plugin-debug-macros@0.4.0-pre1",
|
||||
"**/babel-plugin-ember-template-compilation": "2.0.0",
|
||||
"**/markdown-it": "13.0.1",
|
||||
"**/prettier": "2.7.1"
|
||||
"postinstall": "yarn --cwd app/assets/javascripts $(node -e 'if(JSON.parse(process.env.npm_config_argv).original.includes(`--frozen-lockfile`)){console.log(`--frozen-lockfile`)}')"
|
||||
},
|
||||
"engines": {
|
||||
"node": "16.* || >= 18",
|
||||
|
|
|
@ -151,7 +151,11 @@ RSpec.describe DiscourseJsProcessor do
|
|||
|
||||
let(:mini_racer) do
|
||||
ctx = MiniRacer::Context.new
|
||||
ctx.eval(File.open("#{Rails.root}/node_modules/handlebars/dist/handlebars.js").read)
|
||||
ctx.eval(
|
||||
File.open(
|
||||
"#{Rails.root}/app/assets/javascripts/node_modules/handlebars/dist/handlebars.js",
|
||||
).read,
|
||||
)
|
||||
ctx.eval(helpers)
|
||||
ctx
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user