mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-07-12 15:18:34 +08:00
adding docs
This commit is contained in:
@@ -1,6 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
lib
|
|
||||||
*.log
|
|
||||||
.DS_Store
|
|
||||||
tmp.json
|
|
||||||
Vendored
-8
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
|
||||||
// for the documentation about the extensions.json format
|
|
||||||
"recommendations": [
|
|
||||||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
|
|
||||||
"esbenp.prettier-vscode"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Vendored
-7
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"prettier.printWidth": 140,
|
|
||||||
"prettier.tabWidth": 2,
|
|
||||||
"prettier.singleQuote": true,
|
|
||||||
"editor.tabSize": 2,
|
|
||||||
"editor.formatOnSave": true
|
|
||||||
}
|
|
||||||
@@ -1,395 +0,0 @@
|
|||||||
Attribution 4.0 International
|
|
||||||
|
|
||||||
=======================================================================
|
|
||||||
|
|
||||||
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
|
||||||
does not provide legal services or legal advice. Distribution of
|
|
||||||
Creative Commons public licenses does not create a lawyer-client or
|
|
||||||
other relationship. Creative Commons makes its licenses and related
|
|
||||||
information available on an "as-is" basis. Creative Commons gives no
|
|
||||||
warranties regarding its licenses, any material licensed under their
|
|
||||||
terms and conditions, or any related information. Creative Commons
|
|
||||||
disclaims all liability for damages resulting from their use to the
|
|
||||||
fullest extent possible.
|
|
||||||
|
|
||||||
Using Creative Commons Public Licenses
|
|
||||||
|
|
||||||
Creative Commons public licenses provide a standard set of terms and
|
|
||||||
conditions that creators and other rights holders may use to share
|
|
||||||
original works of authorship and other material subject to copyright
|
|
||||||
and certain other rights specified in the public license below. The
|
|
||||||
following considerations are for informational purposes only, are not
|
|
||||||
exhaustive, and do not form part of our licenses.
|
|
||||||
|
|
||||||
Considerations for licensors: Our public licenses are
|
|
||||||
intended for use by those authorized to give the public
|
|
||||||
permission to use material in ways otherwise restricted by
|
|
||||||
copyright and certain other rights. Our licenses are
|
|
||||||
irrevocable. Licensors should read and understand the terms
|
|
||||||
and conditions of the license they choose before applying it.
|
|
||||||
Licensors should also secure all rights necessary before
|
|
||||||
applying our licenses so that the public can reuse the
|
|
||||||
material as expected. Licensors should clearly mark any
|
|
||||||
material not subject to the license. This includes other CC-
|
|
||||||
licensed material, or material used under an exception or
|
|
||||||
limitation to copyright. More considerations for licensors:
|
|
||||||
wiki.creativecommons.org/Considerations_for_licensors
|
|
||||||
|
|
||||||
Considerations for the public: By using one of our public
|
|
||||||
licenses, a licensor grants the public permission to use the
|
|
||||||
licensed material under specified terms and conditions. If
|
|
||||||
the licensor's permission is not necessary for any reason--for
|
|
||||||
example, because of any applicable exception or limitation to
|
|
||||||
copyright--then that use is not regulated by the license. Our
|
|
||||||
licenses grant only permissions under copyright and certain
|
|
||||||
other rights that a licensor has authority to grant. Use of
|
|
||||||
the licensed material may still be restricted for other
|
|
||||||
reasons, including because others have copyright or other
|
|
||||||
rights in the material. A licensor may make special requests,
|
|
||||||
such as asking that all changes be marked or described.
|
|
||||||
Although not required by our licenses, you are encouraged to
|
|
||||||
respect those requests where reasonable. More_considerations
|
|
||||||
for the public:
|
|
||||||
wiki.creativecommons.org/Considerations_for_licensees
|
|
||||||
|
|
||||||
=======================================================================
|
|
||||||
|
|
||||||
Creative Commons Attribution 4.0 International Public License
|
|
||||||
|
|
||||||
By exercising the Licensed Rights (defined below), You accept and agree
|
|
||||||
to be bound by the terms and conditions of this Creative Commons
|
|
||||||
Attribution 4.0 International Public License ("Public License"). To the
|
|
||||||
extent this Public License may be interpreted as a contract, You are
|
|
||||||
granted the Licensed Rights in consideration of Your acceptance of
|
|
||||||
these terms and conditions, and the Licensor grants You such rights in
|
|
||||||
consideration of benefits the Licensor receives from making the
|
|
||||||
Licensed Material available under these terms and conditions.
|
|
||||||
|
|
||||||
|
|
||||||
Section 1 -- Definitions.
|
|
||||||
|
|
||||||
a. Adapted Material means material subject to Copyright and Similar
|
|
||||||
Rights that is derived from or based upon the Licensed Material
|
|
||||||
and in which the Licensed Material is translated, altered,
|
|
||||||
arranged, transformed, or otherwise modified in a manner requiring
|
|
||||||
permission under the Copyright and Similar Rights held by the
|
|
||||||
Licensor. For purposes of this Public License, where the Licensed
|
|
||||||
Material is a musical work, performance, or sound recording,
|
|
||||||
Adapted Material is always produced where the Licensed Material is
|
|
||||||
synched in timed relation with a moving image.
|
|
||||||
|
|
||||||
b. Adapter's License means the license You apply to Your Copyright
|
|
||||||
and Similar Rights in Your contributions to Adapted Material in
|
|
||||||
accordance with the terms and conditions of this Public License.
|
|
||||||
|
|
||||||
c. Copyright and Similar Rights means copyright and/or similar rights
|
|
||||||
closely related to copyright including, without limitation,
|
|
||||||
performance, broadcast, sound recording, and Sui Generis Database
|
|
||||||
Rights, without regard to how the rights are labeled or
|
|
||||||
categorized. For purposes of this Public License, the rights
|
|
||||||
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
|
||||||
Rights.
|
|
||||||
|
|
||||||
d. Effective Technological Measures means those measures that, in the
|
|
||||||
absence of proper authority, may not be circumvented under laws
|
|
||||||
fulfilling obligations under Article 11 of the WIPO Copyright
|
|
||||||
Treaty adopted on December 20, 1996, and/or similar international
|
|
||||||
agreements.
|
|
||||||
|
|
||||||
e. Exceptions and Limitations means fair use, fair dealing, and/or
|
|
||||||
any other exception or limitation to Copyright and Similar Rights
|
|
||||||
that applies to Your use of the Licensed Material.
|
|
||||||
|
|
||||||
f. Licensed Material means the artistic or literary work, database,
|
|
||||||
or other material to which the Licensor applied this Public
|
|
||||||
License.
|
|
||||||
|
|
||||||
g. Licensed Rights means the rights granted to You subject to the
|
|
||||||
terms and conditions of this Public License, which are limited to
|
|
||||||
all Copyright and Similar Rights that apply to Your use of the
|
|
||||||
Licensed Material and that the Licensor has authority to license.
|
|
||||||
|
|
||||||
h. Licensor means the individual(s) or entity(ies) granting rights
|
|
||||||
under this Public License.
|
|
||||||
|
|
||||||
i. Share means to provide material to the public by any means or
|
|
||||||
process that requires permission under the Licensed Rights, such
|
|
||||||
as reproduction, public display, public performance, distribution,
|
|
||||||
dissemination, communication, or importation, and to make material
|
|
||||||
available to the public including in ways that members of the
|
|
||||||
public may access the material from a place and at a time
|
|
||||||
individually chosen by them.
|
|
||||||
|
|
||||||
j. Sui Generis Database Rights means rights other than copyright
|
|
||||||
resulting from Directive 96/9/EC of the European Parliament and of
|
|
||||||
the Council of 11 March 1996 on the legal protection of databases,
|
|
||||||
as amended and/or succeeded, as well as other essentially
|
|
||||||
equivalent rights anywhere in the world.
|
|
||||||
|
|
||||||
k. You means the individual or entity exercising the Licensed Rights
|
|
||||||
under this Public License. Your has a corresponding meaning.
|
|
||||||
|
|
||||||
|
|
||||||
Section 2 -- Scope.
|
|
||||||
|
|
||||||
a. License grant.
|
|
||||||
|
|
||||||
1. Subject to the terms and conditions of this Public License,
|
|
||||||
the Licensor hereby grants You a worldwide, royalty-free,
|
|
||||||
non-sublicensable, non-exclusive, irrevocable license to
|
|
||||||
exercise the Licensed Rights in the Licensed Material to:
|
|
||||||
|
|
||||||
a. reproduce and Share the Licensed Material, in whole or
|
|
||||||
in part; and
|
|
||||||
|
|
||||||
b. produce, reproduce, and Share Adapted Material.
|
|
||||||
|
|
||||||
2. Exceptions and Limitations. For the avoidance of doubt, where
|
|
||||||
Exceptions and Limitations apply to Your use, this Public
|
|
||||||
License does not apply, and You do not need to comply with
|
|
||||||
its terms and conditions.
|
|
||||||
|
|
||||||
3. Term. The term of this Public License is specified in Section
|
|
||||||
6(a).
|
|
||||||
|
|
||||||
4. Media and formats; technical modifications allowed. The
|
|
||||||
Licensor authorizes You to exercise the Licensed Rights in
|
|
||||||
all media and formats whether now known or hereafter created,
|
|
||||||
and to make technical modifications necessary to do so. The
|
|
||||||
Licensor waives and/or agrees not to assert any right or
|
|
||||||
authority to forbid You from making technical modifications
|
|
||||||
necessary to exercise the Licensed Rights, including
|
|
||||||
technical modifications necessary to circumvent Effective
|
|
||||||
Technological Measures. For purposes of this Public License,
|
|
||||||
simply making modifications authorized by this Section 2(a)
|
|
||||||
(4) never produces Adapted Material.
|
|
||||||
|
|
||||||
5. Downstream recipients.
|
|
||||||
|
|
||||||
a. Offer from the Licensor -- Licensed Material. Every
|
|
||||||
recipient of the Licensed Material automatically
|
|
||||||
receives an offer from the Licensor to exercise the
|
|
||||||
Licensed Rights under the terms and conditions of this
|
|
||||||
Public License.
|
|
||||||
|
|
||||||
b. No downstream restrictions. You may not offer or impose
|
|
||||||
any additional or different terms or conditions on, or
|
|
||||||
apply any Effective Technological Measures to, the
|
|
||||||
Licensed Material if doing so restricts exercise of the
|
|
||||||
Licensed Rights by any recipient of the Licensed
|
|
||||||
Material.
|
|
||||||
|
|
||||||
6. No endorsement. Nothing in this Public License constitutes or
|
|
||||||
may be construed as permission to assert or imply that You
|
|
||||||
are, or that Your use of the Licensed Material is, connected
|
|
||||||
with, or sponsored, endorsed, or granted official status by,
|
|
||||||
the Licensor or others designated to receive attribution as
|
|
||||||
provided in Section 3(a)(1)(A)(i).
|
|
||||||
|
|
||||||
b. Other rights.
|
|
||||||
|
|
||||||
1. Moral rights, such as the right of integrity, are not
|
|
||||||
licensed under this Public License, nor are publicity,
|
|
||||||
privacy, and/or other similar personality rights; however, to
|
|
||||||
the extent possible, the Licensor waives and/or agrees not to
|
|
||||||
assert any such rights held by the Licensor to the limited
|
|
||||||
extent necessary to allow You to exercise the Licensed
|
|
||||||
Rights, but not otherwise.
|
|
||||||
|
|
||||||
2. Patent and trademark rights are not licensed under this
|
|
||||||
Public License.
|
|
||||||
|
|
||||||
3. To the extent possible, the Licensor waives any right to
|
|
||||||
collect royalties from You for the exercise of the Licensed
|
|
||||||
Rights, whether directly or through a collecting society
|
|
||||||
under any voluntary or waivable statutory or compulsory
|
|
||||||
licensing scheme. In all other cases the Licensor expressly
|
|
||||||
reserves any right to collect such royalties.
|
|
||||||
|
|
||||||
|
|
||||||
Section 3 -- License Conditions.
|
|
||||||
|
|
||||||
Your exercise of the Licensed Rights is expressly made subject to the
|
|
||||||
following conditions.
|
|
||||||
|
|
||||||
a. Attribution.
|
|
||||||
|
|
||||||
1. If You Share the Licensed Material (including in modified
|
|
||||||
form), You must:
|
|
||||||
|
|
||||||
a. retain the following if it is supplied by the Licensor
|
|
||||||
with the Licensed Material:
|
|
||||||
|
|
||||||
i. identification of the creator(s) of the Licensed
|
|
||||||
Material and any others designated to receive
|
|
||||||
attribution, in any reasonable manner requested by
|
|
||||||
the Licensor (including by pseudonym if
|
|
||||||
designated);
|
|
||||||
|
|
||||||
ii. a copyright notice;
|
|
||||||
|
|
||||||
iii. a notice that refers to this Public License;
|
|
||||||
|
|
||||||
iv. a notice that refers to the disclaimer of
|
|
||||||
warranties;
|
|
||||||
|
|
||||||
v. a URI or hyperlink to the Licensed Material to the
|
|
||||||
extent reasonably practicable;
|
|
||||||
|
|
||||||
b. indicate if You modified the Licensed Material and
|
|
||||||
retain an indication of any previous modifications; and
|
|
||||||
|
|
||||||
c. indicate the Licensed Material is licensed under this
|
|
||||||
Public License, and include the text of, or the URI or
|
|
||||||
hyperlink to, this Public License.
|
|
||||||
|
|
||||||
2. You may satisfy the conditions in Section 3(a)(1) in any
|
|
||||||
reasonable manner based on the medium, means, and context in
|
|
||||||
which You Share the Licensed Material. For example, it may be
|
|
||||||
reasonable to satisfy the conditions by providing a URI or
|
|
||||||
hyperlink to a resource that includes the required
|
|
||||||
information.
|
|
||||||
|
|
||||||
3. If requested by the Licensor, You must remove any of the
|
|
||||||
information required by Section 3(a)(1)(A) to the extent
|
|
||||||
reasonably practicable.
|
|
||||||
|
|
||||||
4. If You Share Adapted Material You produce, the Adapter's
|
|
||||||
License You apply must not prevent recipients of the Adapted
|
|
||||||
Material from complying with this Public License.
|
|
||||||
|
|
||||||
|
|
||||||
Section 4 -- Sui Generis Database Rights.
|
|
||||||
|
|
||||||
Where the Licensed Rights include Sui Generis Database Rights that
|
|
||||||
apply to Your use of the Licensed Material:
|
|
||||||
|
|
||||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
|
||||||
to extract, reuse, reproduce, and Share all or a substantial
|
|
||||||
portion of the contents of the database;
|
|
||||||
|
|
||||||
b. if You include all or a substantial portion of the database
|
|
||||||
contents in a database in which You have Sui Generis Database
|
|
||||||
Rights, then the database in which You have Sui Generis Database
|
|
||||||
Rights (but not its individual contents) is Adapted Material; and
|
|
||||||
|
|
||||||
c. You must comply with the conditions in Section 3(a) if You Share
|
|
||||||
all or a substantial portion of the contents of the database.
|
|
||||||
|
|
||||||
For the avoidance of doubt, this Section 4 supplements and does not
|
|
||||||
replace Your obligations under this Public License where the Licensed
|
|
||||||
Rights include other Copyright and Similar Rights.
|
|
||||||
|
|
||||||
|
|
||||||
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
|
||||||
|
|
||||||
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
|
||||||
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
|
||||||
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
|
||||||
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
|
||||||
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
|
||||||
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
|
||||||
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
|
||||||
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
|
||||||
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
|
||||||
|
|
||||||
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
|
||||||
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
|
||||||
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
|
||||||
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
|
||||||
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
|
||||||
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
|
||||||
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
|
||||||
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
|
||||||
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
|
||||||
|
|
||||||
c. The disclaimer of warranties and limitation of liability provided
|
|
||||||
above shall be interpreted in a manner that, to the extent
|
|
||||||
possible, most closely approximates an absolute disclaimer and
|
|
||||||
waiver of all liability.
|
|
||||||
|
|
||||||
|
|
||||||
Section 6 -- Term and Termination.
|
|
||||||
|
|
||||||
a. This Public License applies for the term of the Copyright and
|
|
||||||
Similar Rights licensed here. However, if You fail to comply with
|
|
||||||
this Public License, then Your rights under this Public License
|
|
||||||
terminate automatically.
|
|
||||||
|
|
||||||
b. Where Your right to use the Licensed Material has terminated under
|
|
||||||
Section 6(a), it reinstates:
|
|
||||||
|
|
||||||
1. automatically as of the date the violation is cured, provided
|
|
||||||
it is cured within 30 days of Your discovery of the
|
|
||||||
violation; or
|
|
||||||
|
|
||||||
2. upon express reinstatement by the Licensor.
|
|
||||||
|
|
||||||
For the avoidance of doubt, this Section 6(b) does not affect any
|
|
||||||
right the Licensor may have to seek remedies for Your violations
|
|
||||||
of this Public License.
|
|
||||||
|
|
||||||
c. For the avoidance of doubt, the Licensor may also offer the
|
|
||||||
Licensed Material under separate terms or conditions or stop
|
|
||||||
distributing the Licensed Material at any time; however, doing so
|
|
||||||
will not terminate this Public License.
|
|
||||||
|
|
||||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
|
||||||
License.
|
|
||||||
|
|
||||||
|
|
||||||
Section 7 -- Other Terms and Conditions.
|
|
||||||
|
|
||||||
a. The Licensor shall not be bound by any additional or different
|
|
||||||
terms or conditions communicated by You unless expressly agreed.
|
|
||||||
|
|
||||||
b. Any arrangements, understandings, or agreements regarding the
|
|
||||||
Licensed Material not stated herein are separate from and
|
|
||||||
independent of the terms and conditions of this Public License.
|
|
||||||
|
|
||||||
|
|
||||||
Section 8 -- Interpretation.
|
|
||||||
|
|
||||||
a. For the avoidance of doubt, this Public License does not, and
|
|
||||||
shall not be interpreted to, reduce, limit, restrict, or impose
|
|
||||||
conditions on any use of the Licensed Material that could lawfully
|
|
||||||
be made without permission under this Public License.
|
|
||||||
|
|
||||||
b. To the extent possible, if any provision of this Public License is
|
|
||||||
deemed unenforceable, it shall be automatically reformed to the
|
|
||||||
minimum extent necessary to make it enforceable. If the provision
|
|
||||||
cannot be reformed, it shall be severed from this Public License
|
|
||||||
without affecting the enforceability of the remaining terms and
|
|
||||||
conditions.
|
|
||||||
|
|
||||||
c. No term or condition of this Public License will be waived and no
|
|
||||||
failure to comply consented to unless expressly agreed to by the
|
|
||||||
Licensor.
|
|
||||||
|
|
||||||
d. Nothing in this Public License constitutes or may be interpreted
|
|
||||||
as a limitation upon, or waiver of, any privileges and immunities
|
|
||||||
that apply to the Licensor or You, including from the legal
|
|
||||||
processes of any jurisdiction or authority.
|
|
||||||
|
|
||||||
|
|
||||||
=======================================================================
|
|
||||||
|
|
||||||
Creative Commons is not a party to its public
|
|
||||||
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
|
||||||
its public licenses to material it publishes and in those instances
|
|
||||||
will be considered the “Licensor.” The text of the Creative Commons
|
|
||||||
public licenses is dedicated to the public domain under the CC0 Public
|
|
||||||
Domain Dedication. Except for the limited purpose of indicating that
|
|
||||||
material is shared under a Creative Commons public license or as
|
|
||||||
otherwise permitted by the Creative Commons policies published at
|
|
||||||
creativecommons.org/policies, Creative Commons does not authorize the
|
|
||||||
use of the trademark "Creative Commons" or any other trademark or logo
|
|
||||||
of Creative Commons without its prior written consent including,
|
|
||||||
without limitation, in connection with any unauthorized modifications
|
|
||||||
to any of its public licenses or any other arrangements,
|
|
||||||
understandings, or agreements concerning use of licensed material. For
|
|
||||||
the avoidance of doubt, this paragraph does not form part of the
|
|
||||||
public licenses.
|
|
||||||
|
|
||||||
Creative Commons may be contacted at creativecommons.org.
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019-present Microsoft Corporation
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
# Frontend Bootcamp / Days in the Web
|
|
||||||
|
|
||||||
> 🚨🚨 This project is a work in progress! Issues and pull requests are encouraged. 🚨🚨
|
|
||||||
|
|
||||||
## Welcome
|
|
||||||
|
|
||||||
In this two-day workshop you'll learn the basics of frontend development while building a working web app.
|
|
||||||
|
|
||||||
The first day provides an introduction to the fundamentals of the web: HTML, CSS and JavaScript. This is targeted at new and experienced developers alike. On the second day we'll dive into more advanced topics like TypeScript, state management, and testing. While the examples should be accessible to anyone, you'll get the most out of it if you have some prior experience with programming and web technologies.
|
|
||||||
|
|
||||||
## Getting set up
|
|
||||||
|
|
||||||
### 1. Required software
|
|
||||||
|
|
||||||
Before starting, make sure your computer has up-to-date versions of the following installed:
|
|
||||||
|
|
||||||
- [Node/NPM](https://nodejs.org/en/) (choose the **LTS** option, which should be version 10)
|
|
||||||
- [Git](https://git-scm.com/downloads)
|
|
||||||
- [Visual Studio Code](https://code.visualstudio.com)
|
|
||||||
- If using a Mac, also follow [these steps](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line) to install the `code` terminal command.
|
|
||||||
- If you already had VS Code installed, check for updates!
|
|
||||||
- React Developer Tools for [Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/)
|
|
||||||
|
|
||||||
### 2. Installing and opening the project
|
|
||||||
|
|
||||||
- Open VS Code and then press ```ctrl + ` ``` (backtick, in top left corner of keyboard) to open the built-in terminal
|
|
||||||
- Use the `cd` (change directory) command to find an appropriate place for your code
|
|
||||||
- Type `git clone https://github.com/Microsoft/frontend-bootcamp.git` into the terminal to pull down a copy of the workshop code
|
|
||||||
- Type `cd frontend-bootcamp` to change your current directory to the bootcamp folder
|
|
||||||
- Type `npm install` to install all of the project dependencies
|
|
||||||
- Type `code -r .` to open the bootcamp code in VS Code
|
|
||||||
> If on a Mac, be sure you've followed [these steps](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line) first to make the `code` command available.
|
|
||||||
|
|
||||||
### 3. Run the "inner loop" build
|
|
||||||
|
|
||||||
At this point, your VS Code window should look something like this:
|
|
||||||
|
|
||||||
<img src="https://user-images.githubusercontent.com/1434956/53654442-9c379400-3c02-11e9-8768-d19e092b606d.png" width=500 />
|
|
||||||
|
|
||||||
To start the dev "inner loop," run:
|
|
||||||
```
|
|
||||||
npm start
|
|
||||||
```
|
|
||||||
|
|
||||||
This will load the site shown below.
|
|
||||||
|
|
||||||
<img src="https://user-images.githubusercontent.com/1434956/53656239-88426100-3c07-11e9-8456-e3d958aa4def.png" width=500 />
|
|
||||||
|
|
||||||
### 4. Lesson Structure
|
|
||||||
|
|
||||||
1. Demos will either be via CodePen (Steps 1, 2 and 3) or done in the step folder. Follow the step README to walkthrough the demo.
|
|
||||||
|
|
||||||
2. Much like demos, exercises are done via CodePen or in the project step folders. These exercises will give you an opportunity to try what was demonstrated in the first step.
|
|
||||||
|
|
||||||
## What to expect
|
|
||||||
|
|
||||||
For each lesson, the presenter will walk through some demo code to teach core concepts about the topic. Don't worry about writing code at this point. Just follow along via the readmes linked below.
|
|
||||||
|
|
||||||
Most lessons also have an exercise portion. Exercise instructions are usually found in the readme for each step's "exercise" folder.
|
|
||||||
|
|
||||||
### Day one
|
|
||||||
|
|
||||||
Day one covers the basics of HTML, CSS and JavaScript, as well as an introduction to React and Typescript.
|
|
||||||
|
|
||||||
1. [Introduction to HTML](step1-01)
|
|
||||||
2. [Introduction to CSS](step1-02)
|
|
||||||
3. [Introduction JavaScript](step1-03)
|
|
||||||
4. [Introduction to React](step1-04)
|
|
||||||
5. [React Components](step1-05)
|
|
||||||
6. [State-driven UI](step1-06)
|
|
||||||
7. [Types and UI-driven state](step1-07)
|
|
||||||
|
|
||||||
### Day two
|
|
||||||
|
|
||||||
1. [TypeScript basics](step2-01)
|
|
||||||
2. [UI Fabric component library](step2-02)
|
|
||||||
3. [Theming and styling](step2-03)
|
|
||||||
4. [React Context](step2-04)
|
|
||||||
5. [Redux: Store](step2-05)
|
|
||||||
6. [Redux: React binding](step2-06)
|
|
||||||
|
|
||||||
### Bonus content
|
|
||||||
|
|
||||||
* [Redux: Service calls](bonus-servicecalls)
|
|
||||||
* [Testing with Jest](bonus-jest)
|
|
||||||
|
|
||||||
## Additional resources
|
|
||||||
|
|
||||||
- [MDN Web Docs](https://developer.mozilla.org/en-US/)
|
|
||||||
- [React Docs](https://reactjs.org/docs/getting-started.html)
|
|
||||||
- [Thinking in React](https://reactjs.org/docs/thinking-in-react.html)
|
|
||||||
|
|
||||||
## Follow the authors!
|
|
||||||
|
|
||||||
If you are interested in JavaScript, TypeScript, React, Redux, or Design Systems, follow us on Twitter:
|
|
||||||
|
|
||||||
- [@kenneth_chau](https://twitter.com/kenneth_chau)
|
|
||||||
- [@micahgodbolt](https://twitter.com/micahgodbolt)
|
|
||||||
|
|
||||||
## Other projects from the UI Fabric team at Microsoft
|
|
||||||
|
|
||||||
- [UI Fabric](https://developer.microsoft.com/en-us/fabric) - [github repo](https://github.com/officedev/office-ui-fabric-react)
|
|
||||||
- [Just](https://microsoft.github.io/just): The task library that just works - [github repo](https://github.com/Microsoft/just)
|
|
||||||
- [Rush](https://rushjs.io): A scalable monorepo manager for the web - [github repo](https://github.com/Microsoft/web-build-tools/)
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
|
||||||
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
|
||||||
the rights to use your contribution. For details, visit https://cla.microsoft.com.
|
|
||||||
|
|
||||||
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
|
|
||||||
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
|
|
||||||
provided by the bot. You will only need to do this once across all repos using our CLA.
|
|
||||||
|
|
||||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
||||||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
|
|
||||||
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
||||||
|
|
||||||
## Legal notices
|
|
||||||
|
|
||||||
Microsoft and any contributors grant you a license to the Microsoft documentation and other content
|
|
||||||
in this repository under the [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/legalcode),
|
|
||||||
see the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https://opensource.org/licenses/MIT), see the
|
|
||||||
[LICENSE-CODE](LICENSE-CODE) file.
|
|
||||||
|
|
||||||
Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation
|
|
||||||
may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries.
|
|
||||||
The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks.
|
|
||||||
Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.
|
|
||||||
|
|
||||||
Privacy information can be found at https://privacy.microsoft.com/en-us/
|
|
||||||
|
|
||||||
Microsoft and any contributors reserve all other rights, whether under their respective copyrights, patents,
|
|
||||||
or trademarks, whether by implication, estoppel or otherwise.
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# Node.js
|
|
||||||
# Build a general Node.js project with npm.
|
|
||||||
# Add steps that analyze code, save build artifacts, deploy, and more:
|
|
||||||
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
|
|
||||||
|
|
||||||
trigger: none
|
|
||||||
|
|
||||||
pool:
|
|
||||||
vmImage: 'Ubuntu-16.04'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- task: NodeTool@0
|
|
||||||
inputs:
|
|
||||||
versionSpec: '10.x'
|
|
||||||
displayName: 'Install Node.js'
|
|
||||||
|
|
||||||
- script: |
|
|
||||||
npm install
|
|
||||||
npm run build
|
|
||||||
displayName: 'npm install, build'
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
# Node.js
|
|
||||||
# Build a general Node.js project with npm.
|
|
||||||
# Add steps that analyze code, save build artifacts, deploy, and more:
|
|
||||||
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
|
|
||||||
|
|
||||||
pr: none
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
- master
|
|
||||||
|
|
||||||
pool:
|
|
||||||
vmImage: 'Ubuntu-16.04'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- task: NodeTool@0
|
|
||||||
inputs:
|
|
||||||
versionSpec: '10.x'
|
|
||||||
displayName: 'Install Node.js'
|
|
||||||
|
|
||||||
- script: |
|
|
||||||
git config user.email "kchau@microsoft.com"
|
|
||||||
git config user.name "Ken Chau"
|
|
||||||
git remote set-url origin https://kenotron:$(git.pat)@github.com/Microsoft/frontend-bootcamp.git
|
|
||||||
git checkout master
|
|
||||||
git pull
|
|
||||||
npm install
|
|
||||||
git checkout -b build_$(Build.BuildId)
|
|
||||||
npm run build
|
|
||||||
git add .
|
|
||||||
git commit -m "adding docs"
|
|
||||||
git subtree split --prefix docs -b temp_$(Build.BuildId)
|
|
||||||
git push origin temp_$(Build.BuildId):refs/heads/gh-pages --force
|
|
||||||
displayName: 'npm install, build and push docs to gh-pages'
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
!function(n){var e={};function t(r){if(e[r])return e[r].exports;var u=e[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var u in n)t.d(r,u,function(e){return n[e]}.bind(null,u));return r},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=150)}({150:function(n,e,t){"use strict";t.r(e),t.d(e,"getCount",function(){return u}),t.d(e,"increment",function(){return o}),t.d(e,"decrement",function(){return i}),t.d(e,"square",function(){return f});var r=0;function u(){return r}function o(){return++r}function i(){return--r}function f(n){return function(n,e){return n*e}(n,n)}}});
|
||||||
|
//# sourceMappingURL=bundle.js.map
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,15 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" data-src="./README.md"></div><div id="app">For this step, we look at unit testing. Run<pre>npm test</pre>in the command line.</div><script src="../../assets/scripts.js"></script><script src="../../bonus-jest/demo/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" data-src="./README.md"></div>
|
|
||||||
<div id="app">
|
|
||||||
For this step, we look at unit testing. Run
|
|
||||||
<pre>npm test</pre>
|
|
||||||
in the command line.
|
|
||||||
</div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,15 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" class="exercise" data-src="./README.md"></div><div id="app">For this step, we look at unit testing. Run<pre>npm test</pre>in the command line.</div><script src="../../assets/scripts.js"></script><script src="../../bonus-jest/exercise/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" class="exercise" data-src="./README.md"></div>
|
|
||||||
<div id="app">
|
|
||||||
For this step, we look at unit testing. Run
|
|
||||||
<pre>npm test</pre>
|
|
||||||
in the command line.
|
|
||||||
</div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,11 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" data-src="./README.md"></div><div id="app"></div><script src="../../assets/scripts.js"></script><script src="../../bonus-servicecalls/demo/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" data-src="./README.md"></div>
|
|
||||||
<div id="app"></div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
preset: 'ts-jest',
|
|
||||||
setupFiles: ['./jest.setup.js'],
|
|
||||||
testEnvironment: 'jsdom',
|
|
||||||
testPathIgnorePatterns: ['/node_modules/', '/docs/']
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
// setup file
|
|
||||||
var enzyme = require('enzyme');
|
|
||||||
var Adapter = require('enzyme-adapter-react-16');
|
|
||||||
|
|
||||||
enzyme.configure({ adapter: new Adapter() });
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,53 +0,0 @@
|
|||||||
import marked, { Renderer } from 'marked';
|
|
||||||
import hljs from 'highlight.js/lib/highlight';
|
|
||||||
import javascript from 'highlight.js/lib/languages/javascript';
|
|
||||||
import typescript from 'highlight.js/lib/languages/typescript';
|
|
||||||
|
|
||||||
hljs.registerLanguage('javascript', javascript);
|
|
||||||
hljs.registerLanguage('typescript', typescript);
|
|
||||||
|
|
||||||
async function run() {
|
|
||||||
const div = document.getElementById('markdownReadme');
|
|
||||||
|
|
||||||
// Create your custom renderer.
|
|
||||||
const renderer = new Renderer();
|
|
||||||
renderer.code = (code, language) => {
|
|
||||||
// Check whether the given language is valid for highlight.js.
|
|
||||||
const validLang = !!(language && hljs.getLanguage(language));
|
|
||||||
// Highlight only if the language is valid.
|
|
||||||
const highlighted = validLang ? hljs.highlight(language, code).value : code;
|
|
||||||
// Render the highlighted code with `hljs` class.
|
|
||||||
return `<pre><code class="hljs ${language}">${highlighted}</code></pre>`;
|
|
||||||
};
|
|
||||||
marked.setOptions({ renderer });
|
|
||||||
|
|
||||||
if (div) {
|
|
||||||
const response = await fetch(div.dataset['src'] || '../README.md');
|
|
||||||
const markdownText = await response.text();
|
|
||||||
div.innerHTML = marked(markdownText);
|
|
||||||
restoreScroll(div);
|
|
||||||
|
|
||||||
div.addEventListener('scroll', evt => {
|
|
||||||
saveScroll(div);
|
|
||||||
});
|
|
||||||
|
|
||||||
window.addEventListener('resize', evt => {
|
|
||||||
saveScroll(div);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const scrollKey = `${window.location.pathname}_scrolltop`;
|
|
||||||
|
|
||||||
function saveScroll(div: HTMLElement) {
|
|
||||||
window.localStorage.setItem(scrollKey, String(div.scrollTop));
|
|
||||||
}
|
|
||||||
|
|
||||||
function restoreScroll(div: HTMLElement) {
|
|
||||||
const scrollTop = window.localStorage.getItem(scrollKey);
|
|
||||||
if (scrollTop) {
|
|
||||||
div.scrollTop = parseInt(scrollTop);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
run();
|
|
||||||
Generated
-9920
File diff suppressed because it is too large
Load Diff
@@ -1,72 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "bootcamp",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/Microsoft/frontend-bootcamp"
|
|
||||||
},
|
|
||||||
"main": "index.js",
|
|
||||||
"scripts": {
|
|
||||||
"start:client": "webpack-dev-server --mode development --progress --open",
|
|
||||||
"test": "jest --watch",
|
|
||||||
"build": "rimraf docs && webpack --progress --mode production",
|
|
||||||
"start:server": "nodemon -w server server/index.js",
|
|
||||||
"start": "run-p start:server start:client",
|
|
||||||
"deploy-ghpages": "git push origin :gh-pages && git subtree push --prefix docs origin gh-pages"
|
|
||||||
},
|
|
||||||
"keywords": [],
|
|
||||||
"author": "",
|
|
||||||
"license": "ISC",
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/body-parser": "^1.17.0",
|
|
||||||
"@types/cors": "^2.8.4",
|
|
||||||
"@types/enzyme": "^3.9.0",
|
|
||||||
"@types/express": "^4.16.1",
|
|
||||||
"@types/jest": "^23.3.13",
|
|
||||||
"@types/node": "~10.12.21",
|
|
||||||
"@types/react": "^16.7.20",
|
|
||||||
"@types/react-dom": "^16.0.11",
|
|
||||||
"@types/react-redux": "^7.0.0",
|
|
||||||
"@types/redux": "^3.6.0",
|
|
||||||
"@types/uuid": "^3.4.4",
|
|
||||||
"body-parser": "^1.18.3",
|
|
||||||
"copy-webpack-plugin": "^4.6.0",
|
|
||||||
"cors": "^2.8.5",
|
|
||||||
"css-loader": "^2.1.0",
|
|
||||||
"fork-ts-checker-async-overlay-webpack-plugin": "^0.1.0",
|
|
||||||
"fork-ts-checker-webpack-plugin": "^0.5.2",
|
|
||||||
"html-webpack-plugin": "^4.0.0-beta.5",
|
|
||||||
"jest": "^24.1.0",
|
|
||||||
"nodemon": "^1.18.9",
|
|
||||||
"npm-run-all": "^4.1.5",
|
|
||||||
"rimraf": "^2.6.3",
|
|
||||||
"style-loader": "^0.23.1",
|
|
||||||
"ts-jest": "^24.0.0",
|
|
||||||
"ts-loader": "^5.3.3",
|
|
||||||
"tslint": "^5.13.0",
|
|
||||||
"typescript": "^3.3.3",
|
|
||||||
"uuid": "^3.3.2",
|
|
||||||
"webpack": "^4.28.4",
|
|
||||||
"webpack-cli": "^3.2.1",
|
|
||||||
"webpack-dev-server": "^3.1.14"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@uifabric/fluent-theme": "^0.14.1",
|
|
||||||
"@uifabric/theme-samples": "^0.1.4",
|
|
||||||
"enzyme": "^3.9.0",
|
|
||||||
"enzyme-adapter-react-16": "^1.9.1",
|
|
||||||
"express": "^4.16.4",
|
|
||||||
"highlight.js": "^9.14.2",
|
|
||||||
"immer": "^1.12.1",
|
|
||||||
"marked": "^0.6.1",
|
|
||||||
"office-ui-fabric-react": "^6.144.0",
|
|
||||||
"react": "^16.8.3",
|
|
||||||
"react-dom": "^16.8.3",
|
|
||||||
"react-redux": "^6.0.0",
|
|
||||||
"redux": "^4.0.1",
|
|
||||||
"redux-devtools-extension": "^2.13.8",
|
|
||||||
"redux-starter-kit": "^0.4.3",
|
|
||||||
"redux-thunk": "^2.3.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
singleQuote: true,
|
|
||||||
tabWidth: 2,
|
|
||||||
printWidth: 140
|
|
||||||
};
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
// @ts-check
|
|
||||||
const fs = require('fs');
|
|
||||||
const express = require('express');
|
|
||||||
const bodyParser = require('body-parser');
|
|
||||||
const cors = require('cors');
|
|
||||||
const app = express();
|
|
||||||
|
|
||||||
const store = {
|
|
||||||
/** @type {any} */
|
|
||||||
read() {
|
|
||||||
if (fs.existsSync('tmp.json')) {
|
|
||||||
store.todos = JSON.parse(fs.readFileSync('tmp.json').toString());
|
|
||||||
} else {
|
|
||||||
store.todos = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
return store.todos;
|
|
||||||
},
|
|
||||||
|
|
||||||
save() {
|
|
||||||
fs.writeFileSync('tmp.json', JSON.stringify(store.todos));
|
|
||||||
},
|
|
||||||
|
|
||||||
todos: {}
|
|
||||||
};
|
|
||||||
|
|
||||||
app.use(bodyParser.json());
|
|
||||||
app.use(cors());
|
|
||||||
|
|
||||||
app.get('/todos', (req, res) => {
|
|
||||||
res.json(store.read());
|
|
||||||
});
|
|
||||||
|
|
||||||
app.put('/todos/:id', (req, res) => {
|
|
||||||
store.todos[req.params.id] = req.body;
|
|
||||||
store.save();
|
|
||||||
res.json('ok');
|
|
||||||
});
|
|
||||||
|
|
||||||
app.post('/todos/:id', (req, res) => {
|
|
||||||
store.todos[req.params.id] = req.body;
|
|
||||||
store.save();
|
|
||||||
res.json('ok');
|
|
||||||
});
|
|
||||||
|
|
||||||
app.delete('/todos/:id', (req, res) => {
|
|
||||||
delete store.todos[req.params.id];
|
|
||||||
store.save();
|
|
||||||
res.json('ok');
|
|
||||||
});
|
|
||||||
|
|
||||||
app.post('/todos', (req, res) => {
|
|
||||||
store.todos = req.body;
|
|
||||||
store.save();
|
|
||||||
res.json('ok');
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get('/hello', (req, res) => {
|
|
||||||
res.send('world');
|
|
||||||
});
|
|
||||||
|
|
||||||
app.listen(process.env.NODE_ENV === 'production' ? undefined : 3000, () => {
|
|
||||||
console.log('Listening at http://localhost:3000');
|
|
||||||
});
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 2,
|
|
||||||
"name": "todo-server",
|
|
||||||
"builds": [{ "src": "*.js", "use": "@now/node-server" }],
|
|
||||||
"env": {
|
|
||||||
"NODE_ENV": "production"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,6 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><body><div id="app"></div><script src="../../step1-04/final/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><link rel="stylesheet" href="./src/style.css"><body><div id="app"></div><script src="../../step1-05/demo/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<link rel="stylesheet" href="./src/style.css" />
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><link rel="stylesheet" href="./src/style.css"><body><div id="app"></div><script src="../../step1-05/exercise/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<link rel="stylesheet" href="./src/style.css" />
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><link rel="stylesheet" href="./src/style.css"><body><div id="app"></div><script src="../../step1-06/demo/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<link rel="stylesheet" href="./src/style.css" />
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><link rel="stylesheet" href="./src/style.css"><body><div id="app"></div><script src="../../step1-06/exercise/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<link rel="stylesheet" href="./src/style.css" />
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><link rel="stylesheet" href="./src/style.css"><body><div id="app"></div><script src="../../step1-07/demo/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<link rel="stylesheet" href="./src/style.css" />
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><link rel="stylesheet" href="./src/style.css"><body><div id="app"></div><script src="../../step1-07/exercise/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<link rel="stylesheet" href="./src/style.css" />
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><link rel="stylesheet" href="./src/style.css"><body><div id="app"></div><script src="../../step1-07/final/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<link rel="stylesheet" href="./src/style.css" />
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
!function(n){var t={};function e(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return n[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}e.m=n,e.c=t,e.d=function(n,t,o){e.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:o})},e.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,t){if(1&t&&(n=e(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var r in n)e.d(o,r,function(t){return n[t]}.bind(null,r));return o},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},e.p="",e(e.s=130)}({130:function(n,t,e){"use strict";e.r(t);var o,r=(o=function(n,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(n,t)},function(n,t){function e(){this.constructor=n}o(n,t),n.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)}),l=function(){return function(){}}();(function(n){function t(){return null!==n&&n.apply(this,arguments)||this}r(t,n)})(l),function(n){function t(){return null!==n&&n.apply(this,arguments)||this}r(t,n)}(l);new(function(){return function(n,t){this.make=n,this.model=t}}())("Honda","Accord");var u={hello:"world"},c=function(){return function(){this.hello="world"}}();console.log(5),console.log(5),console.log(5),console.log(u),console.log(10),console.log(5),console.log(5),console.log(u),console.log(10),console.log(true),console.log((new c).hello),console.log((new c).hello);var i=function(){function n(){this.data=[]}return n.prototype.push=function(n){this.data.push(n)},n.prototype.pop=function(){return this.data.pop()},n}();new i,new i;var a=function(n,t,e,o){return new(e||(e=Promise))(function(r,l){function u(n){try{i(o.next(n))}catch(n){l(n)}}function c(n){try{i(o.throw(n))}catch(n){l(n)}}function i(n){n.done?r(n.value):new e(function(t){t(n.value)}).then(u,c)}i((o=o.apply(n,t||[])).next())})},f=function(n,t){var e,o,r,l,u={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return l={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function c(l){return function(c){return function(l){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return u.label++,{value:l[1],done:!1};case 5:u.label++,o=l[1],l=[0];continue;case 7:l=u.ops.pop(),u.trys.pop();continue;default:if(!(r=(r=u.trys).length>0&&r[r.length-1])&&(6===l[0]||2===l[0])){u=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){u.label=l[1];break}if(6===l[0]&&u.label<r[1]){u.label=r[1],r=l;break}if(r&&u.label<r[2]){u.label=r[2],u.ops.push(l);break}r[2]&&u.ops.pop(),u.trys.pop();continue}l=t.call(n,u)}catch(n){l=[6,n],o=0}finally{e=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}};(function(){return a(this,void 0,void 0,function(){return f(this,function(n){switch(n.label){case 0:return[4,fetch("http://localhost:3000/hello")];case 1:return[4,n.sent().text()];case 2:return[2,n.sent()]}})})})().then(function(n){console.log("hello "+n)});var s=function(){return(s=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++)for(var r in t=arguments[e])Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}).apply(this,arguments)},p=[1,2,3,4],h=p[0],y=p[1],d=p.slice(2);console.log(h,y,d);var b=[1,2];b=b.concat([3,4]),console.log(b);s({},{x:1,y:2},{z:3}),s({},{x:1},{y:2}).x}});
|
||||||
|
//# sourceMappingURL=bundle.js.map
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,13 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" data-src="./README.md"></div><div id="app">Nothing to show here; just look at your console window for output. Hit F12 (<code>cmd+option+I</code> on Mac) to open console window.</div><script src="../../assets/scripts.js"></script><script src="../../step2-01/demo/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" data-src="./README.md"></div>
|
|
||||||
<div id="app">
|
|
||||||
Nothing to show here; just look at your console window for output. Hit F12 (<code>cmd+option+I</code> on Mac) to open console window.
|
|
||||||
</div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=127)}({127:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,u){function i(e){try{a(r.next(e))}catch(e){u(e)}}function l(e){try{a(r.throw(e))}catch(e){u(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,l)}a((r=r.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function l(u){return function(l){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,l])}}};console.log("hello world");!function(){n(this,void 0,void 0,function(){return r(this,function(e){return[2]})})}()}});
|
||||||
|
//# sourceMappingURL=bundle.js.map
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,14 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" class="exercise" data-src="./README.md"></div><div id="app">Nothing to show here; just look at your console window for output. Hit F12 (<code>cmd+option+I</code> on Mac) to open the console window.</div><script src="../../assets/scripts.js"></script><script src="../../step2-01/exercise/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" class="exercise" data-src="./README.md"></div>
|
|
||||||
<div id="app">
|
|
||||||
Nothing to show here; just look at your console window for output. Hit F12 (<code>cmd+option+I</code> on Mac) to open the console
|
|
||||||
window.
|
|
||||||
</div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=149)}({149:function(e,t,n){"use strict";n.r(t);var r=function(){function e(){this._store=[]}return e.prototype.push=function(e){this._store.push(e)},e.prototype.pop=function(){return this._store.pop()},e}(),o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},u=function(e,t,n,r){return new(n||(n=Promise))(function(o,u){function i(e){try{l(r.next(e))}catch(e){u(e)}}function c(e){try{l(r.throw(e))}catch(e){u(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,c)}l((r=r.apply(e,t||[])).next())})},i=function(e,t){var n,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}};console.log("hello world"),console.log("fib(FibConst) is:",function e(t){return t<=1?t:e(t-1)+e(t-2)}(3));console.log("My car:",JSON.stringify({wheels:4,color:"blue",make:"Toyota",model:"Camry"}));var c=new r;c.push(1),c.push(2),c.push(3),console.log("Number on top of the stack:",c.pop());var l=o({},{first:"who",second:"what",third:"dunno",left:"why"},{center:"because",pitcher:"tomorrow",catcher:"today"}),a=l.first,s=l.second,f=l.catcher;function p(e){return u(this,void 0,Promise,function(){return i(this,function(t){return[2,"hello "+e]})})}console.log("First:",a),console.log("Second:",s),console.log("Catcher:",f),function(){u(this,void 0,void 0,function(){var e,t;return i(this,function(n){switch(n.label){case 0:return[4,Promise.resolve(5)];case 1:return e=n.sent(),console.log("makePromise returned:",e),[4,p("Ken")];case 2:return t=n.sent(),console.log("greeting:",t),[2]}})})}()}});
|
||||||
|
//# sourceMappingURL=bundle.js.map
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,14 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" class="exercise" data-src="./README.md"></div><div id="app">Nothing to show here; just look at your console window for output. Hit F12 (<code>cmd+option+I</code> on Mac) to open the console window.</div><script src="../../assets/scripts.js"></script><script src="../../step2-01/final/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" class="exercise" data-src="./README.md"></div>
|
|
||||||
<div id="app">
|
|
||||||
Nothing to show here; just look at your console window for output. Hit F12 (<code>cmd+option+I</code> on Mac) to open the console
|
|
||||||
window.
|
|
||||||
</div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,11 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" data-src="./README.md"></div><div id="app"></div><script src="../../assets/scripts.js"></script><script src="../../step2-02/demo/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" data-src="./README.md"></div>
|
|
||||||
<div id="app"></div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,11 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" class="exercise" data-src="./README.md"></div><div id="app"></div><script src="../../assets/scripts.js"></script><script src="../../step2-02/exercise/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" class="exercise" data-src="./README.md"></div>
|
|
||||||
<div id="app"></div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,11 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" data-src="./README.md"></div><div id="app"></div><script src="../../assets/scripts.js"></script><script src="../../step2-03/demo/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" data-src="./README.md"></div>
|
|
||||||
<div id="app"></div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,11 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" class="exercise" data-src="./README.md"></div><div id="app"></div><script src="../../assets/scripts.js"></script><script src="../../step2-03/exercise/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" class="exercise" data-src="./README.md"></div>
|
|
||||||
<div id="app"></div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,11 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" data-src="./README.md"></div><div id="app"></div><script src="../../assets/scripts.js"></script><script src="../../step2-04/demo/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" data-src="./README.md"></div>
|
|
||||||
<div id="app"></div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,11 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" class="exercise" data-src="./README.md"></div><div id="app"></div><script src="../../assets/scripts.js"></script><script src="../../step2-04/exercise/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" class="exercise" data-src="./README.md"></div>
|
|
||||||
<div id="app"></div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,23 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" data-src="./README.md"></div><div id="app"><p>Nothing to show here; just look at your console window for output. Hit F12 (<code>cmd+option+I</code> on Mac) to open console window.</p><p>To inspect Redux store, use the <a href="http://extension.remotedev.io/">Redux Dev Tool</a> extension for your browser: <a href="https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd">Chrome</a>, <a href="https://addons.mozilla.org/en-US/firefox/addon/reduxdevtools/">FireFox</a>. (Sorry, no Edge or IE support)</p></div><script src="../../assets/scripts.js"></script><script src="../../step2-05/demo/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" data-src="./README.md"></div>
|
|
||||||
<div id="app">
|
|
||||||
<p>
|
|
||||||
Nothing to show here; just look at your console window for output. Hit F12 (<code>cmd+option+I</code> on Mac) to open console
|
|
||||||
window.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
To inspect Redux store, use the <a href="http://extension.remotedev.io/">Redux Dev Tool</a> extension for your browser:
|
|
||||||
<a href="https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd">Chrome</a>,
|
|
||||||
<a href="https://addons.mozilla.org/en-US/firefox/addon/reduxdevtools/">FireFox</a>. (Sorry, no Edge or IE support)
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,22 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" class="exercise" data-src="./README.md"></div><div id="app"><p>Nothing to show here; just look at your console window for output. Hit F12 (<code>cmd+option+I</code> on Mac) to open console window.</p><p>To inspect Redux store, use the <a href="http://extension.remotedev.io/">Redux Dev Tool</a> extension for your browser: <a href="https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd">Chrome</a>, <a href="https://addons.mozilla.org/en-US/firefox/addon/reduxdevtools/">FireFox</a>. (Sorry, no Edge or IE support)</p></div><script src="../../assets/scripts.js"></script><script src="../../step2-05/exercise/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" class="exercise" data-src="./README.md"></div>
|
|
||||||
<div id="app">
|
|
||||||
<p>
|
|
||||||
Nothing to show here; just look at your console window for output. Hit F12 (<code>cmd+option+I</code> on Mac) to open console
|
|
||||||
window.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
To inspect Redux store, use the <a href="http://extension.remotedev.io/">Redux Dev Tool</a> extension for your browser:
|
|
||||||
<a href="https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd">Chrome</a>,
|
|
||||||
<a href="https://addons.mozilla.org/en-US/firefox/addon/reduxdevtools/">FireFox</a>. (Sorry, no Edge or IE support)
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,11 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" data-src="./README.md"></div><div id="app"></div><script src="../../assets/scripts.js"></script><script src="../../step2-06/demo/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" data-src="./README.md"></div>
|
|
||||||
<div id="app"></div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,15 +1 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html><html><head><link rel="stylesheet" href="../../assets/step.css"></head><body class="ms-Fabric"><div id="markdownReadme" class="exercise" data-src="./README.md"></div><div id="app">For this step, we look at unit testing. Run<pre>npm test</pre>in the command line.</div><script src="../../assets/scripts.js"></script><script src="../../step2-06/exercise/bundle.js"></script><script src="../../markdownReadme/bundle.js"></script></body></html>
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../../assets/step.css" />
|
|
||||||
</head>
|
|
||||||
<body class="ms-Fabric">
|
|
||||||
<div id="markdownReadme" class="exercise" data-src="./README.md"></div>
|
|
||||||
<div id="app">
|
|
||||||
For this step, we look at unit testing. Run
|
|
||||||
<pre>npm test</pre>
|
|
||||||
in the command line.
|
|
||||||
</div>
|
|
||||||
<script src="../../assets/scripts.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "./dist/",
|
|
||||||
"noImplicitAny": false,
|
|
||||||
"module": "esnext",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"target": "es5",
|
|
||||||
"jsx": "react",
|
|
||||||
"allowJs": true,
|
|
||||||
"lib": ["es2015", "dom"],
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"skipDefaultLibCheck": true
|
|
||||||
},
|
|
||||||
"exclude": ["node_modules", "docs"]
|
|
||||||
}
|
|
||||||
@@ -1,138 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const fs = require('fs');
|
|
||||||
|
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
||||||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
||||||
const outPath = path.resolve(__dirname, 'docs');
|
|
||||||
|
|
||||||
const entries = {};
|
|
||||||
const nonWebpackedEntries = [];
|
|
||||||
|
|
||||||
function isValidLessonFolder(folder) {
|
|
||||||
return folder.includes('step') || folder.includes('playground') || folder.includes('bonus');
|
|
||||||
}
|
|
||||||
|
|
||||||
function* getEntryPoint(step) {
|
|
||||||
if (isValidLessonFolder(step)) {
|
|
||||||
for (let prefix of ['', 'demo/', 'exercise/', 'final/']) {
|
|
||||||
for (let suffix of ['.js', '.jsx', '.ts', '.tsx']) {
|
|
||||||
const entryRequest = `./${step}/${prefix}src/index${suffix}`;
|
|
||||||
if (fs.existsSync(entryRequest)) {
|
|
||||||
yield entryRequest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.readdirSync('./').filter(step => {
|
|
||||||
let isEntryPoint = false;
|
|
||||||
|
|
||||||
for (let entryPoint of getEntryPoint(step)) {
|
|
||||||
if (entryPoint) {
|
|
||||||
entries[entryPoint.replace(/\/src\/index.*/, '').replace(/^\.\//, '')] = entryPoint;
|
|
||||||
isEntryPoint = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isEntryPoint && isValidLessonFolder(step)) {
|
|
||||||
nonWebpackedEntries.push(step);
|
|
||||||
} else if (step === 'step1-04') {
|
|
||||||
// special case: this folder's `final` has code, but its `demo` doesn't
|
|
||||||
nonWebpackedEntries.push('step1-04/demo');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = function (env, argv) {
|
|
||||||
return {
|
|
||||||
entry: { ...entries, markdownReadme: './markdownReadme/src/index.ts' },
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.tsx?$/,
|
|
||||||
use: {
|
|
||||||
loader: 'ts-loader',
|
|
||||||
options: {
|
|
||||||
transpileOnly: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
exclude: /node_modules/
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.css$/,
|
|
||||||
use: ['style-loader', 'css-loader'],
|
|
||||||
exclude: /node_modules/
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
...Object.keys(entries).map(entry => {
|
|
||||||
return new HtmlWebpackPlugin({
|
|
||||||
template: path.join(__dirname, entry, 'index.html'),
|
|
||||||
filename: `${entry}/index.html`,
|
|
||||||
chunks: [entry, 'markdownReadme']
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
new CopyWebpackPlugin([
|
|
||||||
...Object.keys(entries).map(entry => {
|
|
||||||
return {
|
|
||||||
from: `${entry}/src/**/*`,
|
|
||||||
to: outPath
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
...Object.keys(entries).map(entry => {
|
|
||||||
return {
|
|
||||||
from: `${entry}/../*.+(md|html)`,
|
|
||||||
to: outPath
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
...Object.keys(entries).map(entry => {
|
|
||||||
return {
|
|
||||||
from: `${entry}/*.+(md|html)`,
|
|
||||||
to: outPath
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
from: 'assets/**/*',
|
|
||||||
to: outPath
|
|
||||||
},
|
|
||||||
{
|
|
||||||
from: 'index.html',
|
|
||||||
to: outPath
|
|
||||||
},
|
|
||||||
...nonWebpackedEntries.map(entry => ({ from: `${entry}/**/*`, to: outPath }))
|
|
||||||
]),
|
|
||||||
new ForkTsCheckerWebpackPlugin({
|
|
||||||
silent: true,
|
|
||||||
async: false
|
|
||||||
})
|
|
||||||
],
|
|
||||||
resolve: {
|
|
||||||
extensions: ['.tsx', '.ts', '.js'],
|
|
||||||
alias: {
|
|
||||||
'react-dom$': 'react-dom/profiling',
|
|
||||||
'scheduler/tracing': 'scheduler/tracing-profiling'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
filename: '[name]/bundle.js',
|
|
||||||
path: outPath
|
|
||||||
},
|
|
||||||
devServer: {
|
|
||||||
contentBase: path.resolve(__dirname),
|
|
||||||
watchContentBase: true,
|
|
||||||
watchOptions: {
|
|
||||||
ignored: /tmp.json/
|
|
||||||
},
|
|
||||||
hot: false,
|
|
||||||
stats: 'errors-only',
|
|
||||||
overlay: true,
|
|
||||||
inline: true
|
|
||||||
},
|
|
||||||
stats: 'minimal',
|
|
||||||
devtool: argv.mode === 'development' ? 'eval' : 'source-map'
|
|
||||||
};
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user