Compare commits

...
This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.

30 Commits
main ... a-pnpm

Author SHA1 Message Date
Jarek Radosz
72971f1901
Workspace and lock 2022-11-16 23:52:32 +01:00
Jarek Radosz
6b6ae207b8
Merge branch 'main' into a-pnpm
# Conflicts:
#	app/assets/javascripts/bootstrap-json/package.json
#	app/assets/javascripts/dialog-holder/yarn.lock
#	app/assets/javascripts/discourse/package.json
#	app/assets/javascripts/package.json
#	app/assets/javascripts/yarn.lock
#	yarn.lock
2022-11-16 23:51:52 +01:00
Jarek Radosz
a31b572b79
Merge branch 'main' into a-pnpm
# Conflicts:
#	app/assets/javascripts/bootstrap-json/.npmrc
2022-11-16 11:14:14 +01:00
Jarek Radosz
576c0dfc51
Lock 🥲 2022-11-16 11:12:32 +01:00
Jarek Radosz
9b3a3a2e03
Merge branch 'main' into a-pnpm
# Conflicts:
#	app/assets/javascripts/yarn.lock
2022-11-16 11:06:16 +01:00
Jarek Radosz
a35498c84a
Add ember-template-lint-plugin-discourse 2022-11-16 11:01:21 +01:00
Jarek Radosz
ad9e6954b6
Licensee again 2022-11-16 10:54:07 +01:00
Jarek Radosz
bbf674e36f
Merge branch 'main' into a-pnpm
# Conflicts:
#	app/assets/javascripts/discourse/testem.js
2022-11-16 10:48:08 +01:00
Jarek Radosz
36ec2d2a93
temp licensee config change 2022-11-16 10:46:42 +01:00
Jarek Radosz
86439fdac1
Revert "Try exec?"
This reverts commit 9aaf1eb10c.
2022-11-16 10:35:59 +01:00
Jarek Radosz
62b9e18ab7
Add deps 2022-11-16 10:35:41 +01:00
Jarek Radosz
ed83e12e9e
Lockfile 2022-11-16 10:09:49 +01:00
Jarek Radosz
c5d7da2ff6
Merge branch 'main' into a-pnpm
# Conflicts:
#	app/assets/javascripts/admin/package.json
#	app/assets/javascripts/discourse-common/package.json
#	app/assets/javascripts/discourse-hbr/package.json
#	app/assets/javascripts/discourse-plugins/package.json
#	app/assets/javascripts/discourse-widget-hbs/package.json
#	app/assets/javascripts/discourse/package.json
#	app/assets/javascripts/pretty-text/package.json
#	app/assets/javascripts/select-kit/package.json
#	app/assets/javascripts/truth-helpers/package.json
#	app/assets/javascripts/wizard/package.json
#	app/assets/javascripts/yarn.lock
2022-11-16 10:09:45 +01:00
Jarek Radosz
123658c422
Use the licensee.js fix 2022-11-16 10:04:25 +01:00
Jarek Radosz
9aaf1eb10c
Try exec? 2022-11-16 09:53:30 +01:00
Jarek Radosz
6601069f77
port the import fix 2022-11-16 01:22:52 +01:00
Jarek Radosz
c8f22aa7f8
Lost terser dep in the merge 2022-11-16 01:19:38 +01:00
Jarek Radosz
8a5935129c
Update lockfiles 2022-11-16 01:14:11 +01:00
Jarek Radosz
5b5a4e1fe2
Merge branch 'main' into a-pnpm
# Conflicts:
#	.github/workflows/licenses.yml
#	.github/workflows/linting.yml
#	.github/workflows/tests.yml
#	app/assets/javascripts/discourse-common/package.json
#	app/assets/javascripts/discourse/lib/dialog-holder/yarn.lock
#	app/assets/javascripts/discourse/package.json
#	app/assets/javascripts/yarn.lock
#	lib/tasks/assets.rake
#	yarn.lock
2022-11-16 01:10:33 +01:00
Jarek Radosz
07cb74f314
Use pnpm from the docker image 2022-11-16 01:00:46 +01:00
Jarek Radosz
dedab341a1
Use a specific version of terser 2022-11-04 01:27:09 +01:00
Jarek Radosz
fb9a81126b
Fix theme_js spec 2022-11-04 01:22:10 +01:00
Jarek Radosz
e184d2ab29
Use a very specific source-map version 2022-11-04 01:20:10 +01:00
Jarek Radosz
f42a57a358
Fix build commands 2022-11-04 00:59:40 +01:00
Jarek Radosz
d8c4912aec
Move stuff, fix missing dep declarations 2022-11-04 00:48:45 +01:00
Jarek Radosz
be785a4c3f
Revert "When all fails, try sudo"
This reverts commit 3c86a8a10f.
2022-11-04 00:16:56 +01:00
Jarek Radosz
3c86a8a10f
When all fails, try sudo 2022-11-04 00:13:30 +01:00
Jarek Radosz
2b396cdb2c
Fix raw node_modules paths 2022-11-04 00:05:55 +01:00
Jarek Radosz
a9cb77f687
try npm install 2022-11-03 23:40:19 +01:00
Jarek Radosz
2b7c47a25f
DEV: Use pnpm instead of yarn v1 2022-11-03 23:35:24 +01:00
48 changed files with 15411 additions and 18149 deletions

View File

@ -50,18 +50,18 @@ jobs:
run: |
gem install licensed
- name: Get yarn cache directory
id: yarn-cache-dir
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Get pnpm cache directory
id: node-cache-dir
run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Yarn cache
- name: Node cache
uses: actions/cache@v3
id: yarn-cache
id: node-cache
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.node-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-node-
- name: Check RubyGems Licenses
if: ${{ !cancelled() }}
@ -69,18 +69,16 @@ jobs:
licensed cache
licensed status
- name: Yarn install
run: yarn install
- name: pnpm install
run: pnpm install
- name: Check Yarn Licenses
- name: Check Node Licenses
if: ${{ !cancelled() }}
run: |
yarn global add licensee
yarn global upgrade licensee
licensee --errors-only
pnpm --package=CvX/licensee.js#pnpm dlx licensee --errors-only
- name: Check Ember CLI Workspace Licenses
if: ${{ !cancelled() }}
working-directory: ./app/assets/javascripts
run: |
licensee --errors-only
pnpm --package=CvX/licensee.js#pnpm dlx licensee --errors-only

View File

@ -47,21 +47,21 @@ jobs:
bundle install --jobs 4
bundle clean
- name: Get yarn cache directory
id: yarn-cache-dir
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Get pnpm cache directory
id: node-cache-dir
run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Yarn cache
- name: Node cache
uses: actions/cache@v3
id: yarn-cache
id: node-cache
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.node-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-node-
- name: Yarn install
run: yarn install
- name: pnpm install
run: pnpm install
- name: Rubocop
if: ${{ !cancelled() }}
@ -69,17 +69,17 @@ jobs:
- name: ESLint (core)
if: ${{ !cancelled() }}
run: yarn eslint app/assets/javascripts
run: pnpm eslint app/assets/javascripts
- name: ESLint (core plugins)
if: ${{ !cancelled() }}
run: yarn eslint plugins
run: pnpm eslint plugins
- name: Prettier
if: ${{ !cancelled() }}
run: |
yarn prettier -v
yarn pprettier --list-different \
pnpm prettier -v
pnpm pprettier --list-different \
"app/assets/stylesheets/**/*.scss" \
"app/assets/javascripts/**/*.js" \
"plugins/**/assets/stylesheets/**/*.scss" \
@ -88,7 +88,7 @@ jobs:
- name: Ember template lint
if: ${{ !cancelled() }}
run: |
yarn ember-template-lint \
pnpm ember-template-lint \
--no-error-on-unmatched-pattern \
"app/assets/javascripts/**/*.hbs" \
"plugins/**/assets/javascripts/**/*.hbs"

View File

@ -79,21 +79,21 @@ jobs:
bundle install --jobs 4
bundle clean
- name: Get yarn cache directory
id: yarn-cache-dir
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Get pnpm cache directory
id: node-cache-dir
run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Yarn cache
- name: Node cache
uses: actions/cache@v3
id: yarn-cache
id: node-cache
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.node-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-node-
- name: Yarn install
run: yarn install
- name: pnpm install
run: pnpm install
- name: Checkout official plugins
if: matrix.target == 'plugins'
@ -230,32 +230,32 @@ jobs:
git config --global user.email "ci@ci.invalid"
git config --global user.name "Discourse CI"
- name: Get yarn cache directory
id: yarn-cache-dir
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Get pnpm cache directory
id: node-cache-dir
run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Yarn cache
- name: Node cache
uses: actions/cache@v3
id: yarn-cache
id: node-cache
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.node-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-node-
- name: Yarn install
- name: pnpm install
working-directory: ./app/assets/javascripts/discourse
run: yarn install
run: pnpm install
- name: Ember Build
working-directory: ./app/assets/javascripts/discourse
run: |
mkdir /tmp/emberbuild
yarn ember build --environment=test -o /tmp/emberbuild
pnpm ember build --environment=test -o /tmp/emberbuild
- name: Core QUnit
working-directory: ./app/assets/javascripts/discourse
run: yarn ember exam --path /tmp/emberbuild --load-balance --parallel=5 --launch "${{ env.TESTEM_BROWSER }}" --write-execution-file --random
run: pnpm ember exam --path /tmp/emberbuild --load-balance --parallel=5 --launch "${{ env.TESTEM_BROWSER }}" --write-execution-file --random
timeout-minutes: 15
- uses: actions/upload-artifact@v3

View File

@ -6,7 +6,7 @@
{
"label": "Prepare discourse",
"type": "shell",
"command": "cd /home/discourse/workspace/discourse && bundle install && yarn && bin/rake db:migrate"
"command": "cd /home/discourse/workspace/discourse && bundle install && pnpm install && bin/rake db:migrate"
},
],
}

View File

@ -10,13 +10,14 @@
]
},
"packages": {
"cli-table": "0.3.11",
"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",
"jsonify": "0.0.1",
"messageformat": "0.1.5",
"line-stream": "0.0.0",
"regenerator-transform": "0.10.1",

View File

@ -40,9 +40,7 @@
"loader.js": "^4.7.0"
},
"engines": {
"node": "16.* || >= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
"node": "16.* || >= 18"
},
"ember": {
"edition": "default"

View File

@ -445,7 +445,7 @@ module.exports = {
Discourse can't be run without a \`--proxy\` setting, because it needs a Rails application
to serve API requests. For example:
yarn run ember serve --proxy "http://localhost:3000"\n`);
pnpm ember serve --proxy "http://localhost:3000"\n`);
throw "--proxy argument is required";
}

View File

@ -15,13 +15,11 @@
]
},
"engines": {
"node": "16.* || >= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
"node": "16.* || >= 18"
},
"dependencies": {
"clean-base-url": "^1.0.0",
"discourse-plugins": "1.0.0",
"discourse-plugins": "workspace:*",
"express": "^4.18.2",
"html-entities": "^2.3.3",
"jsdom": "^20.0.2",

File diff suppressed because it is too large Load Diff

View File

@ -1,119 +0,0 @@
"use strict";
const getChannelURL = require("ember-source-channel-url");
const { embroiderSafe, embroiderOptimized } = require("@embroider/test-setup");
module.exports = async function () {
return {
useYarn: true,
scenarios: [
{
name: "ember-lts-3.8",
npm: {
devDependencies: {
"ember-source": "~3.8.0",
},
},
},
{
name: "ember-lts-3.12",
npm: {
devDependencies: {
"ember-source": "~3.12.0",
},
},
},
{
name: "ember-lts-3.20",
npm: {
devDependencies: {
"ember-source": "~3.20.5",
},
},
},
{
name: "ember-lts-3.24",
npm: {
devDependencies: {
"ember-source": "~3.24.3",
},
},
},
{
name: "ember-lts-3.28",
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
},
},
{
name: "ember-release",
npm: {
devDependencies: {
"ember-source": await getChannelURL("release"),
},
},
},
{
name: "ember-beta",
npm: {
devDependencies: {
"ember-source": await getChannelURL("beta"),
},
},
},
{
name: "ember-canary",
npm: {
devDependencies: {
"ember-source": await getChannelURL("canary"),
},
},
},
// The default `.travis.yml` runs this scenario via `yarn test`,
// not via `ember try`. It's still included here so that running
// `ember try:each` manually or from a customized CI config will run it
// along with all the other scenarios.
{
name: "ember-default",
npm: {
devDependencies: {},
},
},
{
name: "ember-default-with-jquery",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"jquery-integration": true,
}),
},
npm: {
devDependencies: {
"@ember/jquery": "^0.5.1",
},
},
},
{
name: "ember-classic",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"application-template-wrapper": true,
"default-async-observers": false,
"template-only-glimmer-components": false,
}),
},
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
ember: {
edition: "classic",
},
},
},
embroiderSafe(),
embroiderOptimized(),
],
};
};

View File

@ -26,7 +26,7 @@
"ember-cli-htmlbars": "^6.1.1",
"ember-resolver": "^8.0.3",
"handlebars": "^4.7.0",
"truth-helpers": "1.0.0",
"truth-helpers": "workspace:*",
"webpack": "^5.75.0"
},
"devDependencies": {
@ -47,9 +47,7 @@
"loader.js": "^4.7.0"
},
"engines": {
"node": "16.* || >= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
"node": "16.* || >= 18"
},
"ember": {
"edition": "default"

View File

@ -1,119 +0,0 @@
"use strict";
const getChannelURL = require("ember-source-channel-url");
const { embroiderSafe, embroiderOptimized } = require("@embroider/test-setup");
module.exports = async function () {
return {
useYarn: true,
scenarios: [
{
name: "ember-lts-3.8",
npm: {
devDependencies: {
"ember-source": "~3.8.0",
},
},
},
{
name: "ember-lts-3.12",
npm: {
devDependencies: {
"ember-source": "~3.12.0",
},
},
},
{
name: "ember-lts-3.20",
npm: {
devDependencies: {
"ember-source": "~3.20.5",
},
},
},
{
name: "ember-lts-3.24",
npm: {
devDependencies: {
"ember-source": "~3.24.3",
},
},
},
{
name: "ember-lts-3.28",
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
},
},
{
name: "ember-release",
npm: {
devDependencies: {
"ember-source": await getChannelURL("release"),
},
},
},
{
name: "ember-beta",
npm: {
devDependencies: {
"ember-source": await getChannelURL("beta"),
},
},
},
{
name: "ember-canary",
npm: {
devDependencies: {
"ember-source": await getChannelURL("canary"),
},
},
},
// The default `.travis.yml` runs this scenario via `yarn test`,
// not via `ember try`. It's still included here so that running
// `ember try:each` manually or from a customized CI config will run it
// along with all the other scenarios.
{
name: "ember-default",
npm: {
devDependencies: {},
},
},
{
name: "ember-default-with-jquery",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"jquery-integration": true,
}),
},
npm: {
devDependencies: {
"@ember/jquery": "^0.5.1",
},
},
},
{
name: "ember-classic",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"application-template-wrapper": true,
"default-async-observers": false,
"template-only-glimmer-components": false,
}),
},
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
ember: {
edition: "classic",
},
},
},
embroiderSafe(),
embroiderOptimized(),
],
};
};

View File

@ -40,9 +40,7 @@
"loader.js": "^4.7.0"
},
"engines": {
"node": "16.* || >= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
"node": "16.* || >= 18"
},
"ember": {
"edition": "default"

View File

@ -9,7 +9,8 @@
],
"repository": "",
"dependencies": {
"discourse-widget-hbs": "1.0.0",
"discourse-hbr": "workspace:*",
"discourse-widget-hbs": "workspace:*",
"ember-auto-import": "^2.4.3",
"ember-cli": "~3.28.5",
"ember-cli-babel": "^7.26.10",
@ -20,9 +21,7 @@
"@babel/core": "^7.20.2"
},
"engines": {
"node": "16.* || >= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
"node": "16.* || >= 18"
},
"ember": {
"edition": "default"

View File

@ -1,119 +0,0 @@
"use strict";
const getChannelURL = require("ember-source-channel-url");
const { embroiderSafe, embroiderOptimized } = require("@embroider/test-setup");
module.exports = async function () {
return {
useYarn: true,
scenarios: [
{
name: "ember-lts-3.8",
npm: {
devDependencies: {
"ember-source": "~3.8.0",
},
},
},
{
name: "ember-lts-3.12",
npm: {
devDependencies: {
"ember-source": "~3.12.0",
},
},
},
{
name: "ember-lts-3.20",
npm: {
devDependencies: {
"ember-source": "~3.20.5",
},
},
},
{
name: "ember-lts-3.24",
npm: {
devDependencies: {
"ember-source": "~3.24.3",
},
},
},
{
name: "ember-lts-3.28",
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
},
},
{
name: "ember-release",
npm: {
devDependencies: {
"ember-source": await getChannelURL("release"),
},
},
},
{
name: "ember-beta",
npm: {
devDependencies: {
"ember-source": await getChannelURL("beta"),
},
},
},
{
name: "ember-canary",
npm: {
devDependencies: {
"ember-source": await getChannelURL("canary"),
},
},
},
// The default `.travis.yml` runs this scenario via `yarn test`,
// not via `ember try`. It's still included here so that running
// `ember try:each` manually or from a customized CI config will run it
// along with all the other scenarios.
{
name: "ember-default",
npm: {
devDependencies: {},
},
},
{
name: "ember-default-with-jquery",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"jquery-integration": true,
}),
},
npm: {
devDependencies: {
"@ember/jquery": "^0.5.1",
},
},
},
{
name: "ember-classic",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"application-template-wrapper": true,
"default-async-observers": false,
"template-only-glimmer-components": false,
}),
},
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
ember: {
edition: "classic",
},
},
},
embroiderSafe(),
embroiderOptimized(),
],
};
};

View File

@ -41,9 +41,7 @@
"loader.js": "^4.7.0"
},
"engines": {
"node": "16.* || >= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
"node": "16.* || >= 18"
},
"ember": {
"edition": "default"

View File

@ -18,9 +18,10 @@ module.exports = function prettyTextEngine(app) {
const engineTree = babelAddon.transpileTree(namespacedTree);
let markdownIt = funnel("../node_modules/markdown-it/dist", {
let markdownIt = funnel("../discourse/node_modules/markdown-it/dist", {
files: ["markdown-it.js"],
});
return concat(mergeTrees([engineTree, markdownIt]), {
inputFiles: ["**/*.js"],
outputFile: `assets/markdown-it-bundle.js`,

View File

@ -35,19 +35,19 @@
"@uppy/utils": "^4.1.0",
"@uppy/xhr-upload": "^2.1.2",
"a11y-dialog": "7.5.2",
"admin": "1.0.0",
"admin": "workspace:*",
"babel-import-util": "^1.2.2",
"babel-plugin-ember-template-compilation": "^1.0.2",
"bootstrap": "3.4.1",
"bootstrap-json": "1.0.0",
"bootstrap-json": "workspace:*",
"broccoli-asset-rev": "^3.0.0",
"deepmerge": "^4.2.2",
"dialog-holder": "1.0.0",
"discourse-common": "1.0.0",
"discourse-ensure-deprecation-order": "1.0.0",
"discourse-hbr": "1.0.0",
"discourse-plugins": "1.0.0",
"discourse-widget-hbs": "1.0.0",
"dialog-holder": "workspace:*",
"discourse-common": "workspace:*",
"discourse-ensure-deprecation-order": "workspace:*",
"discourse-hbr": "workspace:*",
"discourse-plugins": "workspace:*",
"discourse-widget-hbs": "workspace:*",
"ember-auto-import": "^2.4.3",
"ember-auto-import-chunks-json-generator": "^1.0.0",
"ember-buffered-proxy": "^2.1.1",
@ -82,24 +82,22 @@
"message-bus-client": "^4.2.0",
"messageformat": "0.1.5",
"pretender": "^3.4.7",
"pretty-text": "1.0.0",
"pretty-text": "workspace:*",
"qunit": "^2.19.3",
"qunit-dom": "^2.0.0",
"sass": "^1.56.1",
"select-kit": "1.0.0",
"select-kit": "workspace:*",
"sinon": "^14.0.2",
"source-map": "^0.6.1",
"terser": "5.10.0",
"tippy.js": "^6.3.7",
"virtual-dom": "^2.1.1",
"webpack": "^5.75.0",
"wizard": "1.0.0",
"wizard": "workspace:*",
"xss": "^1.0.14"
},
"engines": {
"node": "16.* || >= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
"node": "16.* || >= 18"
},
"ember": {
"edition": "default"

View File

@ -1,19 +0,0 @@
{
"private": true,
"workspaces": [
"admin",
"bootstrap-json",
"dialog-holder",
"discourse",
"discourse-common",
"discourse-ensure-deprecation-order",
"discourse-hbr",
"discourse-plugins",
"discourse-widget-hbs",
"ember-cli-progress-ci",
"pretty-text",
"select-kit",
"truth-helpers",
"wizard"
]
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
packages:
- "admin"
- "bootstrap-json"
- "dialog-holder"
- "discourse"
- "discourse-common"
- "discourse-ensure-deprecation-order"
- "discourse-hbr"
- "discourse-plugins"
- "discourse-widget-hbs"
- "ember-cli-progress-ci"
- "pretty-text"
- "select-kit"
- "truth-helpers"
- "wizard"

View File

@ -1,119 +0,0 @@
"use strict";
const getChannelURL = require("ember-source-channel-url");
const { embroiderSafe, embroiderOptimized } = require("@embroider/test-setup");
module.exports = async function () {
return {
useYarn: true,
scenarios: [
{
name: "ember-lts-3.8",
npm: {
devDependencies: {
"ember-source": "~3.8.0",
},
},
},
{
name: "ember-lts-3.12",
npm: {
devDependencies: {
"ember-source": "~3.12.0",
},
},
},
{
name: "ember-lts-3.20",
npm: {
devDependencies: {
"ember-source": "~3.20.5",
},
},
},
{
name: "ember-lts-3.24",
npm: {
devDependencies: {
"ember-source": "~3.24.3",
},
},
},
{
name: "ember-lts-3.28",
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
},
},
{
name: "ember-release",
npm: {
devDependencies: {
"ember-source": await getChannelURL("release"),
},
},
},
{
name: "ember-beta",
npm: {
devDependencies: {
"ember-source": await getChannelURL("beta"),
},
},
},
{
name: "ember-canary",
npm: {
devDependencies: {
"ember-source": await getChannelURL("canary"),
},
},
},
// The default `.travis.yml` runs this scenario via `yarn test`,
// not via `ember try`. It's still included here so that running
// `ember try:each` manually or from a customized CI config will run it
// along with all the other scenarios.
{
name: "ember-default",
npm: {
devDependencies: {},
},
},
{
name: "ember-default-with-jquery",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"jquery-integration": true,
}),
},
npm: {
devDependencies: {
"@ember/jquery": "^0.5.1",
},
},
},
{
name: "ember-classic",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"application-template-wrapper": true,
"default-async-observers": false,
"template-only-glimmer-components": false,
}),
},
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
ember: {
edition: "classic",
},
},
},
embroiderSafe(),
embroiderOptimized(),
],
};
};

View File

@ -40,9 +40,7 @@
"loader.js": "^4.7.0"
},
"engines": {
"node": "16.* || >= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
"node": "16.* || >= 18"
},
"ember": {
"edition": "default"

View File

@ -1,119 +0,0 @@
"use strict";
const getChannelURL = require("ember-source-channel-url");
const { embroiderSafe, embroiderOptimized } = require("@embroider/test-setup");
module.exports = async function () {
return {
useYarn: true,
scenarios: [
{
name: "ember-lts-3.8",
npm: {
devDependencies: {
"ember-source": "~3.8.0",
},
},
},
{
name: "ember-lts-3.12",
npm: {
devDependencies: {
"ember-source": "~3.12.0",
},
},
},
{
name: "ember-lts-3.20",
npm: {
devDependencies: {
"ember-source": "~3.20.5",
},
},
},
{
name: "ember-lts-3.24",
npm: {
devDependencies: {
"ember-source": "~3.24.3",
},
},
},
{
name: "ember-lts-3.28",
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
},
},
{
name: "ember-release",
npm: {
devDependencies: {
"ember-source": await getChannelURL("release"),
},
},
},
{
name: "ember-beta",
npm: {
devDependencies: {
"ember-source": await getChannelURL("beta"),
},
},
},
{
name: "ember-canary",
npm: {
devDependencies: {
"ember-source": await getChannelURL("canary"),
},
},
},
// The default `.travis.yml` runs this scenario via `yarn test`,
// not via `ember try`. It's still included here so that running
// `ember try:each` manually or from a customized CI config will run it
// along with all the other scenarios.
{
name: "ember-default",
npm: {
devDependencies: {},
},
},
{
name: "ember-default-with-jquery",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"jquery-integration": true,
}),
},
npm: {
devDependencies: {
"@ember/jquery": "^0.5.1",
},
},
},
{
name: "ember-classic",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"application-template-wrapper": true,
"default-async-observers": false,
"template-only-glimmer-components": false,
}),
},
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
ember: {
edition: "classic",
},
},
},
embroiderSafe(),
embroiderOptimized(),
],
};
};

View File

@ -39,9 +39,7 @@
"loader.js": "^4.7.0"
},
"engines": {
"node": "16.* || >= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
"node": "16.* || >= 18"
},
"ember": {
"edition": "default"

View File

@ -1,119 +0,0 @@
"use strict";
const getChannelURL = require("ember-source-channel-url");
const { embroiderSafe, embroiderOptimized } = require("@embroider/test-setup");
module.exports = async function () {
return {
useYarn: true,
scenarios: [
{
name: "ember-lts-3.24",
npm: {
devDependencies: {
"ember-source": "~3.24.3",
},
},
},
{
name: "ember-lts-3.28",
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
},
},
{
name: "ember-lts-3.20",
npm: {
devDependencies: {
"ember-source": "~3.20.5",
},
},
},
{
name: "ember-lts-3.24",
npm: {
devDependencies: {
"ember-source": "~3.24.3",
},
},
},
{
name: "ember-lts-3.28",
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
},
},
{
name: "ember-release",
npm: {
devDependencies: {
"ember-source": await getChannelURL("release"),
},
},
},
{
name: "ember-beta",
npm: {
devDependencies: {
"ember-source": await getChannelURL("beta"),
},
},
},
{
name: "ember-canary",
npm: {
devDependencies: {
"ember-source": await getChannelURL("canary"),
},
},
},
// The default `.travis.yml` runs this scenario via `yarn test`,
// not via `ember try`. It's still included here so that running
// `ember try:each` manually or from a customized CI config will run it
// along with all the other scenarios.
{
name: "ember-default",
npm: {
devDependencies: {},
},
},
{
name: "ember-default-with-jquery",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"jquery-integration": true,
}),
},
npm: {
devDependencies: {
"@ember/jquery": "^0.5.1",
},
},
},
{
name: "ember-classic",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
"application-template-wrapper": true,
"default-async-observers": false,
"template-only-glimmer-components": false,
}),
},
npm: {
devDependencies: {
"ember-source": "~3.28.0",
},
ember: {
edition: "classic",
},
},
},
embroiderSafe(),
embroiderOptimized(),
],
};
};

View File

@ -39,9 +39,7 @@
"loader.js": "^4.7.0"
},
"engines": {
"node": "16.* || >= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
"node": "16.* || >= 18"
},
"ember": {
"edition": "default"

View File

@ -40,9 +40,7 @@
"loader.js": "^4.7.0"
},
"engines": {
"node": "16.* || >= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
"node": "16.* || >= 18"
},
"ember": {
"edition": "default"

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@
<%= discourse_stylesheet_link_tag(:desktop, theme_id: nil) %>
<style>
<%= File.read("#{Rails.root}/app/assets/javascripts/node_modules/qunit/qunit/qunit.css") %>
<%= File.read("#{Rails.root}/app/assets/javascripts/discourse/node_modules/qunit/qunit/qunit.css") %>
</style>
<%- else %>
<style>

View File

@ -6,7 +6,7 @@ require 'pathname'
RAILS_ROOT = File.expand_path("../../", Pathname.new(__FILE__).realpath)
PORT = ENV["UNICORN_PORT"] ||= "3000"
HOSTNAME = ENV["DISCOURSE_HOSTNAME"] ||= "127.0.0.1"
YARN_DIR = File.join(RAILS_ROOT, "app/assets/javascripts/discourse")
FRONTEND_DIR = File.join(RAILS_ROOT, "app/assets/javascripts/discourse")
CUSTOM_ARGS = ["--try", "--test", "--build", "--unicorn", "-u", "--forward-host"]
PROXY =
if ARGV.include?("--try")
@ -46,21 +46,21 @@ if ARGV.include?("-h") || ARGV.include?("--help")
puts "#{"--test".cyan} To run the test suite"
puts "#{"--unicorn, -u".cyan} To run a unicorn server as well"
puts "The rest of the arguments are passed to ember server per:", ""
exec "yarn -s --cwd #{YARN_DIR} run ember #{command} --help"
exec "pnpm --silent --dir #{FRONTEND_DIR} ember #{command} --help"
end
args = ["-s", "--cwd", YARN_DIR, "run", "ember", command] + (ARGV - CUSTOM_ARGS)
args = ["--silent", "--dir", FRONTEND_DIR, "exec", "ember", command] + (ARGV - CUSTOM_ARGS)
if !args.include?("test") && !args.include?("build") && !args.include?("--proxy")
args << "--proxy"
args << PROXY
end
exit 1 if !system "yarn -s install --cwd #{YARN_DIR}"
exit 1 if !system "pnpm --silent --dir #{FRONTEND_DIR} install"
yarn_env = {}
pnpm_env = {}
if ARGV.include?("--forward-host")
yarn_env["FORWARD_HOST"] = "true"
pnpm_env["FORWARD_HOST"] = "true"
end
if ARGV.include?("-u") || ARGV.include?("--unicorn")
@ -70,7 +70,7 @@ if ARGV.include?("-u") || ARGV.include?("--unicorn")
Thread.new do
require 'open3'
Open3.popen2e(yarn_env, "yarn", *args.to_a.flatten) do |i, oe, t|
Open3.popen2e(pnpm_env, "pnpm", *args.to_a.flatten) do |i, oe, t|
ember_cli_pid = t.pid
puts "Ember CLI running on PID: #{ember_cli_pid}"
oe.each do |line|
@ -99,5 +99,5 @@ if ARGV.include?("-u") || ARGV.include?("--unicorn")
Process.kill("TERM", ember_cli_pid)
end
else
exec(yarn_env, "yarn", *args.to_a.flatten)
exec(pnpm_env, "pnpm", *args.to_a.flatten)
end

View File

@ -14,19 +14,19 @@ pre-commit:
prettier:
glob: "*.js"
include: "app/assets/javascripts|plugins/.+?/assets/javascripts"
run: yarn pprettier --list-different {staged_files}
run: pnpm pprettier --list-different {staged_files}
prettier-scss:
glob: "*.scss"
include: "app/assets/stylesheets|plugins/.+?/assets/stylesheets"
run: yarn pprettier --list-different {staged_files}
run: pnpm pprettier --list-different {staged_files}
eslint:
glob: "*.js"
include: "app/assets/javascripts|plugins/.+?/assets/javascripts"
run: yarn eslint -f compact --quiet {staged_files}
run: pnpm eslint -f compact --quiet {staged_files}
ember-template-lint:
glob: "*.hbs"
include: "app/assets/javascripts|plugins/.+?/assets/javascripts"
run: yarn run ember-template-lint {staged_files}
run: pnpm ember-template-lint {staged_files}
yaml-syntax:
glob: "*.{yaml,yml}"
# database.yml is an erb file not a yaml file
@ -43,13 +43,13 @@ lints:
glob: "*.rb"
run: bundle exec rubocop --parallel
prettier:
run: yarn pprettier --list-different **/*.js
run: pnpm pprettier --list-different **/*.js
prettier-scss:
run: yarn pprettier --list-different **/*.scss
run: pnpm pprettier --list-different **/*.scss
eslint:
run: yarn eslint -f compact --quiet --ext .js .
run: pnpm eslint -f compact --quiet --ext .js .
ember-template-lint:
run: yarn run ember-template-lint .
run: pnpm ember-template-lint .
yaml-syntax:
glob: "*.{yaml,yml}"
# database.yml is an erb file not a yaml file

View File

@ -142,10 +142,10 @@ class DiscourseJsProcessor
JS
# define/require support
load_file_in_context(ctx, "node_modules/loader.js/dist/loader/loader.js")
load_file_in_context(ctx, "discourse/node_modules/loader.js/dist/loader/loader.js")
# Babel
load_file_in_context(ctx, "node_modules/@babel/standalone/babel.js")
load_file_in_context(ctx, "discourse/node_modules/@babel/standalone/babel.js")
ctx.eval <<~JS
globalThis.rawBabelTransform = function(){
return Babel.transform(...arguments).code;
@ -153,15 +153,15 @@ class DiscourseJsProcessor
JS
# Terser
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")
load_file_in_context(ctx, "discourse/node_modules/source-map/dist/source-map.js")
load_file_in_context(ctx, "discourse/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, "node_modules/babel-plugin-ember-template-compilation/src/plugin.js", wrap_in_module: "babel-plugin-ember-template-compilation/index")
load_file_in_context(ctx, "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, "node_modules/babel-import-util/src/index.js", wrap_in_module: "babel-import-util")
load_file_in_context(ctx, "node_modules/ember-cli-htmlbars/lib/colocated-babel-plugin.js", wrap_in_module: "colocated-babel-plugin")
load_file_in_context(ctx, "discourse/node_modules/ember-source/dist/ember-template-compiler.js")
load_file_in_context(ctx, "discourse/node_modules/babel-plugin-ember-template-compilation/src/plugin.js", wrap_in_module: "babel-plugin-ember-template-compilation/index")
load_file_in_context(ctx, "discourse/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, "discourse/node_modules/babel-import-util/src/index.js", wrap_in_module: "babel-import-util")
load_file_in_context(ctx, "discourse/node_modules/ember-cli-htmlbars/lib/colocated-babel-plugin.js", wrap_in_module: "colocated-babel-plugin")
# Widget HBS compiler
widget_hbs_compiler_source = File.read("#{Rails.root}/lib/javascripts/widget-hbs-compiler.js")
@ -178,7 +178,7 @@ class DiscourseJsProcessor
ctx.eval(widget_hbs_compiler_transpiled, filename: "widget-hbs-compiler.js")
# Raw HBS compiler
load_file_in_context(ctx, "node_modules/handlebars/dist/handlebars.js", wrap_in_module: "handlebars")
load_file_in_context(ctx, "discourse/node_modules/handlebars/dist/handlebars.js", wrap_in_module: "handlebars")
raw_hbs_transpiled = ctx.call(
"rawBabelTransform",

View File

@ -46,7 +46,7 @@ module EmberCli
def self.ember_version
@version ||= begin
ember_source_package_raw = File.read("#{Rails.root}/app/assets/javascripts/node_modules/ember-source/package.json")
ember_source_package_raw = File.read("#{Rails.root}/app/assets/javascripts/discourse/node_modules/ember-source/package.json")
JSON.parse(ember_source_package_raw)["version"]
end
end

View File

@ -6,7 +6,7 @@
module BarberEmberPrecompilerFreedomPatch
# Use the template compiler JS from node_modules
def ember_template_precompiler
@ember ||= File.new("app/assets/javascripts/node_modules/ember-source/dist/ember-template-compiler.js")
@ember ||= File.new("app/assets/javascripts/discourse/node_modules/ember-source/dist/ember-template-compiler.js")
end
# Apply a couple of extra shims for more recent ember-template-compilers

View File

@ -4,13 +4,15 @@
class Barber::Precompiler
def sources
[File.open("#{Rails.root}/app/assets/javascripts/node_modules/handlebars/dist/handlebars.js"),
precompiler]
[
File.open("#{Rails.root}/app/assets/javascripts/discourse/node_modules/handlebars/dist/handlebars.js"),
precompiler,
]
end
def precompiler
if !@precompiler
loader = File.read("#{Rails.root}/app/assets/javascripts/node_modules/loader.js/dist/loader/loader.js")
loader = File.read("#{Rails.root}/app/assets/javascripts/discourse/node_modules/loader.js/dist/loader/loader.js")
source = File.read("#{Rails.root}/app/assets/javascripts/discourse-common/addon/lib/raw-handlebars.js")
transpiled = DiscourseJsProcessor.transpile(source, "#{Rails.root}/app/assets/javascripts/", "discourse-common/lib/raw-handlebars")

View File

@ -94,13 +94,13 @@ module PrettyText
end
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}/discourse/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(ctx, "#{root_path}/discourse/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(ctx, "#{root_path}/node_modules/markdown-it/dist/markdown-it.js")
ctx_load(ctx, "#{root_path}/discourse/node_modules/markdown-it/dist/markdown-it.js")
apply_es6_file(ctx, root_path, "discourse-common/addon/lib/get-url")
apply_es6_file(ctx, root_path, "discourse-common/addon/lib/object")

View File

@ -9,7 +9,7 @@ task 'assets:precompile:before' do
end
if ENV["EMBER_CLI_COMPILE_DONE"] != "1"
compile_command = "yarn --cwd app/assets/javascripts/discourse run ember build -prod"
compile_command = "pnpm --dir app/assets/javascripts/discourse exec ember build -prod"
if check_node_heap_size_limit < 1024
STDERR.puts "Detected low Node.js heap_size_limit. Using --max-old-space-size=1024."

View File

@ -44,7 +44,7 @@ end
def run_or_fail_prettier(*patterns)
if patterns.any? { |p| Dir[p].any? }
patterns = patterns.map { |p| "'#{p}'" }.join(' ')
run_or_fail("yarn pprettier --list-different #{patterns}")
run_or_fail("pnpm pprettier --list-different #{patterns}")
else
puts "Skipping prettier. Pattern not found."
true
@ -59,37 +59,37 @@ desc 'Run all tests (JS and code in a standalone environment)'
task 'docker:test' do
begin
@good = true
@good &&= run_or_fail("yarn install")
@good &&= run_or_fail("pnpm install")
unless ENV['SKIP_LINT']
puts "Running linters/prettyfiers"
puts "eslint #{`yarn eslint -v`}"
puts "prettier #{`yarn prettier -v`}"
puts "eslint #{`pnpm eslint -v`}"
puts "prettier #{`pnpm prettier -v`}"
if ENV["SINGLE_PLUGIN"]
@good &&= run_or_fail("bundle exec rubocop --parallel plugins/#{ENV["SINGLE_PLUGIN"]}")
@good &&= run_or_fail("bundle exec ruby script/i18n_lint.rb plugins/#{ENV["SINGLE_PLUGIN"]}/config/locales/{client,server}.en.yml")
@good &&= run_or_fail("yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern plugins/#{ENV['SINGLE_PLUGIN']}")
@good &&= run_or_fail("pnpm eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern plugins/#{ENV['SINGLE_PLUGIN']}")
puts "Listing prettier offenses in #{ENV['SINGLE_PLUGIN']}:"
@good &&= run_or_fail_prettier("plugins/#{ENV['SINGLE_PLUGIN']}/**/*.scss", "plugins/#{ENV['SINGLE_PLUGIN']}/**/*.{js,es6}")
else
@good &&= run_or_fail("bundle exec rake plugin:update_all") unless ENV["SKIP_PLUGINS"]
@good &&= run_or_fail("bundle exec rubocop --parallel") unless ENV["SKIP_CORE"]
@good &&= run_or_fail("yarn eslint app/assets/javascripts") unless ENV["SKIP_CORE"]
@good &&= run_or_fail("yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern plugins") unless ENV["SKIP_PLUGINS"]
@good &&= run_or_fail("pnpm eslint app/assets/javascripts") unless ENV["SKIP_CORE"]
@good &&= run_or_fail("pnpm eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern plugins") unless ENV["SKIP_PLUGINS"]
@good &&= run_or_fail('bundle exec ruby script/i18n_lint.rb "config/locales/{client,server}.en.yml"') unless ENV["SKIP_CORE"]
@good &&= run_or_fail('bundle exec ruby script/i18n_lint.rb "plugins/**/locales/{client,server}.en.yml"') unless ENV["SKIP_PLUGINS"]
unless ENV["SKIP_CORE"]
puts "Listing prettier offenses in core:"
@good &&= run_or_fail('yarn pprettier --list-different "app/assets/stylesheets/**/*.scss" "app/assets/javascripts/**/*.js"')
@good &&= run_or_fail('pnpm pprettier --list-different "app/assets/stylesheets/**/*.scss" "app/assets/javascripts/**/*.js"')
end
unless ENV["SKIP_PLUGINS"]
puts "Listing prettier offenses in plugins:"
@good &&= run_or_fail('yarn pprettier --list-different "plugins/**/assets/stylesheets/**/*.scss" "plugins/**/assets/javascripts/**/*.{js,es6}"')
@good &&= run_or_fail('pnpm pprettier --list-different "plugins/**/assets/stylesheets/**/*.scss" "plugins/**/assets/javascripts/**/*.{js,es6}"')
end
end
end
@ -208,7 +208,7 @@ task 'docker:test' do
js_timeout = ENV["JS_TIMEOUT"].presence || 900_000 # 15 minutes
unless ENV["SKIP_CORE"]
@good &&= run_or_fail("cd app/assets/javascripts/discourse && CI=1 yarn ember exam --load-balance --parallel=3 --random")
@good &&= run_or_fail("cd app/assets/javascripts/discourse && CI=1 pnpm ember exam --load-balance --parallel=3 --random")
end
unless ENV["SKIP_PLUGINS"]

View File

@ -45,7 +45,7 @@ def write_template(path, task_name, template)
File.write(output_path, "#{header}\n\n#{template}")
puts "#{basename} created"
%x{yarn run prettier --write #{output_path}}
%x{pnpm prettier --write #{output_path}}
puts "#{basename} prettified"
end
@ -227,8 +227,8 @@ end
task 'javascript:update' => 'clean_up' do
require 'uglifier'
yarn = system("yarn install")
abort('Unable to run "yarn install"') unless yarn
pnpm = system("pnpm install")
abort('Unable to run "pnpm install"') unless pnpm
versions = {}
start = Time.now

View File

@ -11,13 +11,13 @@ task "qunit:test", [:timeout, :qunit_path, :filter] do |_, args|
abort err.message
end
unless system("command -v yarn >/dev/null;")
abort "Yarn is not installed. Download from https://yarnpkg.com/lang/en/docs/install/"
unless system("command -v pnpm >/dev/null;")
abort "pnpm is not installed. Download from https://pnpm.io/installation"
end
report_requests = ENV['REPORT_REQUESTS'] == "1"
system("yarn install")
system("pnpm install")
# ensure we have this port available
def port_available?(port)
@ -105,11 +105,11 @@ task "qunit:test", [:timeout, :qunit_path, :filter] do |_, args|
if qunit_path
# Bypass `ember test` - it only works properly for the `/tests` path.
# We have to trigger a `build` manually so that JS is available for rails to serve.
system("yarn", "ember", "build", chdir: "#{Rails.root}/app/assets/javascripts/discourse")
system("pnpm", "ember", "build", chdir: "#{Rails.root}/app/assets/javascripts/discourse")
test_page = "#{qunit_path}?#{query}&testem=1"
cmd += ["yarn", "testem", "ci", "-f", "testem.js", "-t", test_page]
cmd += ["pnpm", "testem", "ci", "-f", "testem.js", "-t", test_page]
else
cmd += ["yarn", "ember", "exam", "--query", query]
cmd += ["pnpm", "ember", "exam", "--query", query]
if parallel = ENV["QUNIT_PARALLEL"]
cmd += ["--load-balance", "--parallel", parallel]
end

View File

@ -66,7 +66,7 @@ def assets
manifest.assets.each do |_, path|
fullpath = (Rails.root + "public/assets/#{path}").to_s
# Ignore files we can't find the mime type of, like yarn.lock
# Ignore files we can't find the mime type of
content_type = MiniMime.lookup_by_filename(fullpath)&.content_type
content_type ||= "application/json" if fullpath.end_with?(".map")
if content_type

View File

@ -10,7 +10,7 @@ task "smoke:test" do
abort err.message
end
system("yarn install")
system("pnpm install")
url = ENV["URL"]
if !url

View File

@ -9,9 +9,8 @@ def library_src
end
task 'svgicons:update' do
yarn = system("yarn install")
abort('Unable to run "yarn install"') unless yarn
pnpm = system("pnpm install")
abort('Unable to run "pnpm install"') unless pnpm
dependencies = [
{
@ -24,13 +23,7 @@ task 'svgicons:update' do
dependencies.each do |f|
src = "#{library_src}/#{f[:source]}/."
unless f[:destination]
filename = f[:source].split("/").last
else
filename = f[:destination]
end
filename = f[:destination] || f[:source].split("/").last
dest = "#{vendor_svgs}/#{filename}"
FileUtils.cp_r(src, dest)

View File

@ -31,15 +31,16 @@
"@mixer/parallel-prettier": "^2.0.3",
"chrome-launcher": "^0.15.0",
"chrome-remote-interface": "^0.31.2",
"ember-cli-htmlbars": "^6.0.0",
"ember-template-lint": "^4.18.1",
"ember-template-lint-plugin-discourse": "^2.0.0",
"lefthook": "^1.2.0",
"puppeteer-core": "^13.7.0"
},
"scripts": {
"postinstall": "yarn --cwd app/assets/javascripts/discourse $(node -e 'if(JSON.parse(process.env.npm_config_argv).original.includes(`--frozen-lockfile`)){console.log(`--frozen-lockfile`)}')"
"postinstall": "pnpm --dir app/assets/javascripts/discourse install"
},
"engines": {
"node": "16.* || >= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
"node": "16.* || >= 18"
}
}

3576
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -102,7 +102,7 @@ RSpec.describe DiscourseJsProcessor do
let(:mini_racer) {
ctx = MiniRacer::Context.new
ctx.eval(File.open("#{Rails.root}/app/assets/javascripts/node_modules/handlebars/dist/handlebars.js").read)
ctx.eval(File.open("#{Rails.root}/app/assets/javascripts/discourse/node_modules/handlebars/dist/handlebars.js").read)
ctx.eval(helpers)
ctx
}

2590
yarn.lock

File diff suppressed because it is too large Load Diff