This repository has been archived by the owner on Oct 19, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RFC] Update folder structure (#303)
* chore: move components and tools under src * chore: move existing test and story files * chore: update paths for component stories * chore: remove redundant Staticfile for deploy * chore: specify node and yarn version range * chore: remove temp migrate script * chore: update import paths for components * chore: fix eslint violations * chore: run prettier * chore: revert version change for warning module * chore: update yarn version in engines field
- Loading branch information
Showing
303 changed files
with
749 additions
and
368 deletions.
There are no files selected for viewing
File renamed without changes.
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,7 +1,7 @@ | ||
# Ignore generated folders | ||
node_modules | ||
cjs | ||
es | ||
lib | ||
storybook-static | ||
|
||
# Logs | ||
|
This file was deleted.
Oops, something went wrong.
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,7 +1,7 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- '6' | ||
- '8' | ||
|
||
cache: | ||
yarn: true | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,44 +1,37 @@ | ||
const execSync = require('child_process').execSync; | ||
const inInstall = require('in-publish').inInstall; | ||
'use strict'; | ||
|
||
const { execSync } = require('child_process'); | ||
const { inInstall } = require('in-publish'); | ||
const path = require('path'); | ||
const rimraf = require('rimraf'); | ||
const { promisify } = require('util'); | ||
|
||
if (inInstall()) process.exit(0); | ||
if (inInstall()) { | ||
process.exit(0); | ||
} | ||
|
||
let babelPath = path.resolve(__dirname, '../node_modules/.bin/babel'); | ||
babelPath = babelPath.replace(/ /g, '\\ '); | ||
const dirs = ['components', 'lib', 'internal']; | ||
const rootDir = path.resolve(__dirname, '../'); | ||
const babelPath = path | ||
.resolve(__dirname, '../node_modules/.bin/babel') | ||
.replace(/ /g, '\\ '); | ||
const rimrafAsync = promisify(rimraf); | ||
|
||
const exec = (command, extraEnv) => | ||
execSync(command, { | ||
stdio: 'inherit', | ||
env: Object.assign({}, process.env, extraEnv), | ||
}); | ||
|
||
const compile = (dirs, type) => { | ||
dirs.forEach(dir => { | ||
exec(`${babelPath} ${dir} --out-dir ${type}/${dir} --ignore __tests__`, { | ||
BABEL_ENV: type, | ||
console.log('Deleting old build folders...'); | ||
Promise.all([rimrafAsync(`${rootDir}/cjs`), rimrafAsync(`${rootDir}/es`)]) | ||
.then(() => { | ||
exec(`${babelPath} src -q -d es --ignore __tests__`, { | ||
BABEL_ENV: 'es', | ||
}); | ||
exec(`${babelPath} src -q -d lib --ignore __tests__`, { | ||
BABEL_ENV: 'cjs', | ||
}); | ||
}) | ||
.catch(error => { | ||
throw error; | ||
}); | ||
|
||
exec(`${babelPath} index.js -d ${type}`, { | ||
BABEL_ENV: type, | ||
}); | ||
}; | ||
|
||
console.log('Deleting old build folders ...'); | ||
rimraf(`${rootDir}/cjs`, err => { | ||
if (err) throw err; | ||
|
||
rimraf(`${rootDir}/es`, err => { | ||
if (err) throw err; | ||
|
||
console.log('Building CommonJS modules ...'); | ||
compile(dirs, 'cjs'); | ||
|
||
console.log('\nBuilding ES modules ...'); | ||
compile(dirs, 'es'); | ||
}); | ||
}); |
File renamed without changes.
10 changes: 6 additions & 4 deletions
10
.storybook/components/AccordionStory.js → src/components/Accordion/Accordion-story.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
File renamed without changes.
File renamed without changes.
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,2 @@ | ||
import Accordion from './Accordion'; | ||
export default Accordion; |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
components/AccordionItem.js → ...components/AccordionItem/AccordionItem.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
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,2 @@ | ||
import AccordionItem from './AccordionItem'; | ||
export default AccordionItem; |
6 changes: 4 additions & 2 deletions
6
.storybook/components/BreadcrumbStory.js → ...components/Breadcrumb/Breadcrumb-story.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
File renamed without changes.
File renamed without changes.
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,2 @@ | ||
import Breadcrumb from './Breadcrumb'; | ||
export default Breadcrumb; |
2 changes: 1 addition & 1 deletion
2
components/BreadcrumbItem.js → ...mponents/BreadcrumbItem/BreadcrumbItem.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
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,2 @@ | ||
import BreadcrumbItem from './BreadcrumbItem'; | ||
export default BreadcrumbItem; |
2 changes: 1 addition & 1 deletion
2
.storybook/components/ButtonStory.js → src/components/Button/Button-story.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
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,2 @@ | ||
import Button from './Button'; | ||
export default Button; |
Oops, something went wrong.