-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from DivanteLtd/workflow/theme/deploy-with-st…
…orefront-ui-develop workflow: use SFUI for development, deploy master to production
- Loading branch information
Showing
10 changed files
with
934 additions
and
1,243 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
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 |
---|---|---|
|
@@ -89,4 +89,4 @@ sw.* | |
.DS_Store | ||
|
||
# Vim swap files | ||
*.swp | ||
*.swp |
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/** | ||
* Setup SFUI develop branch and locally publish dependencies | ||
*/ | ||
|
||
const execa = require("execa"); | ||
const path = require("path"); | ||
const fs = require("fs-extra"); | ||
|
||
const tempDir = path.resolve(__dirname, "../temp"); | ||
const repoDir = `${tempDir}/storefront-ui`; | ||
const vuePackageDir = `${repoDir}/packages/vue`; | ||
const sharedPackageDir = `${repoDir}/packages/shared`; | ||
const themeDir = path.resolve(__dirname, "../packages/default-theme"); | ||
const createIndexScriptPath = `${vuePackageDir}/scripts/create-index-files.js`; | ||
const setScssScriptPath = `${vuePackageDir}/scripts/set-styles-variables-root-path.js`; | ||
async function run() { | ||
/** | ||
* Clone develop SFUI | ||
*/ | ||
if (fs.existsSync(repoDir)) { | ||
fs.removeSync(repoDir); | ||
} | ||
await execa( | ||
"git", | ||
[ | ||
"clone", | ||
"--single-branch", | ||
"--branch", | ||
"develop", | ||
"https://github.com/DivanteLtd/storefront-ui", | ||
repoDir | ||
], | ||
{ | ||
stdio: "inherit" | ||
} | ||
); | ||
|
||
/** | ||
* Init repo | ||
*/ | ||
await execa("yarn", [], { | ||
stdio: "inherit", | ||
cwd: repoDir | ||
}); | ||
|
||
// When script added | ||
// await execa("yarn", ["prepublish"], { | ||
// stdio: "inherit", | ||
// cwd: vuePackageDir | ||
// }); | ||
// else | ||
const { createIndexFiles } = require(createIndexScriptPath); | ||
const { setStylesVariablesRootPath } = require(setScssScriptPath); | ||
function runPrePublish() { | ||
createIndexFiles(); | ||
setStylesVariablesRootPath(); | ||
} | ||
runPrePublish(); | ||
|
||
// Publish shared pashage | ||
await execa("npx", ["yalc", "publish"], { | ||
stdio: "inherit", | ||
cwd: sharedPackageDir | ||
}); | ||
|
||
// Publish vue package | ||
await execa("npx", ["yalc", "publish"], { | ||
stdio: "inherit", | ||
cwd: vuePackageDir | ||
}); | ||
|
||
/** | ||
* Add vue and shared package into theme | ||
*/ | ||
await execa("npx", ["yalc", "add", "@storefront-ui/vue"], { | ||
stdio: "inherit", | ||
cwd: themeDir | ||
}); | ||
await execa("npx", ["yalc", "add", "@storefront-ui/shared"], { | ||
stdio: "inherit", | ||
cwd: themeDir | ||
}); | ||
} | ||
|
||
run(); |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.
3113e24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for website ready!
Built with commit fe3a2d9
https://shopware-pwa-gxhlxulc2.now.sh