-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix filename and directory name overlap breaking the build (#264)
* wip * linting * got specs working and removed extra test code * regex ftw * remove page name known issue from docs * clean up TODOs * all scenarios building and passing
- Loading branch information
1 parent
df169d5
commit 75378b7
Showing
10 changed files
with
124 additions
and
15 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
53 changes: 53 additions & 0 deletions
53
...t.workspace-user-directory-mapping/build.default.workspace-user-directory-mapping.spec.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,53 @@ | ||
/* | ||
* Use Case | ||
* Run Greenwood build command with no config and custom workspace testing for file / directory name collisions. | ||
* See this issue for more details: https://github.com/ProjectEvergreen/greenwood/issues/132 | ||
* | ||
* User Result | ||
* Should generate a bare bones Greenwood build with out any errors due to naming. | ||
* | ||
* User Command | ||
* greenwood build | ||
* | ||
* User Config | ||
* None (Greenwood Default) | ||
* | ||
* User Workspace | ||
* src/ | ||
* components/ | ||
* header/ | ||
* header.js | ||
* pages/ | ||
* about.md | ||
* index.md | ||
* services/ | ||
* components.js | ||
* pages/ | ||
* pages.js | ||
* templates/ | ||
* page-template.js | ||
*/ | ||
const TestBed = require('../../../../../test/test-bed'); | ||
|
||
describe('Build Greenwood With: ', function() { | ||
const LABEL = 'Default Greenwood Configuration and Workspace w/Naming Collisions'; | ||
let setup; | ||
|
||
before(async function() { | ||
setup = new TestBed(); | ||
this.context = await setup.setupTestBed(__dirname); | ||
}); | ||
|
||
describe(LABEL, function() { | ||
before(async () => { | ||
await setup.runGreenwoodCommand('build'); | ||
}); | ||
|
||
runSmokeTest(['public', 'index', 'not-found'], LABEL); | ||
}); | ||
|
||
after(function() { | ||
setup.teardownTestBed(); | ||
}); | ||
|
||
}); |
10 changes: 10 additions & 0 deletions
10
...test/cases/build.default.workspace-user-directory-mapping/src/components/header/header.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,10 @@ | ||
import service from '../../services/components'; | ||
import '../../services/pages/pages'; | ||
|
||
class HeaderComponent extends HTMLElement { | ||
constructor() { | ||
service('hello world'); | ||
} | ||
} | ||
|
||
customElements.define('x-header', HeaderComponent); |
3 changes: 3 additions & 0 deletions
3
...li/test/cases/build.default.workspace-user-directory-mapping/src/pages/index.md
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 @@ | ||
### Greenwood | ||
|
||
This is the home page built by Greenwood. Make your own pages in src/pages/index.js! |
3 changes: 3 additions & 0 deletions
3
...li/test/cases/build.default.workspace-user-directory-mapping/src/pages/pages.md
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 @@ | ||
### Pages page | ||
|
||
This is a custom about page built by Greenwood. |
5 changes: 5 additions & 0 deletions
5
.../cli/test/cases/build.default.workspace-user-directory-mapping/src/services/components.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,5 @@ | ||
const logger = (message = '') => { | ||
console.log(`LOGGER [components] => ${message}`); | ||
}; | ||
|
||
export default logger; |
5 changes: 5 additions & 0 deletions
5
...cli/test/cases/build.default.workspace-user-directory-mapping/src/services/pages/pages.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,5 @@ | ||
const logger = (message = '') => { | ||
console.log(`LOGGER [pages] => ${message}`); | ||
}; | ||
|
||
export default logger; |
22 changes: 22 additions & 0 deletions
22
.../test/cases/build.default.workspace-user-directory-mapping/src/templates/page-template.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,22 @@ | ||
import { html, LitElement } from 'lit-element'; | ||
import '../components/header/header'; | ||
|
||
MDIMPORT; | ||
METAIMPORT; | ||
METADATA; | ||
|
||
class PageTemplate extends LitElement { | ||
render() { | ||
return html` | ||
METAELEMENT | ||
<div class='wrapper'> | ||
<div class='page-template blog-content content owen-test'> | ||
<entry></entry> | ||
</div> | ||
<x-header></x-header> | ||
</div> | ||
`; | ||
} | ||
} | ||
|
||
customElements.define('page-template', PageTemplate); |
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