Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add CxJS template UI * Configure Babel for CxJS template * Load transform-cx-jsx on demand * Removing direct sharp dependency * Update CxJS template * add Dojo 2 as a preset template - add dojo2 template - add temporary project as template to load (github) - add type definition creation to styles transpiler - add dojo 2 to home page - add default loading of dojo template src/index.html and src/main.css * change dojo template url to dojo codesandbox repo * add in temporary API override -- REMOVE COMMIT * set isTypeScript to true for dojo template * remove DojoIcon from dojo template definition * Don't throw error for cxjs if main.css is not found * Remove force of Dojo * Fix check * Update URLs * Add CxJS to homepage * update yarn.lock * Add CxJS cube to the homepage and fix CxJS and Dojo icons (#751) * Force build * Change logo order for consistency with homepage * Clean up transpilation listener on unmount * Add to changelog Co-authored-by: Marko Stijak <mstijak@gmail.com> Co-authored-by: Nick Nisi <nick@nisi.org>
- Loading branch information
1 parent
c6fa022
commit 1e544d4
Showing
24 changed files
with
659 additions
and
6 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,4 @@ | ||
[*.js] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf |
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import babelTranspiler from '../../transpilers/babel'; | ||
import jsonTranspiler from '../../transpilers/json'; | ||
import stylesTranspiler from '../../transpilers/style'; | ||
import sassTranspiler from '../../transpilers/sass'; | ||
import rawTranspiler from '../../transpilers/raw'; | ||
import stylusTranspiler from '../../transpilers/stylus'; | ||
import lessTranspiler from '../../transpilers/less'; | ||
import tsTranspiler from '../../transpilers/typescript'; | ||
|
||
import Preset from '../'; | ||
|
||
export default function initialize() { | ||
const cxjsPreset = new Preset( | ||
'cxjs', | ||
['js', 'jsx', 'ts', 'tsx', 'json', 'less', 'scss', 'sass', 'styl', 'css'], | ||
{}, | ||
{} | ||
); | ||
|
||
cxjsPreset.registerTranspiler(module => /\.jsx?$/.test(module.path), [ | ||
{ | ||
transpiler: babelTranspiler, | ||
options: { | ||
dynamicCSSModules: true, | ||
}, | ||
}, | ||
]); | ||
|
||
cxjsPreset.registerTranspiler(module => /\.tsx?$/.test(module.path), [ | ||
{ transpiler: tsTranspiler }, | ||
]); | ||
|
||
cxjsPreset.registerTranspiler(module => /\.css$/.test(module.path), [ | ||
{ transpiler: stylesTranspiler }, | ||
]); | ||
|
||
cxjsPreset.registerTranspiler(module => /\.json$/.test(module.path), [ | ||
{ transpiler: jsonTranspiler }, | ||
]); | ||
|
||
const sassWithConfig = { | ||
transpiler: sassTranspiler, | ||
options: {}, | ||
}; | ||
|
||
const lessWithConfig = { | ||
transpiler: lessTranspiler, | ||
options: {}, | ||
}; | ||
|
||
const stylusWithConfig = { | ||
transpiler: stylusTranspiler, | ||
options: {}, | ||
}; | ||
const styles = { | ||
css: [], | ||
scss: [sassWithConfig], | ||
sass: [sassWithConfig], | ||
less: [lessWithConfig], | ||
styl: [stylusWithConfig], | ||
}; | ||
|
||
/** | ||
* Registers transpilers for all different combinations | ||
* | ||
* @returns | ||
*/ | ||
function registerStyleTranspilers() { | ||
return Object.keys(styles).forEach(type => { | ||
cxjsPreset.registerTranspiler( | ||
module => new RegExp(`\\.${type}`).test(module.path), | ||
[...styles[type], { transpiler: stylesTranspiler }] | ||
); | ||
}); | ||
} | ||
|
||
registerStyleTranspilers(); | ||
|
||
cxjsPreset.registerTranspiler(() => true, [{ transpiler: rawTranspiler }]); | ||
|
||
return cxjsPreset; | ||
} |
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,60 @@ | ||
import { join, absolute } from 'common/utils/path'; | ||
import Preset from '../'; | ||
|
||
import typescriptTranspiler from '../../transpilers/typescript'; | ||
import rawTranspiler from '../../transpilers/raw'; | ||
import jsonTranspiler from '../../transpilers/json'; | ||
import stylesTranspiler from '../../transpilers/style'; | ||
import babelTranspiler from '../../transpilers/babel'; | ||
|
||
export default function initialize() { | ||
const preset = new Preset( | ||
'@dojo/cli-create-app', | ||
['ts', 'tsx', 'js', 'json'], | ||
{}, | ||
{ | ||
setup: async manager => { | ||
const stylesPath = absolute(join('src', 'main.css')); | ||
try { | ||
const tModule = await manager.resolveTranspiledModuleAsync( | ||
stylesPath, | ||
'/' | ||
); | ||
await tModule.transpile(manager); | ||
tModule.setIsEntry(true); | ||
tModule.evaluate(manager); | ||
} catch (e) { | ||
if (e.type === 'module-not-found') { | ||
// Do nothing | ||
} else { | ||
throw e; | ||
} | ||
} | ||
}, | ||
} | ||
); | ||
|
||
preset.registerTranspiler(module => /\.tsx?$/.test(module.path), [ | ||
{ transpiler: typescriptTranspiler }, | ||
]); | ||
|
||
preset.registerTranspiler(module => /\.jsx?$/.test(module.path), [ | ||
{ transpiler: babelTranspiler }, | ||
]); | ||
|
||
preset.registerTranspiler(module => /\.json$/.test(module.path), [ | ||
{ transpiler: jsonTranspiler }, | ||
]); | ||
|
||
preset.registerTranspiler(module => /\.m\.css$/.test(module.path), [ | ||
{ transpiler: stylesTranspiler, options: { module: true } }, | ||
]); | ||
|
||
preset.registerTranspiler(module => /\.css$/.test(module.path), [ | ||
{ transpiler: stylesTranspiler }, | ||
]); | ||
|
||
preset.registerTranspiler(() => true, [{ transpiler: rawTranspiler }]); | ||
|
||
return preset; | ||
} |
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,5 @@ | ||
import React from 'react'; | ||
|
||
import cxjs from './cxjs.svg'; | ||
|
||
export default props => <img alt="cxjs" src={cxjs} {...props} />; |
Oops, something went wrong.