Skip to content

Commit 196a235

Browse files
authored
Merge pull request #839 from near/dev
v8.2.0 Release (dev -> main)
2 parents 59d8900 + e384a41 commit 196a235

File tree

164 files changed

+5990
-4321
lines changed

Some content is hidden

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

164 files changed

+5990
-4321
lines changed

.eslintrc.json

Lines changed: 16 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,53 +7,34 @@
77
"node": true,
88
"jest": true
99
},
10-
"ignorePatterns": [
11-
"**/*"
12-
],
13-
"plugins": [
14-
"@nrwl/nx",
15-
"@typescript-eslint",
16-
"prettier",
17-
"react-hooks"
18-
],
10+
"ignorePatterns": ["**/*"],
11+
"plugins": ["@nx", "@typescript-eslint", "prettier", "react-hooks"],
1912
"overrides": [
2013
{
21-
"files": [
22-
"*.ts",
23-
"*.tsx",
24-
"*.js",
25-
"*.jsx"
26-
],
14+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
2715
"rules": {
28-
"@nrwl/nx/enforce-module-boundaries": [
16+
"@nx/enforce-module-boundaries": [
2917
"error",
3018
{
3119
"enforceBuildableLibDependency": true,
3220
"allow": [],
3321
"depConstraints": [
3422
{
3523
"sourceTag": "*",
36-
"onlyDependOnLibsWithTags": [
37-
"*"
38-
]
24+
"onlyDependOnLibsWithTags": ["*"]
3925
}
4026
]
4127
}
4228
]
4329
}
4430
},
4531
{
46-
"files": [
47-
"*.ts",
48-
"*.tsx"
49-
],
32+
"files": ["*.ts", "*.tsx"],
5033
"parserOptions": {
51-
"project": [
52-
"tsconfig.*?.json"
53-
]
34+
"project": ["tsconfig.*?.json"]
5435
},
5536
"extends": [
56-
"plugin:@nrwl/nx/typescript",
37+
"plugin:@nx/typescript",
5738
"eslint:recommended",
5839
"plugin:@typescript-eslint/recommended",
5940
"prettier"
@@ -88,11 +69,7 @@
8869
"error",
8970
{
9071
"selector": "variableLike",
91-
"format": [
92-
"camelCase",
93-
"PascalCase",
94-
"UPPER_CASE"
95-
],
72+
"format": ["camelCase", "PascalCase", "UPPER_CASE"],
9673
"leadingUnderscore": "allow"
9774
}
9875
],
@@ -112,14 +89,8 @@
11289
],
11390
"@typescript-eslint/consistent-type-imports": "error",
11491
"@typescript-eslint/consistent-type-exports": "error",
115-
"curly": [
116-
"error",
117-
"all"
118-
],
119-
"eqeqeq": [
120-
"error",
121-
"smart"
122-
],
92+
"curly": ["error", "all"],
93+
"eqeqeq": ["error", "smart"],
12394
"default-case": "off",
12495
"no-caller": "error",
12596
"no-case-declarations": "off",
@@ -132,10 +103,7 @@
132103
"no-shadow": "off",
133104
"@typescript-eslint/no-shadow": "error",
134105
"no-unused-expressions": "error",
135-
"radix": [
136-
"error",
137-
"as-needed"
138-
],
106+
"radix": ["error", "as-needed"],
139107
"no-restricted-syntax": [
140108
"error",
141109
{
@@ -148,22 +116,14 @@
148116
"message": "Call parseFloat directly to guarantee radix param is not incorrectly provided"
149117
}
150118
],
151-
"strict": [
152-
"error",
153-
"global"
154-
],
119+
"strict": ["error", "global"],
155120
"valid-jsdoc": "error"
156121
}
157122
},
158123
{
159-
"files": [
160-
"*.js",
161-
"*.jsx"
162-
],
163-
"extends": [
164-
"plugin:@nrwl/nx/javascript"
165-
],
124+
"files": ["*.js", "*.jsx"],
125+
"extends": ["plugin:@nx/javascript"],
166126
"rules": {}
167127
}
168128
]
169-
}
129+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ Thumbs.db
4444

4545
.angular
4646
.npmrc
47+
48+
# Next.js
49+
.next

decorate-angular-cli.js

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -21,59 +21,59 @@
2121
* - Delete and reinstall your node_modules
2222
*/
2323

24-
const fs = require("fs");
25-
const os = require("os");
26-
const cp = require("child_process");
27-
const isWindows = os.platform() === "win32";
28-
let output;
29-
try {
30-
output = require("@nrwl/workspace").output;
31-
} catch (e) {
32-
console.warn(
33-
"Angular CLI could not be decorated to enable computation caching. Please ensure @nrwl/workspace is installed."
34-
);
35-
process.exit(0);
36-
}
24+
const fs = require("fs");
25+
const os = require("os");
26+
const cp = require("child_process");
27+
const isWindows = os.platform() === "win32";
28+
let output;
29+
try {
30+
output = require("@nx/workspace").output;
31+
} catch (e) {
32+
console.warn(
33+
"Angular CLI could not be decorated to enable computation caching. Please ensure @nx/workspace is installed."
34+
);
35+
process.exit(0);
36+
}
3737

38-
/**
39-
* Symlink of ng to nx, so you can keep using `ng build/test/lint` and still
40-
* invoke the Nx CLI and get the benefits of computation caching.
41-
*/
42-
function symlinkNgCLItoNxCLI() {
43-
try {
44-
const ngPath = "./node_modules/.bin/ng";
45-
const nxPath = "./node_modules/.bin/nx";
46-
if (isWindows) {
47-
/**
48-
* This is the most reliable way to create symlink-like behavior on Windows.
49-
* Such that it works in all shells and works with npx.
50-
*/
51-
["", ".cmd", ".ps1"].forEach((ext) => {
52-
if (fs.existsSync(nxPath + ext))
53-
fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext));
54-
});
55-
} else {
56-
// If unix-based, symlink
57-
cp.execSync(`ln -sf ./nx ${ngPath}`);
58-
}
59-
} catch (e) {
60-
output.error({
61-
title:
62-
"Unable to create a symlink from the Angular CLI to the Nx CLI:" +
63-
e.message,
64-
});
65-
throw e;
66-
}
67-
}
38+
/**
39+
* Symlink of ng to nx, so you can keep using `ng build/test/lint` and still
40+
* invoke the Nx CLI and get the benefits of computation caching.
41+
*/
42+
function symlinkNgCLItoNxCLI() {
43+
try {
44+
const ngPath = "./node_modules/.bin/ng";
45+
const nxPath = "./node_modules/.bin/nx";
46+
if (isWindows) {
47+
/**
48+
* This is the most reliable way to create symlink-like behavior on Windows.
49+
* Such that it works in all shells and works with npx.
50+
*/
51+
["", ".cmd", ".ps1"].forEach((ext) => {
52+
if (fs.existsSync(nxPath + ext))
53+
fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext));
54+
});
55+
} else {
56+
// If unix-based, symlink
57+
cp.execSync(`ln -sf ./nx ${ngPath}`);
58+
}
59+
} catch (e) {
60+
output.error({
61+
title:
62+
"Unable to create a symlink from the Angular CLI to the Nx CLI:" +
63+
e.message,
64+
});
65+
throw e;
66+
}
67+
}
6868

69-
try {
70-
symlinkNgCLItoNxCLI();
71-
require("@nrwl/cli/lib/decorate-cli").decorateCli();
72-
output.log({
73-
title: "Angular CLI has been decorated to enable computation caching.",
74-
});
75-
} catch (e) {
76-
output.error({
77-
title: "Decoration of the Angular CLI did not complete successfully",
78-
});
79-
}
69+
try {
70+
symlinkNgCLItoNxCLI();
71+
require("@nrwl/cli/lib/decorate-cli").decorateCli();
72+
output.log({
73+
title: "Angular CLI has been decorated to enable computation caching.",
74+
});
75+
} catch (e) {
76+
output.error({
77+
title: "Decoration of the Angular CLI did not complete successfully",
78+
});
79+
}

examples/angular/.browserslistrc

Lines changed: 0 additions & 16 deletions
This file was deleted.

examples/angular/.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"files": ["*.ts"],
77
"extends": [
8-
"plugin:@nrwl/nx/angular",
8+
"plugin:@nx/angular",
99
"plugin:@angular-eslint/template/process-inline-templates"
1010
],
1111
"rules": {
@@ -34,7 +34,7 @@
3434
},
3535
{
3636
"files": ["*.html"],
37-
"extends": ["plugin:@nrwl/nx/angular-template"],
37+
"extends": ["plugin:@nx/angular-template"],
3838
"rules": {}
3939
}
4040
]

examples/angular/jest.config.js renamed to examples/angular/jest.config.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
/* eslint-disable */
12
module.exports = {
23
displayName: "angular",
34
preset: "../../jest.preset.js",
45
setupFilesAfterEnv: ["<rootDir>/src/test-setup.ts"],
5-
globals: {
6-
"ts-jest": {
7-
tsconfig: "<rootDir>/tsconfig.spec.json",
8-
stringifyContentPathRegex: "\\.(html|svg)$",
9-
},
10-
},
6+
globals: {},
117
coverageDirectory: "../../coverage/examples/angular",
128
transform: {
13-
"^.+\\.(ts|mjs|js|html)$": "jest-preset-angular",
9+
"^.+\\.(ts|mjs|js|html)$": [
10+
"jest-preset-angular",
11+
{
12+
tsconfig: "<rootDir>/tsconfig.spec.json",
13+
stringifyContentPathRegex: "\\.(html|svg)$",
14+
},
15+
],
1416
},
1517
transformIgnorePatterns: ["node_modules/(?!.*\\.mjs$)"],
1618
snapshotSerializers: [

examples/angular/project.json

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
2+
"name": "angular",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
24
"projectType": "application",
3-
"root": "examples/angular",
45
"sourceRoot": "examples/angular/src",
56
"prefix": "near-wallet-selector",
67
"targets": {
78
"build": {
89
"executor": "@angular-devkit/build-angular:browser",
9-
"outputs": [
10-
"{options.outputPath}"
11-
],
10+
"outputs": ["{options.outputPath}"],
1211
"options": {
1312
"outputPath": "dist/examples/angular",
1413
"index": "examples/angular/src/index.html",
@@ -116,9 +115,7 @@
116115
"output": "assets/"
117116
}
118117
],
119-
"styles": [
120-
"examples/angular/src/styles.scss"
121-
],
118+
"styles": ["examples/angular/src/styles.scss"],
122119
"scripts": []
123120
},
124121
"configurations": {
@@ -173,7 +170,7 @@
173170
}
174171
},
175172
"lint": {
176-
"executor": "@nrwl/linter:eslint",
173+
"executor": "@nx/linter:eslint",
177174
"options": {
178175
"lintFilePatterns": [
179176
"examples/angular/src/**/*.ts",
@@ -182,21 +179,19 @@
182179
}
183180
},
184181
"test": {
185-
"executor": "@nrwl/jest:jest",
186-
"outputs": [
187-
"coverage/examples/angular"
188-
],
182+
"executor": "@nx/jest:jest",
183+
"outputs": ["{workspaceRoot}/coverage/examples/angular"],
189184
"options": {
190-
"jestConfig": "examples/angular/jest.config.js",
185+
"jestConfig": "examples/angular/jest.config.ts",
191186
"passWithNoTests": true
192187
}
193188
},
194189
"deploy": {
195-
"executor": "@nrwl/workspace:run-script",
190+
"executor": "@nx/workspace:run-script",
196191
"options": {
197192
"script": "gh-pages -d ./dist/examples/angular"
198193
}
199194
}
200195
},
201196
"tags": []
202-
}
197+
}

examples/angular/tsconfig.app.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
"compilerOptions": {
44
"outDir": "../../dist/out-tsc",
55
"types": [],
6-
"target": "ES2017"
6+
"target": "ES2022",
7+
"useDefineForClassFields": false
78
},
89
"files": ["src/main.ts", "src/polyfills.ts"],
910
"include": ["src/**/*.d.ts"],
10-
"exclude": ["**/*.test.ts", "**/*.spec.ts"]
11+
"exclude": ["**/*.test.ts", "**/*.spec.ts", "jest.config.ts"]
1112
}

examples/angular/tsconfig.spec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"types": ["jest", "node"]
77
},
88
"files": ["src/test-setup.ts"],
9-
"include": ["**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"]
9+
"include": ["**/*.test.ts", "**/*.spec.ts", "**/*.d.ts", "jest.config.ts"]
1010
}

0 commit comments

Comments
 (0)