@@ -8,7 +8,7 @@ const fs = require('fs');
88// gulp plugins and utils
99const livereload = require ( 'gulp-livereload' ) ;
1010const postcss = require ( 'gulp-postcss' ) ;
11- const zip = require ( 'gulp-zip' ) ;
11+ // const zip = require('gulp-zip');
1212const concat = require ( 'gulp-concat' ) ;
1313const uglify = require ( 'gulp-uglify' ) ;
1414// const beeper = require('beeper');
@@ -71,22 +71,22 @@ function js(done) {
7171 ] , handleError ( done ) ) ;
7272}
7373
74- function zipper ( done ) {
75- const filename = require ( './package.json' ) . name + '.zip' ;
76-
77- pump ( [
78- src ( [
79- '**' ,
80- '!node_modules' , '!node_modules/**' ,
81- '!dist' , '!dist/**' ,
82- '!yarn-error.log' ,
83- '!yarn.lock' ,
84- '!gulpfile.js'
85- ] ) ,
86- zip ( filename ) ,
87- dest ( 'dist/' )
88- ] , handleError ( done ) ) ;
89- }
74+ // function zipper(done) {
75+ // const filename = require('./package.json').name + '.zip';
76+
77+ // pump([
78+ // src([
79+ // '**',
80+ // '!node_modules', '!node_modules/**',
81+ // '!dist', '!dist/**',
82+ // '!yarn-error.log',
83+ // '!yarn.lock',
84+ // '!gulpfile.js'
85+ // ]),
86+ // zip(filename),
87+ // dest('dist/')
88+ // ], handleError(done));
89+ // }
9090
9191const cssWatcher = ( ) => watch ( 'assets/css/**' , css ) ;
9292const jsWatcher = ( ) => watch ( 'assets/js/**' , js ) ;
@@ -95,81 +95,81 @@ const watcher = parallel(cssWatcher, jsWatcher, hbsWatcher);
9595const build = series ( css , js ) ;
9696
9797exports . build = build ;
98- exports . zip = series ( build , zipper ) ;
98+ // exports.zip = series(build, zipper);
9999exports . default = series ( build , serve , watcher ) ;
100100
101- exports . release = async ( ) => {
102- // @NOTE : https://yarnpkg.com/lang/en/docs/cli/version/
103- // require(./package.json) can run into caching issues, this re-reads from file everytime on release
104- let packageJSON = JSON . parse ( fs . readFileSync ( './package.json' ) ) ;
105- const newVersion = packageJSON . version ;
106-
107- if ( ! newVersion || newVersion === '' ) {
108- console . log ( `Invalid version: ${ newVersion } ` ) ;
109- return ;
110- }
111-
112- console . log ( `\nCreating release for ${ newVersion } ...` ) ;
113-
114- const githubToken = process . env . GST_TOKEN ;
115-
116- if ( ! githubToken ) {
117- console . log ( 'Please configure your environment with a GitHub token located in GST_TOKEN' ) ;
118- return ;
119- }
120-
121- try {
122- const result = await inquirer . prompt ( [ {
123- type : 'input' ,
124- name : 'compatibleWithGhost' ,
125- message : 'Which version of Ghost is it compatible with?' ,
126- default : '5.0.0'
127- } ] ) ;
128-
129- const compatibleWithGhost = result . compatibleWithGhost ;
130-
131- const releasesResponse = await releaseUtils . releases . get ( {
132- userAgent : 'Source' ,
133- uri : `https://api.github.com/repos/${ REPO_READONLY } /releases`
134- } ) ;
135-
136- if ( ! releasesResponse || ! assetsResponse ) {
137- console . log ( 'No releases found. Skipping...' ) ;
138- return ;
139- }
140-
141- let previousVersion = releasesResponse [ 0 ] . tag_name || releasesResponse [ 0 ] . name ;
142- console . log ( `Previous version: ${ previousVersion } ` ) ;
143-
144- const changelog = new releaseUtils . Changelog ( {
145- changelogPath : CHANGELOG_PATH ,
146- folder : path . join ( process . cwd ( ) , '.' )
147- } ) ;
148-
149- changelog
150- . write ( {
151- githubRepoPath : `https://github.com/${ REPO } ` ,
152- lastVersion : previousVersion
153- } )
154- . sort ( )
155- . clean ( ) ;
156-
157- const newReleaseResponse = await releaseUtils . releases . create ( {
158- draft : true ,
159- preRelease : false ,
160- tagName : 'v' + newVersion ,
161- releaseName : newVersion ,
162- userAgent : 'Source' ,
163- uri : `https://api.github.com/repos/${ REPO } /releases` ,
164- github : {
165- token : githubToken
166- } ,
167- content : [ `**Compatible with Ghost ≥ ${ compatibleWithGhost } **\n\n` ] ,
168- changelogPath : CHANGELOG_PATH
169- } ) ;
170- console . log ( `\nRelease draft generated: ${ newReleaseResponse . releaseUrl } \n` ) ;
171- } catch ( err ) {
172- console . error ( err ) ;
173- process . exit ( 1 ) ;
174- }
175- } ;
101+ // exports.release = async () => {
102+ // // @NOTE : https://yarnpkg.com/lang/en/docs/cli/version/
103+ // // require(./package.json) can run into caching issues, this re-reads from file everytime on release
104+ // let packageJSON = JSON.parse(fs.readFileSync('./package.json'));
105+ // const newVersion = packageJSON.version;
106+
107+ // if (!newVersion || newVersion === '') {
108+ // console.log(`Invalid version: ${newVersion}`);
109+ // return;
110+ // }
111+
112+ // console.log(`\nCreating release for ${newVersion}...`);
113+
114+ // const githubToken = process.env.GST_TOKEN;
115+
116+ // if (!githubToken) {
117+ // console.log('Please configure your environment with a GitHub token located in GST_TOKEN');
118+ // return;
119+ // }
120+
121+ // try {
122+ // const result = await inquirer.prompt([{
123+ // type: 'input',
124+ // name: 'compatibleWithGhost',
125+ // message: 'Which version of Ghost is it compatible with?',
126+ // default: '5.0.0'
127+ // }]);
128+
129+ // const compatibleWithGhost = result.compatibleWithGhost;
130+
131+ // const releasesResponse = await releaseUtils.releases.get({
132+ // userAgent: 'Source',
133+ // uri: `https://api.github.com/repos/${REPO_READONLY}/releases`
134+ // });
135+
136+ // if (!releasesResponse || !assetsResponse) {
137+ // console.log('No releases found. Skipping...');
138+ // return;
139+ // }
140+
141+ // let previousVersion = releasesResponse[0].tag_name || releasesResponse[0].name;
142+ // console.log(`Previous version: ${previousVersion}`);
143+
144+ // const changelog = new releaseUtils.Changelog({
145+ // changelogPath: CHANGELOG_PATH,
146+ // folder: path.join(process.cwd(), '.')
147+ // });
148+
149+ // changelog
150+ // .write({
151+ // githubRepoPath: `https://github.com/${REPO}`,
152+ // lastVersion: previousVersion
153+ // })
154+ // .sort()
155+ // .clean();
156+
157+ // const newReleaseResponse = await releaseUtils.releases.create({
158+ // draft: true,
159+ // preRelease: false,
160+ // tagName: 'v' + newVersion,
161+ // releaseName: newVersion,
162+ // userAgent: 'Source',
163+ // uri: `https://api.github.com/repos/${REPO}/releases`,
164+ // github: {
165+ // token: githubToken
166+ // },
167+ // content: [`**Compatible with Ghost ≥ ${compatibleWithGhost}**\n\n`],
168+ // changelogPath: CHANGELOG_PATH
169+ // });
170+ // console.log(`\nRelease draft generated: ${newReleaseResponse.releaseUrl}\n`);
171+ // } catch (err) {
172+ // console.error(err);
173+ // process.exit(1);
174+ // }
175+ // };
0 commit comments