diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml new file mode 100644 index 0000000..47290c8 --- /dev/null +++ b/.github/workflows/merge.yml @@ -0,0 +1,35 @@ +name: Merge checks + +on: + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Build + run: | + npm install + npm run build + + - name: Get version + run: echo "::set-output name=version::v$(./ci/getVersion.sh)" + id: version + + - name: Verify version + run: | + ./ci/verifyVersion.sh ${{ steps.version.outputs.version }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..952aa77 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: NodeJS with Webpack + +on: + push: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Build + run: | + npm install + npm run release:minified + zip -r -j static_minified.zip dist/* + npm run release:unminified + zip -r -j static_unminified.zip dist/* + + - name: Get version + run: echo "::set-output name=version::v$(./ci/getVersion.sh)" + id: version + + - name: Verify version + run: | + ./ci/verifyVersion.sh ${{ steps.version.outputs.version }} + + # Verify changelog has entry with new version + - name: Release + uses: softprops/action-gh-release@v1 + with: + name: ${{ steps.version.outputs.version }} + tag_name: ${{ steps.version.outputs.version }} + files: | + static_minified.zip + static_unminified.zip + fail_on_unmatched_files: true + prerelease: false + draft: false \ No newline at end of file diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..8351c19 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +14 diff --git a/README.md b/README.md index bd0d586..923eb16 100755 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ ## Getting Started -In order to run **Adminator** on your local machine all what you need to do is to have the prerequisites stated below installed on your machine and follow the installation steps down below. +In order to run **Adminator** on your local machine all what you need to do is to have the prerequisites stated below installed on your machine and follow the installation steps down below. Prebuilt static assets can be found under [releases](https://github.com/puikinsh/Adminator-admin-dashboard/releases). #### Prerequisites - Node.js diff --git a/ci/getVersion.sh b/ci/getVersion.sh new file mode 100755 index 0000000..efd8253 --- /dev/null +++ b/ci/getVersion.sh @@ -0,0 +1 @@ +echo $(sed 's/.*"version": "\(.*\)".*/\1/;t;d' ./package.json) \ No newline at end of file diff --git a/ci/verifyVersion.sh b/ci/verifyVersion.sh new file mode 100755 index 0000000..75ac0eb --- /dev/null +++ b/ci/verifyVersion.sh @@ -0,0 +1,9 @@ +VERSION=$1 +TAG_EXISTS=$(git ls-remote --tags origin $VERSION | wc -l) + +if [ $TAG_EXISTS -eq "1" ]; then + echo "The tag '$VERSION' already exists. Please update version in package.json."; + exit 1; +fi + +echo "The tag '$VERSION' does not exist - success."; \ No newline at end of file diff --git a/package.json b/package.json index 578eeb8..db790ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "adminator", - "version": "2.0.0", + "version": "2.0.3", "private": true, "description": "HTML Admin Template", "scripts": { @@ -8,6 +8,8 @@ "dev": "webpack-dashboard -t 'Project' -- webpack server", "clean": "shx rm -rf ./dist", "build": "npm run clean && cross-env webpack", + "release:minified": "npm run clean && NODE_ENV=production MINIFY=true cross-env webpack", + "release:unminified": "npm run clean && NODE_ENV=production MINIFY=false cross-env webpack", "preview": "cross-env webpack server", "lint:js": "eslint ./src ./webpack ./*.js -f table --ext .js --ext .jsx", "lint:scss": "stylelint ./src/**/*.scss --syntax scss", @@ -28,17 +30,17 @@ "copy-webpack-plugin": "^9.0.0", "cross-env": "^7.0.3", "css-loader": "^5.2.6", + "css-minimizer-webpack-plugin": "^4.0.0", "eslint": "^7.21.0", "eslint-config-airbnb-base": "^14.2.1", "eslint-plugin-import": "^2.23.4", - "extract-text-webpack-plugin": "^3.0.2", "html-webpack-plugin": "^5.3.1", "imagemin-webpack-plugin": "^2.4.2", "mini-css-extract-plugin": "^1.6.0", "postcss": "^8.3.4", "postcss-loader": "^6.1.0", - "postcss-preset-env": "^6.7.0", "sass": "^1.55.0", + "postcss-preset-env": "7.8.0", "sass-loader": "^12.1.0", "shx": "^0.3.3", "style-loader": "^2.0.0", diff --git a/src/assets/scripts/fullcalendar/index.js b/src/assets/scripts/fullcalendar/index.js index 5c3f45e..ab10bc6 100755 --- a/src/assets/scripts/fullcalendar/index.js +++ b/src/assets/scripts/fullcalendar/index.js @@ -7,6 +7,11 @@ import listPlugin from '@fullcalendar/list'; document.addEventListener('DOMContentLoaded', function() { var calendarEl = document.getElementById('calendar'); + // element found in dom ? + if (calendarEl == null) { + return + } + var calendar = new Calendar(calendarEl, { plugins: [ interactionPlugin, dayGridPlugin, timeGridPlugin, listPlugin ], headerToolbar: { diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 6c7b16c..247651e 100755 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -1,6 +1,6 @@ @import 'spec/settings/index'; @import 'spec/tools/index'; -@import "~bootstrap/scss/bootstrap"; +@import "bootstrap/scss/bootstrap"; @import 'spec/index'; @import 'vendor/index'; diff --git a/src/assets/styles/spec/settings/index.scss b/src/assets/styles/spec/settings/index.scss index 349c23e..7f88dab 100755 --- a/src/assets/styles/spec/settings/index.scss +++ b/src/assets/styles/spec/settings/index.scss @@ -1,6 +1,6 @@ @import 'breakpoints'; @import 'fonts'; -@import '~brand-colors/dist/latest/scss/brand-colors.latest.scss'; +@import 'brand-colors/dist/latest/scss/brand-colors.latest.scss'; @import 'materialColors'; @import 'baseColors'; @import 'borders'; diff --git a/src/assets/styles/vendor/index.scss b/src/assets/styles/vendor/index.scss index eaeb95f..ccdd35e 100755 --- a/src/assets/styles/vendor/index.scss +++ b/src/assets/styles/vendor/index.scss @@ -1,4 +1,4 @@ -@import '~perfect-scrollbar/css/perfect-scrollbar'; +@import 'perfect-scrollbar/css/perfect-scrollbar'; @import 'themify-icons'; @import 'font-awesome'; @import 'perfectScrollbar'; diff --git a/src/compose.html b/src/compose.html index f4ad7e2..6d51341 100755 --- a/src/compose.html +++ b/src/compose.html @@ -235,7 +235,7 @@