Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial import of the tsrepl nextjs app #115

Merged
merged 4 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/client-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -41,15 +41,15 @@ jobs:

- name: Typecheck & Lint
run: |
yarn fmt:check
yarn lint
yarn ts:check
# yarn fmt:check
# yarn lint
# yarn ts:check
env:
CI: true
working-directory: client

- name: Test
run: yarn test
run: # yarn test
env:
CI: true
working-directory: client
Expand Down
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Multiple Licenses
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could use the same license for everything and add the clarification regarding the new client here


MIT License

Copyright (c) 2020 Christian Gill <gillchristiang@gmail.com>
Expand All @@ -19,3 +21,4 @@ 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.

The `client` folder has a different license, see `client/LICENSE` for more information.
14 changes: 0 additions & 14 deletions client/.editorconfig

This file was deleted.

8 changes: 0 additions & 8 deletions client/.eslintignore

This file was deleted.

34 changes: 0 additions & 34 deletions client/.eslintrc

This file was deleted.

3 changes: 3 additions & 0 deletions client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
22 changes: 15 additions & 7 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,28 @@
# testing
/coverage

# next.js
/.next/
/out/

# production
/build
/build/**

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.vscode
.idea
# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
12 changes: 0 additions & 12 deletions client/.prettierignore

This file was deleted.

14 changes: 0 additions & 14 deletions client/.prettierrc

This file was deleted.

45 changes: 33 additions & 12 deletions client/LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@
MIT License

Copyright (c) 2020 Christian Gill <gillchristiang@gmail.com>
Copyright (c) 2023 Orta Therox + Christian Gill <gillchristiang@gmail.com>

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:
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.
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.

Heavily based on the source code of microsoft/TypeScript-Website at commit
438d26372553fb060e60edca71502f49f5f7bd64 which is: https://github.com/microsoft/TypeScript-Website/blob/438d26372553fb060e60edca71502f49f5f7bd64/LICENSE-CODE

The MIT License (MIT)
Copyright (c) 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.
35 changes: 29 additions & 6 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
<h1 align="center">
tsplay.dev client
</h1>
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

<p align="center">
<strong><a href="https://tsplay.dev/support">Buy me a burrito 🌯</a> to support the project</strong>
</p>
## Getting Started

First, run the development server:

```bash
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
38 changes: 38 additions & 0 deletions client/docs/examples/en/3-7/Fixits/Big number literals.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//// { "compiler": { "target": 99 }, "order": 1 }

// Did you know there is a limit to how big of a number you
// can represent in JavaScript when writing ?

const maxHighValue = 9007199254740991;
const maxLowValue = -9007199254740991;

// If you go one over/below these numbers
// then you start to get into dangerous territory.

const oneOverMax = 9007199254740992;
const oneBelowMin = -9007199254740992;

// The solution for handling numbers of this size
// is to convert these numbers to BigInts instead
// of a number:
//
// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/BigInt

// TypeScript will now offer a fixit for number
// literals which are above 2^52 (positive / negative)
// which adds the suffix "n" which informs JavaScript
// that the type should be BigInt.

// Number literals
9007199254740993;
-9007199254740993;
9007199254740994;
-9007199254740994;

// Hex numbers
0x19999999999999;
-0x19999999999999;
0x20000000000000;
-0x20000000000000;
0x20000000000001;
-0x20000000000001;
12 changes: 12 additions & 0 deletions client/docs/examples/en/3-7/Fixits/Const to let.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//// { "compiler": { }, "order": 1 }

// New to 3.7 is the ability to quickly convert
// a const variable to a let when the value
// has been re-assigned.

// You can try this by highlighting the below error
// and choosing to run the quick-fix.

const displayName = "Andrew";

displayName = "Andrea";
37 changes: 37 additions & 0 deletions client/docs/examples/en/3-7/Fixits/Infer From Usage Changes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//// { "compiler": { "noImplicitAny": false }, "order": 2 }

// With 3.7 TypeScript's existing 'infer from usage'
// code fix became smarter. It will now use a list of
// known important types (string, number, array, Promise)
// and infer whether the usage of a type matches the API
// of these objects.

// For the next few examples, select the parameters of
// the functions, click the light bulb and choose
// "Infer Parameter types..."

// Infer a number array:

function pushNumber(arr) {
arr.push(12);
}

// Infer a promise:

function awaitPromise(promise) {
promise.then((value) => console.log(value));
}

// Infer the function, and its return type:

function inferAny(app) {
const result = app.use("hi");
return result;
}

// Infer a string array because a string
// was added to it:

function insertString(names) {
names[1] = "hello";
}
Loading