-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix: typescript-app template broken for npm > 7 #362
Conversation
Signed-off-by: iliapolo <epolon@amazon.com>
name: 'cdk8s-cli', | ||
description: 'This is the command line tool for Cloud Development Kit (CDK) for Kubernetes (cdk8s).', | ||
repositoryUrl: 'https://github.com/cdk8s-team/cdk8s-cli.git', | ||
projenUpgradeSecret: 'PROJEN_GITHUB_TOKEN', | ||
authorName: 'Amazon Web Services', | ||
authorUrl: 'https://aws.amazon.com', | ||
minNodeVersion: '14.17.0', | ||
defaultReleaseBranch: 'main', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover from before we had a branch per major version
@@ -62,11 +63,12 @@ const project = new typescript.TypeScriptProject({ | |||
'typescript-json-schema', | |||
], | |||
|
|||
// we need the compiled .js files for the init tests (we run the cli in there) | |||
compileBeforeTest: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary anymore since init templates are not part of the test command anymore
Signed-off-by: iliapolo <epolon@amazon.com>
⚪ Backport skippedThe pull request was not backported as there were no branches to backport to. If this is a mistake, please apply the desired version labels or run the backport tool manually. Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
(cherry picked from commit 77bc7b3) Signed-off-by: Eli Polonsky <epolon@amazon.com>
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `2.x` to `1.x`: - [fix: typescript-app template broken for npm > 7 (#362)](#362) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport)
#362 made the `compile` and `watch` scripts of the `typescript-app` template use a relative path to the `tsc` compiler, however such a form does not work as intended on Windows... Instead of doing this, explicitly declare a `devDependency` on the `typescript` compiler and return to using just `tsc`. Also, pass the `--build` argument, which speeds up incremental builds considerably.
#362 made the `compile` and `watch` scripts of the `typescript-app` template use a relative path to the `tsc` compiler, however such a form does not work as intended on Windows... Instead of doing this, explicitly declare a `devDependency` on the `typescript` compiler and return to using just `tsc`. Also, pass the `--build` argument, which speeds up incremental builds considerably. Signed-off-by: 🧑🏻💻 Romain Marcadier <rmuller@amazon.com>
#362 made the `compile` and `watch` scripts of the `typescript-app` template use a relative path to the `tsc` compiler, however such a form does not work as intended on Windows... Instead of doing this, explicitly declare a `devDependency` on the `typescript` compiler and return to using just `tsc`. Also, pass the `--build` argument, which speeds up incremental builds considerably.
#362 made the `compile` and `watch` scripts of the `typescript-app` template use a relative path to the `tsc` compiler, however such a form does not work as intended on Windows... Instead of doing this, explicitly declare a `devDependency` on the `typescript` compiler and return to using just `tsc`. Also, pass the `--build` argument, which speeds up incremental builds considerably. (cherry picked from commit 43d9db1) Signed-off-by: Romain Marcadier <rmuller@amazon.com>
The
typescript-app
template has a few npm scripts in itspackage.json
that runtsc
.By default, the
tsc
command resolves to./node_modules/.bin/tsc
. This used to be ok, until a change made it so this bin script gets overridden by a different typescript version than the one declared in the template. A fix has already been merged, which should take of this issue. However, we can also fix it in our template by having the scripts point to the expectedtsc
path.When investigating this issue, it also struck me as weird this wasn't detected in the cli init templates tests.
This is because up until now, our init template were using the source code of the CLI to run against, instead of the tarball.
In addition, we did not have any tests executed against newer versions of node, where npm got a major version bump and underwent some substantial behavior changes.
So, this PR also adds the following:
Also, switch to typescript for projen file.
Fixes #363