Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build ux #229

Merged
merged 27 commits into from
Dec 3, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e47d1b1
chore(build): use default import for html
bigopon Nov 23, 2019
dcc96bd
chore(example): use esmodule interop for webpack html loader
bigopon Nov 23, 2019
b2b01ed
chore(build): update all packages css bundling
bigopon Nov 25, 2019
065cd7d
chore(all): update doc & dependencies
bigopon Nov 25, 2019
3edd07a
chore(example): update example code
bigopon Nov 25, 2019
6d3a8b7
chore(build): fix datepicker build, revert to multiple modules
bigopon Dec 1, 2019
3f0ca80
chore(core): revert to multiple modules
bigopon Dec 1, 2019
0518b86
chore(textarea): revert to multi-modules build
bigopon Dec 1, 2019
067f63e
chore(switch): revert to multi-modules build
bigopon Dec 1, 2019
4988309
chore(slider): revert to multi-modules build
bigopon Dec 1, 2019
bd0c5a6
chore(select): revert to multi-modules build
bigopon Dec 1, 2019
9d0cc8e
chore(radio): revert to multi-modules build
bigopon Dec 1, 2019
704f8ff
chore(list): revert to multi-modules build
bigopon Dec 1, 2019
ec8fe5e
chore(input-info): revert to multi-modules build
bigopon Dec 1, 2019
4262565
chore(input): revert to multi-modules build
bigopon Dec 1, 2019
38242b9
chore(icons): revert to multi-modules build
bigopon Dec 1, 2019
1bc5aaa
chore(grid): revert to multi-modules build
bigopon Dec 1, 2019
f21fe11
chore(form): revert to multi-modules build
bigopon Dec 1, 2019
59664d3
chore(chip-input): revert to multi-modules build
bigopon Dec 1, 2019
f3b7921
chore(checkbox): revert to multi-modules build
bigopon Dec 1, 2019
1db5898
chore(card): revert to multi-modules build
bigopon Dec 1, 2019
bee7a49
chore(button): revert to multi-modules build
bigopon Dec 1, 2019
13c25aa
chore(deps): update main deps
bigopon Dec 1, 2019
dcc71c4
chore(example): update example app config
bigopon Dec 1, 2019
de3649e
chore(build): ensure build typings for all packages
bigopon Dec 2, 2019
59bf089
chore(components): revert to multi-modules build
bigopon Dec 2, 2019
58bd9e8
chore(examples): update example app config
bigopon Dec 2, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,26 @@ npm run build:dev -- --environment target_dir: path/to/my/dir
npm run build:dev:watch -- --environment target_dir: path/to/my/dir
```

### Run a test app
### Run a test app which emulates dependencies installation
To run the test app, first make sure you built all the packages via the instruction of how to build above. Then open a shell at root of this project and copy paste the following:
```shell
cd app
npm ci
npm run dev
```

### Run a test app with direct source bundling

To run the test app, with all dependencies pointing to the packages source code, first make sure you could run in previous step, then do:
1. Uncomment line 33 to line 65 in webpack.config.js in `app` folder
2. Open a shell at root of this project and run:

To run the test app, with all dependencies pointing to the packages source code, do:
```shell
cd app
npm ci
npm run dev
```

This will use `webpack-dev-server` and `webpack` to alias all `ux` dependencies to the source in `pakcages` folder.

### Testing from the project's root directory
Expand Down
117 changes: 117 additions & 0 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@
"author": "",
"license": "MIT",
"dependencies": {
"@aurelia-ux/button": "file:../packages/button",
"@aurelia-ux/card": "file:../packages/card",
"@aurelia-ux/checkbox": "file:../packages/checkbox",
"@aurelia-ux/chip-input": "file:../packages/chip-input",
"@aurelia-ux/core": "file:../packages/core",
"@aurelia-ux/datepicker": "file:../packages/datepicker",
"@aurelia-ux/grid": "file:../packages/grid",
"@aurelia-ux/icons": "file:../packages/icons",
"@aurelia-ux/input": "file:../packages/input",
"@aurelia-ux/input-info": "file:../packages/input-info",
"@aurelia-ux/list": "file:../packages/list",
"@aurelia-ux/radio": "file:../packages/radio",
"@aurelia-ux/select": "file:../packages/select",
"@aurelia-ux/slider": "file:../packages/slider",
"@aurelia-ux/switch": "file:../packages/switch",
"@aurelia-ux/textarea": "file:../packages/textarea",
"aurelia-logging-console": "^1.1.1"
},
"devDependencies": {
Expand Down
27 changes: 14 additions & 13 deletions app/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ async function configure(aurelia: Aurelia): Promise<void> {
.standardConfiguration()
.plugin(PLATFORM.moduleName('@aurelia-ux/core'))
.plugin(PLATFORM.moduleName('@aurelia-ux/button'))
.plugin(PLATFORM.moduleName('@aurelia-ux/textarea'))
.plugin(PLATFORM.moduleName('@aurelia-ux/switch'))
.plugin(PLATFORM.moduleName('@aurelia-ux/slider'))
.plugin(PLATFORM.moduleName('@aurelia-ux/select'))
.plugin(PLATFORM.moduleName('@aurelia-ux/radio'))
.plugin(PLATFORM.moduleName('@aurelia-ux/list'))
.plugin(PLATFORM.moduleName('@aurelia-ux/input-info'))
.plugin(PLATFORM.moduleName('@aurelia-ux/input'))
.plugin(PLATFORM.moduleName('@aurelia-ux/icons'))
.plugin(PLATFORM.moduleName('@aurelia-ux/grid'))
.plugin(PLATFORM.moduleName('@aurelia-ux/datepicker'))
.plugin(PLATFORM.moduleName('@aurelia-ux/chip-input'))
.plugin(PLATFORM.moduleName('@aurelia-ux/checkbox'))
.plugin(PLATFORM.moduleName('@aurelia-ux/card'))
.plugin(PLATFORM.moduleName('@aurelia-ux/checkbox'))
.plugin(PLATFORM.moduleName('@aurelia-ux/chip-input'))
.plugin(PLATFORM.moduleName('@aurelia-ux/datepicker'))
// .plugin(PLATFORM.moduleName('@aurelia-ux/form'))
.plugin(PLATFORM.moduleName('@aurelia-ux/grid'))
.plugin(PLATFORM.moduleName('@aurelia-ux/icons'))
.plugin(PLATFORM.moduleName('@aurelia-ux/input'))
.plugin(PLATFORM.moduleName('@aurelia-ux/input-info'))
.plugin(PLATFORM.moduleName('@aurelia-ux/list'))
.plugin(PLATFORM.moduleName('@aurelia-ux/radio'))
.plugin(PLATFORM.moduleName('@aurelia-ux/select'))
.plugin(PLATFORM.moduleName('@aurelia-ux/slider'))
.plugin(PLATFORM.moduleName('@aurelia-ux/switch'))
.plugin(PLATFORM.moduleName('@aurelia-ux/textarea'))

await aurelia.start();
await aurelia.setRoot(PLATFORM.moduleName('app'), document.body);
Expand Down
7 changes: 6 additions & 1 deletion app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "esnext",
"esModuleInterop": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct choice :-)

"allowSyntheticDefaultImports": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is by default turned on when esModuleInterop is true.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, will clean this up

"baseUrl": ".",
"paths": {
"aurelia-framework": [
"../node_modules/aurelia-framework"
]
}
},
"noUnusedLocals": false,
"noUnusedParameters": false
},
"exclude": []
}
48 changes: 24 additions & 24 deletions app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,29 @@ module.exports = function({ production = '' } = {}) {
{}
)),
// alias all packages to src code
...([
'button',
'card',
'checkbox',
'chip-input',
'core',
'datepicker',
'form',
'grid',
'icons',
'input',
'input-info',
'list',
'radio',
'select',
'slider',
'switch',
'textarea',
].reduce((map, packageName) => {
const mappedPackagedName = `@aurelia-ux/${packageName}`;
map[mappedPackagedName] = path.resolve(__dirname, `../packages/${packageName}/src`)
return map;
}, {}))
// ...([
// 'button',
// 'card',
// 'checkbox',
// 'chip-input',
// 'core',
// 'datepicker',
// 'form',
// 'grid',
// 'icons',
// 'input',
// 'input-info',
// 'list',
// 'radio',
// 'select',
// 'slider',
// 'switch',
// 'textarea',
// ].reduce((map, packageName) => {
// const mappedPackagedName = `@aurelia-ux/${packageName}`;
// map[mappedPackagedName] = path.resolve(__dirname, `../packages/${packageName}/src`)
// return map;
// }, {}))
}
},
entry: {
Expand Down Expand Up @@ -96,7 +96,7 @@ module.exports = function({ production = '' } = {}) {
],
aureliaApp: undefined,
entry: undefined,
noModulePathResolve: true
dist: 'es2015',
}),
new HtmlWebpackPlugin({

Expand Down
Loading