diff --git a/.gitignore b/.gitignore index d916651..ebd7352 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,5 @@ testem.log .DS_Store Thumbs.db .eslintcache + +.angular diff --git a/.prettierignore b/.prettierignore index d0b804d..61a17b5 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,3 +2,5 @@ /dist /coverage + +.angular diff --git a/libs/web/container-queries/.eslintrc.json b/libs/web/container-queries/.eslintrc.json new file mode 100644 index 0000000..a7c2eaf --- /dev/null +++ b/libs/web/container-queries/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "angularSpotify", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "angular-spotify", + "style": "kebab-case" + } + ] + }, + "extends": [ + "plugin:@nrwl/nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ] + }, + { + "files": ["*.html"], + "extends": ["plugin:@nrwl/nx/angular-template"], + "rules": {} + } + ] +} diff --git a/libs/web/container-queries/README.md b/libs/web/container-queries/README.md new file mode 100644 index 0000000..f727944 --- /dev/null +++ b/libs/web/container-queries/README.md @@ -0,0 +1,7 @@ +# web-container-queries + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test web-container-queries` to execute the unit tests. diff --git a/libs/web/container-queries/jest.config.ts b/libs/web/container-queries/jest.config.ts new file mode 100644 index 0000000..1997ffd --- /dev/null +++ b/libs/web/container-queries/jest.config.ts @@ -0,0 +1,22 @@ +/* eslint-disable */ +export default { + displayName: 'web-container-queries', + preset: '../../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: '../../../coverage/libs/web/container-queries', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/tsconfig.spec.json', + stringifyContentPathRegex: '\\.(html|svg)$' + } + ] + }, + transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], + snapshotSerializers: [ + 'jest-preset-angular/build/serializers/no-ng-attributes', + 'jest-preset-angular/build/serializers/ng-snapshot', + 'jest-preset-angular/build/serializers/html-comment' + ] +}; diff --git a/libs/web/container-queries/project.json b/libs/web/container-queries/project.json new file mode 100644 index 0000000..e208568 --- /dev/null +++ b/libs/web/container-queries/project.json @@ -0,0 +1,34 @@ +{ + "name": "web-container-queries", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/web/container-queries/src", + "prefix": "angular-spotify", + "tags": [], + "projectType": "library", + "targets": { + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/web/container-queries/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/web/container-queries/**/*.ts", + "libs/web/container-queries/**/*.html" + ] + } + } + } +} diff --git a/libs/web/container-queries/src/index.ts b/libs/web/container-queries/src/index.ts new file mode 100644 index 0000000..932f456 --- /dev/null +++ b/libs/web/container-queries/src/index.ts @@ -0,0 +1 @@ +export * from './lib/container-queries.component'; diff --git a/libs/web/container-queries/src/lib/container-queries.component.ts b/libs/web/container-queries/src/lib/container-queries.component.ts new file mode 100644 index 0000000..1cf2eb0 --- /dev/null +++ b/libs/web/container-queries/src/lib/container-queries.component.ts @@ -0,0 +1,12 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'as-container-queries', + standalone: true, + template: ` +
+

Hello Melbourne 🇦🇺

+
+ ` +}) +export class ContainerQueriesComponent {} diff --git a/libs/web/container-queries/src/test-setup.ts b/libs/web/container-queries/src/test-setup.ts new file mode 100644 index 0000000..1100b3e --- /dev/null +++ b/libs/web/container-queries/src/test-setup.ts @@ -0,0 +1 @@ +import 'jest-preset-angular/setup-jest'; diff --git a/libs/web/container-queries/tsconfig.json b/libs/web/container-queries/tsconfig.json new file mode 100644 index 0000000..5cf0a16 --- /dev/null +++ b/libs/web/container-queries/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "target": "es2022", + "useDefineForClassFields": false, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ], + "extends": "../../../tsconfig.base.json", + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/libs/web/container-queries/tsconfig.lib.json b/libs/web/container-queries/tsconfig.lib.json new file mode 100644 index 0000000..8441346 --- /dev/null +++ b/libs/web/container-queries/tsconfig.lib.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [] + }, + "exclude": ["src/**/*.spec.ts", "src/test-setup.ts", "jest.config.ts", "src/**/*.test.ts"], + "include": ["src/**/*.ts"] +} diff --git a/libs/web/container-queries/tsconfig.spec.json b/libs/web/container-queries/tsconfig.spec.json new file mode 100644 index 0000000..e637bf8 --- /dev/null +++ b/libs/web/container-queries/tsconfig.spec.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "module": "commonjs", + "target": "es2016", + "types": ["jest", "node"] + }, + "files": ["src/test-setup.ts"], + "include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"] +} diff --git a/package.json b/package.json index 7737431..c6b4867 100644 --- a/package.json +++ b/package.json @@ -79,13 +79,14 @@ "@nrwl/cypress": "15.9.2", "@nrwl/eslint-plugin-nx": "15.9.2", "@nrwl/jest": "15.9.2", + "@nrwl/js": "15.9.2", "@nrwl/linter": "15.9.2", "@nrwl/nx-cloud": "16.0.1", "@nrwl/workspace": "15.9.2", "@schematics/angular": "~15.0.0", "@types/jest": "29.4.4", "@types/lodash-es": "4.17.4", - "@types/node": "14.14.33", + "@types/node": "16.11.7", "@types/spotify-api": "0.0.10", "@types/spotify-web-playback-sdk": "0.1.9", "@typescript-eslint/eslint-plugin": "5.59.0", diff --git a/tailwind.config.js b/tailwind.config.js index 3ae667f..d143b6f 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -18,9 +18,9 @@ module.exports = { primary: '#1db954', sliderRail: '#535353', sliderTrack: '#b3b3b3', - baseline: 'rgb(var(--background-base) / )', - white: 'rgb(var(--text-base) / )', - highlight: 'hsla(0,0%,100%,.1)', + baseline: 'rgb(var(--background-baseline) / )', + white: 'rgb(var(--text-baseline) / )', + highlight: 'rgb(var(--background-highlight) / )', } } }, diff --git a/tsconfig.base.json b/tsconfig.base.json index f60d6b7..e5183b8 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -45,6 +45,7 @@ "@angular-spotify/web/browse/ui/category-cover": [ "libs/web/browse/ui/category-cover/src/index.ts" ], + "@angular-spotify/web/container-queries": ["libs/web/container-queries/src/index.ts"], "@angular-spotify/web/home/data-access": ["libs/web/home/data-access/src/index.ts"], "@angular-spotify/web/home/feature": ["libs/web/home/feature/src/index.ts"], "@angular-spotify/web/home/ui/featured-playlists": [ diff --git a/yarn.lock b/yarn.lock index 4d59e6b..b82d064 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3257,10 +3257,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== -"@types/node@14.14.33": - version "14.14.33" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.33.tgz#9e4f8c64345522e4e8ce77b334a8aaa64e2b6c78" - integrity sha512-oJqcTrgPUF29oUP8AsUqbXGJNuPutsetaa9kTQAQce5Lx5dTYWV02ScBiT/k1BX/Z7pKeqedmvp39Wu4zR7N7g== +"@types/node@16.11.7": + version "16.11.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.7.tgz#36820945061326978c42a01e56b61cd223dfdc42" + integrity sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw== "@types/node@^14.14.31": version "14.18.42"