Skip to content

Commit f8a6c40

Browse files
Merge branch 'main' into fix/ps/no-languages-message
2 parents 4fb2b14 + 92ea96a commit f8a6c40

File tree

1,137 files changed

+9694
-5450
lines changed

Some content is hidden

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

1,137 files changed

+9694
-5450
lines changed

.eslintrc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"import/no-unresolved": "off",
4040
"import/order": "warn",
4141
"import/no-self-import": "error",
42-
"import/no-cycle": ["error", { "maxDepth": 2, "allowUnsafeDynamicCyclicDependency": true }],
42+
"import/no-cycle": ["error", { "maxDepth": 6, "allowUnsafeDynamicCyclicDependency": true }],
4343
"local-rules/bad-type-import": "error",
4444
"local-rules/enforce-element-suffix-on-element-class-name": "error",
4545
"local-rules/enforce-umb-prefix-on-element-name": "error",
@@ -48,10 +48,11 @@
4848
"local-rules/prefer-import-aliases": "error",
4949
"local-rules/prefer-static-styles-last": "warn",
5050
"local-rules/umb-class-prefix": "error",
51+
"local-rules/no-relative-import-to-import-map-module": "error",
5152
"local-rules/enforce-umbraco-external-imports": [
5253
"error",
5354
{
54-
"exceptions": ["@umbraco-cms", "@open-wc/testing", "@storybook", "msw", "."]
55+
"exceptions": ["@umbraco-cms", "@open-wc/testing", "@storybook", "msw", ".", "vite"]
5556
}
5657
],
5758
"local-rules/exported-string-constant-naming": [

.github/workflows/azure-static-web-apps-ambitious-stone-0033b3603.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ on:
44
push:
55
branches:
66
- main
7+
- release/*
78
pull_request:
89
types: [opened, synchronize, reopened, closed]
910
branches:
1011
- main
12+
- release/*
1113
workflow_dispatch:
1214
inputs:
1315
issue_number:

.github/workflows/build_test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ name: Build and test
55

66
on:
77
push:
8-
branches: [main]
8+
branches:
9+
- main
10+
- release/*
911
pull_request:
10-
branches: [main]
12+
branches:
13+
- main
14+
- release/*
1115

1216
# Allows GitHub to use this workflow to validate the merge queue
1317
merge_group:

.github/workflows/codeql.yml

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: 'CodeQL'
1313

1414
on:
1515
push:
16-
branches: [ "main" ]
16+
branches:
17+
- main
18+
- release/*
1719
pull_request:
18-
# The branches below must be a subset of the branches above
19-
branches: [ "main" ]
20+
branches:
21+
- main
22+
- release/*
2023
schedule:
2124
- cron: '33 2 * * 1'
2225

@@ -32,25 +35,25 @@ jobs:
3235
strategy:
3336
fail-fast: false
3437
matrix:
35-
language: [ 'javascript' ]
38+
language: ['javascript']
3639
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3740
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
3841

3942
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v4
43+
- name: Checkout repository
44+
uses: actions/checkout@v4
4245

43-
# Initializes the CodeQL tools for scanning.
44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v3
46-
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
51-
52-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53-
# queries: security-extended,security-and-quality
46+
# Initializes the CodeQL tools for scanning.
47+
- name: Initialize CodeQL
48+
uses: github/codeql-action/init@v3
49+
with:
50+
languages: ${{ matrix.language }}
51+
# If you wish to specify custom queries, you can do so here or in a config file.
52+
# By default, queries listed here will override any specified in a config file.
53+
# Prefix the list here with "+" to use these queries and those in the config file.
5454

55-
- name: Perform CodeQL Analysis
56-
uses: github/codeql-action/analyze@v3
55+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
56+
# queries: security-extended,security-and-quality
57+
58+
- name: Perform CodeQL Analysis
59+
uses: github/codeql-action/analyze@v3

.github/workflows/devskim.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ name: DevSkim
77

88
on:
99
push:
10-
branches: [ "main" ]
10+
branches:
11+
- main
12+
- release/*
1113
schedule:
1214
- cron: '19 14 * * 5'
1315

@@ -28,7 +30,7 @@ jobs:
2830
with:
2931
directory-to-scan: src
3032
should-scan-archives: false
31-
ignore-globs: "**/.git/**,*.md,*.mdx,*.stories.ts,*.js"
33+
ignore-globs: '**/.git/**,*.md,*.mdx,*.stories.ts,*.js'
3234

3335
- name: Upload DevSkim scan results to GitHub Security tab
3436
uses: github/codeql-action/upload-sarif@v3
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
const getDirectories = (source) =>
5+
fs
6+
.readdirSync(source, { withFileTypes: true })
7+
.filter((dirent) => dirent.isDirectory())
8+
.map((dirent) => dirent.name);
9+
10+
// TODO: get the correct list of modules. This is a temporary solution where we assume that a directory is equivalent to a module
11+
// TODO: include package modules in this list
12+
const coreRoot = path.join(__dirname, '../../../', 'src/packages/core');
13+
const externalRoot = path.join(__dirname, '../../../', 'src/external');
14+
const libsRoot = path.join(__dirname, '../../../', 'src/libs');
15+
const coreModules = getDirectories(coreRoot).map((dir) => `/core/${dir}/`);
16+
const externalModules = getDirectories(externalRoot).map((dir) => `/${dir}/`);
17+
const libsModules = getDirectories(libsRoot).map((dir) => `/${dir}/`);
18+
19+
const modulePathIdentifiers = [...coreModules, ...externalModules, ...libsModules];
20+
21+
/** @type {import('eslint').Rule.RuleModule} */
22+
module.exports = {
23+
meta: {
24+
type: 'problem',
25+
docs: {
26+
description: 'Prevent relative import to a module that is in the import map.',
27+
category: 'Best Practices',
28+
recommended: true,
29+
},
30+
schema: [],
31+
messages: {
32+
unexpectedValue: 'Relative import paths should include "{{value}}".',
33+
},
34+
},
35+
create: function (context) {
36+
return {
37+
ImportDeclaration(node) {
38+
// exclude test and story files
39+
if (context.filename.endsWith('.test.ts') || context.filename.endsWith('.stories.ts')) {
40+
return {};
41+
}
42+
43+
const importPath = node.source.value;
44+
45+
if (importPath.startsWith('./') || importPath.startsWith('../')) {
46+
if (modulePathIdentifiers.some((moduleName) => importPath.includes(moduleName))) {
47+
context.report({
48+
node,
49+
message: 'Use the correct import map alias instead of a relative import path: ' + importPath,
50+
});
51+
}
52+
}
53+
},
54+
};
55+
},
56+
};

devops/localization/unused-language-keys.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const mainMap = buildMap(mainKeys);
2626
const keys = Array.from(mainMap.keys());
2727
const usedKeys = new Set();
2828

29-
const elementAndControllerFiles = await glob(`${__dirname}/../../src/**/*.ts`);
29+
const elementAndControllerFiles = await glob(`${__dirname}/../../src/**/*.ts`, { filesOnly: true });
3030

3131
console.log(`Checking ${elementAndControllerFiles.length} files for unused keys`);
3232

eslint-local-rules.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const noDirectApiImportRule = require('./devops/eslint/rules/no-direct-api-impor
1010
const preferImportAliasesRule = require('./devops/eslint/rules/prefer-import-aliases.cjs');
1111
const preferStaticStylesLastRule = require('./devops/eslint/rules/prefer-static-styles-last.cjs');
1212
const umbClassPrefixRule = require('./devops/eslint/rules/umb-class-prefix.cjs');
13+
const noRelativeImportToImportMapModule = require('./devops/eslint/rules/no-relative-import-to-import-map-module.cjs');
1314

1415
module.exports = {
1516
'bad-type-import': badTypeImportRule,
@@ -22,4 +23,5 @@ module.exports = {
2223
'prefer-import-aliases': preferImportAliasesRule,
2324
'prefer-static-styles-last': preferStaticStylesLastRule,
2425
'umb-class-prefix': umbClassPrefixRule,
26+
'no-relative-import-to-import-map-module': noRelativeImportToImportMapModule,
2527
};

examples/workspace-context-counter/counter-workspace-context.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ export class WorkspaceContextCounter extends UmbControllerBase {
2424
export const api = WorkspaceContextCounter;
2525

2626
// Declare a Context Token that other elements can use to request the WorkspaceContextCounter:
27-
export const EXAMPLE_COUNTER_CONTEXT = new UmbContextToken<WorkspaceContextCounter>('example.workspaceContext.counter');
27+
export const EXAMPLE_COUNTER_CONTEXT = new UmbContextToken<WorkspaceContextCounter>(
28+
'UmbWorkspaceContext',
29+
'example.workspaceContext.counter',
30+
);

0 commit comments

Comments
 (0)