-
Notifications
You must be signed in to change notification settings - Fork 42
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!: publish in dual format #497
Merged
Merged
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f39453a
feat!: publish in dual format
sofisl 3468eac
remove type files
sofisl 186c1a6
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 8818e75
Merge branch 'publishInDualFormat' of https://github.com/googleapis/n…
gcf-owl-bot[bot] 7f5aef9
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 1052f5b
Merge branch 'publishInDualFormat' of https://github.com/googleapis/n…
gcf-owl-bot[bot] 9eecf14
Update ci.yaml
sofisl a4764eb
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 77902cb
merge conflicts
sofisl 5043e56
add missing dependencies
sofisl 8fd5a54
add gapic-tools dep
sofisl 3c863a1
rfix tests, run lint and update jsdoc to json
sofisl eddff7a
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 81f229e
rerun tests
sofisl 5caca96
Merge branch 'publishInDualFormat' of github.com:googleapis/node-gtok…
sofisl 4e5729a
run lint
sofisl a1eb688
omit certain files from synthtool
sofisl 7fbaba6
force push tests
sofisl 0bb4cb3
rerun lint
sofisl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-typescript", | ||
"@babel/env" | ||
], | ||
"plugins": [ | ||
[ | ||
"replace-import-extension", | ||
{ | ||
"extMapping": { | ||
".js": ".cjs" | ||
} | ||
} | ||
], | ||
"./node_modules/gapic-tools/build/src/replaceESMMockingLib.js", | ||
"./node_modules/gapic-tools/build/src/replaceImportMetaUrl.js", | ||
"./node_modules/gapic-tools/build/src/toggleESMFlagVariable.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ package-lock.json | |
__pycache__ | ||
.coverage | ||
docs/ | ||
.DS_Store | ||
**/*.d.ts | ||
*.d.ts | ||
**/**.d.ts |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2020 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
const config = { | ||
"enable-source-maps": true, | ||
"throw-deprecation": true, | ||
"timeout": 10000, | ||
"recursive": true | ||
} | ||
if (process.env.MOCHA_THROW_DEPRECATION === 'false') { | ||
delete config['throw-deprecation']; | ||
} | ||
if (process.env.MOCHA_REPORTER) { | ||
config.reporter = process.env.MOCHA_REPORTER; | ||
} | ||
if (process.env.MOCHA_REPORTER_OUTPUT) { | ||
config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; | ||
} | ||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2020 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
module.exports = { | ||
...require('gts/.prettierrc.json') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright 2019 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import {describe, it} from 'mocha'; | ||
import {packNTest} from 'pack-n-play'; | ||
|
||
/** | ||
* Optionally keep the staging directory between tests. | ||
*/ | ||
|
||
describe('pack-n-play', () => { | ||
it('supports ESM', async () => { | ||
await packNTest({ | ||
sample: { | ||
description: 'import as ESM', | ||
esm: ` | ||
import {GoogleToken} from 'gtoken'; | ||
|
||
async function main() { | ||
const gtoken = new GoogleToken(); | ||
} | ||
main(); | ||
`, | ||
}, | ||
}); | ||
}); | ||
|
||
it('supports CJS', async () => { | ||
await packNTest({ | ||
sample: { | ||
description: 'require as CJS', | ||
cjs: ` | ||
const {GoogleToken} = require('gtoken'); | ||
async function main() { | ||
const gtoken = new GoogleToken(); | ||
} | ||
main(); | ||
`, | ||
}, | ||
}); | ||
}); | ||
|
||
it('TypeScript', async function () { | ||
this.timeout(300000); | ||
await packNTest({ | ||
packageDir: process.cwd(), | ||
sample: { | ||
description: 'TypeScript user can use the type definitions', | ||
ts: ` | ||
import {GoogleToken} from 'gtoken'; | ||
async function main() { | ||
const gtoken = new GoogleToken(); | ||
} | ||
main(); | ||
`, | ||
}, | ||
}); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* Copyright 2018 Google LLC | ||
* | ||
* Distributed under MIT license. | ||
* See file LICENSE for detail or copy at https://opensource.org/licenses/MIT | ||
*/ | ||
export {}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@sofisl I didn't notice this before, but was the nested
esm
directory and this file intentional?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.
yes!