diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..be3f0c7e --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +dist +test \ No newline at end of file diff --git a/.gitignore b/.gitignore index 40b934d9..1e3eab17 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ node_modules *.bat *.lock *.log - +package-lock.json \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8af4f6e6..c3c4da86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# v0.4.1 +* Help improvements and tidy up + # v0.4.0 * Added buildConfigurations which allows bundling, minification, sourcemaps and build variables * Removed unused staticClientModules from unite.json diff --git a/README.md b/README.md index 8cf9e8fc..a49205bc 100644 --- a/README.md +++ b/README.md @@ -2,39 +2,3 @@ Core of the UniteJS JavaScript framework management tool. See [UniteJS CLI](https://github.com/unitejs/cli#readme) for usage. - - - - - -# Quirks -## Tests code using TypeScript and Chai -The RequireJS loader would normally use the following syntax to import Chai as the module has no default export so we just treat the whole module as the class - import * as Chai from "chai"; -TypeScript calls the class methods with Chai.should etc - -The SystemJS loader would normally use the following syntax to import Chai as it creates a synthetic default export - import Chai from "chai"; -TypeScript calls the class methods with chai_1.default.should etc - -If we switch on the allowSyntheticDefaultImports option for RequireJS usage the SystemJS syntax code will compile but the generated code will try to access the .default variable which does not exist. - -To keep the test code the same for both module loaders the following import syntax is used. - import * as ChaiModule from "chai"; - const Chai = (ChaiModule).default || ChaiModule; - -The ES6 code always uses the same syntax - import Chai from "chai" - -and Babel introduces the following code for RequireJS - - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; - } - -So the question is where does the fix go? At the moment I am leaning towards TypeScript which needs to introduce a similar interop to Babel. As well as the allowSyntheticDefaultImports which is a compile options only I think that a generateSyntheticDefaultImports might also be needed. - -See https://github.com/Microsoft/TypeScript/issues/16093 -and https://github.com/Microsoft/TypeScript/issues/16090 \ No newline at end of file diff --git a/TODO.md b/TODO.md deleted file mode 100644 index a2367d9d..00000000 --- a/TODO.md +++ /dev/null @@ -1,69 +0,0 @@ -# To Do - -## Code Style -Prettier - -## Tasks -Watch - -## App Frameworks -Add Angular 2 -Add Aurelia -Add React -Add Vue -Add Ember -Add Backbone -Add Angular 1? -Add Ionic? - -## Packaging and Icon Generation -Add Web App -Add Electron -Add PhoneGap/Cordova -Add Windows Universal App - -## CSS -Bundling - -## Source Languages -Coffee Script -Flow - -## CSS Linting -Add stylelint -Add sass-lint -Add less-hint -Add stylint - -## Reporting -Lighthouse - -## Build Engine -Add NPM scripts -Add Grunt? -Add Gulp 4 - -## Documentation -JSDoc ? - -## Package Managers -Add bower? - -## Test Frameworks -Add Jest - -## E2E Frameworks -Add Cucumber -Change Webdriver - Allure reports need screenshots - -## Module Loader -Change Webpack - Static Config -Change Browserify - Static Config - -## Unit Testing -Add Chrome headless instead of phantomjs -Alternate UI Browsers for testing Firefox/IE/Edge - -## E2E Testing -Alternate UI Browsers for testing Firefox/IE/Edge - diff --git a/gulpfile.js b/gulpfile.js index 53b6e070..28179fc8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,7 +5,6 @@ const tslint = require("tslint"); const sourcemaps = require('gulp-sourcemaps'); const del = require('del'); const mocha = require('gulp-mocha'); -const path = require('path'); const merge = require('merge2'); const runSequence = require('run-sequence'); @@ -16,9 +15,6 @@ const testFolder = 'test/'; const tsSrcGlob = srcFolder + '**/*.ts'; const cleanTestGlob = testFolder + '/**/*.js'; const tsTestGlob = testFolder + '**/*.spec.ts'; -const jsTestGlob = testFolder + '**/*.spec.js'; - -const tsProject = tsc.createProject(tsConfigFile); gulp.task('build-clean', (cb) => { return del(distFolder, cb); @@ -35,12 +31,14 @@ gulp.task('build-lint', () => { }); gulp.task('build-transpile', () => { + const tsProject = tsc.createProject(tsConfigFile); + let errorCount = 0; - + var tsResult = gulp.src(tsSrcGlob) .pipe(sourcemaps.init()) .pipe(tsProject()) - .on("error", (err) => { + .on("error", () => { errorCount++; }) @@ -77,6 +75,8 @@ gulp.task('test-lint', () => { }); gulp.task('test-transpile', () => { + const tsProject = tsc.createProject(tsConfigFile); + var tsResult = gulp.src(tsTestGlob) .pipe(tsProject()); @@ -95,4 +95,4 @@ gulp.task('test', (cb) => { runSequence('test-clean', 'test-transpile', 'test-lint', cb); }); -gulp.task('clean-all', ['clean-build', 'clean-test']); +gulp.task('clean-all', ['build-clean', 'test-clean']); diff --git a/package-lock.json b/package-lock.json index 9a48de66..139d46e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "unitejs-core", - "version": "0.4.0", + "version": "0.4.1", "lockfileVersion": 1, "dependencies": { "@gulp-sourcemaps/identity-map": { diff --git a/package.json b/package.json index 65c99348..b1b1d28b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "unitejs-core", - "version": "0.4.0", + "version": "0.4.1", "description": "Core of the UniteJS JavaScript framework management tool.", "main": "dist/unitejs-core.js", "types": "dist/unitejs-core.d.ts", @@ -10,6 +10,7 @@ }, "keywords": [ "unite", + "unitejs", "javascript", "typescript", "babel",