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

feat: add ESM path to generator #1402

Merged
merged 70 commits into from
Sep 26, 2023
Merged

feat: add ESM path to generator #1402

merged 70 commits into from
Sep 26, 2023

Conversation

sofisl
Copy link
Contributor

@sofisl sofisl commented Jun 15, 2023

This PR adds a path to generate ESM-templates in the generator by adding a format command-line variable. If omitted, it will generate (regular) cjs code. If included, it will generate ESM-code, that transpiles into dual format. Templates now live under cjs and esm directories.

@sofisl sofisl requested review from a team as code owners June 15, 2023 01:04
@sofisl
Copy link
Contributor Author

sofisl commented Jun 16, 2023

@ddelgrosso1, these are the changes for the generator. This is failing because it's attempting to run tsc -p ./tsconfig.json, so hopefully once we get your plug-in solution this will be resolved!

renovate-bot and others added 15 commits August 22, 2023 20:15
Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
* fix: correct IAM return types

* tests: update baseline

* build: remove kms test until it can be updated for gax
Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](jonschlinkert/word-wrap@1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [c8](https://github.com/bcoe/c8) | [`^8.0.0` -> `^8.0.1`](https://renovatebot.com/diffs/npm/c8/8.0.0/8.0.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/c8/8.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/c8/8.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/c8/8.0.0/8.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/c8/8.0.0/8.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>bcoe/c8 (c8)</summary>

### [`v8.0.1`](https://github.com/bcoe/c8/blob/HEAD/CHANGELOG.md#801-2023-07-25)

[Compare Source](https://github.com/bcoe/c8/compare/v8.0.0...v8.0.1)

##### Bug Fixes

-   **deps:** update istanbul deps ([#&#8203;485](https://github.com/bcoe/c8/issues/485)) ([3be8bd9](https://github.com/bcoe/c8/commit/3be8bd97c3fb38b575a48871c170dd5e5041b9a8)), closes [#&#8203;478](https://github.com/bcoe/c8/issues/478)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/gapic-generator-typescript).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMTEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
…ebpack devDependencies (#1416)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [gapic-tools](https://github.com/googleapis/gax-nodejs) | [`^0.1.7` -> `^0.1.8`](https://renovatebot.com/diffs/npm/gapic-tools/0.1.7/0.1.8) | [![age](https://developer.mend.io/api/mc/badges/age/npm/gapic-tools/0.1.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/gapic-tools/0.1.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/gapic-tools/0.1.7/0.1.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/gapic-tools/0.1.7/0.1.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/gapic-generator-typescript).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yNC4yIiwidXBkYXRlZEluVmVyIjoiMzYuMjQuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
@snippet-bot
Copy link

snippet-bot bot commented Sep 2, 2023

Here is the summary of possible violations 😱

There are 29 possible violations for not having product prefix.
There are format violations for 2 region tags.

The end of the violation section. All the stuff below is FYI purposes only.


Here is the summary of changes.

You are about to add 218 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@sofisl sofisl changed the title feat!: move generated libraries to ESM feat: add ESM path to generator Sep 2, 2023
WORKSPACE Outdated
@@ -40,4 +40,4 @@ npm_translate_lock(

load("@npm//:repositories.bzl", "npm_repositories")
npm_repositories()
pnpm_repository(name = "pnpm")
pnpm_repository(name = "pnpm")
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this file can be reverted since the only change is the linebreak.

"jsdoc-fresh": "^3.0.0",
"jsdoc-region-tag": "^2.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the downgrade?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

@@ -1,7 +1,5 @@
import * as $protobuf from "protobufjs";

// Note: this file was manually edited to remove references to Long which are not needed in this project.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's a good idea to remove references to long.

@@ -26,7 +26,17 @@ import {BundleConfig} from '../bundle.js';
import {Options} from './naming.js';
import {ServiceYaml} from '../serviceyaml.js';
import protobuf from 'protobufjs';
import protoJson from '../../../protos/protos.json' assert {type: 'json'};
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this change needed? What's wrong with the regular import? The path is static anyway, isn't it?

@@ -25,6 +25,11 @@ import protobuf from 'protobufjs';
import protoJson from '../../../protos/protos.json' assert {type: 'json'};
import type * as protos from '../../../protos/index.js';

import * as fs from 'fs';
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove unused imports.

if (options.diregapic) {
commandLine += ' --diregapic';
}
if (options.mixins) {
commandLine += ` --mixins="${options.mixins}"`;
}
console.log('COMMANDLINE ARG:');
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the extra logging.

try {
await fsp.rm(baselineDir, {recursive: true});
} catch (err) {
console.log('no baseline to delete');
Copy link
Contributor

Choose a reason for hiding this comment

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

If we just ignore this, let's ignore silently. Otherwise, this log messages is not very helpful, should've said "Not removing baseline ${baselineDir} because it does not exist", or something like that.

@sofisl sofisl merged commit 2899014 into main Sep 26, 2023
17 of 18 checks passed
@sofisl sofisl deleted the moveToEsm branch September 26, 2023 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants