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 *.out
*.pid *.pid
*.gz *.gz
*.zip
pids pids
logs logs
@ -13,7 +14,6 @@ results
npm-debug.log npm-debug.log
node_modules node_modules
package-lock.json
.idea/* .idea/*
*.iml *.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", "demo": "https://zap.ghost.io",
"version": "1.0.0", "version": "1.0.0",
"engines": { "engines": {
"ghost": ">=3.0.0", "ghost": ">=5.0.0"
"ghost-api": "v3"
}, },
"license": "MIT", "license": "MIT",
"screenshots": { "screenshots": {
"desktop": "assets/screenshot-desktop.jpg" "desktop": "assets/screenshot-desktop.jpg"
}, },
"scripts": { "scripts": {
"dev": "gulp", "dev": "npx tailwindcss -i ./assets/css/screen.css -o ./assets/built/screen.css --watch",
"zip": "gulp zip", "build": "npx tailwindcss -o ./assets/built/screen.css --minify",
"test": "gscan .", "zip": "npm run build && bestzip $npm_package_name.zip assets/* partials/* members/* *.hbs package.json",
"test:ci": "gscan --fatal --verbose .", "test": "npx gscan .",
"pretest": "gulp build", "pretest": "npm run build"
"preship": "yarn test",
"ship": "STATUS=$(git status --porcelain); echo $STATUS; if [ -z \"$STATUS\" ]; then yarn version && git push --follow-tags; fi"
}, },
"author": { "author": {
"name": "Ghost Foundation", "name": "Ghost Foundation",
@ -29,7 +26,7 @@
"type": "theme", "type": "theme",
"categories": [ "categories": [
"Minimal", "Minimal",
"Magazine" "Personal"
] ]
}, },
"keywords": [ "keywords": [
@ -44,19 +41,7 @@
"bugs": "https://github.com/TryGhost/zap/issues", "bugs": "https://github.com/TryGhost/zap/issues",
"contributors": "https://github.com/TryGhost/zap/graphs/contributors", "contributors": "https://github.com/TryGhost/zap/graphs/contributors",
"devDependencies": { "devDependencies": {
"autoprefixer": "9.8.0", "bestzip": "^2.2.1"
"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"
}, },
"browserslist": [ "browserslist": [
"defaults" "defaults"

5491
yarn.lock

File diff suppressed because it is too large Load diff