Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions flow-polymer2lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@
"a-node-html-parser": "^6.0.0-4",
"acorn": "^7.1.0",
"acorn-walk": "^8.2.0",
"glob": "^8.0.3",
"magic-string": "^0.26.3",
"patch-package": "^6.4.7",
"prettier": "^2.1.2",
"typescript": "^4.8.4"
},
"devDependencies": {
"@types/glob": "^8.0.0",
"@types/node": "^13.7.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"lit": "3.3.1"
},
"devDependencies": {
"glob": "11.0.3",
"typescript": "5.9.3",
"strip-css-comments": "5.0.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
},
"type": "module",
"dependencies": {
"mkdirp": "0.5.6",
"glob": "10.3.3"
"mkdirp": "0.5.6"
},
"files": [
"application-theme-plugin.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
* This contains functions and features used to copy theme files.
*/

import { readdirSync, statSync, mkdirSync, existsSync, copyFileSync } from 'fs';
import { resolve, basename, relative, extname } from 'path';
import { globSync } from 'glob';
import { readdirSync, statSync, mkdirSync, existsSync, copyFileSync, globSync } from 'fs';
import { resolve, basename, relative, extname, join } from 'path';

const ignoredFileExtensions = ['.css', '.js', '.json'];

Expand Down Expand Up @@ -144,7 +143,9 @@ function copyStaticAssets(themeName, themeProperties, projectStaticAssetsOutputF
Object.keys(copyRules).forEach((copyRule) => {
// Glob doesn't work with windows path separator so replacing it here.
const nodeSources = resolve('node_modules/', module, copyRule).replace(/\\/g, '/');
const files = globSync(nodeSources, { nodir: true });
const files = globSync(nodeSources, { withFileTypes: true })
.filter((dirent) => !dirent.isDirectory() && dirent.parentPath)
.map((dirent) => join(dirent.parentPath, dirent.name));
const targetFolder = resolve(projectStaticAssetsOutputFolder, 'themes', themeName, copyRules[copyRule]);

mkdirSync(targetFolder, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* This file handles the generation of the '[theme-name].js' to
* the themes/[theme-name] folder according to properties from 'theme.json'.
*/
import { globSync } from 'glob';
import { globSync } from 'node:fs';
import { resolve, basename } from 'path';
import { existsSync, readFileSync, writeFileSync } from 'fs';
import { checkModules } from './theme-copy.js';
Expand Down Expand Up @@ -62,8 +62,10 @@ function writeThemeFiles(themeFolder, themeName, themeProperties, options) {
if (autoInjectComponents) {
componentsFiles = globSync('*.css', {
cwd: resolve(themeFolder, themeComponentsFolder),
nodir: true
});
withFileTypes: true
})
.filter((dirent) => !dirent.isDirectory())
.map((dirent) => dirent.name);

if (componentsFiles.length > 0) {
componentsFileContent +=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,5 @@
"files": [
"theme-loader.js",
"theme-loader-utils.js"
],
"dependencies": {
"glob": "10.3.3"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { existsSync, readFileSync } from 'fs';
import { resolve, basename } from 'path';
import { globSync } from 'glob';
import { existsSync, readFileSync, globSync } from 'fs';
import { resolve, basename, join } from 'path';

// Collect groups [url(] ['|"]optional './|../', other '../' segments optional, file part and end of url
// The additional dot segments could be URL referencing assets in nested imported CSS
Expand Down Expand Up @@ -28,7 +27,9 @@ function assetsContains(fileUrl, themeFolder, logger) {
// if file starts with copyRule target check if file with path after copy target can be found
if (fileUrl.startsWith(copyRules[copyRule])) {
const targetFile = fileUrl.replace(copyRules[copyRule], '');
const files = globSync(resolve('node_modules/', module, copyRule), { nodir: true });
const files = globSync(resolve('node_modules/', module, copyRule), { withFileTypes: true })
.filter((dirent) => !dirent.isDirectory() && dirent.parentPath)
.map((dirent) => join(dirent.parentPath, dirent.name));

for (let file of files) {
if (file.endsWith(targetFile)) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ public void getDefaultDevDependencies_includesAllDependencies_whenUsingVite() {
private Set<String> getCommonDevDeps() {
Set<String> expectedDependencies = new HashSet<>();
expectedDependencies.add("typescript");
expectedDependencies.add("glob");
return expectedDependencies;
}

Expand Down Expand Up @@ -228,12 +227,13 @@ public void updateDefaultDependencies_olderVersionsAreUpdated()
JacksonUtils.createObjectNode());
packageJson.set(NodeUpdater.DEV_DEPENDENCIES,
JacksonUtils.createObjectNode());
((ObjectNode) packageJson.get(NodeUpdater.DEV_DEPENDENCIES)).put("glob",
"7.0.0");
((ObjectNode) packageJson.get(NodeUpdater.DEV_DEPENDENCIES))
.put("typescript", "1.0.0");
nodeUpdater.updateDefaultDependencies(packageJson);

Assert.assertEquals("11.0.3", packageJson
.get(NodeUpdater.DEV_DEPENDENCIES).get("glob").asString());
Assert.assertNotEquals("1.0.0",
packageJson.get(NodeUpdater.DEV_DEPENDENCIES).get("typescript")
.stringValue());
}

@Test // #6907 test when user has set newer versions
Expand Down
Loading