@payfit/nx-core 4.9.2-beta-cache-setup.0 → 4.9.2-beta-generator-ci.0

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.
@@ -0,0 +1,177 @@
1
+ version: 2.1
2
+ orbs:
3
+ nx: nrwl/nx@1.7.0
4
+ aws-cli: circleci/aws-cli@5.3.2
5
+ github: payfit/github@0.9
6
+ node: circleci/node@7.1
7
+
8
+ references:
9
+ setup_env_node: &setup_env_node
10
+ docker:
11
+ - image: cimg/node:22.11.0
12
+ setup_env_machine: &setup_env_machine # Used for getting docker cli
13
+ machine:
14
+ image: ubuntu-2204:current
15
+ install_packages: &install_packages
16
+ check-cache: always
17
+ pkg-manager: yarn-berry
18
+
19
+ attach_workspace: &attach_workspace
20
+ at: ~/project
21
+ nx/set-shas: &nx_set_shas_option
22
+ error-on-no-successful-workflow: false
23
+ main-branch-name: main
24
+ workflow-name: build-test-release
25
+
26
+ jobs:
27
+ yarn:
28
+ <<: *setup_env_node
29
+ steps:
30
+ - checkout
31
+ - node/install-packages: *install_packages
32
+
33
+ lint:
34
+ <<: *setup_env_node
35
+ steps:
36
+ - checkout
37
+ - node/install-packages: *install_packages
38
+ - run: yarn nx report
39
+ - run: yarn lint
40
+
41
+ conformance:
42
+ <<: *setup_env_node
43
+ steps:
44
+ - checkout
45
+ - node/install-packages: *install_packages
46
+ - run: yarn nx-cloud record -- yarn nx-cloud conformance:check
47
+
48
+ sync:
49
+ <<: *setup_env_node
50
+ steps:
51
+ - checkout
52
+ - node/install-packages: *install_packages
53
+ - run: yarn nx-cloud record -- yarn nx sync:check
54
+
55
+ format:
56
+ <<: *setup_env_node
57
+ steps:
58
+ - checkout
59
+ - node/install-packages: *install_packages
60
+ - run: yarn nx-cloud record -- yarn nx format:check
61
+
62
+ build:
63
+ <<: *setup_env_node
64
+ steps:
65
+ - checkout
66
+ - node/install-packages: *install_packages
67
+ - nx/set-shas: *nx_set_shas_option
68
+ - run: yarn build
69
+ - persist_to_workspace:
70
+ root: '.'
71
+ paths:
72
+ - dist
73
+ - packages/nx-core/dist
74
+
75
+ test:
76
+ <<: *setup_env_node
77
+ steps:
78
+ - checkout
79
+ - node/install-packages: *install_packages
80
+ - nx/set-shas: *nx_set_shas_option
81
+ - run: yarn test
82
+ - store_test_results:
83
+ path: test-results
84
+
85
+ publish:
86
+ <<: *setup_env_machine
87
+ steps:
88
+ - checkout
89
+ - attach_workspace: *attach_workspace
90
+ - node/install:
91
+ install-yarn: true
92
+ - node/install-packages: *install_packages
93
+ - nx/set-shas: *nx_set_shas_option
94
+ - aws-cli/setup:
95
+ role_arn: ${PUBLISH_ROLE_ARN}
96
+ profile_name: 'OIDC-PROFILE'
97
+ - run:
98
+ name: 'Install Helm 3'
99
+ command: |
100
+ curl -o- get_helm.sh https://raw.githubusercontent.com/helm/helm/v3.17.3/scripts/get-helm-3 | bash
101
+ - run:
102
+ name: 'Install Tsh'
103
+ command: |
104
+ curl -O https://cdn.teleport.dev/teleport-v17.4.6-linux-amd64-bin.tar.gz
105
+ tar -xzf teleport-v17.4.6-linux-amd64-bin.tar.gz
106
+ cd teleport
107
+ sudo ./install
108
+ - run:
109
+ name: Release
110
+ command: |
111
+ export GITHUB_TOKEN="$(cat github_token)"
112
+ export GH_TOKEN="$(cat github_token)"
113
+ git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/PayFit/${CIRCLE_PROJECT_REPONAME}.git
114
+ git config --global user.email "semver-release@payfit.tech"
115
+ git config --global user.name "semver-release"
116
+ git config --global --type bool push.autoSetupRemote true
117
+ tbot start -c .github/teleport/shared-charts.conf
118
+ if [[ "${CIRCLE_BRANCH}" == "main" || "${CIRCLE_BRANCH}" == "master" ]]; then
119
+ echo "Publishing release"
120
+ yarn nx release --yes
121
+ else
122
+ echo "Publishing ephemeral"
123
+ yarn nx release prerelease --preid beta-${CIRCLE_BRANCH} --skip-publish
124
+ yarn nx release publish --tag beta
125
+ fi
126
+
127
+ workflows:
128
+ build-test-release:
129
+ jobs:
130
+ - yarn:
131
+ context: GLOBAL_ORG
132
+
133
+ - lint:
134
+ context: GLOBAL_ORG
135
+ requires:
136
+ - yarn
137
+
138
+ - sync:
139
+ context: GLOBAL_ORG
140
+ requires:
141
+ - yarn
142
+
143
+ - format:
144
+ context: GLOBAL_ORG
145
+ requires:
146
+ - yarn
147
+
148
+ - conformance:
149
+ context: GLOBAL_ORG
150
+ requires:
151
+ - yarn
152
+
153
+ - build:
154
+ context: GLOBAL_ORG
155
+ requires:
156
+ - yarn
157
+
158
+ - test:
159
+ context: GLOBAL_ORG
160
+ requires:
161
+ - yarn
162
+
163
+ - github/auth:
164
+ name: github_authenticate
165
+ outputFile: github_token
166
+ context:
167
+ - GLOBAL_ORG
168
+
169
+ # - publish:
170
+ # requires:
171
+ # - test
172
+ # - build
173
+ # - github_authenticate
174
+ # context:
175
+ # - GLOBAL_ORG # Contains NPM token to publish to npm
176
+ # - CORE-PLATFORM_SHARED_ENV #Contains the aws credentials to publish to ECR/S3
177
+ # - NX_COMMON_PACKAGES # TSH config
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function initGenerator(tree: Tree): Promise<void>;
3
+ export default initGenerator;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initGenerator = initGenerator;
4
+ const path = require("path");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function injectNxReleaseConfiguration(tree) {
7
+ (0, devkit_1.updateJson)(tree, 'nx.json', (nxJson) => {
8
+ nxJson.release = {
9
+ "projectsRelationship": "independent",
10
+ "projects": ["*"],
11
+ "releaseTagPattern": "{projectName}-{version}",
12
+ "changelog": {
13
+ "projectChangelogs": {
14
+ "createRelease": "github",
15
+ "file": false
16
+ },
17
+ "automaticFromRef": true
18
+ },
19
+ "version": {
20
+ "useLegacyVersioning": false,
21
+ "currentVersionResolver": "git-tag",
22
+ "fallbackCurrentVersionResolver": "disk",
23
+ "specifierSource": "conventional-commits"
24
+ },
25
+ "git": {
26
+ "commit": false,
27
+ "tag": true
28
+ }
29
+ };
30
+ return nxJson;
31
+ });
32
+ }
33
+ async function initGenerator(tree) {
34
+ const workspaceRoot = `.`;
35
+ // Delete the .circleci/config.yml file if it exists
36
+ tree.delete(path.join(workspaceRoot, '.circleci/config.yml'));
37
+ // Generate the .circleci/config.yml file
38
+ (0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), workspaceRoot, {});
39
+ // Patch the nx.json file with the nx release default configuration
40
+ injectNxReleaseConfiguration(tree);
41
+ await (0, devkit_1.formatFiles)(tree);
42
+ }
43
+ exports.default = initGenerator;
44
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../src/generators/init/init.ts"],"names":[],"mappings":";;AAqCA,sCAWC;AAhDD,6BAA4B;AAE5B,uCAImB;AAGnB,SAAS,4BAA4B,CAAC,IAAU;IAC9C,IAAA,mBAAU,EAAC,IAAI,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE;QACrC,MAAM,CAAC,OAAO,GAAG;YACb,sBAAsB,EAAE,aAAa;YACrC,UAAU,EAAE,CAAC,GAAG,CAAC;YACjB,mBAAmB,EAAE,yBAAyB;YAC9C,WAAW,EAAE;gBACX,mBAAmB,EAAE;oBACnB,eAAe,EAAE,QAAQ;oBACzB,MAAM,EAAE,KAAK;iBACd;gBACD,kBAAkB,EAAE,IAAI;aACzB;YACD,SAAS,EAAE;gBACT,qBAAqB,EAAE,KAAK;gBAC5B,wBAAwB,EAAE,SAAS;gBACnC,gCAAgC,EAAE,MAAM;gBACxC,iBAAiB,EAAE,sBAAsB;aAC1C;YACD,KAAK,EAAE;gBACL,QAAQ,EAAE,KAAK;gBACf,KAAK,EAAE,IAAI;aACZ;SACF,CAAA;QACD,OAAO,MAAM,CAAA;IACjB,CAAC,CAAC,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,aAAa,CAAC,IAAU;IAC5C,MAAM,aAAa,GAAG,GAAG,CAAA;IAEzB,oDAAoD;IACpD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,sBAAsB,CAAC,CAAC,CAAA;IAC7D,yCAAyC;IACzC,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,aAAa,EAAE,EAAE,CAAC,CAAA;IAErE,mEAAmE;IACnE,4BAA4B,CAAC,IAAI,CAAC,CAAA;IAClC,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAA;AACzB,CAAC;AAED,kBAAe,aAAa,CAAA"}
File without changes
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "Init",
4
+ "title": "",
5
+ "type": "object"
6
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "generators": {
3
+ "init": {
4
+ "factory": "./dist/src/generators/init/init",
5
+ "schema": "./dist/src/generators/init/schema.json",
6
+ "description": "init generator"
7
+ }
8
+ }
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payfit/nx-core",
3
- "version": "4.9.2-beta-cache-setup.0",
3
+ "version": "4.9.2-beta-generator-ci.0",
4
4
  "type": "commonjs",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -32,5 +32,6 @@
32
32
  ".": "./dist/src/index.js",
33
33
  "./package.json": "./package.json",
34
34
  "./versionActions": "./dist/src/scripts/version-actions.js"
35
- }
35
+ },
36
+ "generators": "./generators.json"
36
37
  }