This commit is contained in:
John O'Nolan 2024-06-07 13:14:49 -04:00
parent 89940e8bd1
commit 7ed10f640b
5 changed files with 205 additions and 5409 deletions

2
.gitignore vendored
View file

@ -6,6 +6,7 @@ b-cov
*.out
*.pid
*.gz
*.zip
pids
logs
@ -13,7 +14,6 @@ results
npm-debug.log
node_modules
package-lock.json
.idea/*
*.iml

File diff suppressed because one or more lines are too long

View file

@ -1,87 +0,0 @@
const {series, watch, src, dest, parallel} = require('gulp');
const pump = require('pump');
// gulp plugins and utils
var livereload = require('gulp-livereload');
var postcss = require('gulp-postcss');
var zip = require('gulp-zip');
var uglify = require('gulp-uglify');
var beeper = require('beeper');
// postcss plugins
var autoprefixer = require('autoprefixer');
var colorFunction = require('postcss-color-mod-function');
var cssnano = require('cssnano');
var easyimport = require('postcss-easy-import');
function serve(done) {
livereload.listen();
done();
}
const handleError = (done) => {
return function (err) {
if (err) {
beeper();
}
return done(err);
};
};
function hbs(done) {
pump([
src(['*.hbs', '**/**/*.hbs', '!node_modules/**/*.hbs']),
livereload()
], handleError(done));
}
function css(done) {
var processors = [
easyimport,
colorFunction(),
autoprefixer(),
cssnano()
];
pump([
src('assets/css/*.css', {sourcemaps: true}),
postcss(processors),
dest('assets/built/', {sourcemaps: '.'}),
livereload()
], handleError(done));
}
function js(done) {
pump([
src('assets/js/*.js', {sourcemaps: true}),
uglify(),
dest('assets/built/', {sourcemaps: '.'}),
livereload()
], handleError(done));
}
function zipper(done) {
var targetDir = 'dist/';
var themeName = require('./package.json').name;
var filename = themeName + '.zip';
pump([
src([
'**',
'!node_modules', '!node_modules/**',
'!dist', '!dist/**'
]),
zip(filename),
dest(targetDir)
], handleError(done));
}
const cssWatcher = () => watch('assets/css/**', css);
const hbsWatcher = () => watch(['*.hbs', '**/**/*.hbs', '!node_modules/**/*.hbs'], hbs);
const watcher = parallel(cssWatcher, hbsWatcher);
const build = series(css, js);
const dev = series(build, serve, watcher);
exports.build = build;
exports.zip = series(build, zipper);
exports.default = dev;

View file

@ -4,21 +4,18 @@
"demo": "https://zap.ghost.io",
"version": "1.0.0",
"engines": {
"ghost": ">=3.0.0",
"ghost-api": "v3"
"ghost": ">=5.0.0"
},
"license": "MIT",
"screenshots": {
"desktop": "assets/screenshot-desktop.jpg"
},
"scripts": {
"dev": "gulp",
"zip": "gulp zip",
"test": "gscan .",
"test:ci": "gscan --fatal --verbose .",
"pretest": "gulp build",
"preship": "yarn test",
"ship": "STATUS=$(git status --porcelain); echo $STATUS; if [ -z \"$STATUS\" ]; then yarn version && git push --follow-tags; fi"
"dev": "npx tailwindcss -i ./assets/css/screen.css -o ./assets/built/screen.css --watch",
"build": "npx tailwindcss -o ./assets/built/screen.css --minify",
"zip": "npm run build && bestzip $npm_package_name.zip assets/* partials/* members/* *.hbs package.json",
"test": "npx gscan .",
"pretest": "npm run build"
},
"author": {
"name": "Ghost Foundation",
@ -29,7 +26,7 @@
"type": "theme",
"categories": [
"Minimal",
"Magazine"
"Personal"
]
},
"keywords": [
@ -44,19 +41,7 @@
"bugs": "https://github.com/TryGhost/zap/issues",
"contributors": "https://github.com/TryGhost/zap/graphs/contributors",
"devDependencies": {
"autoprefixer": "9.8.0",
"cssnano": "4.1.10",
"gscan": "3.5.4",
"gulp": "4.0.2",
"gulp-livereload": "4.0.2",
"gulp-postcss": "8.0.0",
"gulp-sourcemaps": "2.6.5",
"gulp-uglify": "3.0.2",
"gulp-util": "3.0.8",
"gulp-watch": "5.0.1",
"gulp-zip": "5.0.1",
"postcss-color-mod-function": "3.0.3",
"postcss-easy-import": "3.0.0"
"bestzip": "^2.2.1"
},
"browserslist": [
"defaults"

5491
yarn.lock

File diff suppressed because it is too large Load diff