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(Build) Add typescript compiler #1067

Merged
merged 17 commits into from
Jul 16, 2019
Merged
Show file tree
Hide file tree
Changes from 15 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
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- node8-dependencies-

- run: npm install
- run: npm run build

- save_cache:
paths:
Expand All @@ -54,6 +55,7 @@ jobs:
- node10-dependencies-

- run: npm install
- run: npm run build

- save_cache:
paths:
Expand Down
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ lib/build/convert-source-map
lib/build/map-stream
lib/resolve
lib/colors
lib/resources
lib/resources
dist
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ bower_components
.DS_STORE
*.swp
.blog
dist
/release-checks-results
/.nyc_output
/coverage
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ language: node_js
node_js:
- "8"
- "10"
- "12"
- "12"

install:
- npm install
- npm run build
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ For contributors planning to add new features to the skeleton application, pleas
1. Clone the aurelia-cli: `git clone https://github.com/aurelia/cli.git`
2. Go into the cli directory: `cd cli`
3. Run `npm install`
4. Link the cli with: `npm link`
7. Create a new project with `au new` or use an existing project. The linked CLI will be used to create the project.
8. In the project directory, run `npm link aurelia-cli`. The linked CLI will then be used for `au` commands such as `au run`
4. Run build `npm run build`
5. Link the cli with: `npm link`
6. Create a new project with `au new` or use an existing project. The linked CLI will be used to create the project.
7. In the project directory, run `npm link aurelia-cli`. The linked CLI will then be used for `au` commands such as `au run`

## Running the Tests

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion build/tasks/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const gulp = require('gulp');
const eslint = require('gulp-eslint');

gulp.task('lint', function() {
return gulp.src(['lib/**/*.js', 'spec/**/*.js'])
return gulp.src(['lib/**/*.js', 'spec/**/*.js', 'lib/**/*.ts', 'spec/**/*.ts'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failOnError());
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/release-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ const gulp = require('gulp');
const path = require('path');
const SuiteRunner = require('./release-checks/suite-runner');
const LogManager = require('aurelia-logging');
const Utils = require('../../lib/build/utils');
const Utils = require('../../dist/lib/build/utils');
const {MessageHistoryLogger} = require('./release-checks/message-history-logger');
const TestProjectsSelector = require('./release-checks/test-projects-selector');
const Reporter = require('./release-checks/reporter');
const del = require('del');
const ConsoleUI = require('../../lib/ui').ConsoleUI;
const ConsoleUI = require('../../dist/lib/ui').ConsoleUI;
const ui = new ConsoleUI();
const c = require('ansi-colors');

Expand Down
2 changes: 1 addition & 1 deletion build/tasks/release-checks/message-history-logger.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const fs = require('../../../lib/file-system');
const fs = require('../../../dist/lib/file-system');

exports.MessageHistoryLogger = class {
constructor(ui) {
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/release-checks/suite-runner.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const Utils = require('../../../lib/build/utils');
const Utils = require('../../../dist/lib/build/utils');
const suiteSteps = require('./suite-steps');
const StepRunner = require('./step-runner');
const fs = require('../../../lib/file-system');
const fs = require('../../../dist/lib/file-system');

module.exports = class SuiteRunner {
constructor(context, reporter) {
Expand Down
2 changes: 1 addition & 1 deletion build/tasks/release-checks/suite-steps.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');
const tasks = require('./tasks/index');
const tests = require('./tests/index');
const applicable = require('../../../lib/workflow/applicable');
const applicable = require('../../../dist/lib/workflow/applicable');

module.exports = function(suite) {
const features = suite.split('_');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const Task = require('./task');
const Yarn = require('../../../../lib/package-managers/yarn').Yarn;
const Yarn = require('../../../../dist/lib/package-managers/yarn').Yarn;
const LogManager = require('aurelia-logging');
const logger = LogManager.getLogger('link-aurelia-cli');
const CLIOptions = require('../../../../lib/cli-options').CLIOptions;
const CLIOptions = require('../../../../dist/lib/cli-options').CLIOptions;
const cliOptions = new CLIOptions();
const ConsoleUI = require('../../../../lib/ui').ConsoleUI;
const ConsoleUI = require('../../../../dist/lib/ui').ConsoleUI;
const ui = new ConsoleUI();

let userArgs = process.argv.slice(2);
Expand Down
2 changes: 1 addition & 1 deletion build/tasks/release-checks/tasks/install-node-modules.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Task = require('./task');
const Yarn = require('../../../../lib/package-managers/yarn').Yarn;
const Yarn = require('../../../../dist/lib/package-managers/yarn').Yarn;
const LogManager = require('aurelia-logging');
const logger = LogManager.getLogger('install-node-modules');
const fs = require('fs');
Expand Down
6 changes: 3 additions & 3 deletions build/tasks/release-checks/test-projects-selector.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const CLIOptions = require('../../../lib/cli-options').CLIOptions;
const CLIOptions = require('../../../dist/lib/cli-options').CLIOptions;
const cliOptions = new CLIOptions();
const fs = require('../../../lib/file-system');
const fs = require('../../../dist/lib/file-system');
const path = require('path');
const _ = require('lodash');

Expand All @@ -9,7 +9,7 @@ Object.assign(cliOptions, {
args: userArgs.slice(1)
});

const ConsoleUI = require('../../../lib/ui').ConsoleUI;
const ConsoleUI = require('../../../dist/lib/ui').ConsoleUI;
const ui = new ConsoleUI();

module.exports = class TestProjectsSelector {
Expand Down
2 changes: 1 addition & 1 deletion build/tasks/release-checks/tests/generic/au-generate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Test = require('../test');
const ExecuteCommand = require('../../tasks/execute-command');
const fs = require('../../../../../lib/file-system');
const fs = require('../../../../../dist/lib/file-system');
const path = require('path');
const _ = require('lodash');

Expand Down
2 changes: 1 addition & 1 deletion build/tasks/update-dependenciesjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const latestVersion = require('latest-version');
const fs = require('fs');
const path = require('path');

const depJsonPath = path.resolve(__dirname, '../../lib/dependencies.json');
const depJsonPath = path.resolve(__dirname, '../../dist/lib/dependencies.json');

const ignore = ['text', 'gulp', 'extract-text-webpack-plugin'];

Expand Down
3 changes: 2 additions & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ exports.CLI = class {
// this.logger.error prints nothing in run(),
// directly use this.ui.log.
run(cmd, args) {
const version = `${this.options.runningGlobally ? 'Global' : 'Local'} aurelia-cli v${require('../package.json').version}`;
const isRunningFromDist = __filename.includes('dist');
const version = `${this.options.runningGlobally ? 'Global' : 'Local'} aurelia-cli v${require(`${isRunningFromDist ? '../../' : '../'}package.json`).version}`;

if (cmd === '--version' || cmd === '-v') {
return this.ui.log(version);
Expand Down
File renamed without changes.
Loading