Giter Club home page Giter Club logo

ngdart_cli's Introduction

AngularDart Community Website/Documentation

AngularDart Chat Jekyll CI Firebase Hosting

The official repo has been archived and doesn't allow any changes, hence I created this fork so that we, the AngularDart community, can work on improvements by ourselves (and perhaps have our own documentation site?).

Feel free to create & submit ANY issues and pull requests! Nothing is too small to fix, even just a typo :)

A more modern and up-to-date new website is on its way!

The AngularDart community-maintained documentation site, built with Jekyll and hosted on Firebase Hosting.

We welcome contributions, and we're first-timer friendly!

Our main focus now is to keep the version of the website up-to-date with the latest version of AngularDart, but as stated above, feel free to submit anything. See the migration guide for more info!

For simple changes (such as to CSS and text), you probably don't need to build this site. Often you can make changes using the GitHub UI.

If your change involves code samples, adds/removes pages, or affects navigation, you'll need to build and test your work before submitting. If you want or need to build the site, follow the steps below.

Before you build this site

Windows users might find themselves having trouble building this site because they can't run .sh files. We're currently migrating the workflows from using gulpjs to Dart's grinder, which will do everything in Dart and resolve this problem. Sorry Windows users! (and how about considering using linux in the meantime?) We have migrated (most) workflows to Dart and Docker, so Windows users should be able to build the site now. But seriously, considering switching to Linux?

Also, if you do a full-site build, it takes up about 2~3GB of space. Hard Drive Lives Matter!

1. Get the prerequisites

Install the following tools if you don't have them already.

  • Docker. We use Docker for local development and building the site. Install it from https://docs.docker.com/get-docker/.
  • GNU Make. On Windows the easiest way to install Make is choco install make using command prompt or powershell as an admin. Other options include using a [subsystem][wsl].

2. Clone this repo and its submodule

NOTE: This repo has a git submodule, which affects how you clone it.

To clone this repo (site-angulardart), follow the instructions given in the GitHub help on Cloning a repository, and choose one of the following submodule-cloning techniques:

  • Clone this repo and its submodule at the same, use the --recurse-submodules option:
    git clone --recurse-submodules https://github.com/angulardart-community/site-angulardart.git
  • If you've already cloned this repo without its submodule, then run this command from the repo root:
    git submodule update --init --remote

IMPORTANT: Whenever you update your repo, update the submodule as well:
git pull; git submodule update --init --remote

Some common problems that might occur during this process (Linux/Mac only; for Windows please open an issue):

  1. dart pub get getting stuck for hours, usually on dart_style.

    Solution: before running all the steps above, run the following in the project root:

    pub global activate webdev
    pub global activate dartdoc
    pub get
    

Building this site

  1. (Optional) Build the container image from scratch. If you don't have the hard drive space to do so or you just want to quickly see how it looks, you can skip this step and use the image we provide on GitHub. However, if you're changing dependencies, you must run this step to update the dependencies in the image.

    make setup
  2. Serve the site locally (via docker compose).

    make up
  3. View your changes in the browser by navigating to http://localhost:5000.

    Note: Unless you're editing files under site-shared, you can safely ignore ERROR: directory is already being watched messages. For details, see #1363.

  4. Make your changes to the local repo.

    The site will rebuild and the browser will autoreload to reflect the changes.

    Tip: If you aren't seeing the changes you expect (e.g. src/_data), ctrl-C out of your running dev server and rebuild the site from scratch using the following commands:

    $ make down && make clean && make up
  5. When you've finished developing, shut down the Docker container:

    $ make down

For more advance usage, see below

NOTE: Getting jekyll | Error: Too many open files under MacOS or Linux? One way to resolve this is to add the following to your .bashrc:

 ulimit -n 8192

and then reboot your machine.

Other useful grinder tasks

To see the full list of workflow commands available, run grind --help. Below are a few handy ones that you'll likely use to make your life easier. (More coming soon!)

grind clean # Clean build artifacts

ngdart_cli's People

Contributors

gzgavinzhao avatar igorbabalich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ngdart_cli's Issues

Wierd Extra Line(s) on Exception

When facing exceptions that are NOT UsageException, sometimes there will be extra lines after the error message. For example, when a new project's name conflicts with an existing folder name and the user doesn't use --force, the following is produced:

$ ngdart create hello
[Info] Creating project...
[Error] Project directory not empty.

Create a new project directory, or use --force to force generation into the target directory.


There are extra two lines after the last message. The expected output should be like this:

$ ngdart create hello
[Info] Creating project...
[Error] Project directory not empty.

Create a new project directory, or use --force to force generation into the target directory.

It's probably because I carelessly messed up some \ns... Not a big issue but fixing it makes using the program feel better.

wedev serve on a newly created project fails

webdev: 2.7.12
dart: Dart SDK version: 2.19.0-edge.6cc1c3c23c7b8ee0ca8291fc9d090cae9166d6f2 (be) (Fri Nov 4 13:24:57 2022 +0000) on "macos_x64"
ngdart: 1.2.0

steps followed:

  1. dart pub global activate webdev
  2. dart pub global activate ngdart_cli
  3. ngdart create app
  4. webdev serve in the app directory

Result:

[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
[SEVERE] This is likely caused by a misconfigured builder definition.
[SEVERE]
Unhandled exception:
Bad state: Unable to start build daemon.
#0      _handleDaemonStartup.<anonymous closure> (package:build_daemon/client.dart:79:21)
#1      _runUserCode (dart:async/stream_pipe.dart:11:23)
#2      Stream.firstWhere.<anonymous closure> (dart:async/stream.dart:1704:9)
#3      _RootZone.runGuarded (dart:async/zone.dart:1581:10)
#4      _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
#5      _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
#6      _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#7      _SyncBroadcastStreamController._sendDone.<anonymous closure> (dart:async/broadcast_stream_controller.dart:399:22)
#8      _BroadcastStreamController._forEachListener (dart:async/broadcast_stream_controller.dart:322:15)
#9      _SyncBroadcastStreamController._sendDone (dart:async/broadcast_stream_controller.dart:398:7)
#10     _BroadcastStreamController.close (dart:async/broadcast_stream_controller.dart:268:5)
#11     _AsBroadcastStreamController.close (dart:async/broadcast_stream_controller.dart:505:27)
#12     _RootZone.runGuarded (dart:async/zone.dart:1581:10)
#13     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
#14     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
#15     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#16     _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:87:11)
#17     _EventSinkWrapper.close (dart:async/stream_transformers.dart:21:11)
#18     _StringAdapterSink.close (dart:convert/string_conversion.dart:251:11)
#19     _LineSplitterSink.close (dart:convert/line_splitter.dart:154:11)
#20     _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:132:24)
#21     _RootZone.runGuarded (dart:async/zone.dart:1581:10)
#22     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
#23     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
#24     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#25     _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:87:11)
#26     _EventSinkWrapper.close (dart:async/stream_transformers.dart:21:11)
#27     _StringAdapterSink.close (dart:convert/string_conversion.dart:251:11)
#28     _Utf8ConversionSink.close (dart:convert/string_conversion.dart:305:20)
#29     _ConverterStreamEventSink.close (dart:convert/chunked_conversion.dart:81:18)
#30     _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:132:24)
#31     _RootZone.runGuarded (dart:async/zone.dart:1581:10)
#32     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
#33     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
#34     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
#35     _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:782:19)
#36     _StreamController._closeUnchecked (dart:async/stream_controller.dart:637:7)
#37     _StreamController.close (dart:async/stream_controller.dart:630:5)
#38     _Socket._onData (dart:io-patch/socket_patch.dart:2362:21)
#39     _RootZone.runUnaryGuarded (dart:async/zone.dart:1593:10)
#40     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#41     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#42     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#43     _StreamController._add (dart:async/stream_controller.dart:648:7)
#44     _StreamController.add (dart:async/stream_controller.dart:596:5)
#45     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1884:35)
#46     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1327:18)
#47     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#48     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#49     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:123:13)
#50     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:194:5)

ngdart create still uses stagehand templates calling angular package

Steps to reproduce

  1. Run pub global activate webdev && pub global activate ngdart && pub global activate ngdart_cli
  2. Run ngdart create myproject
  3. Open newly created myproject folder
  4. In its pubspec.yaml it still requires angular package, in dart files it imports package:angular/angular.dart

This should be changed to ngdart right? Or am I missing something?

ngdart bin installation

It appears that ngdart is not being installed in the bin directory for v7+. Installing v1+ seems to install bin and works as expected

Steps to reproduce

dart pub global activate ngdart 7.1.1
ls ~/.pub-cache/bin
see ngdart is not present

dart pub global activate ngdart 1.1.0
ls ~/.pub-cache/bin
see ngdart is present and executable

Rename the package name to ngdart_cli

Rename the existing ngdart package utility to ngdart_cli, so the package name will be available for the main angular package of AngularDart Community

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.