Skip to content

Commit

Permalink
Initial packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
timkelty committed Jan 6, 2022
1 parent 81565e8 commit ce2c945
Show file tree
Hide file tree
Showing 9 changed files with 4,801 additions and 43 deletions.
4,791 changes: 4,788 additions & 3 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"dependencies": {
"@benmajor/jquery-touch-events": "^2.0.3",
"@craftcms/sass": "./packages/craftcms-sass",
"@craftcms/garnish": "./packages/craftcms-garnish",
"@pixelandtonic/craftui": "~0.3.8",
"accounting": "^0.4.1",
"axios": "^0.21.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/craftcms-garnish/dist/garnish.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion packages/craftcms-garnish/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ const { getConfig } = require('@craftcms/webpack');
const MergeIntoSingleFilePlugin = require('webpack-merge-and-include-globally');
const glob = require('glob');

// chdir so the glob commands work when running from outside this dir
process.chdir(__dirname);

const files = glob.sync('lib/*.js');
files.push(...glob.sync('src/Base*.js'), 'src/Garnish.js');
files.push('src/Garnish.js', ...glob.sync('src/Base*.js'));
files.push(...glob.sync('src/*.js', {
ignore: files
}));

module.exports = getConfig({
context: __dirname,
config: {
name: 'garnish',
plugins: [
new MergeIntoSingleFilePlugin({
files: {
Expand Down
3 changes: 1 addition & 2 deletions src/web/assets/garnish/GarnishAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ class GarnishAsset extends AssetBundle
*/
public function init()
{
$this->sourcePath = __DIR__ . '/dist';

$this->sourcePath = '@vendor/craftcms/cms/packages/craftcms-garnish/dist';
$this->depends = [
ElementResizeDetectorAsset::class,
JqueryAsset::class,
Expand Down
2 changes: 0 additions & 2 deletions src/web/assets/garnish/dist/garnish.js

This file was deleted.

14 changes: 0 additions & 14 deletions src/web/assets/garnish/dist/garnish.js.LICENSE.txt

This file was deleted.

19 changes: 0 additions & 19 deletions src/web/assets/garnish/webpack.config.js

This file was deleted.

6 changes: 5 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const {getConfigs} = require('@craftcms/webpack');
const garnishConfig = require('@craftcms/garnish');

module.exports = getConfigs();
module.exports = [
garnishConfig,
...getConfigs()
];

0 comments on commit ce2c945

Please sign in to comment.