Git Product home page Git Product logo

tools's Introduction

aurelia-tools

npm Version ZenHub Join the chat at https://gitter.im/aurelia/discuss

This library is part of the Aurelia platform and contains some base tools used in the development of Aurelia itself as well as the source for browser debugging tools.

To keep up to date on Aurelia, please visit and subscribe to the official blog and our email list. We also invite you to follow us on twitter. If you have questions, please join our community on Gitter or use stack overflow. Documentation can be found in our developer hub. If you would like to have deeper insight into our development process, please install the ZenHub Chrome or Firefox Extension and visit any of our repository's boards.

To create a dev environment:

  1. Create an aurelia directory to hold all of the projects.
mkdir aurelia
  1. Change to the new directory
cd aurelia
  1. Clone this repository into the tools directory. This repo contains the helper tools for creating the dev environment.
git clone https://github.com/aurelia/tools.git
  1. Clone the skeleton-navigation also which is the base app for testing -
git clone https://github.com/aurelia/skeleton-navigation.git
  1. Change directory into skeleton-navigation
cd skeleton-navigation
  1. Install the skeleton-navigation application's dependencies:
npm install
jspm install
  1. Build the dev environment. This will create all of the directories inside of aurelia under the proper name, git clone them all and then perform a gulp build.
gulp build-dev-env

Now you have the ability to update the repos locally, make changes, and use those in the skeleton app in the aurelia directory by using the gulp update-own-deps command.

Alternatively, run gulp pull-dev-env to only pull down each aurelia dependency and not perform builds.

Aurelia Context Chrome extension

The chrome extension has moved to the aurelia/inspector repo.

tools's People

Contributors

3cp avatar akath19 avatar ashleygrant avatar bryanrsmith avatar doktordirk avatar eisenbergeffect avatar gheoan avatar hopkins700 avatar jdanyow avatar jpmckearin avatar martingust avatar niieani avatar obedm503 avatar plwalters avatar ryanwischkaemper avatar sylvain-hamel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tools's Issues

Provide option to only pull down all of the Aurelia repositories

It would be nice to have the option to only pull down each repository - similar to how aspnet offers an option to only pull each repository. Sometimes it is useful to just pull down everything to browse the source, and only running git pull for each repository is significantly faster than executing npm install, jspm install and gulp build against each one as well.

It is an extremely simple addition, and it provides a great convenience.

Build-time validation (linter) for Aurelia application

It would be nice if Aurelia would provide build-time correctness validation (linter) of the application. Here i don't mean JS errors, that could be detected with TypeScript, but other types of errors/problems.
For example

  • typos in binding expressions
    • check if view-model contains field/method that should exist in controller
    • check if application contains the ViewConverters and Signals used in expressions
      • (don't know if it is possible to detect, if given ViewConverter/Signal is available in the file where it is used)
  • typos in binding attributes for example value.one-way vs value.on-way
  • typos with incorrect <require from="./not/found"> element path
  • correct usage of template controller (You shouldn't add both repeat.for and if.bind to the same element)
  • check, that <content> element is not used inside dynamically created element, such as if.bind
  • using style attribute with expressions instead of css attribute (if I remember correctly, it cause problems for IE)
    • maybe it could detect some more problems that would work only on some browsers

Implementing some of the features mentioned above would also be very useful for other use-cases, such as a autocomplete/intellisense for IDE plugins (not to mention validation inside IDE plugins).

I'm sure that Aurelia team and community will find lots of more use-cases for it and I'd like to see what other people could come up with.

when using sub folders, the in browser debug experience is broken.

So, let's focus on the navigation app sample and move both the flickr html/js in an sub folder /flickr and update the router accordingly.
After a build watch, the app still works, but the ES6 file (for flickr) is not included in the src folder.

So, when we open the app, things are as expected, the flickr files are not loaded, since systemjs will only load it when needed (great !)
image

Now, when we route to flickr, things change:
image

The folder structure inside dist is a bit strange. There is folder created called src/flickr but the file is empty.
But the most annoying is that the original ES6 file for flickr is not under /src.

Thanks for helping.

Link to extension not working

I'm submitting a bug report

  • Library Version:
    major.minor.patch-pre

Please tell us about your environment:

  • Operating System:
    Windows 10
  • Node Version:
    6.2.0
  • NPM Version:
    3.8.9
  • Browser:
    Chrome XX
  • Language:
    ESNext

Current behavior:
I like to try the chrome plug-in aurelia-context using the link on the page:
http://blog.aurelia.io/2016/04/21/aurelia-cli-debug-tools-and-microsoft-collaboration/
When I click the "Give it a try" link, I get a 404 stating:
The requested URL was not found on this server. That’s all we know.

Expected/desired behavior:
A working link to the context extension.

  • What is the expected behavior?
  • What is the motivation / use case for changing the behavior?

Electron support

I'm submitting a feature request

  • Library Version:
    Aurelia 1.0.0
    Arelia Context 1.2.0
  • Browser:
    electron | chrome
  • Language:
    TypeScript 2.2

Current behavior:
fails with error: chrome-api.js:124 responseCallback is not supported
(Seems like electron does not support callback on sendMessage)

Expected/desired behavior:
to work in electron

note: (redux devtools seems to have had same problem before this pull zalmoxisus/redux-devtools-extension#158)

au new fails to install modules with npm install due to version conflict with babel-eslint

I'm submitting a bug report

  • Library Version:
  • aurelia-tools:2.0.0
  • aurelia-cli:2.0.3

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    v14.18.3

  • NPM Version:
    8.3.0

  • Browser:
    all

  • Language:
    ESNext

Current behavior:
When running a "au new" and selecting any of the projects with ESNext if you do the "npm install" it will fail with the following error

√ Would you like to install all the npm dependencies? · Yes, use NPM
Installing project dependencies...

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/babel-eslint
npm ERR!   dev babel-eslint@"^10.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer babel-eslint@"^7.2.3" from [email protected]
npm ERR! node_modules/aurelia-tools
npm ERR!   dev aurelia-tools@"^2.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\jadra\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jadra\AppData\Local\npm-cache\_logs\2022-01-14T22_52_33_582Z-debug-0.log
Project dependencies were installed.

If you run the npm install with the "--force" flag it will work around this. The version of babel-eslint needs to be resolved in the package.json for this module as it is too restrictive with other dependencies.

Expected/desired behavior:
npm install should never fail

ESLint configuration is invalid: Unexpected top-level property "ecmaFeatures".

I'm submitting a bug report

  • Library Version:
    1.0.0

Please tell us about your environment:

  • Operating System:
    Linux (Xubuntu 16.04)

  • Node Version:
    8.1.0

  • NPM Version:
    5.0.3
  • Browser:
    all?

  • Language:
    ESNext

Current behavior:
the .eslintrc.json file is only valid for eslint <2.0.0, and as such the linter fails to do it's job.

acoording to the eslint docs

Prior to 2.0.0, the way to enable language options was by using ecmaFeatures in your configuration. In 2.0.0:

  • The ecmaFeatures property is now under a top-level parserOptions property.
    if you run the linter you get an error:

error screenshot

and the .eslintrc.json just references aurelia-tools

{
  "extends": "./node_modules/aurelia-tools/.eslintrc.json"
}

Expected/desired behavior:

  • What is the expected behavior?
    that the .eslintrc.json be updated to work with the latest version of eslint. Our project is based on one of the ESNext skeletons, and their .eslintrc.json reference aurelia-tools' .eslintrc.json

  • What is the motivation / use case for changing the behavior?
    We need good tooling as part of "aurelia-tools"

Duplicate declaration "$"

We are trying to add dts-generation to this plugin, however we are getting an error:

events.js:141
      throw er; // Unhandled 'error' event
      ^
 TypeError: D:/Development/aurelia-kendoui-plugin/dist/aurelia-kendoui-plugin.js: Line 186: Duplicate declaration "$"
�[0m  184 | �[90m// };�[39m
  185 |
> 186 | �[36mimport�[39m $ from �[31m'jquery'�[39m�[1m;�[22m
      |        ^
  187 | �[36mimport�[39m �[31m'kendo-ui/js/kendo.button.min'�[39m�[1m;�[22m
  188 |
  189 | �[7m@�[27mcustomAttribute�[94m�[1m(�[22m�[39m�[31m'au-kendo-button'�[39m�[94m�[1m)�[22m�[39m�[0m
    at File.errorWithNode (D:\Development\aurelia-kendoui-plugin\node_modules\babel-core\lib\transformation\file\index.js:489:13)
    at Scope.checkBlockScopedCollisions (D:\Development\aurelia-kendoui-plugin\node_modules\babel-core\lib\traversal\scope\index.js:412:27)
    at Scope.<anonymous> (D:\Development\aurelia-kendoui-plugin\node_modules\babel-core\lib\traversal\scope\index.js:594:18)
    at Scope.registerBinding (D:\Development\aurelia-kendoui-plugin\node_modules\babel-core\lib\traversal\scope\index.js:608:8)
    at Scope.registerDeclaration (D:\Development\aurelia-kendoui-plugin\node_modules\babel-core\lib\traversal\scope\index.js:537:14)
    at NodePath.Declaration (D:\Development\aurelia-kendoui-plugin\node_modules\babel-core\lib\traversal\scope\index.js:83:36)
    at NodePath.call (D:\Development\aurelia-kendoui-plugin\node_modules\babel-core\lib\traversal\path\context.js:56:28)
    at NodePath.visit (D:\Development\aurelia-kendoui-plugin\node_modules\babel-core\lib\traversal\path\context.js:90:8)
    at TraversalContext.visitMultiple (D:\Development\aurelia-kendoui-plugin\node_modules\babel-core\lib\traversal\context.js:108:16)
    at TraversalContext.visit (D:\Development\aurelia-kendoui-plugin\node_modules\babel-core\lib\traversal\context.js:146:19)

I have noticed that in the generated aurelia-kendoui-plugin.js, the following imports were not hoisted and were not deduplicated:

import $ from 'jquery';
import 'kendo-ui/js/kendo.autocomplete.min';

I think this is because these imports do not match the regex patterns.

I assume this is a very common use-case for plugins, and I hope that a fix will be provided for this :)

relative path issue in 'sortFiles' function

Hi
I'm getting error when run 'build' task for the app like this:

src/subfolder/foo.js
src/subfolder/bar.js

bar.js contains the import statement as follows:
import {Foo} from './foo.js'

It seems there is an issue with 'sortFiles' function. Looks like it is looking for 'foo.js' file in 'src/foo.js' instead of 'src/subfolder/foo.js'

Typescript config

I am very happy to see new Aurelia packages move towards a simple NPM based build, and Typescript the language of choice! Hopefully existing packages will slowly migrate.

That said I have a few comments on the tsconfig.json.

I see you use most strict options for maximum safety but you might have missed some:

  • noImplicitThis, which is quite helpful at detecting non-obvious errors.
  • noFallthroughCasesInSwitch

I also suggest the following relaxation: suppressImplicitAnyIndexErrors.
It avoids ugly code such as this example (found in aurelia-webpack-loader):

(PLATFORM as any).Loader = WebpackLoader;

By allowing dynamic access:

PLATFORM['Loader'] = WebpackLoader;

Of course you should properly type everything, but I find that it's nice to have an escape hatch for those occasions when you need one.

A big problem with the current TS build is that it emits its helpers at the top of each and every file (when they're used of course).
This is large, see aurelia-webpack-loader again for example:

"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments)).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
    return { next: verb(0), "throw": verb(1), "return": verb(2) };
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [0, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};

Aurelia is very modular, having those helpers repeated again and again would contribute a large bloat.
I suggest that you use the new option importHelpers. It does pretty much what it says:

import { __extends, __awaiter, __generator } from 'tslib';

And tslib becomes an additional dependency of Aurelia.
That way the helpers are only included once in the final build, and even shared with my own TS code! 🙂
That works at least fine when you use NPM as your package manager, not sure about others (Bower?).

Import regex searches only for single quotes

The patterns for the import statements only matches if you've wrapped the path in single quotes
import {process} from 'some/path/to/module' and does not recognize the double quotes equivalent
import {process} from "some/path/to/module". Is it because of the aurelia coding rules or because the regex gets too complicated to match the opening quote with the closing? If it is too much of a hassle to make it work with both double and single quotes, could you add somewhere a note about this quirk?

Plugin for JetBrains IDEs (WebStorm, PhpStorm, IntelliJ etc.)

I'm submitting a feature request

  • Library Version:
    1.0.8

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    6.9.4

  • NPM Version:
    4.1.1

  • Browser:
    all

  • Language:
    TypeScript 2.1.5

Since it doesn't seem like JetBrains is going to natively support Aurelia soon (see this feature request) and the only available plugin doesn't seem to be maintained anymore I'd really love to see some official plugin from the Aurelia team like the one for VS Code.

I really believe that there are many people who'd also appreciate a decent plugin which supports some basic code completion, highlighting & code refactoring for the Aurelia views (again, see the YouTrack issue).

I just started using Aurelia extensively and I initially even considered moving from PhpStorm to VS Code for its better Aurelia support. "Unfortunately" I wasn't able to actually perform the change due to some missing features that I use a lot...

Common platform for all IDE plugins

Having IDE plugins for most popular IDEs to autocomplete templates and validate application would be very nice.

This issue depends on other issue, that would provide among other things a common tooling library for IDEs to analyse the application statically. If that library is build with keeping in mind this issue (IDE plugins), then building IDE plugins would become way less complicated.

If I'd have to build a common platform for IDE plugins, I'd probably create a background process with REST API, that can be started by IDE plugin. Then all IDE plugins could be implemented relatively easily on top of the REST API to execute different commands (autocomplete, validation, ...).

As i understand, the library should build and provide some kind of application model, that IDE could use to query for example view and custom element models that contain information about template that is used by it and methods/fields, bind. When this information is available, plugins could easily implement

  • autocompled/intellisense
    • fields and methods in binding expressions
    • to import/require custom elements/css files into html template.
  • validation (see what has been mentioned in the other issue, that proposes build-time validation.
  • wizards for
    • new project
    • new view's
    • new custom elements, attributes, value converters and maybe more

I'd personally like to have a plugin for Atom and Eclipse IDEs. When Aurelia provides the common tooling library for IDEs, i think i could come up with very primitive Eclipse plugin myself.

Does this chrome extension work with Aurelia RTM?

I'm submitting a bug report

  • Library Version:
    major.minor.patch-pre

Please tell us about your environment:

  • Operating System:
    Windows [10]

  • Node Version:
    5.1.0

  • NPM Version:
    310.8

  • Browser:
    Chrome 53.0.2785.143 m

  • Language:
    ESNext

Current behavior:
I get the following values with a bound element I am looking at:
router-view.layoutModel:null
router-view.layoutView:null
router-view.layoutViewModel:null
router-view.swapOrder:null

Expected/desired behavior:
I'm expecting to see the actual bindings on the element (what I remember Aurelia Context doing with non rtm code).

  • What is the expected behavior?
  • What is the motivation / use case for changing the behavior?

make no-console = 2

dumb me I always manage to leave a trace of console.logs for simple debug scenarios when releasing a new version. Promoting the no-console eslint rule to 2 would greatly help as the gulp task highlights errors much better. I guess those few circumstances where console.xxx is really used can be explicitly allowed with inline comments

protractor plugin: waitForRouterComplete() race condition

I'm submitting a bug report

  • Library Version:
    0.2.4

Please tell us about your environment:

  • Operating System:
    Linux (Arch 64bit)

  • Node Version:
    6.9.1

  • NPM Version:
    3.10.9
  • Browser:
    Chrome 54

  • Language:
    TypeScript 2.0.7

Current behavior:
The Aurelia Navigation Skeletons have the following function in test/e2e/skeleton.po.[js/ts]:

  navigateTo(href) {
    element(by.css('a[href="' + href + '"]')).click();
    return browser.waitForRouterComplete();
  }

In the first line the anchor gets clicked. The second line causes the webdriver to wait for the next route change, then continue. This usually works if the browser is slow. If the browser is fast, the following happens:

  1. the anchor gets clicked
  2. the aurelia router changes state
  3. browser.waitForRouterComplete() is called.

Since the route change already happened, this last method waits forever. That's a race condition.

Expected/desired behavior:

  • What is the expected behavior?
    I don't know how to clean this up. Ideally, waitForRouterComplete() should first add the routing event listener, then execute the business logic (e.g. clicking the anchor), and then wait for the event callback to be called. This means that waitForRouterComplete() should receive a callback (or something like that).

  • What is the motivation / use case for changing the behavior?
    Sometimes failing e2e tests.

PS: I don't know where this issue belongs: either to aurelia-tools, or protractor-plugin (which seems to be new), or even aurelia-skeleton-navigation.

Add lint rule to prevent usage of browser only global objects

I'm submitting a feature request

  • Language:
    all

Current behavior:
Browser global objects can be used.

Expected/desired behavior:

  • What is the expected behavior?
    Using browser global objects should result in a lint warning. This warning can optionally recommend using aurelia-pal.

This needs to be implemented for both eslint and tslint.
An exception to this rule should be added to the pal library.

  • What is the motivation / use case for changing the behavior?
    Prevent issues such as aurelia/i18n#243.

Chrome extension not working from within a Chrome extension

Some Inception-type stuff happening here.

I have a Chrome extension that uses Aurelia, and I'm trying to get the Aurelia Chrome extension to help me create my own extension. However, the current Aurelia Chrome extension does not work if I inspect my own Chrome extension.

Long story short, the current Aurelia extension initially fails because $0 is undefined in devtools.js. I got around that problem (let me know if you're interested), but quickly ran up against another. For whatever reason, even though my Chrome extension works, the Aurelia extension cannot find a .au property on any DOM element.

Is there another way to retrieve the .au property and/or data? Does that make sense?

I put a lot of time today into trying to figure this out and I feel like I'm close to making it work. Just have to go to sleep and I'm stuck.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.