diff --git a/api/.commitlintrc.yml b/api/.commitlintrc.yml deleted file mode 100644 index 1a5e5ac793..0000000000 --- a/api/.commitlintrc.yml +++ /dev/null @@ -1,29 +0,0 @@ -extends: - - '@commitlint/config-conventional' -rules: - header-max-length: [1, 'always', 72] - type-enum: - - 2 - - always - - - ci - - feat - - fix - - docs - - style - - refactor - - perf - - test - - revert - - chore -help: | - **Possible types**: - `ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle CI, BrowserStack, SauceLabs) - `feat`: Adds a new feature. - `fix`: Solves a bug. - `docs`: Adds or alters documentation. (example scopes: readme, worker, code_of_conduct, contributors) - `style`: Improves formatting, white-space. - `refactor`: Rewrites code without feature, performance or bug changes. - `perf`: Improves performance. - `test`: Adds or modifies tests. (example scopes: functionals, unit-tests) - `revert`: Changes that reverting other changes - `chore`: No production code change. Updating grunt tasks etc; diff --git a/api/.editorconfig b/api/.editorconfig deleted file mode 100644 index f68e97b033..0000000000 --- a/api/.editorconfig +++ /dev/null @@ -1,11 +0,0 @@ -# http://editorconfig.org - -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true diff --git a/api/.eslintrc.js b/api/.eslintrc.js deleted file mode 100644 index c78e7b660d..0000000000 --- a/api/.eslintrc.js +++ /dev/null @@ -1,69 +0,0 @@ -module.exports = { - plugins: [ - "@typescript-eslint", - "header", - "node" - ], - extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], - parser: "@typescript-eslint/parser", - parserOptions: { - "project": "./tsconfig.json" - }, - rules: { - "quotes": [2, "single", { "avoidEscape": true }], - "@typescript-eslint/no-floating-promises": 2, - "@typescript-eslint/no-this-alias": "off", - "brace-style": ["error", "1tbs"], - "eqeqeq": [ - "error", - "smart" - ], - "prefer-rest-params": "off", - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "memberLike", - "modifiers": ["private", "protected"], - "format": ["camelCase"], - "leadingUnderscore": "require" - } - ], - "no-console": "error", - "no-shadow": "off", - "@typescript-eslint/no-shadow": ["warn"], - "@typescript-eslint/no-unused-vars": ["error", {"argsIgnorePattern": "^_", "args": "after-used"}], - "@typescript-eslint/no-inferrable-types": ["error", { ignoreProperties: true }], - "@typescript-eslint/no-empty-function": ["off"], - "@typescript-eslint/ban-types": ["warn", { - "types": { - "Function": null, - } - }], - "@typescript-eslint/no-shadow": ["warn"], - "arrow-parens": ["error", "as-needed"], - "node/no-deprecated-api": ["warn"], - "header/header": [2, "block", [{ - 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, - template: - `\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 ` - }]] - }, - overrides: [ - { - "files": ["test/**/*.ts"], - "rules": { - "no-empty": "off", - "@typescript-eslint/ban-ts-ignore": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-floating-promises": 1, - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/no-var-requires": "off", - "@typescript-eslint/no-shadow": ["off"], - "@typescript-eslint/no-floating-promises": ["off"], - "@typescript-eslint/no-non-null-assertion": ["off"], - "@typescript-eslint/explicit-module-boundary-types": ["off"] - } - } - ] -}; diff --git a/api/.gitattributes b/api/.gitattributes deleted file mode 100644 index 0113e927b8..0000000000 --- a/api/.gitattributes +++ /dev/null @@ -1,39 +0,0 @@ -## This .gitattributes file automatically formats the EOL character in certain filetypes within the repository - -## Source code -# JavaScript, TypeScript, c, and h source files -*.js text eol=lf -*.ts text eol=lf -*.h text eol=lf diff=cpp -*.c text eol=lf diff=cpp - -# Shell scripts -*.sh text eol=lf -*.bash text eol=lf - -# Windows batch and PowerShell scripts -*.bat text eol=crlf -*.cmd text eol=crlf -*.ps1 text eol=crlf - -##### Other file types ##### - -## Text files and documentation -*.txt text -README* text -RELEASING* text -CHANGELOG* text -CONTRIBUTING* text -INSTALL* text -LICENSE* text - -## Non-text documentation -*.html text diff=html -*.pdf binary -*.json text eol=lf -*.rtf binary - -## Git Properties -.gitignore text -.gitmodules text -.gitattributes text diff --git a/api/.github/CODEOWNERS b/api/.github/CODEOWNERS deleted file mode 100644 index 744582a847..0000000000 --- a/api/.github/CODEOWNERS +++ /dev/null @@ -1,15 +0,0 @@ -##################################################### -# -# List of approvers for OpenTelemetry JS SDK -# -##################################################### -# -# Learn about membership in OpenTelemetry community: -# https://github.com/open-telemetry/community/blob/master/community-membership.md -# -# -# Learn about CODEOWNERS file format: -# https://help.github.com/en/articles/about-code-owners -# - -* @open-telemetry/javascript-approvers diff --git a/api/.github/workflows/codeql-analysis.yml b/api/.github/workflows/codeql-analysis.yml deleted file mode 100644 index c9efc6332b..0000000000 --- a/api/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: "CodeQL" - -on: - workflow_dispatch: - schedule: - # ┌───────────── minute (0 - 59) - # │ ┌───────────── hour (0 - 23) - # │ │ ┌───────────── day of the month (1 - 31) - # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) - # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) - # │ │ │ │ │ - # │ │ │ │ │ - # │ │ │ │ │ - # * * * * * - - cron: '30 1 * * *' - -jobs: - CodeQL-Build: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: javascript - - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/api/.github/workflows/docs.yaml b/api/.github/workflows/docs.yaml deleted file mode 100644 index 4dae75bbf6..0000000000 --- a/api/.github/workflows/docs.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: Deploy API Documentation - -on: - release: - types: [published] - -jobs: - build-and-deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v2 - - - name: Install root dependencies - run: npm install --ignore-scripts - - - name: Build 🔧 - run: | - npm run compile - npm run docs - - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@releases/v3 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: gh-pages # The branch the action should deploy to. - FOLDER: docs/out # The folder the action should deploy. diff --git a/api/.github/workflows/lint.yaml b/api/.github/workflows/lint.yaml deleted file mode 100644 index aba62bd293..0000000000 --- a/api/.github/workflows/lint.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: Lint - -on: - push: - branches: - - main - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Lint markdown files - uses: docker://avtodev/markdown-lint:v1 - with: - args: "./**/*.md -i ./CHANGELOG.md" - - - name: Install dependencies - run: npm install - - - name: Build 🔧 - run: npm run compile - - - name: Lint - run: npm run lint - - - name: Check for Circular Dependencies - run: npm run cycle-check - - - name: Generate Documentation 📜 - run: npm run docs - - - name: Test Docs - run: npm run docs:test diff --git a/api/.github/workflows/release-please.yml b/api/.github/workflows/release-please.yml deleted file mode 100644 index f4f136910d..0000000000 --- a/api/.github/workflows/release-please.yml +++ /dev/null @@ -1,33 +0,0 @@ -on: - push: - branches: - - main -name: release-please -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: GoogleCloudPlatform/release-please-action@v2 - id: release - with: - token: ${{secrets.RELEASE_PR_TOKEN}} - release-type: node - package-name: "@opentelemetry/api" - # The logic below handles the npm publication: - - uses: actions/checkout@v2 - # these if statements ensure that a publication only occurs when - # a new release is created: - if: ${{ steps.release.outputs.release_created }} - - uses: actions/setup-node@v1 - with: - node-version: 14 - registry-url: 'https://registry.npmjs.org' - if: ${{ steps.release.outputs.release_created }} - - run: npm install - if: ${{ steps.release.outputs.release_created }} - - run: npm run compile - if: ${{ steps.release.outputs.release_created }} - - run: npm publish --tag next - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - if: ${{ steps.release.outputs.release_created }} diff --git a/api/.github/workflows/test.yaml b/api/.github/workflows/test.yaml deleted file mode 100644 index 75f3998fc0..0000000000 --- a/api/.github/workflows/test.yaml +++ /dev/null @@ -1,58 +0,0 @@ -name: Unit Tests -on: - push: - branches: - - main - pull_request: - -jobs: - unit-test: - strategy: - fail-fast: false - matrix: - node: ["8", "10", "12", "14", "16"] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node }} - - - name: Install Dependencies - run: npm install - - - name: Compile 🔧 - run: npm run compile - - - name: Unit tests - run: npm run test - - - name: Report Coverage - run: npm run codecov - if: ${{ matrix.node == '14' }} - - browser-tests: - runs-on: ubuntu-latest - container: - image: circleci/node:12-browsers - steps: - - name: Permission Setup - run: sudo chmod -R 777 /github /__w - - - name: Checkout - uses: actions/checkout@v2 - - - name: Install Dependencies - run: npm install - - - name: Compile 🔧 - run: npm run compile - - - name: Unit tests - run: npm run test:browser - - - name: Report Coverage - run: npm run codecov:browser diff --git a/api/.gitignore b/api/.gitignore deleted file mode 100644 index 10aac0eb73..0000000000 --- a/api/.gitignore +++ /dev/null @@ -1,88 +0,0 @@ -# version.ts file is autogenerated at compile time -src/version.ts - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ -build/ - -# TypeScript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -# next.js build output -.next - -# lock files -yarn.lock -package-lock.json - -# generated gh-pages files -docs/out - -.nyc_output - -#lerna -.changelog -package.json.lerna_backup - -# OS generated files -.DS_Store - -# VsCode configs -.vscode/ - -#Visual Studio -.vs/ - -#IDEA -.idea -*.iml diff --git a/api/.markdownlint.json b/api/.markdownlint.json deleted file mode 100644 index 6208ac19f1..0000000000 --- a/api/.markdownlint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "MD013": false, - "MD024": false, - "MD033": false, - "MD041": false, - "MD026": false -} diff --git a/api/.npmignore b/api/.npmignore deleted file mode 100644 index 9505ba9450..0000000000 --- a/api/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -/bin -/coverage -/doc -/test diff --git a/api/TODO.md b/api/TODO.md new file mode 100644 index 0000000000..53f2b1c282 --- /dev/null +++ b/api/TODO.md @@ -0,0 +1,11 @@ +# TODO + +These tasks must be completed before the API package can be released from this repository. + +- [x] remove files specific to the API git repo +- [ ] add to lerna monorepo + - [ ] add tsconfig files + - [ ] add web testing + - [ ] build esm versions +- [ ] test node versions 8, 10, and 12 +- [ ] add to auto published docs diff --git a/api/karma.base.js b/api/karma.base.js deleted file mode 100644 index cbae813f7b..0000000000 --- a/api/karma.base.js +++ /dev/null @@ -1,31 +0,0 @@ -/*! - * Copyright The OpenTelemetry Authors - * - * 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. - */ - -module.exports = { - listenAddress: 'localhost', - hostname: 'localhost', - browsers: ['ChromeHeadless'], - frameworks: ['mocha'], - coverageIstanbulReporter: { - reports: ['html', 'json'], - dir: '.nyc_output', - fixWebpackSourcePaths: true - }, - reporters: ['spec', 'coverage-istanbul'], - files: ['test/index-webpack.ts'], - preprocessors: { 'test/index-webpack.ts': ['webpack'] }, - webpackMiddleware: { noInfo: true } -}; diff --git a/api/karma.conf.js b/api/karma.conf.js deleted file mode 100644 index c6dacb9a68..0000000000 --- a/api/karma.conf.js +++ /dev/null @@ -1,8 +0,0 @@ -const karmaWebpackConfig = require('./karma.webpack'); -const karmaBaseConfig = require('./karma.base'); - -module.exports = (config) => { - config.set(Object.assign({}, karmaBaseConfig, { - webpack: karmaWebpackConfig - })) -}; \ No newline at end of file diff --git a/api/karma.webpack.js b/api/karma.webpack.js deleted file mode 100644 index bc8eb3a790..0000000000 --- a/api/karma.webpack.js +++ /dev/null @@ -1,43 +0,0 @@ -/*! - * Copyright The OpenTelemetry Authors - * - * 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 webpackNodePolyfills = require('./webpack.node-polyfills.js'); - -// This is the webpack configuration for browser Karma tests with coverage. -module.exports = { - mode: 'development', - target: 'web', - output: { filename: 'bundle.js' }, - resolve: { extensions: ['.ts', '.js'] }, - devtool: 'inline-source-map', - module: { - rules: [ - { test: /\.ts$/, use: 'ts-loader' }, - { - enforce: 'post', - exclude: /(node_modules|\.test\.[tj]sx?$)/, - test: /\.ts$/, - use: { - loader: 'istanbul-instrumenter-loader', - options: { esModules: true } - } - }, - // This setting configures Node polyfills for the browser that will be - // added to the webpack bundle for Karma tests. - { parser: { node: webpackNodePolyfills } } - ] - } -}; diff --git a/api/renovate.json b/api/renovate.json deleted file mode 100644 index f78c11be4a..0000000000 --- a/api/renovate.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": [ - "config:base" - ], - "packageRules": [ - { - "groupName": "all non-major dependencies", - "updateTypes": ["patch", "minor"], - "groupSlug": "all-minor-patch" - } - ], - "ignoreDeps": [ - "gcp-metadata", - "got", - "mocha" - ], - "assignees": [ - "@dyladan", - "@vmarchaud" - ], - "schedule": [ - "before 3am on Friday" - ], - "labels": ["dependencies"] -} diff --git a/api/scripts/version-update.js b/api/scripts/version-update.js deleted file mode 100644 index 4e22aa900b..0000000000 --- a/api/scripts/version-update.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * - * 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. - */ - -const fs = require('fs'); -const os = require('os'); -const path = require('path'); - -const appRoot = process.cwd(); - -const packageJsonUrl = path.resolve(`${appRoot}/package.json`); -const pjson = require(packageJsonUrl); - -const content = `/* - * Copyright The OpenTelemetry Authors - * - * 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. - */ - -// this is autogenerated file, see scripts/version-update.js -export const VERSION = '${pjson.version}'; -`; - -const fileUrl = path.join(appRoot, "src", "version.ts") - -fs.writeFileSync(fileUrl, content); \ No newline at end of file diff --git a/api/tsconfig.esm.json b/api/tsconfig.esm.json deleted file mode 100644 index fd8eb6b378..0000000000 --- a/api/tsconfig.esm.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "ES6", - "moduleResolution": "node", - "outDir": "build/esm", - "rootDir": "src", - "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" - }, - "include": [ - "src/**/*.ts" - ], -} diff --git a/api/tsconfig.json b/api/tsconfig.json deleted file mode 100644 index f73b707389..0000000000 --- a/api/tsconfig.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "compilerOptions": { - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "declaration": true, - "declarationMap": true, - "forceConsistentCasingInFileNames": true, - "module": "commonjs", - "noEmitOnError": true, - "noFallthroughCasesInSwitch": true, - "noImplicitReturns": true, - "noUnusedLocals": true, - "noImplicitOverride": true, - "outDir": "build", - "pretty": true, - "rootDir": ".", - "sourceMap": true, - "strict": true, - "strictNullChecks": true, - "target": "es5", - "incremental": true, - "newLine": "LF", - "inlineSources": true - }, - "include": [ - "src/**/*.ts", - "test/**/*.ts" - ], - "exclude": [ - "node_modules" - ], - "typedocOptions": { - "name": "OpenTelemetry API for JavaScript", - "out": "docs/out", - "entryPoints": ["./src/index.ts"], - "excludePrivate": true, - "hideGenerator": true - } -} diff --git a/api/webpack.node-polyfills.js b/api/webpack.node-polyfills.js deleted file mode 100644 index 8d50ebd242..0000000000 --- a/api/webpack.node-polyfills.js +++ /dev/null @@ -1,52 +0,0 @@ -module.exports = { - // Enable the assert library polyfill because that is used in tests - assert: true, - // The assert polyfill from github.com/browserify/commonjs-assert - // also requires the `global` polyfill. - global: true, - - // Turn off all other Node.js API polyfills for the browser tests to - // make sure that we are not attempting to use Node-specific APIs in - // the browser code. Instead, we will write browser specific - // implementations of platform functionality we need under the - // `./src/platform/browser` folder. This allows for writing browser - // optimized implementations of the specific needed functionality - // rather than bringing in (sometimes large) polyfills for the - // corresponding Node APIs. - Buffer: false, - __dirname: false, - __filename: false, - buffer: false, - child_process: false, - cluster: false, - console: false, - constants: false, - crypto: false, - dgram: false, - dns: false, - domain: false, - events: false, - fs: false, - http: false, - https: false, - module: false, - net: false, - os: false, - path: false, - process: false, - punycode: false, - querystring: false, - readline: false, - repl: false, - setImmediate: false, - stream: false, - string_decoder: false, - sys: false, - timers: false, - tls: false, - tty: false, - url: false, - util: false, - vm: false, - zlib: false -};