diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 9e31981..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @splitio/sdk diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index f51e2c7..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,7 +0,0 @@ -# React SDK - -## What did you accomplish? - -## How do we test the changes introduced in this PR? - -## Extra Notes diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml deleted file mode 100644 index 6fc6399..0000000 --- a/.github/workflows/ci-cd.yml +++ /dev/null @@ -1,135 +0,0 @@ -name: ci - -on: - push: - branches: - - '**' - pull_request: - branches: - - main - - development - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true - -permissions: - contents: read - id-token: write - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: Set up Node.js - uses: actions/setup-node@v6 - with: - node-version: 'lts/*' - cache: 'npm' - - - name: npm ci - run: npm ci - - - name: npm check - run: npm run check - - - name: npm test - run: npm run test - - - name: npm build - run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") npm run build - - - name: Set VERSION env - run: echo "VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV - - - name: Store assets - if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/development') - uses: actions/upload-artifact@v5 - with: - name: assets - path: umd/ - retention-days: 1 - - upload-stage: - name: Upload assets - runs-on: ubuntu-latest - needs: build - if: github.event_name == 'push' && github.ref == 'refs/heads/development' - strategy: - matrix: - environment: - - stage - include: - - environment: stage - account_id: "079419646996" - bucket: split-public-stage - - steps: - - name: Download assets - uses: actions/download-artifact@v6 - with: - name: assets - path: umd - - - name: Display structure of assets - run: ls -R - working-directory: umd - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role - aws-region: us-east-1 - - - name: Upload to S3 - run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS - env: - BUCKET: ${{ matrix.bucket }} - SOURCE_DIR: ./umd - DEST_DIR: sdk - ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public - - upload-prod: - name: Upload assets - runs-on: ubuntu-latest - needs: build - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - strategy: - matrix: - environment: - - prod - include: - - environment: prod - account_id: "825951051969" - bucket: split-public - - steps: - - name: Download assets - uses: actions/download-artifact@v6 - with: - name: assets - path: umd - - - name: Display structure of assets - run: ls -R - working-directory: umd - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role - aws-region: us-east-1 - - - name: Upload to S3 - run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS - env: - BUCKET: ${{ matrix.bucket }} - SOURCE_DIR: ./umd - DEST_DIR: sdk - ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public diff --git a/.github/workflows/update-notice-year.yml b/.github/workflows/update-notice-year.yml deleted file mode 100644 index 7043f6f..0000000 --- a/.github/workflows/update-notice-year.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Update Notice Year - -on: - schedule: - - cron: "0 3 1 1 *" # 03:00 AM on January 1 - -permissions: - contents: write - pull-requests: write - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: Set Current year - run: "echo CURRENT=$(date +%Y) >> $GITHUB_ENV" - - - name: Set Previous Year - run: "echo PREVIOUS=$(($CURRENT-1)) >> $GITHUB_ENV" - - - name: Update NOTICE - uses: jacobtomlinson/gha-find-replace@v3 - with: - find: ${{ env.PREVIOUS }} - replace: ${{ env.CURRENT }} - include: "NOTICE" - regex: false - - - name: Commit files - run: | - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - git commit -m "Updated Notice Year" -a - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - title: Update Notice Year - branch: update-notice diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml new file mode 100644 index 0000000..8179cd8 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient.yaml @@ -0,0 +1,108 @@ +pipeline: + name: react-client-repo + identifier: reactclient + projectIdentifier: Harness_Split + orgIdentifier: PROD + tags: {} + properties: + ci: + codebase: + connectorRef: fmegithubharnessgitops + repoName: react-client + build: <+input> + stages: + - stage: + name: Check-Test-Build-Upload + identifier: Check_Test_Build_Upload + description: "" + type: CI + spec: + cloneCodebase: true + caching: + enabled: true + override: true + paths: [] + buildIntelligence: + enabled: false + execution: + steps: + - step: + type: Run + name: npm ci + identifier: npm_ci + spec: + connectorRef: dockerhub + image: node:lts + shell: Bash + command: npm ci + - step: + type: Run + name: npm run check + identifier: npm_run_check + spec: + connectorRef: dockerhub + image: node:lts + shell: Bash + command: npm run check + - step: + type: Run + name: npm run test + identifier: npm_run_test + spec: + connectorRef: dockerhub + image: node:lts + shell: Bash + command: npm run test -- --maxWorkers=2 + resources: + limits: + memory: 4Gi + cpu: "2" + - step: + type: Run + name: npm run build + identifier: npm_run_build + spec: + connectorRef: dockerhub + image: node:lts + shell: Bash + command: BUILD_BRANCH=<+codebase.branch> npm run build + - parallel: + - step: + type: Run + name: upload dev assets to CDN + identifier: upload_dev_assets_to_CDN + spec: + connectorRef: dockerhub + image: amazon/aws-cli:2.31.5 + shell: Bash + command: aws s3 sync ./umd s3://split-public-stage/sdk --acl public-read --follow-symlinks --cache-control max-age=31536000,public + envVariables: + AWS_DEFAULT_REGION: us-east-1 + when: + stageStatus: Success + condition: <+trigger.event> == "PUSH" && <+trigger.branch> == "development" + - step: + type: Run + name: upload prod assets to CDN + identifier: upload_prod_assets_to_CDN + spec: + connectorRef: dockerhub + image: amazon/aws-cli:2.31.5 + shell: Bash + command: aws s3 sync ./umd s3://split-public/sdk --acl public-read --follow-symlinks --cache-control max-age=31536000,public + envVariables: + AWS_DEFAULT_REGION: us-east-1 + when: + stageStatus: Success + condition: <+trigger.event> == "PUSH" && <+trigger.branch> == "main" + infrastructure: + type: KubernetesDirect + spec: + connectorRef: "<+codebase.branch == \"main\" ? \"use1prod1cd\" : \"use1stage1cd\">" + namespace: harness-delegate + serviceAccountName: "<+codebase.branch == \"main\" ? \"use1-prod-1-public-assets\" : \"use1-stage-1-public-assets\">" + automountServiceAccountToken: false + nodeSelector: {} + os: Linux + delegateSelectors: + - "<+codebase.branch == \"main\" ? \"use1-prod-1-cd\" : \"use1-stage-1-cd\">" diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclient_push.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclient_push.yaml new file mode 100644 index 0000000..d768ae6 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclient_push.yaml @@ -0,0 +1,14 @@ +inputSet: + name: reactclient_push + identifier: reactclient_push + orgIdentifier: PROD + projectIdentifier: Harness_Split + pipeline: + identifier: reactclient + properties: + ci: + codebase: + build: + type: branch + spec: + branch: <+trigger.branch> diff --git a/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclientinputset.yaml b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclientinputset.yaml new file mode 100644 index 0000000..34a0290 --- /dev/null +++ b/.harness/orgs/PROD/projects/Harness_Split/pipelines/reactclient/input_sets/reactclientinputset.yaml @@ -0,0 +1,14 @@ +inputSet: + name: reactclientinputset + identifier: reactclientinputset + orgIdentifier: PROD + projectIdentifier: Harness_Split + pipeline: + identifier: reactclient + properties: + ci: + codebase: + build: + type: PR + spec: + number: <+trigger.prNumber> diff --git a/package-lock.json b/package-lock.json index d9fa4fb..a4a0401 100644 --- a/package-lock.json +++ b/package-lock.json @@ -634,9 +634,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/js-yaml": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", - "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz", + "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==", "dev": true, "funding": [ { @@ -1615,9 +1615,9 @@ "license": "Python-2.0" }, "node_modules/@splitsoftware/splitio/node_modules/js-yaml": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", - "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz", + "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==", "funding": [ { "type": "github", @@ -3096,9 +3096,9 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", - "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz", + "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==", "dev": true, "license": "MIT", "dependencies": { @@ -4594,9 +4594,9 @@ } }, "node_modules/eslint/node_modules/js-yaml": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", - "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz", + "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==", "dev": true, "funding": [ { @@ -4974,9 +4974,9 @@ "dev": true }, "node_modules/fast-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", - "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.5.tgz", + "integrity": "sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw==", "dev": true, "funding": [ { @@ -11681,9 +11681,9 @@ } }, "js-yaml": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", - "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz", + "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==", "dev": true, "requires": { "argparse": "^2.0.1" @@ -12396,9 +12396,9 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "js-yaml": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", - "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz", + "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==", "requires": { "argparse": "^2.0.1" } @@ -13492,9 +13492,9 @@ } }, "brace-expansion": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", - "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz", + "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -14342,9 +14342,9 @@ "dev": true }, "js-yaml": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", - "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz", + "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==", "dev": true, "requires": { "argparse": "^2.0.1" @@ -14873,9 +14873,9 @@ "dev": true }, "fast-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", - "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.5.tgz", + "integrity": "sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw==", "dev": true }, "fastest-levenshtein": {