Skip to content

Commit

Permalink
DEV: Merge root JS packages (discourse#25857)
Browse files Browse the repository at this point in the history
Before this commit, we had a yarn package set up in the root directory and also in `app/assets/javascripts`. That meant two `yarn install` calls and two `node_modules` directories. This commit merges them both into the root location, and updates references to node_modules.

A previous attempt can be found at discourse#21172. This commit re-uses that script to merge the `yarn.lock` files.

Co-authored-by: Jarek Radosz <[email protected]>
  • Loading branch information
davidtaylorhq and CvX authored Feb 26, 2024
1 parent b3a1199 commit 588a79c
Show file tree
Hide file tree
Showing 26 changed files with 9,002 additions and 12,021 deletions.
14 changes: 13 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,25 @@ updates:
- "railties"
- "sprockets-rails"
- package-ecosystem: "npm"
directory: "/app/assets/javascripts/"
directory: "/"
schedule:
interval: daily
time: "08:00"
timezone: Australia/Sydney
open-pull-requests-limit: 20
versioning-strategy: increase
ignore: # These are all vendored so need to be updated manually. See lib/tasks/javascript.rake
- dependency-name: "ace-builds"
- dependency-name: "@json-editor/json-editor"
- dependency-name: "chart.js"
- dependency-name: "chartjs-plugin-datalabels"
- dependency-name: "diffhtml"
- dependency-name: "magnific-popup"
- dependency-name: "pikaday"
- dependency-name: "moment"
- dependency-name: "moment-timezone"
- dependency-name: "@discourse/moment-timezon-names-translations"
- dependency-name: "squoosh"
groups:
babel:
patterns:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,3 @@ 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
25 changes: 23 additions & 2 deletions .licensee.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,38 @@
"CC0-1.0",
"CC-BY-3.0",
"CC-BY-4.0",
"Apache-2.0 WITH LLVM-exception"
"Apache-2.0 WITH LLVM-exception",
"ISC"
]
},
"packages": {
"@fortawesome/fontawesome-free": "*",
"@glimmer/interfaces": "*",
"@glimmer/syntax": "*",
"@jspreadsheet/formula": "2.0.2",
"cli-table": "0.3.11",
"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.1",
"jspreadsheet-ce": "4.13.4",
"line-stream": "0.0.0",
"messageformat": "0.1.5",
"regenerator-transform": "0.10.1",
"source-map": "0.1.43",
"sourcemap-validator": "1.1.1",
"spawn-command": "0.0.2",
"squoosh": "2.0.0",
"taffydb": "2.6.2"
},
"corrections": true
"corrections": true,
"ignore": [
{
"author": "Discourse"
}
]
}
35 changes: 0 additions & 35 deletions app/assets/javascripts/.licensee.json

This file was deleted.

4 changes: 2 additions & 2 deletions app/assets/javascripts/discourse/lib/workbox-tree-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ module.exports = function generateWorkboxTree() {
];

const nodes = workboxDeps.map((name) => {
return funnel(`../node_modules/${name}/build`);
return funnel(`../../../../node_modules/${name}/build`);
});

const versions = workboxDeps.map((name) => {
return require(`../../node_modules/${name}/package.json`).version;
return require(`../../../../../node_modules/${name}/package.json`).version;
});

// Normally Sprockets will create a cachebuster per-file. In this case we need it at the directory level since
Expand Down
33 changes: 0 additions & 33 deletions app/assets/javascripts/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion app/assets/javascripts/theme-transpiler/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ esbuild
bundle: true,
minify: true,
alias: {
util: "./app/assets/javascripts/node_modules/@zxing/text-encoding",
util: "./node_modules/@zxing/text-encoding",
},
define: {
process: `{ "env": {} }`,
Expand Down
Loading

0 comments on commit 588a79c

Please sign in to comment.