@docupace/pipeline 1.0.77 → 1.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/.prettierrc.cjs +12 -12
  2. package/README.md +135 -135
  3. package/bin/azuread_update_callbacks_for_app.sh +58 -58
  4. package/bin/next-changeset-validate.sh +8 -8
  5. package/bitbucket-pipelines.yml +59 -59
  6. package/eslint.config.js +49 -49
  7. package/jest.config.js +15 -15
  8. package/next/changeset.sh +75 -75
  9. package/next/copy.sh +34 -34
  10. package/next/deploy.sh +40 -40
  11. package/next/execute.sh +123 -123
  12. package/next/sonar.sh +23 -23
  13. package/package.json +1 -1
  14. package/src/auth0/alias.js +79 -79
  15. package/src/auth0/alias.test.js +172 -172
  16. package/src/auth0/cli.js +82 -82
  17. package/src/auth0/configure.js +902 -902
  18. package/src/auth0/configure.test.js +167 -167
  19. package/src/auth0/export.js +48 -48
  20. package/src/auth0/export.test.js +103 -103
  21. package/src/auth0/metadata.js +141 -141
  22. package/src/auth0/metadata.test.js +186 -186
  23. package/src/auth0/vault.js +60 -60
  24. package/src/auth0/vault.test.js +134 -134
  25. package/src/changeset/changelog-wiki.js +328 -328
  26. package/src/changeset/changeset-config.js +34 -34
  27. package/src/changeset/cli.js +237 -237
  28. package/src/changeset/create.js +215 -215
  29. package/src/changeset/package-util.js +87 -87
  30. package/src/changeset/util.js +43 -43
  31. package/src/changeset/validate.js +91 -91
  32. package/src/changeset/version.js +102 -102
  33. package/src/jenkins/setParams.groovy +58 -58
  34. package/src/lib/merge-driver.js +204 -204
  35. package/src/merge/cli-merge-all.js +507 -507
  36. package/src/merge/cli-merge.js +492 -492
  37. package/src/merge/cli-resolve.js +399 -399
  38. package/src/merge/cli.js +38 -38
  39. package/src/merge/merge-changelog.js +87 -87
  40. package/src/merge/merge-package.js +106 -106
  41. package/src/merge/merge-types.js +82 -82
  42. package/src/merge/pr.js +231 -231
  43. package/src/micro/deploy-microservice.js +153 -0
  44. package/src/micro/{ms-publish.js → publish-ms.js} +8 -6
  45. package/src/next/alias.js +53 -53
  46. package/src/next/apache.js +81 -81
  47. package/src/next/cli.js +10 -1
  48. package/src/next/config.js +137 -137
  49. package/src/next/connect.js +226 -226
  50. package/src/next/copy.js +61 -61
  51. package/src/next/deploy.js +633 -633
  52. package/src/next/git-to-semver.js +79 -79
  53. package/src/next/haproxy.js +76 -76
  54. package/src/next/jenkins.js +123 -123
  55. package/src/next/jira.js +84 -84
  56. package/src/next/logger.js +17 -17
  57. package/src/next/pipline.js +114 -114
  58. package/src/next/publish.js +71 -71
  59. package/src/next/pull.js +7 -7
  60. package/src/next/sonar.js +23 -23
  61. package/src/next/test.js +5 -5
  62. package/src/next/util.js +95 -93
  63. package/src/next/vault.js +45 -45
  64. package/terraform/apply.sh +37 -37
  65. package/terraform/init.sh +72 -72
  66. package/terraform/plan.sh +76 -76
  67. package/terraform/validate.sh +17 -17
  68. package/src/micro/cli.js +0 -71
  69. package/src/micro/ms-deploy.js +0 -271
package/.prettierrc.cjs CHANGED
@@ -1,12 +1,12 @@
1
- module.exports = {
2
- parser: 'typescript',
3
- trailingComma: 'all',
4
- tabWidth: 2,
5
- semi: true,
6
- singleQuote: true,
7
- printWidth: 80,
8
- tabs: false,
9
- jsxSingleQuote: false,
10
- bracketSameLine: true,
11
- arrowParens: 'always',
12
- };
1
+ module.exports = {
2
+ parser: 'typescript',
3
+ trailingComma: 'all',
4
+ tabWidth: 2,
5
+ semi: true,
6
+ singleQuote: true,
7
+ printWidth: 80,
8
+ tabs: false,
9
+ jsxSingleQuote: false,
10
+ bracketSameLine: true,
11
+ arrowParens: 'always',
12
+ };
package/README.md CHANGED
@@ -1,136 +1,136 @@
1
- # Pipeline Shared Scripts
2
-
3
- A collection of CLI tools for Docupace's CI/CD pipelines and deployment workflows.
4
-
5
- ## Overview
6
-
7
- This package provides a set of command-line interfaces (CLIs) to facilitate various DevOps operations in the Docupace ecosystem:
8
-
9
- - `dp-next-cli`: Deployment and pipeline management for Next applications
10
- - `dp-changeset-cli`: Versioning and changeset management
11
- - `dp-auth0-cli`: Auth0 tenant configuration and management
12
-
13
- ## Installation
14
-
15
- ```bash
16
- npm install @docupace/pipeline
17
- ```
18
-
19
- Or with pnpm:
20
-
21
- ```bash
22
- pnpm add @docupace/pipeline
23
- ```
24
-
25
- ## Command Line Interfaces
26
-
27
- ### dp-next-cli
28
-
29
- Manages deployment, Docker image handling, and infrastructure configuration.
30
-
31
- ```bash
32
- dp-next-cli [command] [options]
33
- ```
34
-
35
- **Commands:**
36
-
37
- - `pull <imageName>`: Pull a Docker image from the registry
38
- - `sonar`: Run Sonar analysis
39
- - `addApacheSite`: Add site to apache
40
- - `connectClone`: Clone connect site
41
- - `haproxySync`: Sync haproxy config
42
- - `vaultAddSiteData`: Add m2m auth0 data to vault
43
- - `-s, --site-name <siteName>`: Site name
44
- - `-p, --site-config-remote-path <path>`: Site config remote path
45
- - `publish`: Publish a Docker image
46
- - `deploy-from-site`: Deploy an application for a specific site
47
- - `-f, --from-env <fromEnv>`: Source environment
48
- - `-t, --to-env <toEnv>`: Target environment
49
- - `-F, --from-site <fromSite>`: Source site
50
- - `-T, --to-site <toSite>`: Target site
51
- - `-c, --deploy-core <deployCore>`: Deploy Core (default: "false")
52
- - `-C, --deploy-connect <deployConnect>`: Deploy Connect (default: "false")
53
- - `deploy-template`: Deploy an application for a specific site
54
- - `deploy-app <application>`: Deploy an application for a specific site
55
- - `deploy-core <env> <site>`: Deploy Core
56
- - `-l, --liquibase <liquibase>`: Application name (default: "true")
57
- - `-b, --branch <branch>`: Branch (default: "master")
58
- - `deploy-connect <env> <site>`: Deploy Connect
59
- - `-l, --liquibase <liquibase>`: Application name (default: "true")
60
- - `-b, --branch <branch>`: Branch (default: "master")
61
- - `deploy-core-pipeline <env> <site>`: Deploy Core via pipeline
62
- - `-l, --liquibase <liquibase>`: Application name (default: "true")
63
- - `-b, --branch <branch>`: Branch (default: "master")
64
- - `copy`: Copy a Docker image between registries
65
- - `-a, --application <application>`: Application name
66
- - `-f, --from-env <fromEnv>`: Source environment
67
- - `-t, --to-env <toEnv>`: Target environment
68
- - `-g, --tag <tag>`: Image tag
69
- - `run-pipeline`: Trigger a pipeline by name
70
- - `-r, --repository <repository>`: Repository name
71
- - `-p, --pipeline-name <pipelineName>`: Pipeline name
72
- - `-b, --branch <branch>`: Branch name
73
- - `-v, --variables <key=value>`: Pipeline variable as key=value pair
74
- - `-w, --wait`: Wait for the pipeline to complete (default: false)
75
-
76
- ### dp-changeset-cli
77
-
78
- Manages versioning and changesets for mono-repos and single-package repos.
79
-
80
- ```bash
81
- dp-changeset-cli [command] [options]
82
- ```
83
-
84
- **Commands:**
85
-
86
- - `validate`: Validate changesets for the provided PR
87
- - `version`: Run Changeset versioning
88
- - `commit-tag`: Commit and tag the new version
89
- - `version-commit-tag`: Run versioning and commit-and-tag in sequence
90
- - `close-version`: Close a version and create a release branch
91
- - `create-changeset`: Create a changeset based on the current branch and Jira ticket information
92
-
93
- ### dp-auth0-cli
94
-
95
- Manages Auth0 tenant configuration across environments.
96
-
97
- ```bash
98
- dp-auth0-cli [command] [options]
99
- ```
100
-
101
- **Commands:**
102
-
103
- - `configureFromSite <fromSite> <toSite> <fromEnv> <toEnv> <deployUI> <deployGraphQLServer> <useNewDomain> <useS3>`: Configure Auth0 tenants
104
- - `getVaultSecrets <vaultPath>`: Get secrets from Vault
105
- - `configureAlias <site> <env> <username> <password> <realm>`: Configure Core Alias for the given site
106
- - `exportConf <site> <env>`: Export Auth0 configuration for the given site
107
- - `getAuth0Metadata <site> <env>`: Get Auth0 metadata for the given site
108
-
109
- ## Environment Configuration
110
-
111
- The CLI tools look for environment configuration in the following locations:
112
- - `.env.pipeline.local`
113
- - `config/.env.pipeline.local`
114
-
115
- ## Examples
116
-
117
- ```bash
118
- # Deploy from one site to another
119
- dp-next-cli deploy-from-site --from-env dev --to-env dev --from-site financialdev --to-site template --deploy-core true
120
-
121
- # Run a pipeline
122
- dp-next-cli run-pipeline -r docupace-next-e2e -b master -p run-tests-qa
123
-
124
- # Validate changesets
125
- dp-changeset-cli validate
126
-
127
- # Create a new changeset
128
- dp-changeset-cli create-changeset
129
-
130
- # Configure Auth0 for a site
131
- dp-auth0-cli configureFromSite sourceSite targetSite dev prod true true true false
132
- ```
133
-
134
- ## License
135
-
1
+ # Pipeline Shared Scripts
2
+
3
+ A collection of CLI tools for Docupace's CI/CD pipelines and deployment workflows.
4
+
5
+ ## Overview
6
+
7
+ This package provides a set of command-line interfaces (CLIs) to facilitate various DevOps operations in the Docupace ecosystem:
8
+
9
+ - `dp-next-cli`: Deployment and pipeline management for Next applications
10
+ - `dp-changeset-cli`: Versioning and changeset management
11
+ - `dp-auth0-cli`: Auth0 tenant configuration and management
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install @docupace/pipeline
17
+ ```
18
+
19
+ Or with pnpm:
20
+
21
+ ```bash
22
+ pnpm add @docupace/pipeline
23
+ ```
24
+
25
+ ## Command Line Interfaces
26
+
27
+ ### dp-next-cli
28
+
29
+ Manages deployment, Docker image handling, and infrastructure configuration.
30
+
31
+ ```bash
32
+ dp-next-cli [command] [options]
33
+ ```
34
+
35
+ **Commands:**
36
+
37
+ - `pull <imageName>`: Pull a Docker image from the registry
38
+ - `sonar`: Run Sonar analysis
39
+ - `addApacheSite`: Add site to apache
40
+ - `connectClone`: Clone connect site
41
+ - `haproxySync`: Sync haproxy config
42
+ - `vaultAddSiteData`: Add m2m auth0 data to vault
43
+ - `-s, --site-name <siteName>`: Site name
44
+ - `-p, --site-config-remote-path <path>`: Site config remote path
45
+ - `publish`: Publish a Docker image
46
+ - `deploy-from-site`: Deploy an application for a specific site
47
+ - `-f, --from-env <fromEnv>`: Source environment
48
+ - `-t, --to-env <toEnv>`: Target environment
49
+ - `-F, --from-site <fromSite>`: Source site
50
+ - `-T, --to-site <toSite>`: Target site
51
+ - `-c, --deploy-core <deployCore>`: Deploy Core (default: "false")
52
+ - `-C, --deploy-connect <deployConnect>`: Deploy Connect (default: "false")
53
+ - `deploy-template`: Deploy an application for a specific site
54
+ - `deploy-app <application>`: Deploy an application for a specific site
55
+ - `deploy-core <env> <site>`: Deploy Core
56
+ - `-l, --liquibase <liquibase>`: Application name (default: "true")
57
+ - `-b, --branch <branch>`: Branch (default: "master")
58
+ - `deploy-connect <env> <site>`: Deploy Connect
59
+ - `-l, --liquibase <liquibase>`: Application name (default: "true")
60
+ - `-b, --branch <branch>`: Branch (default: "master")
61
+ - `deploy-core-pipeline <env> <site>`: Deploy Core via pipeline
62
+ - `-l, --liquibase <liquibase>`: Application name (default: "true")
63
+ - `-b, --branch <branch>`: Branch (default: "master")
64
+ - `copy`: Copy a Docker image between registries
65
+ - `-a, --application <application>`: Application name
66
+ - `-f, --from-env <fromEnv>`: Source environment
67
+ - `-t, --to-env <toEnv>`: Target environment
68
+ - `-g, --tag <tag>`: Image tag
69
+ - `run-pipeline`: Trigger a pipeline by name
70
+ - `-r, --repository <repository>`: Repository name
71
+ - `-p, --pipeline-name <pipelineName>`: Pipeline name
72
+ - `-b, --branch <branch>`: Branch name
73
+ - `-v, --variables <key=value>`: Pipeline variable as key=value pair
74
+ - `-w, --wait`: Wait for the pipeline to complete (default: false)
75
+
76
+ ### dp-changeset-cli
77
+
78
+ Manages versioning and changesets for mono-repos and single-package repos.
79
+
80
+ ```bash
81
+ dp-changeset-cli [command] [options]
82
+ ```
83
+
84
+ **Commands:**
85
+
86
+ - `validate`: Validate changesets for the provided PR
87
+ - `version`: Run Changeset versioning
88
+ - `commit-tag`: Commit and tag the new version
89
+ - `version-commit-tag`: Run versioning and commit-and-tag in sequence
90
+ - `close-version`: Close a version and create a release branch
91
+ - `create-changeset`: Create a changeset based on the current branch and Jira ticket information
92
+
93
+ ### dp-auth0-cli
94
+
95
+ Manages Auth0 tenant configuration across environments.
96
+
97
+ ```bash
98
+ dp-auth0-cli [command] [options]
99
+ ```
100
+
101
+ **Commands:**
102
+
103
+ - `configureFromSite <fromSite> <toSite> <fromEnv> <toEnv> <deployUI> <deployGraphQLServer> <useNewDomain> <useS3>`: Configure Auth0 tenants
104
+ - `getVaultSecrets <vaultPath>`: Get secrets from Vault
105
+ - `configureAlias <site> <env> <username> <password> <realm>`: Configure Core Alias for the given site
106
+ - `exportConf <site> <env>`: Export Auth0 configuration for the given site
107
+ - `getAuth0Metadata <site> <env>`: Get Auth0 metadata for the given site
108
+
109
+ ## Environment Configuration
110
+
111
+ The CLI tools look for environment configuration in the following locations:
112
+ - `.env.pipeline.local`
113
+ - `config/.env.pipeline.local`
114
+
115
+ ## Examples
116
+
117
+ ```bash
118
+ # Deploy from one site to another
119
+ dp-next-cli deploy-from-site --from-env dev --to-env dev --from-site financialdev --to-site template --deploy-core true
120
+
121
+ # Run a pipeline
122
+ dp-next-cli run-pipeline -r docupace-next-e2e -b master -p run-tests-qa
123
+
124
+ # Validate changesets
125
+ dp-changeset-cli validate
126
+
127
+ # Create a new changeset
128
+ dp-changeset-cli create-changeset
129
+
130
+ # Configure Auth0 for a site
131
+ dp-auth0-cli configureFromSite sourceSite targetSite dev prod true true true false
132
+ ```
133
+
134
+ ## License
135
+
136
136
  ISC
@@ -1,58 +1,58 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- ENV=$1
5
-
6
- if [ -z "$ENV" ]; then
7
- echo "Usage: $0 <environment>"
8
- exit 1
9
- fi
10
-
11
- TENANT_ID="docupace.onmicrosoft.com"
12
- CLIENT_ID=$ARM_CLIENT_ID
13
- CLIENT_SECRET=$ARM_CLIENT_SECRET
14
- NEW_REDIRECT="https://docupace-$ENV-$SITE_NAME.us.auth0.com/login/callback"
15
- APP_ID="auth0-$ENV-docupace"
16
- APP_SCOPE="https://graph.microsoft.com/.default"
17
- GRAPH_API="https://graph.microsoft.com/v1.0"
18
-
19
- ACCESS_TOKEN=$(curl -s -X POST \
20
- -H "Content-Type: application/x-www-form-urlencoded" \
21
- -d "grant_type=client_credentials&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&scope=$APP_SCOPE" \
22
- https://login.microsoftonline.com/$TENANT_ID/oauth2/v2.0/token | jq -r '.access_token')
23
-
24
- APP_DETAILS=$(curl -s -G "https://graph.microsoft.com/v1.0/applications" \
25
- -H "Authorization: Bearer $ACCESS_TOKEN" \
26
- -H "Content-Type: application/json" \
27
- --data-urlencode "\$filter=appId eq '$CLIENT_ID'")
28
-
29
- APP_ID=$(echo "$APP_DETAILS" | jq -r '.value[0].id')
30
- echo "Application ID: $APP_ID"
31
-
32
- CURRENT_REDIRECTS=$(echo "$APP_DETAILS" | jq -r '.value[0].web.redirectUris // []')
33
- echo "Current redirect URIs: $CURRENT_REDIRECTS"
34
-
35
- if echo "$CURRENT_REDIRECTS" | jq -e --arg uri "$NEW_REDIRECT" 'index($uri)' > /dev/null; then
36
- echo "Redirect URI '$NEW_REDIRECT' already exists. No update needed."
37
- else
38
- UPDATED_REDIRECTS=$(echo "$CURRENT_REDIRECTS" | jq --arg uri "$NEW_REDIRECT" '. + [$uri]')
39
- echo "Updated redirect URIs: $UPDATED_REDIRECTS"
40
-
41
- UPDATE_REDIRECTS=$(curl -fs -X PATCH \
42
- -H "Authorization: Bearer $ACCESS_TOKEN" \
43
- -H "Content-Type: application/json" \
44
- -d "{
45
- \"web\": {
46
- \"redirectUris\": $UPDATED_REDIRECTS
47
- }
48
- }" \
49
- "https://graph.microsoft.com/v1.0/applications/$APP_ID")
50
-
51
- if [ $? -eq 0 ]; then
52
- echo "Successfully updated redirect URIs"
53
- echo $UPDATE_REDIRECTS
54
- else
55
- echo "Failed to update redirect URIs"
56
- echo $UPDATE_REDIRECTS
57
- fi
58
- fi
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ ENV=$1
5
+
6
+ if [ -z "$ENV" ]; then
7
+ echo "Usage: $0 <environment>"
8
+ exit 1
9
+ fi
10
+
11
+ TENANT_ID="docupace.onmicrosoft.com"
12
+ CLIENT_ID=$ARM_CLIENT_ID
13
+ CLIENT_SECRET=$ARM_CLIENT_SECRET
14
+ NEW_REDIRECT="https://docupace-$ENV-$SITE_NAME.us.auth0.com/login/callback"
15
+ APP_ID="auth0-$ENV-docupace"
16
+ APP_SCOPE="https://graph.microsoft.com/.default"
17
+ GRAPH_API="https://graph.microsoft.com/v1.0"
18
+
19
+ ACCESS_TOKEN=$(curl -s -X POST \
20
+ -H "Content-Type: application/x-www-form-urlencoded" \
21
+ -d "grant_type=client_credentials&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&scope=$APP_SCOPE" \
22
+ https://login.microsoftonline.com/$TENANT_ID/oauth2/v2.0/token | jq -r '.access_token')
23
+
24
+ APP_DETAILS=$(curl -s -G "https://graph.microsoft.com/v1.0/applications" \
25
+ -H "Authorization: Bearer $ACCESS_TOKEN" \
26
+ -H "Content-Type: application/json" \
27
+ --data-urlencode "\$filter=appId eq '$CLIENT_ID'")
28
+
29
+ APP_ID=$(echo "$APP_DETAILS" | jq -r '.value[0].id')
30
+ echo "Application ID: $APP_ID"
31
+
32
+ CURRENT_REDIRECTS=$(echo "$APP_DETAILS" | jq -r '.value[0].web.redirectUris // []')
33
+ echo "Current redirect URIs: $CURRENT_REDIRECTS"
34
+
35
+ if echo "$CURRENT_REDIRECTS" | jq -e --arg uri "$NEW_REDIRECT" 'index($uri)' > /dev/null; then
36
+ echo "Redirect URI '$NEW_REDIRECT' already exists. No update needed."
37
+ else
38
+ UPDATED_REDIRECTS=$(echo "$CURRENT_REDIRECTS" | jq --arg uri "$NEW_REDIRECT" '. + [$uri]')
39
+ echo "Updated redirect URIs: $UPDATED_REDIRECTS"
40
+
41
+ UPDATE_REDIRECTS=$(curl -fs -X PATCH \
42
+ -H "Authorization: Bearer $ACCESS_TOKEN" \
43
+ -H "Content-Type: application/json" \
44
+ -d "{
45
+ \"web\": {
46
+ \"redirectUris\": $UPDATED_REDIRECTS
47
+ }
48
+ }" \
49
+ "https://graph.microsoft.com/v1.0/applications/$APP_ID")
50
+
51
+ if [ $? -eq 0 ]; then
52
+ echo "Successfully updated redirect URIs"
53
+ echo $UPDATE_REDIRECTS
54
+ else
55
+ echo "Failed to update redirect URIs"
56
+ echo $UPDATE_REDIRECTS
57
+ fi
58
+ fi
@@ -1,8 +1,8 @@
1
- #!/bin/bash
2
- # bin/next-changeset-validate
3
-
4
- DIR="$(cd "$(dirname "$0")" && pwd)/../@docupace/pipeline"
5
-
6
- # Pass all arguments to the actual script
7
-
8
- bash $DIR/next/changeset.sh validate $2
1
+ #!/bin/bash
2
+ # bin/next-changeset-validate
3
+
4
+ DIR="$(cd "$(dirname "$0")" && pwd)/../@docupace/pipeline"
5
+
6
+ # Pass all arguments to the actual script
7
+
8
+ bash $DIR/next/changeset.sh validate $2
@@ -1,60 +1,60 @@
1
- # bitbucket-pipelines.yml
2
- clone:
3
- depth: 2
4
-
5
- pipelines:
6
- pull-requests:
7
- '**':
8
- - step:
9
- runs-on:
10
- - self.hosted
11
- - linux.shell
12
- name: On Pull Request
13
- script:
14
- - npm install -g pnpm
15
- - pnpm config set //registry.npmjs.org/:_authToken $DOCUPACE_NPM_TOKEN
16
- - pnpm install --frozen-lockfile
17
- - 'npx eslint . --rule "no-unused-vars: warn" --rule "no-useless-escape: warn" --color'
18
- - pnpm test
19
- artifacts:
20
- - coverage/**
21
- after-script:
22
- - echo "Pipeline completed with status $BITBUCKET_EXIT_CODE"
23
-
24
- custom:
25
- scheduled-tests:
26
- - step:
27
- runs-on:
28
- - self.hosted
29
- - linux.shell
30
- name: Scheduled Tests
31
- script:
32
- - npm install -g pnpm
33
- - pnpm config set //registry.npmjs.org/:_authToken $DOCUPACE_NPM_TOKEN
34
- - pnpm install --frozen-lockfile
35
- - 'npx eslint . --rule "no-unused-vars: warn" --rule "no-useless-escape: warn" --color'
36
- - pnpm test
37
- artifacts:
38
- - coverage/**
39
- after-script:
40
- - echo "Pipeline completed with status $BITBUCKET_EXIT_CODE"
41
-
42
- branches:
43
- main:
44
- - step:
45
- runs-on:
46
- - self.hosted
47
- - linux.shell
48
- name: Main Branch Build
49
- script:
50
- - npm install -g pnpm
51
- - pnpm config set //registry.npmjs.org/:_authToken $DOCUPACE_NPM_TOKEN
52
- - pnpm install --frozen-lockfile
53
- - 'npx eslint . --rule "no-unused-vars: warn" --rule "no-useless-escape: warn" --color'
54
- - pnpm test
55
- artifacts:
56
- - coverage/**
57
-
58
- definitions:
59
- caches:
1
+ # bitbucket-pipelines.yml
2
+ clone:
3
+ depth: 2
4
+
5
+ pipelines:
6
+ pull-requests:
7
+ '**':
8
+ - step:
9
+ runs-on:
10
+ - self.hosted
11
+ - linux.shell
12
+ name: On Pull Request
13
+ script:
14
+ - npm install -g pnpm
15
+ - pnpm config set //registry.npmjs.org/:_authToken $DOCUPACE_NPM_TOKEN
16
+ - pnpm install --frozen-lockfile
17
+ - 'npx eslint . --rule "no-unused-vars: warn" --rule "no-useless-escape: warn" --color'
18
+ - pnpm test
19
+ artifacts:
20
+ - coverage/**
21
+ after-script:
22
+ - echo "Pipeline completed with status $BITBUCKET_EXIT_CODE"
23
+
24
+ custom:
25
+ scheduled-tests:
26
+ - step:
27
+ runs-on:
28
+ - self.hosted
29
+ - linux.shell
30
+ name: Scheduled Tests
31
+ script:
32
+ - npm install -g pnpm
33
+ - pnpm config set //registry.npmjs.org/:_authToken $DOCUPACE_NPM_TOKEN
34
+ - pnpm install --frozen-lockfile
35
+ - 'npx eslint . --rule "no-unused-vars: warn" --rule "no-useless-escape: warn" --color'
36
+ - pnpm test
37
+ artifacts:
38
+ - coverage/**
39
+ after-script:
40
+ - echo "Pipeline completed with status $BITBUCKET_EXIT_CODE"
41
+
42
+ branches:
43
+ main:
44
+ - step:
45
+ runs-on:
46
+ - self.hosted
47
+ - linux.shell
48
+ name: Main Branch Build
49
+ script:
50
+ - npm install -g pnpm
51
+ - pnpm config set //registry.npmjs.org/:_authToken $DOCUPACE_NPM_TOKEN
52
+ - pnpm install --frozen-lockfile
53
+ - 'npx eslint . --rule "no-unused-vars: warn" --rule "no-useless-escape: warn" --color'
54
+ - pnpm test
55
+ artifacts:
56
+ - coverage/**
57
+
58
+ definitions:
59
+ caches:
60
60
  pnpm: ~/.pnpm-store
package/eslint.config.js CHANGED
@@ -1,49 +1,49 @@
1
- import globals from 'globals';
2
- import pluginJs from '@eslint/js';
3
- import prettierConfig from 'eslint-config-prettier';
4
- import prettierPlugin from 'eslint-plugin-prettier';
5
- import importPlugin from 'eslint-plugin-import';
6
-
7
- export default [
8
- {
9
- languageOptions: {
10
- globals: {
11
- ...globals.browser,
12
- ...globals.node,
13
- },
14
- },
15
- },
16
-
17
- // Core JS rules
18
- pluginJs.configs.recommended,
19
-
20
- // Jest globals for test files only
21
- {
22
- files: ['**/*.test.js', '**/__tests__/**/*.js'],
23
- languageOptions: {
24
- globals: {
25
- ...globals.jest,
26
- },
27
- },
28
- },
29
-
30
- {
31
- plugins: {
32
- prettier: prettierPlugin,
33
- import: importPlugin,
34
- },
35
- settings: {
36
- 'import/resolver': {
37
- node: { extensions: ['.js', '.mjs', '.cjs'] },
38
- typescript: {},
39
- },
40
- },
41
- rules: {
42
- ...prettierConfig.rules,
43
- 'prettier/prettier': 'error',
44
- 'import/no-unresolved': 'error',
45
- 'import/named': 'error',
46
- 'import/no-extraneous-dependencies': 'error',
47
- },
48
- },
49
- ];
1
+ import globals from 'globals';
2
+ import pluginJs from '@eslint/js';
3
+ import prettierConfig from 'eslint-config-prettier';
4
+ import prettierPlugin from 'eslint-plugin-prettier';
5
+ import importPlugin from 'eslint-plugin-import';
6
+
7
+ export default [
8
+ {
9
+ languageOptions: {
10
+ globals: {
11
+ ...globals.browser,
12
+ ...globals.node,
13
+ },
14
+ },
15
+ },
16
+
17
+ // Core JS rules
18
+ pluginJs.configs.recommended,
19
+
20
+ // Jest globals for test files only
21
+ {
22
+ files: ['**/*.test.js', '**/__tests__/**/*.js'],
23
+ languageOptions: {
24
+ globals: {
25
+ ...globals.jest,
26
+ },
27
+ },
28
+ },
29
+
30
+ {
31
+ plugins: {
32
+ prettier: prettierPlugin,
33
+ import: importPlugin,
34
+ },
35
+ settings: {
36
+ 'import/resolver': {
37
+ node: { extensions: ['.js', '.mjs', '.cjs'] },
38
+ typescript: {},
39
+ },
40
+ },
41
+ rules: {
42
+ ...prettierConfig.rules,
43
+ 'prettier/prettier': 'error',
44
+ 'import/no-unresolved': 'error',
45
+ 'import/named': 'error',
46
+ 'import/no-extraneous-dependencies': 'error',
47
+ },
48
+ },
49
+ ];