Skip to content

Commit

Permalink
Merge pull request #72 from KrishEnacton/feature/gulp-zip
Browse files Browse the repository at this point in the history
feat: gulp zip implemented
  • Loading branch information
guocaoyi authored Feb 6, 2024
2 parents eaa3903 + 80fbd1e commit d7c3b84
Show file tree
Hide file tree
Showing 39 changed files with 268 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-chrome-ext",
"version": "0.9.1",
"version": "0.9.2",
"type": "module",
"description": "Scaffolding your chrome extension, multiple boilerplates supported!",
"author": "yalda",
Expand Down
5 changes: 4 additions & 1 deletion template-alpine-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
"preview": "vite preview",
"zip": "npm run build && node src/zip.js"
},
"dependencies": {
"alpinejs": "^3.13.1"
},
"devDependencies": {
"@crxjs/vite-plugin": "^2.0.0-beta.19",
"gulp": "^4.0.2",
"gulp-zip": "^6.0.0",
"vite": "^4.4.11"
}
}
10 changes: 10 additions & 0 deletions template-alpine-js/src/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp'
import zip from 'gulp-zip'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const manifest = require('../build/manifest.json')

gulp
.src('build/*')
.pipe(zip(`${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`))
.pipe(gulp.dest('package'))
5 changes: 4 additions & 1 deletion template-alpine-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
"preview": "vite preview",
"zip": "npm run build && node src/zip.js"
},
"dependencies": {
"alpinejs": "^3.13.1"
Expand All @@ -28,6 +29,8 @@
"@crxjs/vite-plugin": "^2.0.0-beta.19",
"@types/alpinejs": "^3.13.2",
"@types/chrome": "^0.0.246",
"gulp": "^4.0.2",
"gulp-zip": "^6.0.0",
"typescript": "^5.2.2",
"vite": "^4.4.11"
}
Expand Down
10 changes: 10 additions & 0 deletions template-alpine-ts/src/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp'
import zip from 'gulp-zip'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const manifest = require('../build/manifest.json')

gulp
.src('build/*')
.pipe(zip(`${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`))
.pipe(gulp.dest('package'))
5 changes: 4 additions & 1 deletion template-inferno-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
"preview": "vite preview",
"zip": "npm run build && node src/zip.js"
},
"dependencies": {
"inferno": "^8.2.2"
Expand All @@ -28,6 +29,8 @@
"@babel/core": "7.23.2",
"@babel/parser": "7.23.0",
"@crxjs/vite-plugin": "^2.0.0-beta.19",
"gulp": "^4.0.2",
"gulp-zip": "^6.0.0",
"vite": "^4.4.11",
"vite-plugin-inferno": "0.0.1"
}
Expand Down
10 changes: 10 additions & 0 deletions template-inferno-js/src/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp'
import zip from 'gulp-zip'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const manifest = require('../build/manifest.json')

gulp
.src('build/*')
.pipe(zip(`${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`))
.pipe(gulp.dest('package'))
5 changes: 4 additions & 1 deletion template-inferno-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
"preview": "vite preview",
"zip": "npm run build && node src/zip.js"
},
"dependencies": {
"inferno": "^8.2.2"
Expand All @@ -29,6 +30,8 @@
"@babel/parser": "7.23.0",
"@crxjs/vite-plugin": "^2.0.0-beta.19",
"@types/chrome": "^0.0.246",
"gulp": "^4.0.2",
"gulp-zip": "^6.0.0",
"typescript": "^5.2.2",
"vite": "^4.4.11",
"vite-plugin-inferno": "0.0.1"
Expand Down
10 changes: 10 additions & 0 deletions template-inferno-ts/src/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp'
import zip from 'gulp-zip'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const manifest = require('../build/manifest.json')

gulp
.src('build/*')
.pipe(zip(`${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`))
.pipe(gulp.dest('package'))
5 changes: 4 additions & 1 deletion template-lit-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"fmt": "prettier --write '**/*.{js,json,css,scss,md}'"
"fmt": "prettier --write '**/*.{js,json,css,scss,md}'",
"zip": "npm run build && node src/zip.js"
},
"dependencies": {
"lit": "^2.8.0"
},
"devDependencies": {
"@crxjs/vite-plugin": "^2.0.0-beta.19",
"gulp": "^4.0.2",
"gulp-zip": "^6.0.0",
"prettier": "^3.0.3",
"vite": "^3.2.7"
}
Expand Down
10 changes: 10 additions & 0 deletions template-lit-js/src/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp'
import zip from 'gulp-zip'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const manifest = require('../build/manifest.json')

gulp
.src('build/*')
.pipe(zip(`${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`))
.pipe(gulp.dest('package'))
5 changes: 4 additions & 1 deletion template-lit-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"fmt": "prettier --write '**/*.{ts,json,css,scss,md}'"
"fmt": "prettier --write '**/*.{ts,json,css,scss,md}'",
"zip": "npm run build && node src/zip.js"
},
"dependencies": {
"lit": "^3.0.0"
},
"devDependencies": {
"@crxjs/vite-plugin": "^2.0.0-beta.19",
"@types/chrome": "^0.0.246",
"gulp": "^4.0.2",
"gulp-zip": "^6.0.0",
"path": "^0.12.7",
"prettier": "^3.0.3",
"typescript": "^5.2.2",
Expand Down
10 changes: 10 additions & 0 deletions template-lit-ts/src/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp'
import zip from 'gulp-zip'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const manifest = require('../build/manifest.json')

gulp
.src('build/*')
.pipe(zip(`${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`))
.pipe(gulp.dest('package'))
5 changes: 4 additions & 1 deletion template-preact-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"fmt": "prettier --write '**/*.{jsx,js,json,css,scss,md}'"
"fmt": "prettier --write '**/*.{jsx,js,json,css,scss,md}'",
"zip": "npm run build && node src/zip.js"
},
"dependencies": {
"preact": "^10.18.1"
},
"devDependencies": {
"@crxjs/vite-plugin": "^2.0.0-beta.19",
"@preact/preset-vite": "^2.6.0",
"gulp": "^4.0.2",
"gulp-zip": "^6.0.0",
"prettier": "^3.0.3",
"vite": "^4.4.11"
}
Expand Down
10 changes: 10 additions & 0 deletions template-preact-js/src/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp'
import zip from 'gulp-zip'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const manifest = require('../build/manifest.json')

gulp
.src('build/*')
.pipe(zip(`${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`))
.pipe(gulp.dest('package'))
5 changes: 4 additions & 1 deletion template-preact-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"fmt": "prettier --write '**/*.{tsx,ts,json,css,scss,md}'"
"fmt": "prettier --write '**/*.{tsx,ts,json,css,scss,md}'",
"zip": "npm run build && node src/zip.js"
},
"dependencies": {
"preact": "^10.18.1"
Expand All @@ -28,6 +29,8 @@
"@crxjs/vite-plugin": "^2.0.0-beta.19",
"@preact/preset-vite": "^2.6.0",
"@types/chrome": "^0.0.246",
"gulp": "^4.0.2",
"gulp-zip": "^6.0.0",
"prettier": "^3.0.3",
"typescript": "^5.2.2",
"vite": "^4.4.11"
Expand Down
10 changes: 10 additions & 0 deletions template-preact-ts/src/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp'
import zip from 'gulp-zip'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const manifest = require('../build/manifest.json')

gulp
.src('build/*')
.pipe(zip(`${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`))
.pipe(gulp.dest('package'))
5 changes: 4 additions & 1 deletion template-react-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"fmt": "prettier --write '**/*.{jsx,js,json,css,scss,md}'"
"fmt": "prettier --write '**/*.{jsx,js,json,css,scss,md}'",
"zip": "npm run build && node src/zip.js"
},
"dependencies": {
"react": "^18.2.0",
Expand All @@ -31,6 +32,8 @@
"@types/react-dom": "^18.2.13",
"@vitejs/plugin-react": "^4.1.0",
"glob": "^10.3.10",
"gulp": "^4.0.2",
"gulp-zip": "^6.0.0",
"prettier": "^3.0.3",
"vite": "^4.4.11"
}
Expand Down
10 changes: 10 additions & 0 deletions template-react-js/src/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp'
import zip from 'gulp-zip'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const manifest = require('../build/manifest.json')

gulp
.src('build/*')
.pipe(zip(`${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`))
.pipe(gulp.dest('package'))
5 changes: 4 additions & 1 deletion template-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"fmt": "prettier --write '**/*.{tsx,ts,json,css,scss,md}'"
"fmt": "prettier --write '**/*.{tsx,ts,json,css,scss,md}'",
"zip": "npm run build && node src/zip.js"
},
"dependencies": {
"react": "^18.2.0",
Expand All @@ -31,6 +32,8 @@
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
"@vitejs/plugin-react": "^4.1.0",
"gulp": "^4.0.2",
"gulp-zip": "^6.0.0",
"prettier": "^3.0.3",
"typescript": "^5.2.2",
"vite": "^4.4.11"
Expand Down
10 changes: 10 additions & 0 deletions template-react-ts/src/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp'
import zip from 'gulp-zip'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const manifest = require('../build/manifest.json')

gulp
.src('build/*')
.pipe(zip(`${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`))
.pipe(gulp.dest('package'))
5 changes: 4 additions & 1 deletion template-solid-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"fmt": "prettier --write '**/*.{tsx,ts,json,css,md}'"
"fmt": "prettier --write '**/*.{tsx,ts,json,css,md}'",
"zip": "npm run build && node src/zip.js"
},
"devDependencies": {
"@crxjs/vite-plugin": "^2.0.0-beta.19",
"gulp": "^4.0.2",
"gulp-zip": "^6.0.0",
"prettier": "^3.0.3",
"vite": "^4.4.11",
"vite-plugin-solid": "^2.7.1"
Expand Down
10 changes: 10 additions & 0 deletions template-solid-js/src/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp'
import zip from 'gulp-zip'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const manifest = require('../build/manifest.json')

gulp
.src('build/*')
.pipe(zip(`${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`))
.pipe(gulp.dest('package'))
5 changes: 4 additions & 1 deletion template-solid-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"fmt": "prettier --write '**/*.{tsx,ts,json,css,md}'"
"fmt": "prettier --write '**/*.{tsx,ts,json,css,md}'",
"zip": "npm run build && node src/zip.js"
},
"devDependencies": {
"@crxjs/vite-plugin": "^2.0.0-beta.19",
"@types/chrome": "^0.0.246",
"gulp": "^4.0.2",
"gulp-zip": "^6.0.0",
"prettier": "^3.0.3",
"typescript": "^5.2.2",
"vite": "^4.4.11",
Expand Down
10 changes: 10 additions & 0 deletions template-solid-ts/src/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp'
import zip from 'gulp-zip'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const manifest = require('../build/manifest.json')

gulp
.src('build/*')
.pipe(zip(`${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`))
.pipe(gulp.dest('package'))
5 changes: 4 additions & 1 deletion template-stencil-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
"build": "stencil build",
"start": "stencil build --dev --watch --serve",
"generate": "stencil generate",
"fmt": "prettier --write '**/*.{jsx,js,json,css,md}'"
"fmt": "prettier --write '**/*.{jsx,js,json,css,md}'",
"zip": "npm run build && node src/zip.js"
},
"devDependencies": {
"@stencil/core": "^4.4.0",
"@types/chrome": "^0.0.246",
"@types/node": "^20.8.3",
"express": "^4.18.2",
"gulp": "^4.0.2",
"gulp-zip": "^6.0.0",
"prettier": "^3.0.3",
"typescript": "^5.2.2"
}
Expand Down
10 changes: 10 additions & 0 deletions template-stencil-ts/src/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import gulp from 'gulp'
import zip from 'gulp-zip'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const manifest = require('../build/manifest.json')

gulp
.src('build/*')
.pipe(zip(`${manifest.name.replaceAll(' ', '-')}-${manifest.version}.zip`))
.pipe(gulp.dest('package'))
Loading

0 comments on commit d7c3b84

Please sign in to comment.