Skip to content

Commit 2c9777a

Browse files
authored
Merge branch 'main' into docs/sdk-metrics
2 parents 0f14be9 + 032f68f commit 2c9777a

111 files changed

Lines changed: 7694 additions & 31 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/peer-api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
peer-api-check:
1111
runs-on: ubuntu-latest
1212
container:
13-
image: node:14
13+
image: node:18
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v3

api/.commitlintrc.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
extends:
2+
- '@commitlint/config-conventional'
3+
rules:
4+
header-max-length: [1, 'always', 72]
5+
type-enum:
6+
- 2
7+
- always
8+
- - ci
9+
- feat
10+
- fix
11+
- docs
12+
- style
13+
- refactor
14+
- perf
15+
- test
16+
- revert
17+
- chore
18+
help: |
19+
**Possible types**:
20+
`ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle CI, BrowserStack, SauceLabs)
21+
`feat`: Adds a new feature.
22+
`fix`: Solves a bug.
23+
`docs`: Adds or alters documentation. (example scopes: readme, worker, code_of_conduct, contributors)
24+
`style`: Improves formatting, white-space.
25+
`refactor`: Rewrites code without feature, performance or bug changes.
26+
`perf`: Improves performance.
27+
`test`: Adds or modifies tests. (example scopes: functionals, unit-tests)
28+
`revert`: Changes that reverting other changes
29+
`chore`: No production code change. Updating grunt tasks etc;

api/.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true

api/.eslintrc.js

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
module.exports = {
2+
plugins: [
3+
"@typescript-eslint",
4+
"header",
5+
"node"
6+
],
7+
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
8+
parser: "@typescript-eslint/parser",
9+
parserOptions: {
10+
"project": "./tsconfig.json"
11+
},
12+
rules: {
13+
"quotes": [2, "single", { "avoidEscape": true }],
14+
"@typescript-eslint/no-floating-promises": 2,
15+
"@typescript-eslint/no-this-alias": "off",
16+
"brace-style": ["error", "1tbs"],
17+
"eqeqeq": [
18+
"error",
19+
"smart"
20+
],
21+
"prefer-rest-params": "off",
22+
"@typescript-eslint/naming-convention": [
23+
"error",
24+
{
25+
"selector": "memberLike",
26+
"modifiers": ["private", "protected"],
27+
"format": ["camelCase"],
28+
"leadingUnderscore": "require"
29+
}
30+
],
31+
"no-console": "error",
32+
"no-shadow": "off",
33+
"@typescript-eslint/no-shadow": ["warn"],
34+
"@typescript-eslint/no-unused-vars": ["error", {"argsIgnorePattern": "^_", "args": "after-used"}],
35+
"@typescript-eslint/no-inferrable-types": ["error", { ignoreProperties: true }],
36+
"@typescript-eslint/no-empty-function": ["off"],
37+
"@typescript-eslint/ban-types": ["warn", {
38+
"types": {
39+
"Function": null,
40+
}
41+
}],
42+
"@typescript-eslint/no-shadow": ["warn"],
43+
"arrow-parens": ["error", "as-needed"],
44+
"node/no-deprecated-api": ["warn"],
45+
"header/header": [2, "block", [{
46+
pattern: / \* Copyright The OpenTelemetry Authors[\r\n]+ \*[\r\n]+ \* Licensed under the Apache License, Version 2\.0 \(the \"License\"\);[\r\n]+ \* you may not use this file except in compliance with the License\.[\r\n]+ \* You may obtain a copy of the License at[\r\n]+ \*[\r\n]+ \* https:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0[\r\n]+ \*[\r\n]+ \* Unless required by applicable law or agreed to in writing, software[\r\n]+ \* distributed under the License is distributed on an \"AS IS\" BASIS,[\r\n]+ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.[\r\n]+ \* See the License for the specific language governing permissions and[\r\n]+ \* limitations under the License\./gm,
47+
template:
48+
`\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n `
49+
}]]
50+
},
51+
overrides: [
52+
{
53+
"files": ["test/**/*.ts"],
54+
"rules": {
55+
"no-empty": "off",
56+
"@typescript-eslint/ban-ts-ignore": "off",
57+
"@typescript-eslint/no-empty-function": "off",
58+
"@typescript-eslint/no-explicit-any": "off",
59+
"@typescript-eslint/no-floating-promises": 1,
60+
"@typescript-eslint/no-unused-vars": "off",
61+
"@typescript-eslint/no-var-requires": "off",
62+
"@typescript-eslint/no-shadow": ["off"],
63+
"@typescript-eslint/no-floating-promises": ["off"],
64+
"@typescript-eslint/no-non-null-assertion": ["off"],
65+
"@typescript-eslint/explicit-module-boundary-types": ["off"]
66+
}
67+
}
68+
]
69+
};

api/.gitattributes

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## This .gitattributes file automatically formats the EOL character in certain filetypes within the repository
2+
3+
## Source code
4+
# JavaScript, TypeScript, c, and h source files
5+
*.js text eol=lf
6+
*.ts text eol=lf
7+
*.h text eol=lf diff=cpp
8+
*.c text eol=lf diff=cpp
9+
10+
# Shell scripts
11+
*.sh text eol=lf
12+
*.bash text eol=lf
13+
14+
# Windows batch and PowerShell scripts
15+
*.bat text eol=crlf
16+
*.cmd text eol=crlf
17+
*.ps1 text eol=crlf
18+
19+
##### Other file types #####
20+
21+
## Text files and documentation
22+
*.txt text
23+
README* text
24+
RELEASING* text
25+
CHANGELOG* text
26+
CONTRIBUTING* text
27+
INSTALL* text
28+
LICENSE* text
29+
30+
## Non-text documentation
31+
*.html text diff=html
32+
*.pdf binary
33+
*.json text eol=lf
34+
*.rtf binary
35+
36+
## Git Properties
37+
.gitignore text
38+
.gitmodules text
39+
.gitattributes text

api/.github/CODEOWNERS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#####################################################
2+
#
3+
# List of approvers for OpenTelemetry JS SDK
4+
#
5+
#####################################################
6+
#
7+
# Learn about membership in OpenTelemetry community:
8+
# https://github.com/open-telemetry/community/blob/master/community-membership.md
9+
#
10+
#
11+
# Learn about CODEOWNERS file format:
12+
# https://help.github.com/en/articles/about-code-owners
13+
#
14+
15+
* @open-telemetry/javascript-approvers
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "CodeQL"
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# ┌───────────── minute (0 - 59)
7+
# │ ┌───────────── hour (0 - 23)
8+
# │ │ ┌───────────── day of the month (1 - 31)
9+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
10+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
11+
# │ │ │ │ │
12+
# │ │ │ │ │
13+
# │ │ │ │ │
14+
# * * * * *
15+
- cron: '30 1 * * *'
16+
17+
jobs:
18+
CodeQL-Build:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v2
24+
25+
- name: Initialize CodeQL
26+
uses: github/codeql-action/init@v1
27+
with:
28+
languages: javascript
29+
30+
- name: Autobuild
31+
uses: github/codeql-action/autobuild@v1
32+
33+
- name: Perform CodeQL Analysis
34+
uses: github/codeql-action/analyze@v1

api/.github/workflows/docs.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Deploy API Documentation
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-and-deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout 🛎️
12+
uses: actions/checkout@v2
13+
14+
- name: Install root dependencies
15+
run: npm install --ignore-scripts
16+
17+
- name: Build 🔧
18+
run: |
19+
npm run compile
20+
npm run docs
21+
22+
- name: Deploy 🚀
23+
uses: JamesIves/github-pages-deploy-action@releases/v3
24+
with:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
BRANCH: gh-pages # The branch the action should deploy to.
27+
FOLDER: docs/out # The folder the action should deploy.

api/.github/workflows/lint.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Lint markdown files
17+
uses: docker://avtodev/markdown-lint:v1
18+
with:
19+
args: "./**/*.md -i ./CHANGELOG.md"
20+
21+
- name: Install dependencies
22+
run: npm install
23+
24+
- name: Build 🔧
25+
run: npm run compile
26+
27+
- name: Lint
28+
run: npm run lint
29+
30+
- name: Check for Circular Dependencies
31+
run: npm run cycle-check
32+
33+
- name: Generate Documentation 📜
34+
run: npm run docs
35+
36+
- name: Test Docs
37+
run: npm run docs:test
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
name: release-please
6+
jobs:
7+
release-please:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: GoogleCloudPlatform/release-please-action@v2
11+
id: release
12+
with:
13+
token: ${{secrets.RELEASE_PR_TOKEN}}
14+
release-type: node
15+
package-name: "@opentelemetry/api"
16+
# The logic below handles the npm publication:
17+
- uses: actions/checkout@v2
18+
# these if statements ensure that a publication only occurs when
19+
# a new release is created:
20+
if: ${{ steps.release.outputs.release_created }}
21+
- uses: actions/setup-node@v1
22+
with:
23+
node-version: 14
24+
registry-url: 'https://registry.npmjs.org'
25+
if: ${{ steps.release.outputs.release_created }}
26+
- run: npm install
27+
if: ${{ steps.release.outputs.release_created }}
28+
- run: npm run compile
29+
if: ${{ steps.release.outputs.release_created }}
30+
- run: npm publish --tag next
31+
env:
32+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
33+
if: ${{ steps.release.outputs.release_created }}

0 commit comments

Comments
 (0)