Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8587feb
prep for yarn 4 in gitignore
aeischeid Apr 27, 2026
48b1ecb
basic version bump and config changes for stencil4, TS 5, & React19
aeischeid Apr 27, 2026
3b17207
formating or prettier type changes
aeischeid Apr 28, 2026
5850586
TS tightening & stencil upgrade specific changes
aeischeid Apr 28, 2026
f824a25
muted console.debug in jest setup
aeischeid Apr 28, 2026
e179ee1
fix missing hasGeometry attr
aeischeid Apr 28, 2026
9924829
remove @aee getMarkupElement from viewr-markup
aeischeid Apr 28, 2026
a3f9a32
Moxks and type tightening around png-decoder
aeischeid Apr 28, 2026
cfea7c6
clearLoadingTimer and terminate on webWorker mock
aeischeid Apr 28, 2026
45c10d2
runInBand for jest limit concurancy for stencil
aeischeid Apr 28, 2026
3f6860e
fix png-decoder import issue
aeischeid Apr 28, 2026
8e4072c
update stencil config for new TS plugin
aeischeid Apr 28, 2026
afa7ca8
Merge branch 'master' into newReact19Stencil4
aeischeid Apr 28, 2026
dd52889
Update yarn.lock
aeischeid Apr 28, 2026
a527d05
Update rollup.config to pass inlineDynamicImports: true
aeischeid Apr 28, 2026
59f27b4
Merge branch 'master' into newReact19Stencil4
aeischeid Apr 29, 2026
a21f413
revert doc-viewer packages to private for now
aeischeid Apr 29, 2026
8b0939b
add back working version of `@see` for viewer documentation
aeischeid Apr 29, 2026
14d94b3
add stencilPackageName for reactOutputTarget in viewer
aeischeid Apr 29, 2026
81803f2
update interval type to NodeJS.Timeout per feedback
aeischeid Apr 29, 2026
691e1af
add some readonly specifiers per sonarQube suggestions
aeischeid Apr 29, 2026
1a7586c
remove applyPolyfills from the viewer-vue too
aeischeid Apr 29, 2026
56ba9c1
remove obsolete requestidlecallback polyfill
aeischeid Apr 29, 2026
f7afa72
new lock file after removing polyfill
aeischeid Apr 29, 2026
72c5511
react-output-target needs to be a runtime dep of react packages, but
aeischeid Apr 29, 2026
712fa0b
bump stream-api to ts 5 too, last one
aeischeid Apr 29, 2026
c78e14b
attempt better SSR case for viewer-react
aeischeid Apr 29, 2026
a52ffd4
Revert "attempt better SSR case for viewer-react"
aeischeid Apr 30, 2026
7bda5d3
defensive wrappers around window object to avoid SSR issues
aeischeid Apr 29, 2026
46f1a5a
basic test for SSR safety / via node import try
aeischeid Apr 30, 2026
e29999f
make builder and viewer-react module first bundles
aeischeid Apr 30, 2026
e8313d3
big push to move builds to type:module
aeischeid May 1, 2026
2d301bf
fix postbuild script - which exists to maintain backwards compat with
aeischeid May 1, 2026
867de4d
Potential fix for pull request finding in formate-example.js
aeischeid May 1, 2026
466bab6
more backwards compatible exports map for viewer
aeischeid May 1, 2026
55bb5ef
address sonar complaints in short term way so i can test builds
aeischeid May 1, 2026
6cb4499
use explict prettier deb more directly
aeischeid May 1, 2026
7e92766
minor update to lockfile for prettier
aeischeid May 1, 2026
b8c96b1
Merge branch 'master' into newReact19Stencil4
aeischeid May 1, 2026
9e26ec1
remove nomodule fallbacks in examples that pointed to artifacts that
aeischeid May 1, 2026
b446dfa
have doc-viewer exports/bundles match viewer
aeischeid May 1, 2026
d181168
will do withouth html comment lines and have examples in readme instead
aeischeid May 1, 2026
2ae52f1
had to rename lint config files after changing to type module in
aeischeid May 1, 2026
8bcc23b
Merge branch 'master' into newReact19Stencil4
aeischeid May 1, 2026
3a394f9
new yarn.lock after merge main
aeischeid May 1, 2026
525b825
Merge branch 'master' into newReact19Stencil4
aeischeid May 4, 2026
76857ad
fix botched conflict resolve done via GH ui
aeischeid May 4, 2026
4235cf0
fix another unresolved merge
aeischeid May 4, 2026
72d3efd
newly generated lock
aeischeid May 4, 2026
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jspm_packages/

# Yarn Integrity file
.yarn-integrity
.yarn/install-state.gz

# dotenv environment variables file
.env
Expand Down Expand Up @@ -84,4 +85,4 @@ generated/
# Ignore TSDoc directory
docs/

.tool-versions
.tool-versions
4 changes: 4 additions & 0 deletions internal/build/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ const jestConfig = require('@vertexvis/jest-config-vertexvis/jest.config');

module.exports = {
...jestConfig,
setupFilesAfterEnv: [
...(jestConfig.setupFilesAfterEnv || []),
'<rootDir>/../../jest.setup.console.js',
],
coverageThreshold: {
global: {
branches: 90,
Expand Down
16 changes: 10 additions & 6 deletions internal/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,30 @@
"scripts": {
"clean": "rm -fr ./dist && mkdir ./dist",
"prebuild": "yarn clean",
"build": "rollup --config ./rollup.config.js",
"build": "rollup --config ./rollup.config.js && tsc --project tsconfig.json --emitDeclarationOnly --declaration --outDir dist",
"format": "yarn lint --fix",
"lint": "eslint --ext .ts,.tsx,.js,.jsx --ignore-path ../../.gitignore .",
"start": "jest --watch",
"test": "jest",
"test": "jest --runInBand",
"test:coverage": "yarn test --coverage"
},
"dependencies": {
"@rollup/plugin-commonjs": "^21.1.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@vertexvis/build-tools": "^0.10.2",
Comment thread
aeischeid marked this conversation as resolved.
Outdated
"@vertexvis/typescript-config-vertexvis": "1.1.0",
"tslib": "^2.1.0"
"rollup-plugin-terser": "^7.0.2",
"tslib": "^2.4.0",
"typescript": "^5.2.0"
},
"devDependencies": {
"@types/jest": "^27.5.1",
"@types/jest": "^29.5.14",
"@vertexvis/eslint-config-vertexvis-typescript": "^0.5.0",
"@vertexvis/jest-config-vertexvis": "^0.5.4",
"eslint": "^8.57.1",
"jest": "^27.5.1",
"jest": "^29.5.14",
"rollup": "^2.80.0",
"ts-jest": "^27.1.4"
"ts-jest": "^29.4.9"
},
"peerDependencies": {
"rollup": "^2"
Expand Down
116 changes: 111 additions & 5 deletions internal/build/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,113 @@
import { config, input, output, typescript } from '@vertexvis/build-tools';
import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import fs from 'fs';

Check warning on line 3 in internal/build/rollup.config.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `node:fs` over `fs`.

See more on https://sonarcloud.io/project/issues?id=Vertexvis_vertex-web-sdk&issues=AZ3U0_J9Jnsbue2gJUbc&open=AZ3U0_J9Jnsbue2gJUbc&pullRequest=763
import { builtinModules } from 'module';

Check warning on line 4 in internal/build/rollup.config.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `node:module` over `module`.

See more on https://sonarcloud.io/project/issues?id=Vertexvis_vertex-web-sdk&issues=AZ3U0_J9Jnsbue2gJUbd&open=AZ3U0_J9Jnsbue2gJUbd&pullRequest=763
// TODO: update some TS stuff in build-tools so we can use that again here.

Check warning on line 5 in internal/build/rollup.config.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this "TODO" comment.

See more on https://sonarcloud.io/project/issues?id=Vertexvis_vertex-web-sdk&issues=AZ3WZ-chMYklAafZqYth&open=AZ3WZ-chMYklAafZqYth&pullRequest=763
// import { config, input, output, typescript } from '@vertexvis/build-tools';
import path from 'path';

Check warning on line 7 in internal/build/rollup.config.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `node:path` over `path`.

See more on https://sonarcloud.io/project/issues?id=Vertexvis_vertex-web-sdk&issues=AZ3U0_J9Jnsbue2gJUbe&open=AZ3U0_J9Jnsbue2gJUbe&pullRequest=763
import ts from 'typescript';

export default config(
input('src/index.ts'),
typescript(),
output({ enableInlineDynamicImports: true })
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The common build-tool config was abandoned for this package. This was somewhat a decision I inherited from the initial draft PR ( #729 ). I have tried to understand if I could update build-tools instead, but haven't had too much success with that so far. Maybe for now there is a way to just incorporate this enableInlineDynamicImports bit into this custom config? But, also at a bit at a loss on how exactly to accomplish that, or how to test if it is done correctly. Looking for feedback on the later part from @amvertex since that was added recently by them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think I figured this out, not how to test it, but should be ready to test

function loadTsConfig(tsconfigPath) {
const configFile = ts.readConfigFile(tsconfigPath, ts.sys.readFile);
if (configFile.error != null) {
throw new Error(
ts.formatDiagnosticsWithColorAndContext([configFile.error], {
getCanonicalFileName: (fileName) => fileName,
getCurrentDirectory: () => process.cwd(),
getNewLine: () => '\n',
})
);
}

return ts.parseJsonConfigFileContent(
configFile.config,
ts.sys,
path.dirname(tsconfigPath),
undefined,
tsconfigPath
);
}

function createTypeScriptPlugin() {
const parsedConfig = loadTsConfig(
path.resolve(process.cwd(), 'tsconfig.json')
);
const transpileOptions = {
...parsedConfig.options,
declaration: false,
declarationMap: false,
module: ts.ModuleKind.ESNext,
noEmit: false,
};

return {
name: 'vertex-typescript',
transform(source, id) {
if (!/\.(ts|tsx)$/.test(id) || id.endsWith('.d.ts')) {
return null;
}

const transpiled = ts.transpileModule(source, {
compilerOptions: transpileOptions,
fileName: id,
reportDiagnostics: true,
});

const errors = (transpiled.diagnostics ?? []).filter(
(diagnostic) => diagnostic.category === ts.DiagnosticCategory.Error
);
if (errors.length > 0) {
this.error(
ts.formatDiagnosticsWithColorAndContext(errors, {
getCanonicalFileName: (fileName) => fileName,
getCurrentDirectory: () => process.cwd(),
getNewLine: () => '\n',
})
);
}

return {
code: transpiled.outputText,
map:
transpiled.sourceMapText != null
? JSON.parse(transpiled.sourceMapText)
: null,
};
},
};
}

const packageJson = JSON.parse(
fs.readFileSync(new URL('./package.json', import.meta.url), 'utf8')
);
const builtins = builtinModules.flatMap((module) => [module, `node:${module}`]);

export default {
external: [
...builtins,
...Object.keys(packageJson.dependencies ?? {}),
...Object.keys(packageJson.peerDependencies ?? {}),
],
input: 'src/index.ts',
output: [
{
file: 'dist/bundle.cjs.js',
format: 'cjs',
sourcemap: true,
inlineDynamicImports: true,
},
{
file: 'dist/bundle.esm.js',
format: 'esm',
sourcemap: true,
inlineDynamicImports: true,
},
],
plugins: [
nodeResolve({
extensions: ['.mjs', '.js', '.json', '.node', '.ts', '.tsx'],
}),
commonjs(),
createTypeScriptPlugin(),
],
};
Loading
Loading