-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
7,583 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "src"] | ||
path = src | ||
url = [email protected]:ericfennis/vue-structure.git |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
/src | ||
/src | ||
build.js | ||
deploy.sh | ||
*.log |
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,84 @@ | ||
const path = require("path"); | ||
const fs = require("fs-extra"); | ||
const walk = require('walk'); | ||
|
||
const dist = './generator/template'; | ||
|
||
const excludeByBuild = [ | ||
'src/node_modules', | ||
'src/.git', | ||
'src/public', | ||
'src/.browserslistrc', | ||
'src/package.json', | ||
'src/postcss.config.js', | ||
'src/preset.json', | ||
'src/yarn.lock', | ||
]; | ||
|
||
fs.emptyDir(dist) | ||
.then(() => { | ||
copy(); | ||
}) | ||
.catch(err => { | ||
console.error(err) | ||
}); | ||
|
||
const copy = () => { | ||
fs.copy( | ||
'./src', | ||
dist, | ||
{ | ||
filter: src => !excludeByBuild.includes(src) | ||
}, | ||
(err) => { | ||
if (err) { | ||
console.error(err); | ||
} else { | ||
console.log("success!"); | ||
walker(); | ||
} | ||
}); | ||
} | ||
|
||
const walker = () => { | ||
walk | ||
.walk(dist) | ||
.on("file", (root, file, next) => { | ||
const prefix = file.name.charAt(0); | ||
if(prefix === '_' || prefix === '.'){ | ||
//console.log(root); | ||
console.log(`\nFound file:\t`,file.name); | ||
renameFile(root, file, prefix) | ||
.then(response => { | ||
console.log(`Renamed it to:\t`,response); | ||
next(); | ||
}) | ||
.catch(error => { | ||
console.error(error); | ||
}) | ||
|
||
} else { | ||
next(); | ||
} | ||
|
||
}) | ||
.on("end", () => { | ||
console.log(`\n======================================\n TEMPLATE BUILDED !!!`) | ||
}) | ||
} | ||
|
||
const renameFile = (root, file, prefix) => { | ||
return new Promise( | ||
(resolve, reject) => { | ||
const renamedFilename = | ||
prefix === '_' ? `_${file.name}` : | ||
prefix === '.' ? '_' + file.name.substring(1) | ||
: reject('error'); | ||
|
||
fs.rename(`${root}/${file.name}`, `${root}/${renamedFilename}`, function(err) { | ||
if ( err ) reject(err) | ||
resolve(renamedFilename); | ||
}); | ||
} | ||
) | ||
} |
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
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
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
// SCSS Styling App.scss | ||
// App Styling | ||
.app { | ||
// | ||
} |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<script src="./App.js"></script> | ||
|
||
<template> | ||
<div> | ||
<div class="app"> | ||
<RouterView /> | ||
</div> | ||
</template> |
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
5 changes: 4 additions & 1 deletion
5
generator/template/src/components/ExampleComponent/ExampleComponent.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 |
---|---|---|
@@ -1 +1,4 @@ | ||
// ExampleComponent SCSS | ||
// Example Component SCSS Scoped | ||
.example-component { | ||
// | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Icon Component SCSS Scoped | ||
.icon { | ||
display: inline-block; | ||
vertical-align: middle; | ||
|
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { default as Icon } from './Icon'; | ||
export { default as ExampleComponent } from './ExampleComponent'; | ||
export { default as ExampleComponent } from './ExampleComponent'; |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
/* eslint-disable import/prefer-default-export, import, prettier/prettier */ | ||
export { default as exampleDirective } from './exampleDirective'; | ||
/* eslint-disable import/prefer-default-export,import,prettier/prettier */ | ||
export { default as exampleDirective } from './exampleDirective'; |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
/* eslint-disable import/prefer-default-export, import, prettier/prettier */ | ||
export { default as exampleFilter } from './exampleFilter'; | ||
/* eslint-disable import/prefer-default-export,import,prettier/prettier */ | ||
export { default as exampleFilter } from './exampleFilter'; |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
/* eslint-disable import/prefer-default-export, import, prettier/prettier */ | ||
export { default as exampleMixin } from './exampleMixin'; | ||
/* eslint-disable import/prefer-default-export,import,prettier/prettier */ | ||
export { default as exampleMixin } from './exampleMixin'; |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export { default, types } from './app'; | ||
export { default, types } from './app'; |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
// Home SCSS | ||
// Home SCSS Scoped | ||
.home { | ||
// | ||
} |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
// 404 Not Found SCSS | ||
.not-found { | ||
// | ||
} |
Oops, something went wrong.