-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: publish in dual format (#497)
* feat!: publish in dual format * remove type files * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update ci.yaml * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add missing dependencies * add gapic-tools dep * rfix tests, run lint and update jsdoc to json * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * rerun tests * run lint * omit certain files from synthtool * force push tests * rerun lint --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
7ece46d
commit a81bde8
Showing
20 changed files
with
335 additions
and
145 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ docs/ | |
protos/ | ||
samples/generated/ | ||
system-test/**/fixtures | ||
*.d.ts |
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,4 +7,7 @@ package-lock.json | |
__pycache__ | ||
.coverage | ||
docs/ | ||
.DS_Store | ||
.DS_Store | ||
**/*.d.ts | ||
*.d.ts | ||
**/**.d.ts |
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,34 @@ | ||
{ | ||
"opts": { | ||
"readme": "./README.md", | ||
"package": "./package.json", | ||
"template": "./node_modules/jsdoc-fresh", | ||
"recurse": true, | ||
"verbose": true, | ||
"destination": "./docs/" | ||
}, | ||
"plugins": [ | ||
"plugins/markdown", | ||
"jsdoc-region-tag" | ||
], | ||
"source": { | ||
"excludePattern": "(^|\\/|\\\\)[._]", | ||
"include": [ | ||
"build/esm/src" | ||
], | ||
"includePattern": "\\.js$" | ||
}, | ||
"templates": { | ||
"copyright": "Copyright 2024 Google, LLC.", | ||
"includeDate": false, | ||
"sourceFiles": false, | ||
"systemName": "gtoken", | ||
"theme": "lumen", | ||
"default": { | ||
"outputSourceFiles": false | ||
} | ||
}, | ||
"markdown": { | ||
"idInHeadings": true | ||
} | ||
} |
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 |
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
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.