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

chore: huge monorepo refactor! #7063

Merged
merged 20 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
* @winglang/maintainers

# Wing Console
/apps/wing-console/ @skyrpex
/wing-console/ @skyrpex
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Install Playwright
working-directory: apps/wing-console/console/app
working-directory: wing-console/console/app
run: |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
pnpm exec playwright install --with-deps
Expand Down Expand Up @@ -304,11 +304,11 @@ jobs:
id: deploy-fly
run: |
if ! flyctl status --app "$APP_NAME"; then
pushd ./apps/wing-console/console/app/preview
pushd ./wing-console/console/app/preview
flyctl launch --no-deploy --copy-config --name "$APP_NAME" --image-label latest -o personal
popd
fi
flyctl deploy . --config ./apps/wing-console/console/app/preview/fly.toml --app "$APP_NAME" --image-label latest --vm-memory 1024 --strategy immediate
flyctl deploy . --config ./wing-console/console/app/preview/fly.toml --app "$APP_NAME" --image-label latest --vm-memory 1024 --strategy immediate
flyctl scale count 1 --yes --app "$APP_NAME"
echo "deploytime=$(TZ=UTC date +'%Y-%m-%d %H:%M')" >> $GITHUB_OUTPUT

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sdk-spec-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
run: |
if ${{ env.MANUAL == 'true' }}
then
WING_CLI=$(realpath apps/wing/bin/wing)
WING_CLI=$(realpath packages/winglang/bin/wing)
elif ${{ env.LOCAL_BUILD == 'false'}}
then
WING_CLI=$(which wing)
Expand Down
34 changes: 23 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@
"version": "0.2.0",
"configurations": [
{
"command": "./apps/wing/bin/wing compile -t tf-aws ${file}",
"command": "./packages/winglang/bin/wing compile -t tf-aws ${file}",
"name": "wing compile tf-aws",
"request": "launch",
"type": "node-terminal"
},
{
"command": "./apps/wing/bin/wing compile -t tf-azure ${file}",
"command": "./packages/winglang/bin/wing compile -t tf-azure ${file}",
"name": "wing compile tf-azure",
"request": "launch",
"type": "node-terminal"
},
{
"command": "./apps/wing/bin/wing compile -t sim ${file}",
"command": "./packages/winglang/bin/wing compile -t sim ${file}",
"name": "wing compile sim",
"request": "launch",
"type": "node-terminal"
},
{
"command": "./apps/wing/bin/wing test ${file}",
"command": "./packages/winglang/bin/wing test ${file}",
"name": "wing test sim",
"request": "launch",
"type": "node-terminal"
},
{
"command": "./apps/wing/bin/wing test -t tf-aws ${file}",
"command": "./packages/winglang/bin/wing test -t tf-aws ${file}",
"name": "wing test tf-aws",
"request": "launch",
"type": "node-terminal"
Expand All @@ -39,19 +39,31 @@
"name": "Debug Extension",
"type": "node",
"request": "launch",
"args": ["${workspaceFolder}/apps/vscode-wing/scripts/dev.mjs"],
"outFiles": ["${workspaceFolder}/apps/vscode-wing/lib/**/*.js"]
"args": [
"${workspaceFolder}/packages/vscode-wing/scripts/dev.mjs"
],
"outFiles": [
"${workspaceFolder}/packages/vscode-wing/lib/**/*.js"
]
},
{
"name": "Debug Wing Compiler",
"type": "lldb",
"request": "launch",
"cwd": "${workspaceFolder}/libs/wingc",
"cwd": "${workspaceFolder}/packages/@winglang/wingc",
"cargo": {
"args": ["build", "--example", "compile"]
"args": [
"build",
"--example",
"compile"
]
},
"args": ["${file}"],
"sourceLanguages": ["rust"]
"args": [
"${file}"
],
"sourceLanguages": [
"rust"
]
}
]
}
4 changes: 2 additions & 2 deletions CONTRIBUTION_LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Last revised on July 17<sup>th</sup>, 2023**

1. <a name="_heading=h.gjdgxs"></a>Wing Cloud, Inc., a Delaware corporation and/or its affiliates (dba “**Wing Cloud**”) ("Company") may release and operate certain projects under an open-source licensing regime (the “**Project(s)**”). This document describes the license under which you provide your contribution If you wish to contribute to any Project. This document is provided for convenience and details the terms of the licenses you provide and granted as described under the Contributors Terms of Use available [**here**](https://github.com/winglang/wing/blob/main/CONTRIBUTORS_TERMS_OF_SERVICE.md) (“**CTS**”). Contributing or otherwise participating in the Project is subject to the CTS which supersede in any discrepancy with this document. By contributing to the Project, you agree to comply with the CTS. NOTE: This document does not apply to or govern the use of (and/or contributions to) any Company’s licensed products or services which are subject to separate license agreements. For example, the Company Console Software Application, is governed by the Company Console Software License Agreement (the current version of which could be found **[here](https://github.com/winglang/wing/blob/main/apps/wing-console/LICENSE.md)**.
1. <a name="_heading=h.gjdgxs"></a>Wing Cloud, Inc., a Delaware corporation and/or its affiliates (dba “**Wing Cloud**”) ("Company") may release and operate certain projects under an open-source licensing regime (the “**Project(s)**”). This document describes the license under which you provide your contribution If you wish to contribute to any Project. This document is provided for convenience and details the terms of the licenses you provide and granted as described under the Contributors Terms of Use available [**here**](https://github.com/winglang/wing/blob/main/CONTRIBUTORS_TERMS_OF_SERVICE.md) (“**CTS**”). Contributing or otherwise participating in the Project is subject to the CTS which supersede in any discrepancy with this document. By contributing to the Project, you agree to comply with the CTS. NOTE: This document does not apply to or govern the use of (and/or contributions to) any Company’s licensed products or services which are subject to separate license agreements. For example, the Company Console Software Application, is governed by the Company Console Software License Agreement (the current version of which could be found **[here](https://github.com/winglang/wing/blob/main/wing-console/LICENSE.md)**).


2. **Your Contribution is Yours**. Your Contribution shall remain at all times, and to the extent permitted by law, your sole and exclusive property. You hereby further acknowledge and agree that the Contribution is non-confidential. You may release your Contribution to the public, license it under any license or use it as an owner in any manner provided however that the licenses and waivers granted below shall remain in full force.
Expand All @@ -29,4 +29,4 @@
9. **Changes**. Company may change the terms of the license regime and the CTS from time to time, at its sole discretion and without any notice however, we will take efforts to notify regarding substantial changes on the homepage of the Project or Company’s website and/or we will send you an e-mail regarding such changes to the e-mail address that you provided in the registration form (as applicable). Company may at any time, at its sole discretion, cease the operation of the Project or any part thereof, temporarily or permanently, without giving any prior notice. You agree and acknowledge that Company does not assume any responsibility with respect to, or in connection with the termination of the Project and/or and loss of any data.


10. We encourage you to carefully read the CTS before you participate in any Project. You can contact Company here: [help@](mailto:help@wing.cloud)[wing.cloud](mailto:help@wing.cloud) for any questions.
10. We encourage you to carefully read the CTS before you participate in any Project. You can contact Company here: [help@](mailto:help@wing.cloud)[wing.cloud](mailto:help@wing.cloud) for any questions.
2 changes: 1 addition & 1 deletion CONTRIBUTORS_TERMS_OF_SERVICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**1. Acceptance of Terms**

1.1. Wing Cloud, Inc., a Delaware corporation and/or its affiliates (dba “Wing Cloud”) (“Company”) may operate release and operate certain projects under an open-source licensing regime (the “Project(s)”). If you wish to contribute to or otherwise participate in any such Project, please read carefully the following Contributors Terms of Service (“CTS”). NOTE: This document does not apply to or govern the use of (and/or contributions to) any Company’s licensed products or services which are subject to separate license agreements. For example, the Company Console Software Application, is governed by the Company Console Software License Agreement (the current versions of which could be found **[here](https://github.com/winglang/wing/blob/main/apps/wing-console/LICENSE.md)**).
1.1. Wing Cloud, Inc., a Delaware corporation and/or its affiliates (dba “Wing Cloud”) (“Company”) may operate release and operate certain projects under an open-source licensing regime (the “Project(s)”). If you wish to contribute to or otherwise participate in any such Project, please read carefully the following Contributors Terms of Service (“CTS”). NOTE: This document does not apply to or govern the use of (and/or contributions to) any Company’s licensed products or services which are subject to separate license agreements. For example, the Company Console Software Application, is governed by the Company Console Software License Agreement (the current versions of which could be found **[here](https://github.com/winglang/wing/blob/main/wing-console/LICENSE.md)**).


1.2. BY CLICKING THE BOX INDICATING YOUR ACCEPTANCE OF THIS CTS, BY CONTRIBUTING ANY CONTENT TO THE PROJECTS OR BY OTHERWISE PARTICIPATING IN A PROJECT, YOU ACKNOWLEDGE THAT YOU HAVE READ AND UNDERSTOOD THE FOLLOWING TERMS AND YOU AGREE TO BE BOUND BY THEM AND TO COMPLY WITH ALL APPLICABLE LAWS AND REGULATIONS REGARDING YOUR PARTICIPATION IN OR ENGAGEMENT WITH THE PROJECT, AND YOU ACKNOWLEDGE THAT THESE TERMS CONSTITUTE A BINDING AND ENFORCEABLE LEGAL CONTRACT BETWEEN COMPANY AND YOU. IF YOU ACCEPT THESE CTS ON BEHALF OF AN ORGANIZATION, YOU REPRESENT THAT YOU HAVE THE AUTHORITY TO BIND YOUR ORGANIZATION BY THESE CTS. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT AGREE WITH THIS CTS, DO NOT CLICK ON THE ACCEPT BOX AND DO NOT CONTRIBUTE ANY MATERIALS TO OR ENGAGE WITH THE PROJECTS.
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[workspace]
members = [
"apps/wingcli-v2",
"libs/tree-sitter-wing",
"libs/wingc",
"libs/wingii",
"packages/wingcli-v2",
"packages/@winglang/tree-sitter-wing",
"packages/@winglang/wingc",
"packages/@winglang/wingii",
]
resolver = "2"

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Copyright (c) 2022-present Wing Cloud, Inc.

Portions of this software are licensed as follows:

- All content that resides under the "apps/wing-console/" directory of this repository, if that directory exists, is licensed under the license defined in "apps/wing-console/LICENSE.md".
- All content that resides under the "wing-console/" directory of this repository, if that directory exists, is licensed under the license defined in "wing-console/LICENSE.md".
- All third party components incorporated into the Winglang Software are licensed under the original license provided by the owner of the applicable component.
- Content outside of the above mentioned directories or restrictions above is available under the "MIT" license as defined below.

Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@



<div align="center">
<img src="./apps/wing/logo/banner.gif" alt="Wing Banner" >
<img src="./packages/winglang/logo/banner.gif" alt="Wing Banner" >
</div>

<h1 align="center">Welcome to the Wing Language! :wave:</h1>
Expand Down Expand Up @@ -37,7 +34,7 @@ Winglang addresses these pains by letting you work at a higher level of abstract
We also provide you with a set of tools that let you test your code locally, significantly faster than before.

<div align="center">
<img src="./apps/wing/logo/demo.gif" alt="Wing Demo" height="400px">
<img src="./packages/winglang/logo/demo.gif" alt="Wing Demo" height="400px">
</div>

Wing is built by [Elad Ben-Israel](https://github.com/eladb), the guy behind the [AWS CDK](https://github.com/aws/aws-cdk), the gang at the [Wing Cloud team](https://www.wing.cloud/) and an amazing [community](https://t.winglang.io/discord) of contributors (also known as Wingnuts).
Expand Down
3 changes: 1 addition & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

To report a vulnerability, please email us at security@winglang.io


### Owner

For any questions regarding this document please contact @staycoolcall911
For any questions regarding this document please contact @eladb
9 changes: 0 additions & 9 deletions apps/wing-console/console/app/CONTRIBUTING.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/api/02-cli-user-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Usage:
$ wing new <template>
```

Run `wing new` without any arguments to view the available templates or you can [view the templates on GitHub](https://github.com/winglang/wing/tree/main/apps/wing/project-templates/wing).
Run `wing new` without any arguments to view the available templates or you can [view the templates on GitHub](https://github.com/winglang/wing/tree/main/packages/winglang/project-templates/wing).

## Run: `wing run|it`

Expand Down
20 changes: 9 additions & 11 deletions docs/contributing/01-start-here/05-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ It will compile, lint, test and package all modules.
When testing your changes to Wing, locally it may be helpful to be able to easily invoke your local version of the Wing CLI.
In which case adding a shell alias may be helpful for instance on Linux and Mac you could add:

`alias mywing=/<PATH_TO_WING_REPO>/apps/wing/bin/wing` to your shell's rc file.
`alias mywing=/<PATH_TO_WING_REPO>/packages/winglang/bin/wing` to your shell's rc file.
:::

The `pnpm wing` command can be executed from the root of the repository in order to build and run the
Expand Down Expand Up @@ -118,13 +118,11 @@ This command runs the full Wing CLI with the given arguments. Turbo will ensure
## How is the repository structured?

The Wing repository is structured as a monorepo, which means that it contains multiple packages.
Packages that are primarily meant to be run by users are in the `apps` directory, while packages
that are primarily meant to be consumed as libraries are in the `libs` directory. Some packages are
written in Rust, while others are written in TypeScript. Each has a README explaining what it does
Most of the packages are inside the `packages` folder. Each has a README explaining what it does
and how to use it. (If you see one missing, please open an issue and let us know!)

The Wing monorepo uses [Turbo] to run commands across all code packages in the `libs` and `apps`
folders. This means it includes packages that form the entire toolchain (compiler, standard library, IDE
The Wing monorepo uses [Turbo] to run commands across all code packages in the `packages`
folder. This means it includes packages that form the entire toolchain (compiler, standard library, IDE
extension, etc), and the build and release bind them all together.

Turbo will be installed alongside the rest of the project's dependencies after you run `pnpm install`
Expand Down Expand Up @@ -196,10 +194,10 @@ turbo test -F @winglang/wingc
The following command runs `wingc` on a file. This performs all the compilation steps. Run from the root.

```sh
pnpm wing -- compile <path to a .w file (full path, or relative to the location of the apps/wing folder)>
pnpm wing -- compile <path to a .w file (full path, or relative to the location of the packages/winglang folder)>
```

You can find the compilation artifacts in the `apps/wing/target` folder.
You can find the compilation artifacts in the `packages/winglang/target` folder.

To check that your code passes all the lints, run:

Expand Down Expand Up @@ -243,8 +241,8 @@ turbo playground -F @winglang/tree-sitter-wing

## 🔨 How do I build the VSCode extension?

The VSCode extension is located in `apps/vscode-wing`. Most of the "logic" is in the language server, which
is located in the Wing CLI at `apps/wing/src/commands/lsp.ts`.
The VSCode extension is located in `packages/vscode-wing`. Most of the "logic" is in the language server, which
is located in the Wing CLI at `packages/winglang/src/commands/lsp.ts`.

To compile the extension (also creates an installable `.vsix` file):

Expand Down Expand Up @@ -283,7 +281,7 @@ Lastly you can show linting errors in your IDE by enabling the following setting

Adding a new template is straightforward!

Each template is represented by a folder located at [project-templates](https://github.com/winglang/wing/tree/main/apps/wing/project-templates), containing all of the files that template should be initialized with.
Each template is represented by a folder located at [project-templates](https://github.com/winglang/wing/tree/main/packages/winglang/project-templates), containing all of the files that template should be initialized with.

Create a new folder with the template name, and insert any code files that are needed to run it.
Unit tests ran with `turbo test` (or in GitHub Actions once you make a pull request) will automatically validate that the template is valid.
4 changes: 2 additions & 2 deletions docs/docs/01-start-here/02-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ Wing has extended support for two IDEs. They provide syntax highlighting, comple
To use Wing in other IDEs, there are a few tools available to help:

- Language server - Running `wing lsp` serves the official language server
- [TextMate grammar](https://github.com/winglang/wing/blob/main/apps/vscode-wing/syntaxes/wing.tmLanguage.json) - For syntax highlighting
- [tree-sitter grammar and queries](https://github.com/winglang/wing/tree/main/libs/tree-sitter-wing) - For syntax highlighting and more
- [TextMate grammar](https://github.com/winglang/wing/blob/main/packages/vscode-wing/syntaxes/wing.tmLanguage.json) - For syntax highlighting
- [tree-sitter grammar and queries](https://github.com/winglang/wing/tree/main/packages/@winglang/tree-sitter-wing) - For syntax highlighting and more
- [Syntax Highlighting for GitHub (Chrome extension)](https://chromewebstore.google.com/detail/winglang-syntax-hightligh/gjnleleianfjpmckmmdeahlklhcdlakj) - Adds syntax highlighting to various locations within GitHub

## Create your project
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/999-faq/041-is-the-console-open-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords: [faq, console, winglang, Wing programming language, Wing language, ope
Unlike the rest of the wing repo, which is open-source under the MIT license, the console is source-available.
It means that you can see the source code, report bugs in it and contribute modifications, but you can't use it for commercial purposes.

You can see the full details of the license [here](https://github.com/winglang/wing/blob/main/apps/wing-console/LICENSE.md).
You can see the full details of the license [here](https://github.com/winglang/wing/blob/main/wing-console/LICENSE.md).

The license for the rest of the repo is [MIT](https://github.com/winglang/wing/blob/main/LICENSE.md).

2 changes: 1 addition & 1 deletion docs/src/generate_examples_files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ function generateTestsFromDocExamples(): void {

fs.rmSync(join(docExamplesDir, "invalid"), { recursive: true, force: true });
fs.rmSync(join(docExamplesDir, "valid"), { recursive: true, force: true });
generateTestsFromDocExamples();
generateTestsFromDocExamples();
49 changes: 0 additions & 49 deletions examples/tests/sdk_tests/schedule/init.test.w.tf-aws.snap.md

This file was deleted.

Loading
Loading