-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: change repository to monorepo
- Loading branch information
Showing
207 changed files
with
17,298 additions
and
1,903 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
**.log | ||
|
||
.*-tmp | ||
.*-cache | ||
.DS_Store | ||
.git | ||
.idea | ||
.jekyll-metadata | ||
.tmp | ||
.vscode | ||
.editorconfig | ||
|
||
bower_components | ||
node_modules | ||
|
||
/test | ||
|
||
bower.json | ||
gulpfile.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"printWidth": 120, | ||
"singleQuote": true, | ||
"semi": true, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "petals-basic", | ||
"homepage": "https://github.com/petals/basic", | ||
"authors": [ | ||
"Ourai Lin <[email protected]>" | ||
], | ||
"description": "CSS framework following SUIT CSS naming conventions", | ||
"main": [ | ||
"scss/_all.scss", | ||
"css/all.css" | ||
], | ||
"keywords": [ | ||
"css", | ||
"sass", | ||
"scss", | ||
"helper" | ||
], | ||
"license": "MIT", | ||
"ignore": [ | ||
"**/.*", | ||
"*.json", | ||
"*.log", | ||
"*.md", | ||
"gulpfile.js", | ||
"bower_components", | ||
"node_modules", | ||
"test", | ||
"tests" | ||
], | ||
"devDependencies": { | ||
"suitcss-sass-0.1.0": "suitcss-sass#0.1.0", | ||
"trick-1.0.3": "packagent/trick#1.0.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const gulp = require('gulp'); | ||
const concat = require('gulp-concat'); | ||
const rename = require('gulp-rename'); | ||
const sass = require('gulp-sass'); | ||
const scssimport = require('gulp-shopify-sass'); | ||
const cssmin = require('gulp-cssmin'); | ||
const stripCssComments = require('gulp-strip-css-comments'); | ||
const sourcemaps = require('gulp-sourcemaps'); | ||
const { exec } = require('child_process'); | ||
|
||
const { DIST_DIR, ENTRY_POINTS } = require('./helper'); | ||
|
||
const tasks = []; | ||
const ALL_FILE_NAME = '_all.scss'; | ||
|
||
ENTRY_POINTS.forEach(name => { | ||
const taskName = `compile-scss-${name}`; | ||
|
||
tasks.push(taskName); | ||
|
||
gulp.task(taskName, () => { | ||
return gulp | ||
.src(`src/style/_${name}.scss`) | ||
.pipe(concat(`${name}.scss`)) | ||
.pipe( | ||
sass({ outputStyle: 'expanded', noLineComments: true, keepSpecialComments: 0 }).on( | ||
'error', | ||
sass.logError, | ||
), | ||
) | ||
.pipe(stripCssComments({ preserve: false })) | ||
.pipe(gulp.dest(DIST_DIR)); | ||
}); | ||
}); | ||
|
||
gulp.task('concat-entry-points', () => | ||
gulp | ||
.src(ENTRY_POINTS.map(entry => `src/style/_${entry}.scss`)) | ||
.pipe(concat(ALL_FILE_NAME)) | ||
.pipe(scssimport()) | ||
.pipe( | ||
rename(p => { | ||
p.basename = p.basename.replace('.cat.scss', ''); | ||
p.extname = '.scss'; | ||
}), | ||
) | ||
.pipe(gulp.dest(DIST_DIR)), | ||
); | ||
|
||
gulp.task( | ||
'compile-scss-all', | ||
gulp.series('concat-entry-points', () => | ||
gulp | ||
.src(`${DIST_DIR}/${ALL_FILE_NAME}`) | ||
.pipe(concat(ALL_FILE_NAME.replace('_', ''))) | ||
.pipe( | ||
sass({ outputStyle: 'expanded', noLineComments: true, keepSpecialComments: 0 }).on( | ||
'error', | ||
sass.logError, | ||
), | ||
) | ||
.pipe(stripCssComments({ preserve: false })) | ||
.pipe(gulp.dest(DIST_DIR)), | ||
), | ||
); | ||
|
||
tasks.push('compile-scss-all'); | ||
|
||
gulp.task( | ||
'compress', | ||
gulp.series(gulp.parallel(...tasks), () => | ||
gulp | ||
.src(`${DIST_DIR}/**/*.css`, { base: DIST_DIR }) | ||
.pipe(sourcemaps.init({ largeFile: true, loadMaps: true })) | ||
.pipe(cssmin()) | ||
.pipe(rename({ suffix: '.min' })) | ||
.pipe(sourcemaps.write('')) | ||
.pipe(gulp.dest(DIST_DIR)), | ||
), | ||
); | ||
|
||
gulp.task( | ||
'compile', | ||
gulp.series('compress', () => { | ||
const paths = [...ENTRY_POINTS, 'all'].map(entry => `${DIST_DIR}/${entry}.css`); | ||
|
||
return exec(`rm -rf ${paths.join(' ')}`); | ||
}), | ||
); | ||
|
||
module.exports = { | ||
COMPILE_TASKS: ['compile'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const gulp = require('gulp'); | ||
const scssimport = require('gulp-shopify-sass'); | ||
const rename = require('gulp-rename'); | ||
|
||
const { DIST_DIR } = require('./helper'); | ||
|
||
gulp.task('extract-scss', () => { | ||
return gulp | ||
.src('src/style/*.scss') | ||
.pipe(scssimport()) | ||
.pipe( | ||
rename(p => { | ||
p.basename = p.basename.replace('.cat.scss', ''); | ||
p.extname = '.scss'; | ||
}), | ||
) | ||
.pipe(gulp.dest(DIST_DIR)); | ||
}); | ||
|
||
module.exports = { | ||
EXTRACT_TASKS: ['extract-scss'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const DIST_DIR = 'dist/style'; | ||
const ENTRY_POINTS = ['base', 'utils']; | ||
|
||
module.exports = { | ||
DIST_DIR, | ||
ENTRY_POINTS, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const { COMPILE_TASKS } = require('./compile'); | ||
const { EXTRACT_TASKS } = require('./extract'); | ||
|
||
module.exports = { | ||
COMPILE_TASKS, | ||
EXTRACT_TASKS, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const gulp = require('gulp'); | ||
|
||
const { COMPILE_TASKS, EXTRACT_TASKS } = require('./build/tasks'); | ||
|
||
gulp.task('default', gulp.parallel(...EXTRACT_TASKS, ...COMPILE_TASKS)); |
Oops, something went wrong.