Skip to content

Commit

Permalink
Merge branch 'dev' into meteor-sign-message
Browse files Browse the repository at this point in the history
  • Loading branch information
Elabar authored Aug 2, 2023
2 parents 0a5c299 + 3b8b236 commit 451e1ab
Show file tree
Hide file tree
Showing 257 changed files with 7,821 additions and 5,788 deletions.
26 changes: 14 additions & 12 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@
"jest": true
},
"ignorePatterns": ["**/*"],
"plugins": [
"@nrwl/nx",
"@typescript-eslint",
"prettier",
"react-hooks"
],
"plugins": ["@nx", "@typescript-eslint", "prettier", "react-hooks"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -39,13 +34,14 @@
"project": ["tsconfig.*?.json"]
},
"extends": [
"plugin:@nrwl/nx/typescript",
"plugin:@nx/typescript",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"prettier/prettier": ["error",
"prettier/prettier": [
"error",
{
"arrowParens": "always",
"bracketSpacing": true,
Expand All @@ -61,7 +57,8 @@
"insertPragma": false,
"requirePragma": false,
"bracketSameLine": false,
"endOfLine": "auto"
"endOfLine": "auto",
"jsdoc": true
}
],
"@typescript-eslint/ban-ts-comment": "off",
Expand All @@ -84,7 +81,12 @@
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/array-type": ["error", { "default": "generic" }],
"@typescript-eslint/array-type": [
"error",
{
"default": "generic"
}
],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/consistent-type-exports": "error",
"curly": ["error", "all"],
Expand Down Expand Up @@ -120,7 +122,7 @@
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
}
]
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
node-version: "16.x"
cache: 'yarn'
- name: Check example apps
run: echo "EXAMPLE_APPS=$(ls ./examples | tr '\n' ',')" >> $GITHUB_ENV
run: echo "EXAMPLE_APPS=$(ls ./examples | tr '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV

- name: Install dependencies
run: yarn install --frozen-lockfile --prefer-offline
Expand All @@ -42,6 +42,9 @@ jobs:
if: github.ref == 'refs/heads/main'
run: echo "GIT_TAG=$(git describe --exact-match --tags $(git log -n1 --pretty='%h') 2> /dev/null)" >> $GITHUB_ENV

- name: Run Build All
run: yarn build:all

- name: Deploy
run: yarn nx run-many --target=deploy --all --exclude=$EXAMPLE_APPS --dry-run
env:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ Thumbs.db

.angular
.npmrc

# Next.js
.next
108 changes: 54 additions & 54 deletions decorate-angular-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,59 +21,59 @@
* - Delete and reinstall your node_modules
*/

const fs = require("fs");
const os = require("os");
const cp = require("child_process");
const isWindows = os.platform() === "win32";
let output;
try {
output = require("@nrwl/workspace").output;
} catch (e) {
console.warn(
"Angular CLI could not be decorated to enable computation caching. Please ensure @nrwl/workspace is installed."
);
process.exit(0);
}
const fs = require("fs");
const os = require("os");
const cp = require("child_process");
const isWindows = os.platform() === "win32";
let output;
try {
output = require("@nx/workspace").output;
} catch (e) {
console.warn(
"Angular CLI could not be decorated to enable computation caching. Please ensure @nx/workspace is installed."
);
process.exit(0);
}

/**
* Symlink of ng to nx, so you can keep using `ng build/test/lint` and still
* invoke the Nx CLI and get the benefits of computation caching.
*/
function symlinkNgCLItoNxCLI() {
try {
const ngPath = "./node_modules/.bin/ng";
const nxPath = "./node_modules/.bin/nx";
if (isWindows) {
/**
* This is the most reliable way to create symlink-like behavior on Windows.
* Such that it works in all shells and works with npx.
*/
["", ".cmd", ".ps1"].forEach((ext) => {
if (fs.existsSync(nxPath + ext))
fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext));
});
} else {
// If unix-based, symlink
cp.execSync(`ln -sf ./nx ${ngPath}`);
}
} catch (e) {
output.error({
title:
"Unable to create a symlink from the Angular CLI to the Nx CLI:" +
e.message,
});
throw e;
}
}
/**
* Symlink of ng to nx, so you can keep using `ng build/test/lint` and still
* invoke the Nx CLI and get the benefits of computation caching.
*/
function symlinkNgCLItoNxCLI() {
try {
const ngPath = "./node_modules/.bin/ng";
const nxPath = "./node_modules/.bin/nx";
if (isWindows) {
/**
* This is the most reliable way to create symlink-like behavior on Windows.
* Such that it works in all shells and works with npx.
*/
["", ".cmd", ".ps1"].forEach((ext) => {
if (fs.existsSync(nxPath + ext))
fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext));
});
} else {
// If unix-based, symlink
cp.execSync(`ln -sf ./nx ${ngPath}`);
}
} catch (e) {
output.error({
title:
"Unable to create a symlink from the Angular CLI to the Nx CLI:" +
e.message,
});
throw e;
}
}

try {
symlinkNgCLItoNxCLI();
require("@nrwl/cli/lib/decorate-cli").decorateCli();
output.log({
title: "Angular CLI has been decorated to enable computation caching.",
});
} catch (e) {
output.error({
title: "Decoration of the Angular CLI did not complete successfully",
});
}
try {
symlinkNgCLItoNxCLI();
require("@nrwl/cli/lib/decorate-cli").decorateCli();
output.log({
title: "Angular CLI has been decorated to enable computation caching.",
});
} catch (e) {
output.error({
title: "Decoration of the Angular CLI did not complete successfully",
});
}
16 changes: 0 additions & 16 deletions examples/angular/.browserslistrc

This file was deleted.

4 changes: 2 additions & 2 deletions examples/angular/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"files": ["*.ts"],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
Expand Down Expand Up @@ -34,7 +34,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
/* eslint-disable */
module.exports = {
displayName: "angular",
preset: "../../jest.preset.js",
setupFilesAfterEnv: ["<rootDir>/src/test-setup.ts"],
globals: {
"ts-jest": {
tsconfig: "<rootDir>/tsconfig.spec.json",
stringifyContentPathRegex: "\\.(html|svg)$",
},
},
globals: {},
coverageDirectory: "../../coverage/examples/angular",
transform: {
"^.+\\.(ts|mjs|js|html)$": "jest-preset-angular",
"^.+\\.(ts|mjs|js|html)$": [
"jest-preset-angular",
{
tsconfig: "<rootDir>/tsconfig.spec.json",
stringifyContentPathRegex: "\\.(html|svg)$",
},
],
},
transformIgnorePatterns: ["node_modules/(?!.*\\.mjs$)"],
snapshotSerializers: [
Expand Down
42 changes: 26 additions & 16 deletions examples/angular/project.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "angular",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"root": "examples/angular",
"sourceRoot": "examples/angular/src",
"prefix": "near-wallet-selector",
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": [
"{options.outputPath}"
],
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/examples/angular",
"index": "examples/angular/src/index.html",
Expand Down Expand Up @@ -97,13 +96,26 @@
},
{
"glob": "**/*",
"input": "packages/xdefi/assets/",
"input": "packages/here-wallet/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/narwallets/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/near-snap/assets/",
"output": "assets/"
},
{
"glob": "**/*",
"input": "packages/neth/assets/",
"output": "assets/"
}
],
"styles": [
"examples/angular/src/styles.scss"
],
"styles": ["examples/angular/src/styles.scss"],
"scripts": []
},
"configurations": {
Expand Down Expand Up @@ -158,7 +170,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"executor": "@nx/linter:eslint",
"options": {
"lintFilePatterns": [
"examples/angular/src/**/*.ts",
Expand All @@ -167,21 +179,19 @@
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": [
"coverage/examples/angular"
],
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/examples/angular"],
"options": {
"jestConfig": "examples/angular/jest.config.js",
"jestConfig": "examples/angular/jest.config.ts",
"passWithNoTests": true
}
},
"deploy": {
"executor": "@nrwl/workspace:run-script",
"executor": "nx:run-script",
"options": {
"script": "gh-pages -d ./dist/examples/angular"
}
}
},
"tags": []
}
}
5 changes: 3 additions & 2 deletions examples/angular/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": [],
"target": "ES2017"
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/main.ts", "src/polyfills.ts"],
"include": ["src/**/*.d.ts"],
"exclude": ["**/*.test.ts", "**/*.spec.ts"]
"exclude": ["**/*.test.ts", "**/*.spec.ts", "jest.config.ts"]
}
2 changes: 1 addition & 1 deletion examples/angular/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"types": ["jest", "node"]
},
"files": ["src/test-setup.ts"],
"include": ["**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"]
"include": ["**/*.test.ts", "**/*.spec.ts", "**/*.d.ts", "jest.config.ts"]
}
2 changes: 1 addition & 1 deletion examples/react/.babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"presets": ["@nrwl/next/babel"],
"presets": ["@nx/next/babel"],
"plugins": []
}
2 changes: 1 addition & 1 deletion examples/react/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": [
"plugin:@nrwl/nx/react-typescript",
"plugin:@nx/react-typescript",
"../../.eslintrc.json",
"next",
"next/core-web-vitals"
Expand Down
Loading

0 comments on commit 451e1ab

Please sign in to comment.