Skip to content

Commit

Permalink
refactor: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
patzick committed Dec 5, 2019
1 parent e970e34 commit 6c1e4d4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 48 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/deploy-zeit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ jobs:
run: |
yarn
node ./scripts/prepareSFUIRepoClone.js
# git clone --single-branch --branch develop https://github.com/DivanteLtd/storefront-ui
# yarn
# cd ./packages/vue
# yarn remove lerna
# cd ../../../packages/default-theme/
# yarn link @storefront-ui/vue
# cd ../../
- name: Build packages
run: |
yarn
Expand Down
6 changes: 1 addition & 5 deletions packages/default-theme/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,4 @@ sw.*
.DS_Store

# Vim swap files
*.swp

# Local yalc files
# .yalc
# yalc.lock
*.swp
6 changes: 1 addition & 5 deletions packages/default-theme/components/TopNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
active-sidebar="activeSidebar"
>
<template #navigation>
<!-- <nuxt-link to="/"><SfHeaderNavigationItem>Home</SfHeaderNavigationItem></nuxt-link>
<nuxt-link to="/"><SfHeaderNavigationItem>Home</SfHeaderNavigationItem></nuxt-link>
<nuxt-link v-for="element in navigationElements" :key="element.id" :to="convertToSlug(element.name)">
<SfHeaderNavigationItem>{{ element.name }}</SfHeaderNavigationItem>
</nuxt-link> -->
<nuxt-link to="/"><span>Home</span></nuxt-link>
<nuxt-link v-for="element in navigationElements" :key="element.id" :to="convertToSlug(element.name)">
<span>{{ element.name }}</span>
</nuxt-link>
</template>

Expand Down
41 changes: 10 additions & 31 deletions scripts/prepareSFUIRepoClone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Setup core dependencies as they're not published yet
* Setup SFUI develop branch and locally publish dependencies
*/

const execa = require("execa");
Expand All @@ -10,17 +10,12 @@ const tempDir = path.resolve(__dirname, "../temp");
const repoDir = `${tempDir}/storefront-ui`;
const vuePackageDir = `${repoDir}/packages/vue`;
const sharedPackageDir = `${repoDir}/packages/shared`;
// 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`;
// const corePackagesDir = path.resolve(__dirname, "../vsf-core-packages");
// const vueCorePackageDir = `${corePackagesDir}/vue`;
// const sharedCorePackageDir = `${corePackagesDir}/shared`;

async function run() {
/**
* Clone newest Next repo
* Clone develop SFUI
*/
if (fs.existsSync(repoDir)) {
fs.removeSync(repoDir);
Expand All @@ -40,28 +35,14 @@ async function run() {
}
);

/**
* Init repo
*/
await execa("yarn", [], {
stdio: "inherit",
cwd: repoDir
});

/**
* Prepare nuxt-module package
*/
// if (fs.existsSync(vueCorePackageDir)) {
// fs.removeSync(vueCorePackageDir);
// }
// await execa("cp", ["-r", vuePackageDir, vueCorePackageDir], {
// stdio: "inherit"
// });

// if (fs.existsSync(sharedCorePackageDir)) {
// fs.removeSync(sharedCorePackageDir);
// }
// await execa("cp", ["-r", sharedPackageDir, sharedCorePackageDir], {
// stdio: "inherit"
// });

// When script added
// await execa("yarn", ["prepublish"], {
// stdio: "inherit",
Expand All @@ -70,37 +51,35 @@ async function run() {
// 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
});

// if (fs.existsSync(repoDir)) {
// fs.removeSync(repoDir);
// }
}

run();

0 comments on commit 6c1e4d4

Please sign in to comment.