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

refactor(all): better interfaces, add router event export, more tests #632

Merged
merged 17 commits into from
Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
106 changes: 41 additions & 65 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,46 @@
# Defaults for all jobs
version: 2.1

defaults: &defaults
working_directory: ~/repo
docker:
- image: aureliaeffect/circleci-v1:latest
map-1: &filter_only_develop
filters:
branches:
only: develop

# Variables
var_1: &cache_key aurelia-{{ .Branch }}-{{ checksum "package.json" }}{{ checksum "package-lock.json" }}
map-2: &filter_only_tag
filters:
branches:
ignore: /.*/
tags:
only: /^v?[0-9]+(\.[0-9]+)*$/

version: 2
jobs:
install:
<<: *defaults
steps:
- checkout
- run: npm ci
- run: jspm install
- run: git checkout -- package.json
- save_cache:
key: *cache_key
paths:
- node_modules
- jspm_packages

build:
<<: *defaults
steps:
- checkout
- restore_cache:
key: *cache_key
- run: gulp build
- store_artifacts:
path: ./dist

unit_tests:
<<: *defaults
steps:
- checkout
- restore_cache:
key: *cache_key
- run: gulp cover
- run: codecov -f ./build/reports/coverage/coverage-final.json
- store_test_results:
path: ./build/reports/coverage
- store_artifacts:
path: ./build/reports/coverage

lint:
<<: *defaults
steps:
- checkout
- restore_cache:
key: *cache_key
- run: gulp lint
orbs:
v1: aurelia/v1@volatile

workflows:
version: 2
default_workflow:
jobs:
- install
- build:
requires:
- install
- unit_tests:
requires:
- install
- lint:
requires:
- install
main:
jobs:
- v1/build_test:
use_jspm: false
- v1/build_merge:
<<: *filter_only_develop
use_jspm: false
requires:
- v1/build_test
- v1/npm_publish:
<<: *filter_only_tag
name: npm_publish_dry
args: "--dry-run"
- request_publish_latest:
<<: *filter_only_tag
type: approval
requires:
- npm_publish_dry
- v1/npm_publish:
<<: *filter_only_tag
name: npm_publish
context: Aurelia
requires:
- request_publish_latest
- v1/merge_back:
<<: *filter_only_tag
requires:
- npm_publish
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"typescript.tsdk": "aurelia-router/node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"tslint.autoFixOnSave": true
}
14 changes: 7 additions & 7 deletions build/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function generateDts() {
console.log('\n==============\nGenerating dts bundle...\n==============');
return new Promise(resolve => {
const ChildProcess = require('child_process');
ChildProcess.exec('npm run bundle-dts', (err, stdout, stderr) => {
ChildProcess.exec('npm run build:dts', (err, stdout, stderr) => {
if (err || stderr) {
console.log('Generating dts error:');
console.log(stderr);
Expand All @@ -50,9 +50,9 @@ function build() {
console.log('\n==============\nBuidling...\n==============');
return Promise.all([
{
input: 'src/index.ts',
input: `src/${LIB_NAME}.ts`,
output: [
{ file: 'dist/es2015/index.js', format: 'es' }
{ file: `dist/es2015/${LIB_NAME}.js`, format: 'es', sourcemap: true }
],
external: externalLibs,
plugins: [
Expand All @@ -67,11 +67,11 @@ function build() {
]
},
{
input: 'src/index.ts',
input: `src/${LIB_NAME}.ts`,
output: [
{ file: 'dist/commonjs/index.js', format: 'cjs' },
{ file: 'dist/amd/index.js', format: 'amd', amd: { id: LIB_NAME } },
{ file: 'dist/native-modules/index.js', format: 'es' }
{ file: `dist/commonjs/${LIB_NAME}.js`, format: 'cjs', sourcemap: true },
{ file: `dist/amd/${LIB_NAME}.js`, format: 'amd', amd: { id: LIB_NAME }, sourcemap: true },
{ file: `dist/native-modules/${LIB_NAME}.js`, format: 'es', sourcemap: true }
],
external: externalLibs,
plugins: [
Expand Down
96 changes: 0 additions & 96 deletions config.js

This file was deleted.

1 change: 0 additions & 1 deletion gulpfile.js

This file was deleted.

26 changes: 17 additions & 9 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
const path = require('path');

module.exports = function(config) {
const browsers = config.browsers;
config.set({

basePath: '',
frameworks: ["jasmine"],
files: ["test/*.spec.ts"],
files: ["test/**/*.spec.ts"],
preprocessors: {
"**/*.ts": ["webpack"]
"test/**/*.spec.ts": ["webpack", 'sourcemap']
},
webpack: {
mode: "development",
entry: 'test/setup.ts',
resolve: {
extensions: [".ts", ".js"],
modules: ["src", "node_modules"],
modules: ["node_modules"],
alias: {
src: path.resolve(__dirname, "src")
src: path.resolve(__dirname, 'src'),
test: path.resolve(__dirname, 'test')
}
},
devtool: "cheap-module-eval-source-map",
devtool: browsers.includes('ChromeDebugging') ? 'eval-source-map' : 'inline-source-map',
module: {
rules: [
{
Expand All @@ -32,16 +35,21 @@ module.exports = function(config) {
mime: {
"text/x-typescript": ["ts"]
},
reporters: ["mocha", "progress"],
reporters: ["mocha"],
webpackServer: { noInfo: config.noInfo },
browsers: ["Chrome"],
browsers: Array.isArray(browsers) && browsers.length > 0 ? browsers : ['ChromeHeadless'],
customLaunchers: {
ChromeDebugging: {
base: "Chrome",
flags: ["--remote-debugging-port=9333"],
base: 'Chrome',
flags: [
'--remote-debugging-port=9333'
],
debug: true
}
},
mochaReporter: {
ignoreSkipped: true
},
singleRun: false
});
};
Loading