Skip to content

Commit

Permalink
Merge pull request #167 from yast/update_deps
Browse files Browse the repository at this point in the history
Update NPM dependencies, improve CI
  • Loading branch information
lslezak authored Oct 20, 2023
2 parents 20ff198 + 792d064 commit 1702df5
Show file tree
Hide file tree
Showing 13 changed files with 3,960 additions and 2,235 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,15 @@ jobs:
steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: Git Fix
# fix the ownership to pass a git security check
run: chown "$UID" .
uses: actions/checkout@v3

- name: Prepare System
run: zypper --non-interactive in --no-recommends breeze5-icons npm-default

# if the included files are not up to date and there is a change in the
# generated file then the package build later fails
- name: Build QSS and CSS files
# reset possible package-lock changes
run: rake generate && git checkout src/package-lock.json
run: rake generate

- name: Stylelint
run: cd src && npx gulp lint
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ and testing the changes in a real installation.

- Install npm: `sudo zypper install npm-default`
- Go to the `src/` subdirectory.
- Install the SASS processor and the tools: `npm install`
- Install the SASS processor and the tools: `npm ci`
- The NPM packages are installed into the `node_modules` subdirectory

### Building the QSS and CSS Files
Expand All @@ -60,6 +60,20 @@ and testing the changes in a real installation.
- This generates all `theme/SLE/wizard/*.qss` and `theme/SLE/wizard/*.css`
files.

## Updating the NPM Packages

The `npm ci` command installs the NPM packages exactly in the versions specified
in the `package-lock.json` file.

If you want to update the packages to the latest semver compatible version then
run command `npm install`.

If you want to update the packages to a newer, possibly incompatible version,
then edit the `package.json` file and run `npm install`. Carefully check the
built result.

In all cases do not forget to commit the changes in both `package.json` and
`package-lock.json` files to git.

### Sources

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ task :generate do
end

Dir.chdir("src") do
system("npm install") unless File.exist?("node_modules")
system("npm ci") unless File.exist?("node_modules")
system("npx gulp")
end
end
Expand Down
10 changes: 10 additions & 0 deletions package/yast2-theme.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Fri Oct 20 07:53:13 UTC 2023 - Ladislav Slezák <[email protected]>

- Dropped unmaintained "gulp-stylelint" internal development dependency
- Manually updated the internal development dependencies to the latest
NPM packages
- The stylesheets have been rebuilt with the new dependencies
- Updated README.md
- 5.0.1

-------------------------------------------------------------------
Wed Aug 30 20:16:10 UTC 2023 - Josef Reidinger <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-theme.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-theme
Version: 5.0.0
Version: 5.0.1
Release: 0

Source0: %{name}-%{version}.tar.bz2
Expand Down
15 changes: 6 additions & 9 deletions src/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const gulp = require('gulp');
const gulpStylelint = require('gulp-stylelint');
const sass = require('gulp-sass')(require('sass'));
const rename = require('gulp-rename');
const header = require('gulp-header');
const spawn = require('child_process').spawn;

let path = {
src_source: 'scss',
Expand Down Expand Up @@ -49,14 +49,11 @@ const buildThemes = (done) => {
})();
};

gulp.task('lint', function () {
return gulp
.src('**/*.scss')
.pipe(gulpStylelint({
reporters: [
{formatter: 'string', console: true}
]
}));
gulp.task('lint', function (cb) {
const cmd = spawn('npx', ['stylelint', '**/*.scss'], {stdio: 'inherit'});
cmd.on('close', function (code) {
cb(code);
});
});

gulp.task('default', gulp.series(buildThemes));
Loading

0 comments on commit 1702df5

Please sign in to comment.