Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b4408cd
chore: 🤖 upgrade Angular and Nx
ktrz Jan 10, 2023
93037e9
chore: [nx migration] 15.0.0-migrate-to-inputs
ktrz Jan 10, 2023
baf8032
chore: [nx migration] 15.0.0-prefix-outputs
ktrz Jan 10, 2023
6740261
chore: [nx migration] update-angular-cli-version-14-1-0
ktrz Jan 10, 2023
d537c46
chore: [nx migration] update-rxjs-7-5-0
ktrz Jan 10, 2023
d828308
chore: [nx migration] update-angular-cli-version-14-2-0
ktrz Jan 10, 2023
fa90fb2
chore: [nx migration] update-angular-cli-version-15-0-0
ktrz Jan 10, 2023
06b1967
chore: [nx migration] remove-browserlist-config
ktrz Jan 10, 2023
6124682
chore: [nx migration] update-typescript-target
ktrz Jan 10, 2023
e7d5988
chore: [nx migration] migration-v15
ktrz Jan 10, 2023
df784ea
chore: [nx migration] update-cypress-configs-preset
ktrz Jan 10, 2023
52a6836
chore: [nx migration] update-cypress-if-v10
ktrz Jan 10, 2023
1e0c838
chore: [nx migration] add-cypress-inputs
ktrz Jan 10, 2023
1c598cd
chore: [nx migration] update-to-cypress-11
ktrz Jan 10, 2023
087e695
chore: [nx migration] exclude-jest-config-from-ts-config
ktrz Jan 10, 2023
fe99403
chore: [nx migration] update-configs-jest-28
ktrz Jan 10, 2023
7800b8f
chore: [nx migration] add-jest-inputs
ktrz Jan 10, 2023
66a27c2
chore: [nx migration] add-eslint-inputs
ktrz Jan 10, 2023
89ccfbe
chore: [nx migration] add-babel-inputs
ktrz Jan 10, 2023
becf051
chore: [nx migration] 14-8-0-change-run-commands-executor
ktrz Jan 10, 2023
b9b92fa
fix: package-lock fixes
Mar 5, 2023
9336475
chore: upgraded to latest version of everything
Mar 5, 2023
2f55da6
fix: try updating package-lock with npm v8.1.0 to fix CI
Mar 5, 2023
5d244cc
fix: use changed cypress API to keep existing functionality
Mar 5, 2023
2e5b383
fix: peer dependencies update
Mar 5, 2023
38e83dc
chore: proper documentation for cypress-indexeddb
Mar 9, 2023
7016fda
feat: use lts/gallium for nvmrc
Mar 10, 2023
55f1337
chore: run cypress tests with test isolation and add todo with issue …
Mar 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
node_modules
2 changes: 1 addition & 1 deletion .nvmrc
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
16.10.0
lts/gallium
2 changes: 1 addition & 1 deletion apps/showcase-e2e/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@ const cypressJsonConfig = {
};
export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...nxE2EPreset(__filename),
...cypressJsonConfig,
},
});
1 change: 1 addition & 0 deletions apps/showcase-e2e/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/showcase-e2e/src",
"projectType": "application",
Expand Down
17 changes: 0 additions & 17 deletions apps/showcase/.browserslistrc

This file was deleted.

17 changes: 9 additions & 8 deletions apps/showcase/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,21 +3,22 @@ export default {
displayName: 'showcase',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
coverageDirectory: '../../coverage/apps/showcase',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
};
3 changes: 2 additions & 1 deletion apps/showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/showcase/src",
Expand DownExpand Up@@ -78,7 +79,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/showcase"],
"options": {
"jestConfig": "apps/showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/showcase/src/app/app.module.ts
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatIconModule } from '@angular/material/icon';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatToolbarModule } from '@angular/material/toolbar';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatSelectModule } from '@angular/material/select';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
import { RouteConfigModule } from '@this-dot/route-config';
import { FirstRouteComponent } from './components/first-route/first-route.component';
import { RouteTagsShowcaseComponent } from './components/route-tags-showcase/route-tags-showcase.component';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import {
addItem,
connectIndexedDb,
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import {
FormGroupDirective,
Validators,
} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import { connectIndexedDb, deleteItem, getObjectStore, read, setItem } from '@this-dot/rxidb';
import { isTruthy } from '@this-dot/utils';
import { merge, Observable, Subject, timer } from 'rxjs';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS as MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar';
import { RxidbRoutingModule } from './rxidb-routing.module';
import { RxidbKeyValuePairShowcaseComponent } from './components/rxidb-key-value-pair-showcase/rxidb-key-value-pair-showcase.component';
import { RxidbAutoIncrementComponent } from './components/rxidb-auto-increment/rxidb-auto-increment.component';
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": []
"types": [],
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/main.ts", "src/polyfills.ts"],
"exclude": ["jest.config.ts"]
Expand Down
10 changes: 10 additions & 0 deletions apps/vue-showcase/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,5 +15,15 @@ export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...cypressJsonConfig,
/**
* TODO (https://github.com/thisdot/open-source/issues/161)
* Set the flag to true and fix tests.
*
* In Cypress v12,the testIsolation option is turned on by default.
* This can cause tests to start breaking where not indended.
* You should consider enabling this once you verify tests do not depend on each other
* More Info: https://docs.cypress.io/guides/references/migration-guide#Test-Isolation
**/
testIsolation: false,
Comment thread
TapaiBalazs marked this conversation as resolved.
},
});
3 changes: 2 additions & 1 deletion apps/vue-showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "vue-showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/vue-showcase/src",
Expand DownExpand Up@@ -34,7 +35,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/vue-showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/vue-showcase"],
"options": {
"jestConfig": "apps/vue-showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/vue-showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,6 @@
"outDir": "../../dist/out-tsc",
"types": ["vue-i18n", "node"]
},
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx"],
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx", "jest.config.ts"],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.vue", "**/*.json"]
}
3 changes: 2 additions & 1 deletion apps/vue-showcase/tsconfig.e2e.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,5 +6,6 @@
"allowJs": true,
"types": ["cypress", "node"]
},
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"]
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"],
"exclude": ["jest.config.ts"]
}
14 changes: 13 additions & 1 deletion jest.preset.js
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
const nxPreset = require('@nrwl/jest/preset').default;

module.exports = { ...nxPreset };
module.exports = {
...nxPreset,
/* TODO: Update to latest Jest snapshotFormat
* By default Nx has kept the older style of Jest Snapshot formats
* to prevent breaking of any existing tests with snapshots.
* It's recommend you update to the latest format.
* You can do this by removing snapshotFormat property
* and running tests with --update-snapshot flag.
* Example: "nx affected --targets=test --update-snapshot"
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
*/
snapshotFormat: { escapeString: true, printBasicPrototype: true },
};
9 changes: 8 additions & 1 deletion libs/cypress-indexeddb/.babelrc
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
{
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
"presets": [
[
"@nrwl/js/babel",
{
"useBuiltIns": "usage"
}
]
]
}
15 changes: 15 additions & 0 deletions libs/cypress-indexeddb/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,21 @@ It supports:

### Installation

**With Cypress versions _above_ 12.6.0:**

1. Install the package:
`npm install @this-dot/cypress-indexeddb`
or
`yarn add @this-dot/cypress-indexeddb`

2. Import the plugin in your `cypress/support/commands.js` or `cypress/support/commands.ts` file:

```typescript
import '@this-dot/cypress-indexeddb';
```

Please note, that cypress introduced the `Cypress.Commands.overwriteQuery` command in [12.6.0](https://docs.cypress.io/guides/references/changelog#12-6-0), therefore, cypress versions 12.0.0 to 12.5.x are not supported by this library.

**With Cypress versions _below_ 12.0.0:**

1. Install the 1.2.1 version of the package:
Expand Down
13 changes: 7 additions & 6 deletions libs/cypress-indexeddb/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,14 +2,15 @@
export default {
displayName: 'cypress-indexeddb',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
'^.+\\.[tj]sx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/cypress-indexeddb',
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,6 +20,6 @@
"typescript"
],
"peerDependencies": {
"cypress": "< 12.0.0"
"cypress": "< 12.6.0"
}
}
3 changes: 2 additions & 1 deletion libs/cypress-indexeddb/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "cypress-indexeddb",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/cypress-indexeddb/src",
"projectType": "library",
Expand All@@ -12,7 +13,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/cypress-indexeddb"],
"outputs": ["{workspaceRoot}/coverage/libs/cypress-indexeddb"],
"options": {
"jestConfig": "libs/cypress-indexeddb/jest.config.ts",
"passWithNoTests": true
Expand Down
32 changes: 19 additions & 13 deletions libs/cypress-indexeddb/src/lib/alias-setup.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,20 +18,26 @@ export function setDatabaseInternal(databaseName: string, database: IDBDatabase)
type IDBItemType = 'store' | 'database';

export function overrideAs(
originalAs: (subject: unknown, alias: string) => any,
subject: unknown,
alias: string
originalAs: Cypress.QueryFn<'as'>,
alias: string,
options?: Partial<Cypress.AsOptions>
) {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return originalAs(subject, alias);
}
const asArgs: [string, Partial<Cypress.AsOptions> | undefined] = [alias, options];
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const innerFn = originalAs.apply(this, asArgs);
return (subject: unknown) => {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return innerFn(subject);
}
};
}

export const getDatabase = getIDBItem('database');
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/src/lib/cypress-indexeddb.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import { entries, keys } from './object-store-metadata';
import { openIndexedDb } from './open-database';

function setupIDBHelpers(): void {
Cypress.Commands.overwrite('as', overrideAs);
Cypress.Commands.overwriteQuery('as', overrideAs);
Cypress.Commands.add(`clearIndexedDb`, deleteDatabase);
Cypress.Commands.add(`openIndexedDb`, openIndexedDb);
Cypress.Commands.add(`getIndexedDb`, getDatabase);
Expand Down
15 changes: 8 additions & 7 deletions libs/ng-utils/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,15 +3,16 @@ export default {
displayName: 'ng-utils',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/libs/ng-utils',
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
4 changes: 2 additions & 2 deletions libs/ng-utils/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,8 +20,8 @@
"utilities"
],
"peerDependencies": {
"@angular/common": ">= 12.0.0 < 15",
"@angular/core": ">= 12.0.0 < 15"
"@angular/common": ">= 12.0.0 < 16",
"@angular/core": ">= 12.0.0 < 16"
},
"dependencies": {
"tslib": "^2.2.0"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b4408cd
chore: 🤖 upgrade Angular and Nx
ktrz Jan 10, 2023
93037e9
chore: [nx migration] 15.0.0-migrate-to-inputs
ktrz Jan 10, 2023
baf8032
chore: [nx migration] 15.0.0-prefix-outputs
ktrz Jan 10, 2023
6740261
chore: [nx migration] update-angular-cli-version-14-1-0
ktrz Jan 10, 2023
d537c46
chore: [nx migration] update-rxjs-7-5-0
ktrz Jan 10, 2023
d828308
chore: [nx migration] update-angular-cli-version-14-2-0
ktrz Jan 10, 2023
fa90fb2
chore: [nx migration] update-angular-cli-version-15-0-0
ktrz Jan 10, 2023
06b1967
chore: [nx migration] remove-browserlist-config
ktrz Jan 10, 2023
6124682
chore: [nx migration] update-typescript-target
ktrz Jan 10, 2023
e7d5988
chore: [nx migration] migration-v15
ktrz Jan 10, 2023
df784ea
chore: [nx migration] update-cypress-configs-preset
ktrz Jan 10, 2023
52a6836
chore: [nx migration] update-cypress-if-v10
ktrz Jan 10, 2023
1e0c838
chore: [nx migration] add-cypress-inputs
ktrz Jan 10, 2023
1c598cd
chore: [nx migration] update-to-cypress-11
ktrz Jan 10, 2023
087e695
chore: [nx migration] exclude-jest-config-from-ts-config
ktrz Jan 10, 2023
fe99403
chore: [nx migration] update-configs-jest-28
ktrz Jan 10, 2023
7800b8f
chore: [nx migration] add-jest-inputs
ktrz Jan 10, 2023
66a27c2
chore: [nx migration] add-eslint-inputs
ktrz Jan 10, 2023
89ccfbe
chore: [nx migration] add-babel-inputs
ktrz Jan 10, 2023
becf051
chore: [nx migration] 14-8-0-change-run-commands-executor
ktrz Jan 10, 2023
b9b92fa
fix: package-lock fixes
Mar 5, 2023
9336475
chore: upgraded to latest version of everything
Mar 5, 2023
2f55da6
fix: try updating package-lock with npm v8.1.0 to fix CI
Mar 5, 2023
5d244cc
fix: use changed cypress API to keep existing functionality
Mar 5, 2023
2e5b383
fix: peer dependencies update
Mar 5, 2023
38e83dc
chore: proper documentation for cypress-indexeddb
Mar 9, 2023
7016fda
feat: use lts/gallium for nvmrc
Mar 10, 2023
55f1337
chore: run cypress tests with test isolation and add todo with issue …
Mar 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
node_modules
2 changes: 1 addition & 1 deletion .nvmrc
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
16.10.0
lts/gallium
2 changes: 1 addition & 1 deletion apps/showcase-e2e/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@ const cypressJsonConfig = {
};
export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...nxE2EPreset(__filename),
...cypressJsonConfig,
},
});
1 change: 1 addition & 0 deletions apps/showcase-e2e/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/showcase-e2e/src",
"projectType": "application",
Expand Down
17 changes: 0 additions & 17 deletions apps/showcase/.browserslistrc

This file was deleted.

17 changes: 9 additions & 8 deletions apps/showcase/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,21 +3,22 @@ export default {
displayName: 'showcase',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
coverageDirectory: '../../coverage/apps/showcase',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
};
3 changes: 2 additions & 1 deletion apps/showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/showcase/src",
Expand DownExpand Up@@ -78,7 +79,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/showcase"],
"options": {
"jestConfig": "apps/showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/showcase/src/app/app.module.ts
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatIconModule } from '@angular/material/icon';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatToolbarModule } from '@angular/material/toolbar';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatSelectModule } from '@angular/material/select';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
import { RouteConfigModule } from '@this-dot/route-config';
import { FirstRouteComponent } from './components/first-route/first-route.component';
import { RouteTagsShowcaseComponent } from './components/route-tags-showcase/route-tags-showcase.component';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import {
addItem,
connectIndexedDb,
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import {
FormGroupDirective,
Validators,
} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import { connectIndexedDb, deleteItem, getObjectStore, read, setItem } from '@this-dot/rxidb';
import { isTruthy } from '@this-dot/utils';
import { merge, Observable, Subject, timer } from 'rxjs';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS as MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar';
import { RxidbRoutingModule } from './rxidb-routing.module';
import { RxidbKeyValuePairShowcaseComponent } from './components/rxidb-key-value-pair-showcase/rxidb-key-value-pair-showcase.component';
import { RxidbAutoIncrementComponent } from './components/rxidb-auto-increment/rxidb-auto-increment.component';
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": []
"types": [],
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/main.ts", "src/polyfills.ts"],
"exclude": ["jest.config.ts"]
Expand Down
10 changes: 10 additions & 0 deletions apps/vue-showcase/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,5 +15,15 @@ export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...cypressJsonConfig,
/**
* TODO (https://github.com/thisdot/open-source/issues/161)
* Set the flag to true and fix tests.
*
* In Cypress v12,the testIsolation option is turned on by default.
* This can cause tests to start breaking where not indended.
* You should consider enabling this once you verify tests do not depend on each other
* More Info: https://docs.cypress.io/guides/references/migration-guide#Test-Isolation
**/
testIsolation: false,
Comment thread
TapaiBalazs marked this conversation as resolved.
},
});
3 changes: 2 additions & 1 deletion apps/vue-showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "vue-showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/vue-showcase/src",
Expand DownExpand Up@@ -34,7 +35,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/vue-showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/vue-showcase"],
"options": {
"jestConfig": "apps/vue-showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/vue-showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,6 @@
"outDir": "../../dist/out-tsc",
"types": ["vue-i18n", "node"]
},
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx"],
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx", "jest.config.ts"],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.vue", "**/*.json"]
}
3 changes: 2 additions & 1 deletion apps/vue-showcase/tsconfig.e2e.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,5 +6,6 @@
"allowJs": true,
"types": ["cypress", "node"]
},
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"]
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"],
"exclude": ["jest.config.ts"]
}
14 changes: 13 additions & 1 deletion jest.preset.js
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
const nxPreset = require('@nrwl/jest/preset').default;

module.exports = { ...nxPreset };
module.exports = {
...nxPreset,
/* TODO: Update to latest Jest snapshotFormat
* By default Nx has kept the older style of Jest Snapshot formats
* to prevent breaking of any existing tests with snapshots.
* It's recommend you update to the latest format.
* You can do this by removing snapshotFormat property
* and running tests with --update-snapshot flag.
* Example: "nx affected --targets=test --update-snapshot"
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
*/
snapshotFormat: { escapeString: true, printBasicPrototype: true },
};
9 changes: 8 additions & 1 deletion libs/cypress-indexeddb/.babelrc
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
{
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
"presets": [
[
"@nrwl/js/babel",
{
"useBuiltIns": "usage"
}
]
]
}
15 changes: 15 additions & 0 deletions libs/cypress-indexeddb/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,21 @@ It supports:

### Installation

**With Cypress versions _above_ 12.6.0:**

1. Install the package:
`npm install @this-dot/cypress-indexeddb`
or
`yarn add @this-dot/cypress-indexeddb`

2. Import the plugin in your `cypress/support/commands.js` or `cypress/support/commands.ts` file:

```typescript
import '@this-dot/cypress-indexeddb';
```

Please note, that cypress introduced the `Cypress.Commands.overwriteQuery` command in [12.6.0](https://docs.cypress.io/guides/references/changelog#12-6-0), therefore, cypress versions 12.0.0 to 12.5.x are not supported by this library.

**With Cypress versions _below_ 12.0.0:**

1. Install the 1.2.1 version of the package:
Expand Down
13 changes: 7 additions & 6 deletions libs/cypress-indexeddb/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,14 +2,15 @@
export default {
displayName: 'cypress-indexeddb',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
'^.+\\.[tj]sx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/cypress-indexeddb',
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,6 +20,6 @@
"typescript"
],
"peerDependencies": {
"cypress": "< 12.0.0"
"cypress": "< 12.6.0"
}
}
3 changes: 2 additions & 1 deletion libs/cypress-indexeddb/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "cypress-indexeddb",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/cypress-indexeddb/src",
"projectType": "library",
Expand All@@ -12,7 +13,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/cypress-indexeddb"],
"outputs": ["{workspaceRoot}/coverage/libs/cypress-indexeddb"],
"options": {
"jestConfig": "libs/cypress-indexeddb/jest.config.ts",
"passWithNoTests": true
Expand Down
32 changes: 19 additions & 13 deletions libs/cypress-indexeddb/src/lib/alias-setup.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,20 +18,26 @@ export function setDatabaseInternal(databaseName: string, database: IDBDatabase)
type IDBItemType = 'store' | 'database';

export function overrideAs(
originalAs: (subject: unknown, alias: string) => any,
subject: unknown,
alias: string
originalAs: Cypress.QueryFn<'as'>,
alias: string,
options?: Partial<Cypress.AsOptions>
) {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return originalAs(subject, alias);
}
const asArgs: [string, Partial<Cypress.AsOptions> | undefined] = [alias, options];
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const innerFn = originalAs.apply(this, asArgs);
return (subject: unknown) => {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return innerFn(subject);
}
};
}

export const getDatabase = getIDBItem('database');
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/src/lib/cypress-indexeddb.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import { entries, keys } from './object-store-metadata';
import { openIndexedDb } from './open-database';

function setupIDBHelpers(): void {
Cypress.Commands.overwrite('as', overrideAs);
Cypress.Commands.overwriteQuery('as', overrideAs);
Cypress.Commands.add(`clearIndexedDb`, deleteDatabase);
Cypress.Commands.add(`openIndexedDb`, openIndexedDb);
Cypress.Commands.add(`getIndexedDb`, getDatabase);
Expand Down
15 changes: 8 additions & 7 deletions libs/ng-utils/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,15 +3,16 @@ export default {
displayName: 'ng-utils',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/libs/ng-utils',
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
4 changes: 2 additions & 2 deletions libs/ng-utils/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,8 +20,8 @@
"utilities"
],
"peerDependencies": {
"@angular/common": ">= 12.0.0 < 15",
"@angular/core": ">= 12.0.0 < 15"
"@angular/common": ">= 12.0.0 < 16",
"@angular/core": ">= 12.0.0 < 16"
},
"dependencies": {
"tslib": "^2.2.0"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b4408cd
chore: 🤖 upgrade Angular and Nx
ktrz Jan 10, 2023
93037e9
chore: [nx migration] 15.0.0-migrate-to-inputs
ktrz Jan 10, 2023
baf8032
chore: [nx migration] 15.0.0-prefix-outputs
ktrz Jan 10, 2023
6740261
chore: [nx migration] update-angular-cli-version-14-1-0
ktrz Jan 10, 2023
d537c46
chore: [nx migration] update-rxjs-7-5-0
ktrz Jan 10, 2023
d828308
chore: [nx migration] update-angular-cli-version-14-2-0
ktrz Jan 10, 2023
fa90fb2
chore: [nx migration] update-angular-cli-version-15-0-0
ktrz Jan 10, 2023
06b1967
chore: [nx migration] remove-browserlist-config
ktrz Jan 10, 2023
6124682
chore: [nx migration] update-typescript-target
ktrz Jan 10, 2023
e7d5988
chore: [nx migration] migration-v15
ktrz Jan 10, 2023
df784ea
chore: [nx migration] update-cypress-configs-preset
ktrz Jan 10, 2023
52a6836
chore: [nx migration] update-cypress-if-v10
ktrz Jan 10, 2023
1e0c838
chore: [nx migration] add-cypress-inputs
ktrz Jan 10, 2023
1c598cd
chore: [nx migration] update-to-cypress-11
ktrz Jan 10, 2023
087e695
chore: [nx migration] exclude-jest-config-from-ts-config
ktrz Jan 10, 2023
fe99403
chore: [nx migration] update-configs-jest-28
ktrz Jan 10, 2023
7800b8f
chore: [nx migration] add-jest-inputs
ktrz Jan 10, 2023
66a27c2
chore: [nx migration] add-eslint-inputs
ktrz Jan 10, 2023
89ccfbe
chore: [nx migration] add-babel-inputs
ktrz Jan 10, 2023
becf051
chore: [nx migration] 14-8-0-change-run-commands-executor
ktrz Jan 10, 2023
b9b92fa
fix: package-lock fixes
Mar 5, 2023
9336475
chore: upgraded to latest version of everything
Mar 5, 2023
2f55da6
fix: try updating package-lock with npm v8.1.0 to fix CI
Mar 5, 2023
5d244cc
fix: use changed cypress API to keep existing functionality
Mar 5, 2023
2e5b383
fix: peer dependencies update
Mar 5, 2023
38e83dc
chore: proper documentation for cypress-indexeddb
Mar 9, 2023
7016fda
feat: use lts/gallium for nvmrc
Mar 10, 2023
55f1337
chore: run cypress tests with test isolation and add todo with issue …
Mar 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
node_modules
2 changes: 1 addition & 1 deletion .nvmrc
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
16.10.0
lts/gallium
2 changes: 1 addition & 1 deletion apps/showcase-e2e/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@ const cypressJsonConfig = {
};
export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...nxE2EPreset(__filename),
...cypressJsonConfig,
},
});
1 change: 1 addition & 0 deletions apps/showcase-e2e/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/showcase-e2e/src",
"projectType": "application",
Expand Down
17 changes: 0 additions & 17 deletions apps/showcase/.browserslistrc

This file was deleted.

17 changes: 9 additions & 8 deletions apps/showcase/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,21 +3,22 @@ export default {
displayName: 'showcase',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
coverageDirectory: '../../coverage/apps/showcase',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
};
3 changes: 2 additions & 1 deletion apps/showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/showcase/src",
Expand DownExpand Up@@ -78,7 +79,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/showcase"],
"options": {
"jestConfig": "apps/showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/showcase/src/app/app.module.ts
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatIconModule } from '@angular/material/icon';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatToolbarModule } from '@angular/material/toolbar';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatSelectModule } from '@angular/material/select';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
import { RouteConfigModule } from '@this-dot/route-config';
import { FirstRouteComponent } from './components/first-route/first-route.component';
import { RouteTagsShowcaseComponent } from './components/route-tags-showcase/route-tags-showcase.component';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import {
addItem,
connectIndexedDb,
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import {
FormGroupDirective,
Validators,
} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import { connectIndexedDb, deleteItem, getObjectStore, read, setItem } from '@this-dot/rxidb';
import { isTruthy } from '@this-dot/utils';
import { merge, Observable, Subject, timer } from 'rxjs';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS as MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar';
import { RxidbRoutingModule } from './rxidb-routing.module';
import { RxidbKeyValuePairShowcaseComponent } from './components/rxidb-key-value-pair-showcase/rxidb-key-value-pair-showcase.component';
import { RxidbAutoIncrementComponent } from './components/rxidb-auto-increment/rxidb-auto-increment.component';
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": []
"types": [],
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/main.ts", "src/polyfills.ts"],
"exclude": ["jest.config.ts"]
Expand Down
10 changes: 10 additions & 0 deletions apps/vue-showcase/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,5 +15,15 @@ export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...cypressJsonConfig,
/**
* TODO (https://github.com/thisdot/open-source/issues/161)
* Set the flag to true and fix tests.
*
* In Cypress v12,the testIsolation option is turned on by default.
* This can cause tests to start breaking where not indended.
* You should consider enabling this once you verify tests do not depend on each other
* More Info: https://docs.cypress.io/guides/references/migration-guide#Test-Isolation
**/
testIsolation: false,
Comment thread
TapaiBalazs marked this conversation as resolved.
},
});
3 changes: 2 additions & 1 deletion apps/vue-showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "vue-showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/vue-showcase/src",
Expand DownExpand Up@@ -34,7 +35,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/vue-showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/vue-showcase"],
"options": {
"jestConfig": "apps/vue-showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/vue-showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,6 @@
"outDir": "../../dist/out-tsc",
"types": ["vue-i18n", "node"]
},
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx"],
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx", "jest.config.ts"],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.vue", "**/*.json"]
}
3 changes: 2 additions & 1 deletion apps/vue-showcase/tsconfig.e2e.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,5 +6,6 @@
"allowJs": true,
"types": ["cypress", "node"]
},
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"]
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"],
"exclude": ["jest.config.ts"]
}
14 changes: 13 additions & 1 deletion jest.preset.js
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
const nxPreset = require('@nrwl/jest/preset').default;

module.exports = { ...nxPreset };
module.exports = {
...nxPreset,
/* TODO: Update to latest Jest snapshotFormat
* By default Nx has kept the older style of Jest Snapshot formats
* to prevent breaking of any existing tests with snapshots.
* It's recommend you update to the latest format.
* You can do this by removing snapshotFormat property
* and running tests with --update-snapshot flag.
* Example: "nx affected --targets=test --update-snapshot"
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
*/
snapshotFormat: { escapeString: true, printBasicPrototype: true },
};
9 changes: 8 additions & 1 deletion libs/cypress-indexeddb/.babelrc
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
{
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
"presets": [
[
"@nrwl/js/babel",
{
"useBuiltIns": "usage"
}
]
]
}
15 changes: 15 additions & 0 deletions libs/cypress-indexeddb/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,21 @@ It supports:

### Installation

**With Cypress versions _above_ 12.6.0:**

1. Install the package:
`npm install @this-dot/cypress-indexeddb`
or
`yarn add @this-dot/cypress-indexeddb`

2. Import the plugin in your `cypress/support/commands.js` or `cypress/support/commands.ts` file:

```typescript
import '@this-dot/cypress-indexeddb';
```

Please note, that cypress introduced the `Cypress.Commands.overwriteQuery` command in [12.6.0](https://docs.cypress.io/guides/references/changelog#12-6-0), therefore, cypress versions 12.0.0 to 12.5.x are not supported by this library.

**With Cypress versions _below_ 12.0.0:**

1. Install the 1.2.1 version of the package:
Expand Down
13 changes: 7 additions & 6 deletions libs/cypress-indexeddb/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,14 +2,15 @@
export default {
displayName: 'cypress-indexeddb',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
'^.+\\.[tj]sx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/cypress-indexeddb',
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,6 +20,6 @@
"typescript"
],
"peerDependencies": {
"cypress": "< 12.0.0"
"cypress": "< 12.6.0"
}
}
3 changes: 2 additions & 1 deletion libs/cypress-indexeddb/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "cypress-indexeddb",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/cypress-indexeddb/src",
"projectType": "library",
Expand All@@ -12,7 +13,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/cypress-indexeddb"],
"outputs": ["{workspaceRoot}/coverage/libs/cypress-indexeddb"],
"options": {
"jestConfig": "libs/cypress-indexeddb/jest.config.ts",
"passWithNoTests": true
Expand Down
32 changes: 19 additions & 13 deletions libs/cypress-indexeddb/src/lib/alias-setup.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,20 +18,26 @@ export function setDatabaseInternal(databaseName: string, database: IDBDatabase)
type IDBItemType = 'store' | 'database';

export function overrideAs(
originalAs: (subject: unknown, alias: string) => any,
subject: unknown,
alias: string
originalAs: Cypress.QueryFn<'as'>,
alias: string,
options?: Partial<Cypress.AsOptions>
) {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return originalAs(subject, alias);
}
const asArgs: [string, Partial<Cypress.AsOptions> | undefined] = [alias, options];
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const innerFn = originalAs.apply(this, asArgs);
return (subject: unknown) => {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return innerFn(subject);
}
};
}

export const getDatabase = getIDBItem('database');
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/src/lib/cypress-indexeddb.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import { entries, keys } from './object-store-metadata';
import { openIndexedDb } from './open-database';

function setupIDBHelpers(): void {
Cypress.Commands.overwrite('as', overrideAs);
Cypress.Commands.overwriteQuery('as', overrideAs);
Cypress.Commands.add(`clearIndexedDb`, deleteDatabase);
Cypress.Commands.add(`openIndexedDb`, openIndexedDb);
Cypress.Commands.add(`getIndexedDb`, getDatabase);
Expand Down
15 changes: 8 additions & 7 deletions libs/ng-utils/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,15 +3,16 @@ export default {
displayName: 'ng-utils',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/libs/ng-utils',
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
4 changes: 2 additions & 2 deletions libs/ng-utils/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,8 +20,8 @@
"utilities"
],
"peerDependencies": {
"@angular/common": ">= 12.0.0 < 15",
"@angular/core": ">= 12.0.0 < 15"
"@angular/common": ">= 12.0.0 < 16",
"@angular/core": ">= 12.0.0 < 16"
},
"dependencies": {
"tslib": "^2.2.0"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b4408cd
chore: 🤖 upgrade Angular and Nx
ktrz Jan 10, 2023
93037e9
chore: [nx migration] 15.0.0-migrate-to-inputs
ktrz Jan 10, 2023
baf8032
chore: [nx migration] 15.0.0-prefix-outputs
ktrz Jan 10, 2023
6740261
chore: [nx migration] update-angular-cli-version-14-1-0
ktrz Jan 10, 2023
d537c46
chore: [nx migration] update-rxjs-7-5-0
ktrz Jan 10, 2023
d828308
chore: [nx migration] update-angular-cli-version-14-2-0
ktrz Jan 10, 2023
fa90fb2
chore: [nx migration] update-angular-cli-version-15-0-0
ktrz Jan 10, 2023
06b1967
chore: [nx migration] remove-browserlist-config
ktrz Jan 10, 2023
6124682
chore: [nx migration] update-typescript-target
ktrz Jan 10, 2023
e7d5988
chore: [nx migration] migration-v15
ktrz Jan 10, 2023
df784ea
chore: [nx migration] update-cypress-configs-preset
ktrz Jan 10, 2023
52a6836
chore: [nx migration] update-cypress-if-v10
ktrz Jan 10, 2023
1e0c838
chore: [nx migration] add-cypress-inputs
ktrz Jan 10, 2023
1c598cd
chore: [nx migration] update-to-cypress-11
ktrz Jan 10, 2023
087e695
chore: [nx migration] exclude-jest-config-from-ts-config
ktrz Jan 10, 2023
fe99403
chore: [nx migration] update-configs-jest-28
ktrz Jan 10, 2023
7800b8f
chore: [nx migration] add-jest-inputs
ktrz Jan 10, 2023
66a27c2
chore: [nx migration] add-eslint-inputs
ktrz Jan 10, 2023
89ccfbe
chore: [nx migration] add-babel-inputs
ktrz Jan 10, 2023
becf051
chore: [nx migration] 14-8-0-change-run-commands-executor
ktrz Jan 10, 2023
b9b92fa
fix: package-lock fixes
Mar 5, 2023
9336475
chore: upgraded to latest version of everything
Mar 5, 2023
2f55da6
fix: try updating package-lock with npm v8.1.0 to fix CI
Mar 5, 2023
5d244cc
fix: use changed cypress API to keep existing functionality
Mar 5, 2023
2e5b383
fix: peer dependencies update
Mar 5, 2023
38e83dc
chore: proper documentation for cypress-indexeddb
Mar 9, 2023
7016fda
feat: use lts/gallium for nvmrc
Mar 10, 2023
55f1337
chore: run cypress tests with test isolation and add todo with issue …
Mar 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
node_modules
2 changes: 1 addition & 1 deletion .nvmrc
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
16.10.0
lts/gallium
2 changes: 1 addition & 1 deletion apps/showcase-e2e/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@ const cypressJsonConfig = {
};
export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...nxE2EPreset(__filename),
...cypressJsonConfig,
},
});
1 change: 1 addition & 0 deletions apps/showcase-e2e/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/showcase-e2e/src",
"projectType": "application",
Expand Down
17 changes: 0 additions & 17 deletions apps/showcase/.browserslistrc

This file was deleted.

17 changes: 9 additions & 8 deletions apps/showcase/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,21 +3,22 @@ export default {
displayName: 'showcase',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
coverageDirectory: '../../coverage/apps/showcase',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
};
3 changes: 2 additions & 1 deletion apps/showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/showcase/src",
Expand DownExpand Up@@ -78,7 +79,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/showcase"],
"options": {
"jestConfig": "apps/showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/showcase/src/app/app.module.ts
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatIconModule } from '@angular/material/icon';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatToolbarModule } from '@angular/material/toolbar';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatSelectModule } from '@angular/material/select';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
import { RouteConfigModule } from '@this-dot/route-config';
import { FirstRouteComponent } from './components/first-route/first-route.component';
import { RouteTagsShowcaseComponent } from './components/route-tags-showcase/route-tags-showcase.component';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import {
addItem,
connectIndexedDb,
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import {
FormGroupDirective,
Validators,
} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import { connectIndexedDb, deleteItem, getObjectStore, read, setItem } from '@this-dot/rxidb';
import { isTruthy } from '@this-dot/utils';
import { merge, Observable, Subject, timer } from 'rxjs';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS as MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar';
import { RxidbRoutingModule } from './rxidb-routing.module';
import { RxidbKeyValuePairShowcaseComponent } from './components/rxidb-key-value-pair-showcase/rxidb-key-value-pair-showcase.component';
import { RxidbAutoIncrementComponent } from './components/rxidb-auto-increment/rxidb-auto-increment.component';
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": []
"types": [],
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/main.ts", "src/polyfills.ts"],
"exclude": ["jest.config.ts"]
Expand Down
10 changes: 10 additions & 0 deletions apps/vue-showcase/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,5 +15,15 @@ export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...cypressJsonConfig,
/**
* TODO (https://github.com/thisdot/open-source/issues/161)
* Set the flag to true and fix tests.
*
* In Cypress v12,the testIsolation option is turned on by default.
* This can cause tests to start breaking where not indended.
* You should consider enabling this once you verify tests do not depend on each other
* More Info: https://docs.cypress.io/guides/references/migration-guide#Test-Isolation
**/
testIsolation: false,
Comment thread
TapaiBalazs marked this conversation as resolved.
},
});
3 changes: 2 additions & 1 deletion apps/vue-showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "vue-showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/vue-showcase/src",
Expand DownExpand Up@@ -34,7 +35,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/vue-showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/vue-showcase"],
"options": {
"jestConfig": "apps/vue-showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/vue-showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,6 @@
"outDir": "../../dist/out-tsc",
"types": ["vue-i18n", "node"]
},
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx"],
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx", "jest.config.ts"],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.vue", "**/*.json"]
}
3 changes: 2 additions & 1 deletion apps/vue-showcase/tsconfig.e2e.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,5 +6,6 @@
"allowJs": true,
"types": ["cypress", "node"]
},
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"]
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"],
"exclude": ["jest.config.ts"]
}
14 changes: 13 additions & 1 deletion jest.preset.js
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
const nxPreset = require('@nrwl/jest/preset').default;

module.exports = { ...nxPreset };
module.exports = {
...nxPreset,
/* TODO: Update to latest Jest snapshotFormat
* By default Nx has kept the older style of Jest Snapshot formats
* to prevent breaking of any existing tests with snapshots.
* It's recommend you update to the latest format.
* You can do this by removing snapshotFormat property
* and running tests with --update-snapshot flag.
* Example: "nx affected --targets=test --update-snapshot"
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
*/
snapshotFormat: { escapeString: true, printBasicPrototype: true },
};
9 changes: 8 additions & 1 deletion libs/cypress-indexeddb/.babelrc
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
{
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
"presets": [
[
"@nrwl/js/babel",
{
"useBuiltIns": "usage"
}
]
]
}
15 changes: 15 additions & 0 deletions libs/cypress-indexeddb/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,21 @@ It supports:

### Installation

**With Cypress versions _above_ 12.6.0:**

1. Install the package:
`npm install @this-dot/cypress-indexeddb`
or
`yarn add @this-dot/cypress-indexeddb`

2. Import the plugin in your `cypress/support/commands.js` or `cypress/support/commands.ts` file:

```typescript
import '@this-dot/cypress-indexeddb';
```

Please note, that cypress introduced the `Cypress.Commands.overwriteQuery` command in [12.6.0](https://docs.cypress.io/guides/references/changelog#12-6-0), therefore, cypress versions 12.0.0 to 12.5.x are not supported by this library.

**With Cypress versions _below_ 12.0.0:**

1. Install the 1.2.1 version of the package:
Expand Down
13 changes: 7 additions & 6 deletions libs/cypress-indexeddb/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,14 +2,15 @@
export default {
displayName: 'cypress-indexeddb',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
'^.+\\.[tj]sx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/cypress-indexeddb',
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,6 +20,6 @@
"typescript"
],
"peerDependencies": {
"cypress": "< 12.0.0"
"cypress": "< 12.6.0"
}
}
3 changes: 2 additions & 1 deletion libs/cypress-indexeddb/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "cypress-indexeddb",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/cypress-indexeddb/src",
"projectType": "library",
Expand All@@ -12,7 +13,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/cypress-indexeddb"],
"outputs": ["{workspaceRoot}/coverage/libs/cypress-indexeddb"],
"options": {
"jestConfig": "libs/cypress-indexeddb/jest.config.ts",
"passWithNoTests": true
Expand Down
32 changes: 19 additions & 13 deletions libs/cypress-indexeddb/src/lib/alias-setup.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,20 +18,26 @@ export function setDatabaseInternal(databaseName: string, database: IDBDatabase)
type IDBItemType = 'store' | 'database';

export function overrideAs(
originalAs: (subject: unknown, alias: string) => any,
subject: unknown,
alias: string
originalAs: Cypress.QueryFn<'as'>,
alias: string,
options?: Partial<Cypress.AsOptions>
) {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return originalAs(subject, alias);
}
const asArgs: [string, Partial<Cypress.AsOptions> | undefined] = [alias, options];
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const innerFn = originalAs.apply(this, asArgs);
return (subject: unknown) => {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return innerFn(subject);
}
};
}

export const getDatabase = getIDBItem('database');
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/src/lib/cypress-indexeddb.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import { entries, keys } from './object-store-metadata';
import { openIndexedDb } from './open-database';

function setupIDBHelpers(): void {
Cypress.Commands.overwrite('as', overrideAs);
Cypress.Commands.overwriteQuery('as', overrideAs);
Cypress.Commands.add(`clearIndexedDb`, deleteDatabase);
Cypress.Commands.add(`openIndexedDb`, openIndexedDb);
Cypress.Commands.add(`getIndexedDb`, getDatabase);
Expand Down
15 changes: 8 additions & 7 deletions libs/ng-utils/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,15 +3,16 @@ export default {
displayName: 'ng-utils',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/libs/ng-utils',
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
4 changes: 2 additions & 2 deletions libs/ng-utils/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,8 +20,8 @@
"utilities"
],
"peerDependencies": {
"@angular/common": ">= 12.0.0 < 15",
"@angular/core": ">= 12.0.0 < 15"
"@angular/common": ">= 12.0.0 < 16",
"@angular/core": ">= 12.0.0 < 16"
},
"dependencies": {
"tslib": "^2.2.0"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b4408cd
chore: 🤖 upgrade Angular and Nx
ktrz Jan 10, 2023
93037e9
chore: [nx migration] 15.0.0-migrate-to-inputs
ktrz Jan 10, 2023
baf8032
chore: [nx migration] 15.0.0-prefix-outputs
ktrz Jan 10, 2023
6740261
chore: [nx migration] update-angular-cli-version-14-1-0
ktrz Jan 10, 2023
d537c46
chore: [nx migration] update-rxjs-7-5-0
ktrz Jan 10, 2023
d828308
chore: [nx migration] update-angular-cli-version-14-2-0
ktrz Jan 10, 2023
fa90fb2
chore: [nx migration] update-angular-cli-version-15-0-0
ktrz Jan 10, 2023
06b1967
chore: [nx migration] remove-browserlist-config
ktrz Jan 10, 2023
6124682
chore: [nx migration] update-typescript-target
ktrz Jan 10, 2023
e7d5988
chore: [nx migration] migration-v15
ktrz Jan 10, 2023
df784ea
chore: [nx migration] update-cypress-configs-preset
ktrz Jan 10, 2023
52a6836
chore: [nx migration] update-cypress-if-v10
ktrz Jan 10, 2023
1e0c838
chore: [nx migration] add-cypress-inputs
ktrz Jan 10, 2023
1c598cd
chore: [nx migration] update-to-cypress-11
ktrz Jan 10, 2023
087e695
chore: [nx migration] exclude-jest-config-from-ts-config
ktrz Jan 10, 2023
fe99403
chore: [nx migration] update-configs-jest-28
ktrz Jan 10, 2023
7800b8f
chore: [nx migration] add-jest-inputs
ktrz Jan 10, 2023
66a27c2
chore: [nx migration] add-eslint-inputs
ktrz Jan 10, 2023
89ccfbe
chore: [nx migration] add-babel-inputs
ktrz Jan 10, 2023
becf051
chore: [nx migration] 14-8-0-change-run-commands-executor
ktrz Jan 10, 2023
b9b92fa
fix: package-lock fixes
Mar 5, 2023
9336475
chore: upgraded to latest version of everything
Mar 5, 2023
2f55da6
fix: try updating package-lock with npm v8.1.0 to fix CI
Mar 5, 2023
5d244cc
fix: use changed cypress API to keep existing functionality
Mar 5, 2023
2e5b383
fix: peer dependencies update
Mar 5, 2023
38e83dc
chore: proper documentation for cypress-indexeddb
Mar 9, 2023
7016fda
feat: use lts/gallium for nvmrc
Mar 10, 2023
55f1337
chore: run cypress tests with test isolation and add todo with issue …
Mar 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
node_modules
2 changes: 1 addition & 1 deletion .nvmrc
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
16.10.0
lts/gallium
2 changes: 1 addition & 1 deletion apps/showcase-e2e/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@ const cypressJsonConfig = {
};
export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...nxE2EPreset(__filename),
...cypressJsonConfig,
},
});
1 change: 1 addition & 0 deletions apps/showcase-e2e/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/showcase-e2e/src",
"projectType": "application",
Expand Down
17 changes: 0 additions & 17 deletions apps/showcase/.browserslistrc

This file was deleted.

17 changes: 9 additions & 8 deletions apps/showcase/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,21 +3,22 @@ export default {
displayName: 'showcase',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
coverageDirectory: '../../coverage/apps/showcase',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
};
3 changes: 2 additions & 1 deletion apps/showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/showcase/src",
Expand DownExpand Up@@ -78,7 +79,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/showcase"],
"options": {
"jestConfig": "apps/showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/showcase/src/app/app.module.ts
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatIconModule } from '@angular/material/icon';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatToolbarModule } from '@angular/material/toolbar';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatSelectModule } from '@angular/material/select';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
import { RouteConfigModule } from '@this-dot/route-config';
import { FirstRouteComponent } from './components/first-route/first-route.component';
import { RouteTagsShowcaseComponent } from './components/route-tags-showcase/route-tags-showcase.component';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import {
addItem,
connectIndexedDb,
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import {
FormGroupDirective,
Validators,
} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import { connectIndexedDb, deleteItem, getObjectStore, read, setItem } from '@this-dot/rxidb';
import { isTruthy } from '@this-dot/utils';
import { merge, Observable, Subject, timer } from 'rxjs';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS as MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar';
import { RxidbRoutingModule } from './rxidb-routing.module';
import { RxidbKeyValuePairShowcaseComponent } from './components/rxidb-key-value-pair-showcase/rxidb-key-value-pair-showcase.component';
import { RxidbAutoIncrementComponent } from './components/rxidb-auto-increment/rxidb-auto-increment.component';
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": []
"types": [],
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/main.ts", "src/polyfills.ts"],
"exclude": ["jest.config.ts"]
Expand Down
10 changes: 10 additions & 0 deletions apps/vue-showcase/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,5 +15,15 @@ export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...cypressJsonConfig,
/**
* TODO (https://github.com/thisdot/open-source/issues/161)
* Set the flag to true and fix tests.
*
* In Cypress v12,the testIsolation option is turned on by default.
* This can cause tests to start breaking where not indended.
* You should consider enabling this once you verify tests do not depend on each other
* More Info: https://docs.cypress.io/guides/references/migration-guide#Test-Isolation
**/
testIsolation: false,
Comment thread
TapaiBalazs marked this conversation as resolved.
},
});
3 changes: 2 additions & 1 deletion apps/vue-showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "vue-showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/vue-showcase/src",
Expand DownExpand Up@@ -34,7 +35,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/vue-showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/vue-showcase"],
"options": {
"jestConfig": "apps/vue-showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/vue-showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,6 @@
"outDir": "../../dist/out-tsc",
"types": ["vue-i18n", "node"]
},
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx"],
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx", "jest.config.ts"],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.vue", "**/*.json"]
}
3 changes: 2 additions & 1 deletion apps/vue-showcase/tsconfig.e2e.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,5 +6,6 @@
"allowJs": true,
"types": ["cypress", "node"]
},
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"]
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"],
"exclude": ["jest.config.ts"]
}
14 changes: 13 additions & 1 deletion jest.preset.js
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
const nxPreset = require('@nrwl/jest/preset').default;

module.exports = { ...nxPreset };
module.exports = {
...nxPreset,
/* TODO: Update to latest Jest snapshotFormat
* By default Nx has kept the older style of Jest Snapshot formats
* to prevent breaking of any existing tests with snapshots.
* It's recommend you update to the latest format.
* You can do this by removing snapshotFormat property
* and running tests with --update-snapshot flag.
* Example: "nx affected --targets=test --update-snapshot"
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
*/
snapshotFormat: { escapeString: true, printBasicPrototype: true },
};
9 changes: 8 additions & 1 deletion libs/cypress-indexeddb/.babelrc
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
{
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
"presets": [
[
"@nrwl/js/babel",
{
"useBuiltIns": "usage"
}
]
]
}
15 changes: 15 additions & 0 deletions libs/cypress-indexeddb/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,21 @@ It supports:

### Installation

**With Cypress versions _above_ 12.6.0:**

1. Install the package:
`npm install @this-dot/cypress-indexeddb`
or
`yarn add @this-dot/cypress-indexeddb`

2. Import the plugin in your `cypress/support/commands.js` or `cypress/support/commands.ts` file:

```typescript
import '@this-dot/cypress-indexeddb';
```

Please note, that cypress introduced the `Cypress.Commands.overwriteQuery` command in [12.6.0](https://docs.cypress.io/guides/references/changelog#12-6-0), therefore, cypress versions 12.0.0 to 12.5.x are not supported by this library.

**With Cypress versions _below_ 12.0.0:**

1. Install the 1.2.1 version of the package:
Expand Down
13 changes: 7 additions & 6 deletions libs/cypress-indexeddb/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,14 +2,15 @@
export default {
displayName: 'cypress-indexeddb',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
'^.+\\.[tj]sx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/cypress-indexeddb',
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,6 +20,6 @@
"typescript"
],
"peerDependencies": {
"cypress": "< 12.0.0"
"cypress": "< 12.6.0"
}
}
3 changes: 2 additions & 1 deletion libs/cypress-indexeddb/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "cypress-indexeddb",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/cypress-indexeddb/src",
"projectType": "library",
Expand All@@ -12,7 +13,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/cypress-indexeddb"],
"outputs": ["{workspaceRoot}/coverage/libs/cypress-indexeddb"],
"options": {
"jestConfig": "libs/cypress-indexeddb/jest.config.ts",
"passWithNoTests": true
Expand Down
32 changes: 19 additions & 13 deletions libs/cypress-indexeddb/src/lib/alias-setup.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,20 +18,26 @@ export function setDatabaseInternal(databaseName: string, database: IDBDatabase)
type IDBItemType = 'store' | 'database';

export function overrideAs(
originalAs: (subject: unknown, alias: string) => any,
subject: unknown,
alias: string
originalAs: Cypress.QueryFn<'as'>,
alias: string,
options?: Partial<Cypress.AsOptions>
) {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return originalAs(subject, alias);
}
const asArgs: [string, Partial<Cypress.AsOptions> | undefined] = [alias, options];
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const innerFn = originalAs.apply(this, asArgs);
return (subject: unknown) => {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return innerFn(subject);
}
};
}

export const getDatabase = getIDBItem('database');
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/src/lib/cypress-indexeddb.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import { entries, keys } from './object-store-metadata';
import { openIndexedDb } from './open-database';

function setupIDBHelpers(): void {
Cypress.Commands.overwrite('as', overrideAs);
Cypress.Commands.overwriteQuery('as', overrideAs);
Cypress.Commands.add(`clearIndexedDb`, deleteDatabase);
Cypress.Commands.add(`openIndexedDb`, openIndexedDb);
Cypress.Commands.add(`getIndexedDb`, getDatabase);
Expand Down
15 changes: 8 additions & 7 deletions libs/ng-utils/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,15 +3,16 @@ export default {
displayName: 'ng-utils',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/libs/ng-utils',
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
4 changes: 2 additions & 2 deletions libs/ng-utils/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,8 +20,8 @@
"utilities"
],
"peerDependencies": {
"@angular/common": ">= 12.0.0 < 15",
"@angular/core": ">= 12.0.0 < 15"
"@angular/common": ">= 12.0.0 < 16",
"@angular/core": ">= 12.0.0 < 16"
},
"dependencies": {
"tslib": "^2.2.0"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b4408cd
chore: 🤖 upgrade Angular and Nx
ktrz Jan 10, 2023
93037e9
chore: [nx migration] 15.0.0-migrate-to-inputs
ktrz Jan 10, 2023
baf8032
chore: [nx migration] 15.0.0-prefix-outputs
ktrz Jan 10, 2023
6740261
chore: [nx migration] update-angular-cli-version-14-1-0
ktrz Jan 10, 2023
d537c46
chore: [nx migration] update-rxjs-7-5-0
ktrz Jan 10, 2023
d828308
chore: [nx migration] update-angular-cli-version-14-2-0
ktrz Jan 10, 2023
fa90fb2
chore: [nx migration] update-angular-cli-version-15-0-0
ktrz Jan 10, 2023
06b1967
chore: [nx migration] remove-browserlist-config
ktrz Jan 10, 2023
6124682
chore: [nx migration] update-typescript-target
ktrz Jan 10, 2023
e7d5988
chore: [nx migration] migration-v15
ktrz Jan 10, 2023
df784ea
chore: [nx migration] update-cypress-configs-preset
ktrz Jan 10, 2023
52a6836
chore: [nx migration] update-cypress-if-v10
ktrz Jan 10, 2023
1e0c838
chore: [nx migration] add-cypress-inputs
ktrz Jan 10, 2023
1c598cd
chore: [nx migration] update-to-cypress-11
ktrz Jan 10, 2023
087e695
chore: [nx migration] exclude-jest-config-from-ts-config
ktrz Jan 10, 2023
fe99403
chore: [nx migration] update-configs-jest-28
ktrz Jan 10, 2023
7800b8f
chore: [nx migration] add-jest-inputs
ktrz Jan 10, 2023
66a27c2
chore: [nx migration] add-eslint-inputs
ktrz Jan 10, 2023
89ccfbe
chore: [nx migration] add-babel-inputs
ktrz Jan 10, 2023
becf051
chore: [nx migration] 14-8-0-change-run-commands-executor
ktrz Jan 10, 2023
b9b92fa
fix: package-lock fixes
Mar 5, 2023
9336475
chore: upgraded to latest version of everything
Mar 5, 2023
2f55da6
fix: try updating package-lock with npm v8.1.0 to fix CI
Mar 5, 2023
5d244cc
fix: use changed cypress API to keep existing functionality
Mar 5, 2023
2e5b383
fix: peer dependencies update
Mar 5, 2023
38e83dc
chore: proper documentation for cypress-indexeddb
Mar 9, 2023
7016fda
feat: use lts/gallium for nvmrc
Mar 10, 2023
55f1337
chore: run cypress tests with test isolation and add todo with issue …
Mar 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
node_modules
2 changes: 1 addition & 1 deletion .nvmrc
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
16.10.0
lts/gallium
2 changes: 1 addition & 1 deletion apps/showcase-e2e/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@ const cypressJsonConfig = {
};
export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...nxE2EPreset(__filename),
...cypressJsonConfig,
},
});
1 change: 1 addition & 0 deletions apps/showcase-e2e/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/showcase-e2e/src",
"projectType": "application",
Expand Down
17 changes: 0 additions & 17 deletions apps/showcase/.browserslistrc

This file was deleted.

17 changes: 9 additions & 8 deletions apps/showcase/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,21 +3,22 @@ export default {
displayName: 'showcase',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
coverageDirectory: '../../coverage/apps/showcase',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
};
3 changes: 2 additions & 1 deletion apps/showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/showcase/src",
Expand DownExpand Up@@ -78,7 +79,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/showcase"],
"options": {
"jestConfig": "apps/showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/showcase/src/app/app.module.ts
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatIconModule } from '@angular/material/icon';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatToolbarModule } from '@angular/material/toolbar';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatSelectModule } from '@angular/material/select';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
import { RouteConfigModule } from '@this-dot/route-config';
import { FirstRouteComponent } from './components/first-route/first-route.component';
import { RouteTagsShowcaseComponent } from './components/route-tags-showcase/route-tags-showcase.component';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import {
addItem,
connectIndexedDb,
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import {
FormGroupDirective,
Validators,
} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import { connectIndexedDb, deleteItem, getObjectStore, read, setItem } from '@this-dot/rxidb';
import { isTruthy } from '@this-dot/utils';
import { merge, Observable, Subject, timer } from 'rxjs';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS as MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar';
import { RxidbRoutingModule } from './rxidb-routing.module';
import { RxidbKeyValuePairShowcaseComponent } from './components/rxidb-key-value-pair-showcase/rxidb-key-value-pair-showcase.component';
import { RxidbAutoIncrementComponent } from './components/rxidb-auto-increment/rxidb-auto-increment.component';
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": []
"types": [],
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/main.ts", "src/polyfills.ts"],
"exclude": ["jest.config.ts"]
Expand Down
10 changes: 10 additions & 0 deletions apps/vue-showcase/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,5 +15,15 @@ export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...cypressJsonConfig,
/**
* TODO (https://github.com/thisdot/open-source/issues/161)
* Set the flag to true and fix tests.
*
* In Cypress v12,the testIsolation option is turned on by default.
* This can cause tests to start breaking where not indended.
* You should consider enabling this once you verify tests do not depend on each other
* More Info: https://docs.cypress.io/guides/references/migration-guide#Test-Isolation
**/
testIsolation: false,
Comment thread
TapaiBalazs marked this conversation as resolved.
},
});
3 changes: 2 additions & 1 deletion apps/vue-showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "vue-showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/vue-showcase/src",
Expand DownExpand Up@@ -34,7 +35,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/vue-showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/vue-showcase"],
"options": {
"jestConfig": "apps/vue-showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/vue-showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,6 @@
"outDir": "../../dist/out-tsc",
"types": ["vue-i18n", "node"]
},
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx"],
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx", "jest.config.ts"],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.vue", "**/*.json"]
}
3 changes: 2 additions & 1 deletion apps/vue-showcase/tsconfig.e2e.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,5 +6,6 @@
"allowJs": true,
"types": ["cypress", "node"]
},
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"]
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"],
"exclude": ["jest.config.ts"]
}
14 changes: 13 additions & 1 deletion jest.preset.js
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
const nxPreset = require('@nrwl/jest/preset').default;

module.exports = { ...nxPreset };
module.exports = {
...nxPreset,
/* TODO: Update to latest Jest snapshotFormat
* By default Nx has kept the older style of Jest Snapshot formats
* to prevent breaking of any existing tests with snapshots.
* It's recommend you update to the latest format.
* You can do this by removing snapshotFormat property
* and running tests with --update-snapshot flag.
* Example: "nx affected --targets=test --update-snapshot"
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
*/
snapshotFormat: { escapeString: true, printBasicPrototype: true },
};
9 changes: 8 additions & 1 deletion libs/cypress-indexeddb/.babelrc
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
{
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
"presets": [
[
"@nrwl/js/babel",
{
"useBuiltIns": "usage"
}
]
]
}
15 changes: 15 additions & 0 deletions libs/cypress-indexeddb/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,21 @@ It supports:

### Installation

**With Cypress versions _above_ 12.6.0:**

1. Install the package:
`npm install @this-dot/cypress-indexeddb`
or
`yarn add @this-dot/cypress-indexeddb`

2. Import the plugin in your `cypress/support/commands.js` or `cypress/support/commands.ts` file:

```typescript
import '@this-dot/cypress-indexeddb';
```

Please note, that cypress introduced the `Cypress.Commands.overwriteQuery` command in [12.6.0](https://docs.cypress.io/guides/references/changelog#12-6-0), therefore, cypress versions 12.0.0 to 12.5.x are not supported by this library.

**With Cypress versions _below_ 12.0.0:**

1. Install the 1.2.1 version of the package:
Expand Down
13 changes: 7 additions & 6 deletions libs/cypress-indexeddb/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,14 +2,15 @@
export default {
displayName: 'cypress-indexeddb',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
'^.+\\.[tj]sx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/cypress-indexeddb',
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,6 +20,6 @@
"typescript"
],
"peerDependencies": {
"cypress": "< 12.0.0"
"cypress": "< 12.6.0"
}
}
3 changes: 2 additions & 1 deletion libs/cypress-indexeddb/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "cypress-indexeddb",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/cypress-indexeddb/src",
"projectType": "library",
Expand All@@ -12,7 +13,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/cypress-indexeddb"],
"outputs": ["{workspaceRoot}/coverage/libs/cypress-indexeddb"],
"options": {
"jestConfig": "libs/cypress-indexeddb/jest.config.ts",
"passWithNoTests": true
Expand Down
32 changes: 19 additions & 13 deletions libs/cypress-indexeddb/src/lib/alias-setup.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,20 +18,26 @@ export function setDatabaseInternal(databaseName: string, database: IDBDatabase)
type IDBItemType = 'store' | 'database';

export function overrideAs(
originalAs: (subject: unknown, alias: string) => any,
subject: unknown,
alias: string
originalAs: Cypress.QueryFn<'as'>,
alias: string,
options?: Partial<Cypress.AsOptions>
) {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return originalAs(subject, alias);
}
const asArgs: [string, Partial<Cypress.AsOptions> | undefined] = [alias, options];
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const innerFn = originalAs.apply(this, asArgs);
return (subject: unknown) => {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return innerFn(subject);
}
};
}

export const getDatabase = getIDBItem('database');
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/src/lib/cypress-indexeddb.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import { entries, keys } from './object-store-metadata';
import { openIndexedDb } from './open-database';

function setupIDBHelpers(): void {
Cypress.Commands.overwrite('as', overrideAs);
Cypress.Commands.overwriteQuery('as', overrideAs);
Cypress.Commands.add(`clearIndexedDb`, deleteDatabase);
Cypress.Commands.add(`openIndexedDb`, openIndexedDb);
Cypress.Commands.add(`getIndexedDb`, getDatabase);
Expand Down
15 changes: 8 additions & 7 deletions libs/ng-utils/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,15 +3,16 @@ export default {
displayName: 'ng-utils',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/libs/ng-utils',
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
4 changes: 2 additions & 2 deletions libs/ng-utils/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,8 +20,8 @@
"utilities"
],
"peerDependencies": {
"@angular/common": ">= 12.0.0 < 15",
"@angular/core": ">= 12.0.0 < 15"
"@angular/common": ">= 12.0.0 < 16",
"@angular/core": ">= 12.0.0 < 16"
},
"dependencies": {
"tslib": "^2.2.0"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b4408cd
chore: 🤖 upgrade Angular and Nx
ktrz Jan 10, 2023
93037e9
chore: [nx migration] 15.0.0-migrate-to-inputs
ktrz Jan 10, 2023
baf8032
chore: [nx migration] 15.0.0-prefix-outputs
ktrz Jan 10, 2023
6740261
chore: [nx migration] update-angular-cli-version-14-1-0
ktrz Jan 10, 2023
d537c46
chore: [nx migration] update-rxjs-7-5-0
ktrz Jan 10, 2023
d828308
chore: [nx migration] update-angular-cli-version-14-2-0
ktrz Jan 10, 2023
fa90fb2
chore: [nx migration] update-angular-cli-version-15-0-0
ktrz Jan 10, 2023
06b1967
chore: [nx migration] remove-browserlist-config
ktrz Jan 10, 2023
6124682
chore: [nx migration] update-typescript-target
ktrz Jan 10, 2023
e7d5988
chore: [nx migration] migration-v15
ktrz Jan 10, 2023
df784ea
chore: [nx migration] update-cypress-configs-preset
ktrz Jan 10, 2023
52a6836
chore: [nx migration] update-cypress-if-v10
ktrz Jan 10, 2023
1e0c838
chore: [nx migration] add-cypress-inputs
ktrz Jan 10, 2023
1c598cd
chore: [nx migration] update-to-cypress-11
ktrz Jan 10, 2023
087e695
chore: [nx migration] exclude-jest-config-from-ts-config
ktrz Jan 10, 2023
fe99403
chore: [nx migration] update-configs-jest-28
ktrz Jan 10, 2023
7800b8f
chore: [nx migration] add-jest-inputs
ktrz Jan 10, 2023
66a27c2
chore: [nx migration] add-eslint-inputs
ktrz Jan 10, 2023
89ccfbe
chore: [nx migration] add-babel-inputs
ktrz Jan 10, 2023
becf051
chore: [nx migration] 14-8-0-change-run-commands-executor
ktrz Jan 10, 2023
b9b92fa
fix: package-lock fixes
Mar 5, 2023
9336475
chore: upgraded to latest version of everything
Mar 5, 2023
2f55da6
fix: try updating package-lock with npm v8.1.0 to fix CI
Mar 5, 2023
5d244cc
fix: use changed cypress API to keep existing functionality
Mar 5, 2023
2e5b383
fix: peer dependencies update
Mar 5, 2023
38e83dc
chore: proper documentation for cypress-indexeddb
Mar 9, 2023
7016fda
feat: use lts/gallium for nvmrc
Mar 10, 2023
55f1337
chore: run cypress tests with test isolation and add todo with issue …
Mar 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
node_modules
2 changes: 1 addition & 1 deletion .nvmrc
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
16.10.0
lts/gallium
2 changes: 1 addition & 1 deletion apps/showcase-e2e/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@ const cypressJsonConfig = {
};
export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...nxE2EPreset(__filename),
...cypressJsonConfig,
},
});
1 change: 1 addition & 0 deletions apps/showcase-e2e/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/showcase-e2e/src",
"projectType": "application",
Expand Down
17 changes: 0 additions & 17 deletions apps/showcase/.browserslistrc

This file was deleted.

17 changes: 9 additions & 8 deletions apps/showcase/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,21 +3,22 @@ export default {
displayName: 'showcase',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
coverageDirectory: '../../coverage/apps/showcase',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
};
3 changes: 2 additions & 1 deletion apps/showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/showcase/src",
Expand DownExpand Up@@ -78,7 +79,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/showcase"],
"options": {
"jestConfig": "apps/showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/showcase/src/app/app.module.ts
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatIconModule } from '@angular/material/icon';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatToolbarModule } from '@angular/material/toolbar';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatSelectModule } from '@angular/material/select';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
import { RouteConfigModule } from '@this-dot/route-config';
import { FirstRouteComponent } from './components/first-route/first-route.component';
import { RouteTagsShowcaseComponent } from './components/route-tags-showcase/route-tags-showcase.component';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import {
addItem,
connectIndexedDb,
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import {
FormGroupDirective,
Validators,
} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import { connectIndexedDb, deleteItem, getObjectStore, read, setItem } from '@this-dot/rxidb';
import { isTruthy } from '@this-dot/utils';
import { merge, Observable, Subject, timer } from 'rxjs';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS as MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar';
import { RxidbRoutingModule } from './rxidb-routing.module';
import { RxidbKeyValuePairShowcaseComponent } from './components/rxidb-key-value-pair-showcase/rxidb-key-value-pair-showcase.component';
import { RxidbAutoIncrementComponent } from './components/rxidb-auto-increment/rxidb-auto-increment.component';
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": []
"types": [],
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/main.ts", "src/polyfills.ts"],
"exclude": ["jest.config.ts"]
Expand Down
10 changes: 10 additions & 0 deletions apps/vue-showcase/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,5 +15,15 @@ export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...cypressJsonConfig,
/**
* TODO (https://github.com/thisdot/open-source/issues/161)
* Set the flag to true and fix tests.
*
* In Cypress v12,the testIsolation option is turned on by default.
* This can cause tests to start breaking where not indended.
* You should consider enabling this once you verify tests do not depend on each other
* More Info: https://docs.cypress.io/guides/references/migration-guide#Test-Isolation
**/
testIsolation: false,
Comment thread
TapaiBalazs marked this conversation as resolved.
},
});
3 changes: 2 additions & 1 deletion apps/vue-showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "vue-showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/vue-showcase/src",
Expand DownExpand Up@@ -34,7 +35,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/vue-showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/vue-showcase"],
"options": {
"jestConfig": "apps/vue-showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/vue-showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,6 @@
"outDir": "../../dist/out-tsc",
"types": ["vue-i18n", "node"]
},
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx"],
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx", "jest.config.ts"],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.vue", "**/*.json"]
}
3 changes: 2 additions & 1 deletion apps/vue-showcase/tsconfig.e2e.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,5 +6,6 @@
"allowJs": true,
"types": ["cypress", "node"]
},
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"]
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"],
"exclude": ["jest.config.ts"]
}
14 changes: 13 additions & 1 deletion jest.preset.js
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
const nxPreset = require('@nrwl/jest/preset').default;

module.exports = { ...nxPreset };
module.exports = {
...nxPreset,
/* TODO: Update to latest Jest snapshotFormat
* By default Nx has kept the older style of Jest Snapshot formats
* to prevent breaking of any existing tests with snapshots.
* It's recommend you update to the latest format.
* You can do this by removing snapshotFormat property
* and running tests with --update-snapshot flag.
* Example: "nx affected --targets=test --update-snapshot"
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
*/
snapshotFormat: { escapeString: true, printBasicPrototype: true },
};
9 changes: 8 additions & 1 deletion libs/cypress-indexeddb/.babelrc
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
{
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
"presets": [
[
"@nrwl/js/babel",
{
"useBuiltIns": "usage"
}
]
]
}
15 changes: 15 additions & 0 deletions libs/cypress-indexeddb/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,21 @@ It supports:

### Installation

**With Cypress versions _above_ 12.6.0:**

1. Install the package:
`npm install @this-dot/cypress-indexeddb`
or
`yarn add @this-dot/cypress-indexeddb`

2. Import the plugin in your `cypress/support/commands.js` or `cypress/support/commands.ts` file:

```typescript
import '@this-dot/cypress-indexeddb';
```

Please note, that cypress introduced the `Cypress.Commands.overwriteQuery` command in [12.6.0](https://docs.cypress.io/guides/references/changelog#12-6-0), therefore, cypress versions 12.0.0 to 12.5.x are not supported by this library.

**With Cypress versions _below_ 12.0.0:**

1. Install the 1.2.1 version of the package:
Expand Down
13 changes: 7 additions & 6 deletions libs/cypress-indexeddb/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,14 +2,15 @@
export default {
displayName: 'cypress-indexeddb',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
'^.+\\.[tj]sx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/cypress-indexeddb',
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,6 +20,6 @@
"typescript"
],
"peerDependencies": {
"cypress": "< 12.0.0"
"cypress": "< 12.6.0"
}
}
3 changes: 2 additions & 1 deletion libs/cypress-indexeddb/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "cypress-indexeddb",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/cypress-indexeddb/src",
"projectType": "library",
Expand All@@ -12,7 +13,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/cypress-indexeddb"],
"outputs": ["{workspaceRoot}/coverage/libs/cypress-indexeddb"],
"options": {
"jestConfig": "libs/cypress-indexeddb/jest.config.ts",
"passWithNoTests": true
Expand Down
32 changes: 19 additions & 13 deletions libs/cypress-indexeddb/src/lib/alias-setup.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,20 +18,26 @@ export function setDatabaseInternal(databaseName: string, database: IDBDatabase)
type IDBItemType = 'store' | 'database';

export function overrideAs(
originalAs: (subject: unknown, alias: string) => any,
subject: unknown,
alias: string
originalAs: Cypress.QueryFn<'as'>,
alias: string,
options?: Partial<Cypress.AsOptions>
) {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return originalAs(subject, alias);
}
const asArgs: [string, Partial<Cypress.AsOptions> | undefined] = [alias, options];
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const innerFn = originalAs.apply(this, asArgs);
return (subject: unknown) => {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return innerFn(subject);
}
};
}

export const getDatabase = getIDBItem('database');
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/src/lib/cypress-indexeddb.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import { entries, keys } from './object-store-metadata';
import { openIndexedDb } from './open-database';

function setupIDBHelpers(): void {
Cypress.Commands.overwrite('as', overrideAs);
Cypress.Commands.overwriteQuery('as', overrideAs);
Cypress.Commands.add(`clearIndexedDb`, deleteDatabase);
Cypress.Commands.add(`openIndexedDb`, openIndexedDb);
Cypress.Commands.add(`getIndexedDb`, getDatabase);
Expand Down
15 changes: 8 additions & 7 deletions libs/ng-utils/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,15 +3,16 @@ export default {
displayName: 'ng-utils',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/libs/ng-utils',
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
4 changes: 2 additions & 2 deletions libs/ng-utils/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,8 +20,8 @@
"utilities"
],
"peerDependencies": {
"@angular/common": ">= 12.0.0 < 15",
"@angular/core": ">= 12.0.0 < 15"
"@angular/common": ">= 12.0.0 < 16",
"@angular/core": ">= 12.0.0 < 16"
},
"dependencies": {
"tslib": "^2.2.0"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b4408cd
chore: 🤖 upgrade Angular and Nx
ktrz Jan 10, 2023
93037e9
chore: [nx migration] 15.0.0-migrate-to-inputs
ktrz Jan 10, 2023
baf8032
chore: [nx migration] 15.0.0-prefix-outputs
ktrz Jan 10, 2023
6740261
chore: [nx migration] update-angular-cli-version-14-1-0
ktrz Jan 10, 2023
d537c46
chore: [nx migration] update-rxjs-7-5-0
ktrz Jan 10, 2023
d828308
chore: [nx migration] update-angular-cli-version-14-2-0
ktrz Jan 10, 2023
fa90fb2
chore: [nx migration] update-angular-cli-version-15-0-0
ktrz Jan 10, 2023
06b1967
chore: [nx migration] remove-browserlist-config
ktrz Jan 10, 2023
6124682
chore: [nx migration] update-typescript-target
ktrz Jan 10, 2023
e7d5988
chore: [nx migration] migration-v15
ktrz Jan 10, 2023
df784ea
chore: [nx migration] update-cypress-configs-preset
ktrz Jan 10, 2023
52a6836
chore: [nx migration] update-cypress-if-v10
ktrz Jan 10, 2023
1e0c838
chore: [nx migration] add-cypress-inputs
ktrz Jan 10, 2023
1c598cd
chore: [nx migration] update-to-cypress-11
ktrz Jan 10, 2023
087e695
chore: [nx migration] exclude-jest-config-from-ts-config
ktrz Jan 10, 2023
fe99403
chore: [nx migration] update-configs-jest-28
ktrz Jan 10, 2023
7800b8f
chore: [nx migration] add-jest-inputs
ktrz Jan 10, 2023
66a27c2
chore: [nx migration] add-eslint-inputs
ktrz Jan 10, 2023
89ccfbe
chore: [nx migration] add-babel-inputs
ktrz Jan 10, 2023
becf051
chore: [nx migration] 14-8-0-change-run-commands-executor
ktrz Jan 10, 2023
b9b92fa
fix: package-lock fixes
Mar 5, 2023
9336475
chore: upgraded to latest version of everything
Mar 5, 2023
2f55da6
fix: try updating package-lock with npm v8.1.0 to fix CI
Mar 5, 2023
5d244cc
fix: use changed cypress API to keep existing functionality
Mar 5, 2023
2e5b383
fix: peer dependencies update
Mar 5, 2023
38e83dc
chore: proper documentation for cypress-indexeddb
Mar 9, 2023
7016fda
feat: use lts/gallium for nvmrc
Mar 10, 2023
55f1337
chore: run cypress tests with test isolation and add todo with issue …
Mar 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
node_modules
2 changes: 1 addition & 1 deletion .nvmrc
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
16.10.0
lts/gallium
2 changes: 1 addition & 1 deletion apps/showcase-e2e/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@ const cypressJsonConfig = {
};
export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...nxE2EPreset(__filename),
...cypressJsonConfig,
},
});
1 change: 1 addition & 0 deletions apps/showcase-e2e/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/showcase-e2e/src",
"projectType": "application",
Expand Down
17 changes: 0 additions & 17 deletions apps/showcase/.browserslistrc

This file was deleted.

17 changes: 9 additions & 8 deletions apps/showcase/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,21 +3,22 @@ export default {
displayName: 'showcase',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
coverageDirectory: '../../coverage/apps/showcase',
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
transform: {
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
stringifyContentPathRegex: '\\.(html|svg)$',

tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
};
3 changes: 2 additions & 1 deletion apps/showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/showcase/src",
Expand DownExpand Up@@ -78,7 +79,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/showcase"],
"options": {
"jestConfig": "apps/showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/showcase/src/app/app.module.ts
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatIconModule } from '@angular/material/icon';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatToolbarModule } from '@angular/material/toolbar';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatSelectModule } from '@angular/material/select';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
import { RouteConfigModule } from '@this-dot/route-config';
import { FirstRouteComponent } from './components/first-route/first-route.component';
import { RouteTagsShowcaseComponent } from './components/route-tags-showcase/route-tags-showcase.component';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
import { Component, Inject, OnDestroy, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import {
addItem,
connectIndexedDb,
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import {
FormGroupDirective,
Validators,
} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
import { connectIndexedDb, deleteItem, getObjectStore, read, setItem } from '@this-dot/rxidb';
import { isTruthy } from '@this-dot/utils';
import { merge, Observable, Subject, timer } from 'rxjs';
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MAT_LEGACY_FORM_FIELD_DEFAULT_OPTIONS as MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar';
import { RxidbRoutingModule } from './rxidb-routing.module';
import { RxidbKeyValuePairShowcaseComponent } from './components/rxidb-key-value-pair-showcase/rxidb-key-value-pair-showcase.component';
import { RxidbAutoIncrementComponent } from './components/rxidb-auto-increment/rxidb-auto-increment.component';
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": []
"types": [],
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/main.ts", "src/polyfills.ts"],
"exclude": ["jest.config.ts"]
Expand Down
10 changes: 10 additions & 0 deletions apps/vue-showcase/cypress.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,5 +15,15 @@ export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
...cypressJsonConfig,
/**
* TODO (https://github.com/thisdot/open-source/issues/161)
* Set the flag to true and fix tests.
*
* In Cypress v12,the testIsolation option is turned on by default.
* This can cause tests to start breaking where not indended.
* You should consider enabling this once you verify tests do not depend on each other
* More Info: https://docs.cypress.io/guides/references/migration-guide#Test-Isolation
**/
testIsolation: false,
Comment thread
TapaiBalazs marked this conversation as resolved.
},
});
3 changes: 2 additions & 1 deletion apps/vue-showcase/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "vue-showcase",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/vue-showcase/src",
Expand DownExpand Up@@ -34,7 +35,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/vue-showcase"],
"outputs": ["{workspaceRoot}/coverage/apps/vue-showcase"],
"options": {
"jestConfig": "apps/vue-showcase/jest.config.ts",
"passWithNoTests": true
Expand Down
2 changes: 1 addition & 1 deletion apps/vue-showcase/tsconfig.app.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,6 @@
"outDir": "../../dist/out-tsc",
"types": ["vue-i18n", "node"]
},
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx"],
"exclude": ["**/*.spec.js", "**/*.spec.jsx", "**/*.spec.ts", "**/*.spec.tsx", "jest.config.ts"],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.vue", "**/*.json"]
}
3 changes: 2 additions & 1 deletion apps/vue-showcase/tsconfig.e2e.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,5 +6,6 @@
"allowJs": true,
"types": ["cypress", "node"]
},
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"]
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"],
"exclude": ["jest.config.ts"]
}
14 changes: 13 additions & 1 deletion jest.preset.js
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
const nxPreset = require('@nrwl/jest/preset').default;

module.exports = { ...nxPreset };
module.exports = {
...nxPreset,
/* TODO: Update to latest Jest snapshotFormat
* By default Nx has kept the older style of Jest Snapshot formats
* to prevent breaking of any existing tests with snapshots.
* It's recommend you update to the latest format.
* You can do this by removing snapshotFormat property
* and running tests with --update-snapshot flag.
* Example: "nx affected --targets=test --update-snapshot"
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
*/
snapshotFormat: { escapeString: true, printBasicPrototype: true },
};
9 changes: 8 additions & 1 deletion libs/cypress-indexeddb/.babelrc
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
{
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
"presets": [
[
"@nrwl/js/babel",
{
"useBuiltIns": "usage"
}
]
]
}
15 changes: 15 additions & 0 deletions libs/cypress-indexeddb/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,6 +24,21 @@ It supports:

### Installation

**With Cypress versions _above_ 12.6.0:**

1. Install the package:
`npm install @this-dot/cypress-indexeddb`
or
`yarn add @this-dot/cypress-indexeddb`

2. Import the plugin in your `cypress/support/commands.js` or `cypress/support/commands.ts` file:

```typescript
import '@this-dot/cypress-indexeddb';
```

Please note, that cypress introduced the `Cypress.Commands.overwriteQuery` command in [12.6.0](https://docs.cypress.io/guides/references/changelog#12-6-0), therefore, cypress versions 12.0.0 to 12.5.x are not supported by this library.

**With Cypress versions _below_ 12.0.0:**

1. Install the 1.2.1 version of the package:
Expand Down
13 changes: 7 additions & 6 deletions libs/cypress-indexeddb/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,14 +2,15 @@
export default {
displayName: 'cypress-indexeddb',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
globals: {},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
'^.+\\.[tj]sx?$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/cypress-indexeddb',
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,6 +20,6 @@
"typescript"
],
"peerDependencies": {
"cypress": "< 12.0.0"
"cypress": "< 12.6.0"
}
}
3 changes: 2 additions & 1 deletion libs/cypress-indexeddb/project.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"name": "cypress-indexeddb",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/cypress-indexeddb/src",
"projectType": "library",
Expand All@@ -12,7 +13,7 @@
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/cypress-indexeddb"],
"outputs": ["{workspaceRoot}/coverage/libs/cypress-indexeddb"],
"options": {
"jestConfig": "libs/cypress-indexeddb/jest.config.ts",
"passWithNoTests": true
Expand Down
32 changes: 19 additions & 13 deletions libs/cypress-indexeddb/src/lib/alias-setup.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,20 +18,26 @@ export function setDatabaseInternal(databaseName: string, database: IDBDatabase)
type IDBItemType = 'store' | 'database';

export function overrideAs(
originalAs: (subject: unknown, alias: string) => any,
subject: unknown,
alias: string
originalAs: Cypress.QueryFn<'as'>,
alias: string,
options?: Partial<Cypress.AsOptions>
) {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return originalAs(subject, alias);
}
const asArgs: [string, Partial<Cypress.AsOptions> | undefined] = [alias, options];
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const innerFn = originalAs.apply(this, asArgs);
return (subject: unknown) => {
if (isIDBObjectStore(subject)) {
STORES.set(alias, subject);
return subject;
} else if (isIDBDatabase(subject)) {
DATABASE_ALIASES.set(alias, subject.name);
DATABASES.set(subject.name, subject);
return subject;
} else {
return innerFn(subject);
}
};
}

export const getDatabase = getIDBItem('database');
Expand Down
2 changes: 1 addition & 1 deletion libs/cypress-indexeddb/src/lib/cypress-indexeddb.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import { entries, keys } from './object-store-metadata';
import { openIndexedDb } from './open-database';

function setupIDBHelpers(): void {
Cypress.Commands.overwrite('as', overrideAs);
Cypress.Commands.overwriteQuery('as', overrideAs);
Cypress.Commands.add(`clearIndexedDb`, deleteDatabase);
Cypress.Commands.add(`openIndexedDb`, openIndexedDb);
Cypress.Commands.add(`getIndexedDb`, getDatabase);
Expand Down
15 changes: 8 additions & 7 deletions libs/ng-utils/jest.config.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,15 +3,16 @@ export default {
displayName: 'ng-utils',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
globals: {},
coverageDirectory: '../../coverage/libs/ng-utils',
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
4 changes: 2 additions & 2 deletions libs/ng-utils/package.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,8 +20,8 @@
"utilities"
],
"peerDependencies": {
"@angular/common": ">= 12.0.0 < 15",
"@angular/core": ">= 12.0.0 < 15"
"@angular/common": ">= 12.0.0 < 16",
"@angular/core": ">= 12.0.0 < 16"
},
"dependencies": {
"tslib": "^2.2.0"
Expand Down
Loading