-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: avoid shameful hoisting (#1471)
Co-authored-by: AndreasBerliner <[email protected]>
- Loading branch information
1 parent
e1e7ae0
commit a5d718f
Showing
14 changed files
with
406 additions
and
472 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
registry=https://registry.npmjs.org | ||
@siemens:registry=https://registry.npmjs.org | ||
shamefully-hoist=true | ||
puppeteer_skip_chromium_download=true | ||
puppeteer_skip_chrome_headless_shell_download=true | ||
puppeteer_skip_download=true | ||
link-workspace-packages = deep | ||
prefer-workspace-packages = true | ||
link-workspace-packages=deep | ||
prefer-workspace-packages=true | ||
|
||
# angular-test-app echarts dependency needs public hoisting | ||
public-hoist-pattern[]=zrender | ||
public-hoist-pattern[]=claygl | ||
|
||
# documentation | ||
public-hoist-pattern[]=@docusaurus/* | ||
public-hoist-pattern[]=hogan.js | ||
public-hoist-pattern[]=autocomplete.js | ||
public-hoist-pattern[]=mark.js | ||
public-hoist-pattern[]=lunr | ||
|
||
public-hoist-pattern[]=playwright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ playwright-ct.config.ts | |
playwright.config.ts | ||
stencil.config.ts | ||
src/components.d.ts | ||
scripts/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17914,6 +17914,11 @@ | |
"docstring": "", | ||
"path": "src/components/toast/toast-utils.ts" | ||
}, | ||
"../../node_modules/.pnpm/@[email protected]/node_modules/@stencil/core/internal/stencil-core/index.d.ts::Element": { | ||
"declaration": "any", | ||
"docstring": "", | ||
"path": "../../node_modules/.pnpm/@[email protected]/node_modules/@stencil/core/internal/stencil-core/index.d.ts" | ||
}, | ||
"src/components/tree/tree-model.ts::TreeModel": { | ||
"declaration": "{\n [P in K]: T;\n}", | ||
"docstring": "", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
import { JsonDocs } from '@stencil/core/internal'; | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
|
||
function normalizeProperties(obj: JsonDocs, deleteProps: string[]) { | ||
for (const key in obj) { | ||
if (obj[key] && typeof obj[key] === 'object') { | ||
normalizeProperties(obj[key], deleteProps); | ||
} else if (deleteProps.includes(key)) { | ||
const posixPath = path | ||
.join( | ||
...path | ||
.relative(path.join(__dirname, '..', '..'), obj[key]) | ||
.split(path.sep) | ||
) | ||
.toString(); | ||
obj[key] = posixPath.replace(/\\/g, '/'); | ||
} | ||
} | ||
|
||
return obj; | ||
} | ||
|
||
export const customComponentDocGenerator = (docs: JsonDocs): void => { | ||
// Delete timestamp from docs, because turbo caching not working with autogenerated time | ||
docs.timestamp = ''; | ||
const docsJson = JSON.stringify(docs, null, 2); | ||
|
||
// Remove all paths from component doc | ||
const patchedJson = normalizeProperties(JSON.parse(docsJson), [ | ||
'dirPath', | ||
'filePath', | ||
'readmePath', | ||
'usagesDir', | ||
'path', | ||
]); | ||
|
||
fs.writeFileSync('component-doc.json', JSON.stringify(patchedJson, null, 2)); | ||
}; | ||
|
||
export const getDevAssets = () => { | ||
const copyAssets = [ | ||
{ | ||
src: './../node_modules/@siemens/ix-icons/dist', | ||
dest: 'build/ix-icons', | ||
}, | ||
{ | ||
src: './../node_modules/bootstrap', | ||
dest: 'build/bootstrap', | ||
}, | ||
]; | ||
|
||
try { | ||
const brandTheme = require.resolve('@siemens/ix-brand-theme'); | ||
|
||
if (brandTheme) { | ||
const themeFolder = path.join(brandTheme, '..', '..'); | ||
copyAssets.push({ | ||
src: themeFolder, | ||
dest: 'build/ix-brand-theme', | ||
}); | ||
} | ||
} catch (e) { | ||
console.warn('No additional theme fround'); | ||
} | ||
|
||
return copyAssets; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.