diff --git a/buildDEV.bat b/buildDEV.bat new file mode 100644 index 000000000..655e3e282 --- /dev/null +++ b/buildDEV.bat @@ -0,0 +1,168 @@ +rem Builds all packages and demos in dev mode (no minification, with source maps, no tests, no lint) +rem Use this for browser debugging. The resulting bundles will be unminified and include source maps. + +call node --version +call npm --version + +rem Install all demos first so that npm install can symlink the packages +pushd demos\compareJSON +call npm install +popd + +pushd demos\compareSolutions +call npm install +popd + +pushd demos\copyItemInfo +call npm install +popd + +pushd demos\copySolutions +call npm install +popd + +pushd demos\createSolution +call npm install +popd + +pushd demos\deleteSolution +call npm install +popd + +pushd demos\deploySolution +call npm install +popd + +pushd demos\getItemInfo +call npm install +popd + +pushd demos\implementedTypes +call npm install +popd + +pushd demos\recreateSolution +call npm install +popd + +pushd demos\reuseDeployedItems +call npm install +popd + +pushd demos\verifySolution +call npm install +popd + +rem Install root and build all packages with source maps enabled +call npm install + +rem Build packages (ESM + CJS) — pass dev-only compiler overrides +call npm run build:esm -- -- --sourceMap --declarationMap +call npm run build:cjs -- -- --sourceMap --declarationMap + +call commit-stamp.bat + +rem Delete dist package.json files (root, esm, and cjs) so that webpack does not +rem treat the compiled output as strict ESM. The dist/esm/package.json contains +rem {"type":"module"}, which forces webpack to require explicit .js extensions +rem on every relative import — but the TypeScript output uses extensionless +rem paths, so resolution fails. The standard build.bat deletes these for the +rem same reason. +del/q packages\common\dist\package.json 2>nul +del/q packages\common\dist\cjs\package.json 2>nul +del/q packages\common\dist\esm\package.json 2>nul +del/q packages\creator\dist\package.json 2>nul +del/q packages\creator\dist\cjs\package.json 2>nul +del/q packages\creator\dist\esm\package.json 2>nul +del/q packages\deployer\dist\package.json 2>nul +del/q packages\deployer\dist\cjs\package.json 2>nul +del/q packages\deployer\dist\esm\package.json 2>nul +del/q packages\feature-layer\dist\package.json 2>nul +del/q packages\feature-layer\dist\cjs\package.json 2>nul +del/q packages\feature-layer\dist\esm\package.json 2>nul +del/q packages\file\dist\package.json 2>nul +del/q packages\file\dist\cjs\package.json 2>nul +del/q packages\file\dist\esm\package.json 2>nul +del/q packages\form\dist\package.json 2>nul +del/q packages\form\dist\cjs\package.json 2>nul +del/q packages\form\dist\esm\package.json 2>nul +del/q packages\group\dist\package.json 2>nul +del/q packages\group\dist\cjs\package.json 2>nul +del/q packages\group\dist\esm\package.json 2>nul +del/q packages\hub-types\dist\package.json 2>nul +del/q packages\hub-types\dist\cjs\package.json 2>nul +del/q packages\hub-types\dist\esm\package.json 2>nul +del/q packages\simple-types\dist\package.json 2>nul +del/q packages\simple-types\dist\cjs\package.json 2>nul +del/q packages\simple-types\dist\esm\package.json 2>nul +del/q packages\storymap\dist\package.json 2>nul +del/q packages\storymap\dist\cjs\package.json 2>nul +del/q packages\storymap\dist\esm\package.json 2>nul +del/q packages\velocity\dist\package.json 2>nul +del/q packages\velocity\dist\cjs\package.json 2>nul +del/q packages\velocity\dist\esm\package.json 2>nul +del/q packages\viewer\dist\package.json 2>nul +del/q packages\viewer\dist\cjs\package.json 2>nul +del/q packages\viewer\dist\esm\package.json 2>nul +del/q packages\web-experience\dist\package.json 2>nul +del/q packages\web-experience\dist\cjs\package.json 2>nul +del/q packages\web-experience\dist\esm\package.json 2>nul +del/q packages\web-tool\dist\package.json 2>nul +del/q packages\web-tool\dist\cjs\package.json 2>nul +del/q packages\web-tool\dist\esm\package.json 2>nul +del/q packages\workflow\dist\package.json 2>nul +del/q packages\workflow\dist\cjs\package.json 2>nul +del/q packages\workflow\dist\esm\package.json 2>nul + +rem Build all demos in development mode (unminified, readable) +pushd demos\compareJSON +call npx webpack --mode=development +popd + +pushd demos\compareSolutions +call npx webpack --mode=development +popd + +pushd demos\copyItemInfo +call npx webpack --mode=development +popd + +pushd demos\copySolutions +call npx webpack --mode=development +popd + +pushd demos\createSolution +call npx webpack --mode=development +popd + +pushd demos\deleteSolution +call npx webpack --mode=development +popd + +pushd demos\deploySolution +call npm run prebuild +call npx webpack --mode=development +popd + +pushd demos\getItemInfo +call npx webpack --mode=development +popd + +pushd demos\implementedTypes +call npx webpack --mode=development +popd + +pushd demos\recreateSolution +call npx webpack --mode=development +popd + +pushd demos\reuseDeployedItems +call npx webpack --mode=development +popd + +pushd demos\verifySolution +call npx webpack --mode=development +popd + +echo. +echo DEV build complete. All demo bundles are unminified with source maps. diff --git a/demos/compareJSON/package-lock.json b/demos/compareJSON/package-lock.json index 72d766ce1..f45be8f1d 100644 --- a/demos/compareJSON/package-lock.json +++ b/demos/compareJSON/package-lock.json @@ -2344,4 +2344,4 @@ "license": "MIT" } } -} \ No newline at end of file +} diff --git a/demos/compareJSON/webpack.config.js b/demos/compareJSON/webpack.config.js index 3cbc672d8..0c840fea8 100644 --- a/demos/compareJSON/webpack.config.js +++ b/demos/compareJSON/webpack.config.js @@ -3,6 +3,24 @@ const path = require('path'); const isProduction = process.env.NODE_ENV == 'production'; +const createDevAliases = () => ({ + '@esri/solution-common': path.resolve(__dirname, '../../packages/common/src/index.ts'), + '@esri/solution-creator': path.resolve(__dirname, '../../packages/creator/src/index.ts'), + '@esri/solution-deployer': path.resolve(__dirname, '../../packages/deployer/src/index.ts'), + '@esri/solution-feature-layer': path.resolve(__dirname, '../../packages/feature-layer/src/index.ts'), + '@esri/solution-file': path.resolve(__dirname, '../../packages/file/src/index.ts'), + '@esri/solution-form': path.resolve(__dirname, '../../packages/form/src/index.ts'), + '@esri/solution-group': path.resolve(__dirname, '../../packages/group/src/index.ts'), + '@esri/solution-hub-types': path.resolve(__dirname, '../../packages/hub-types/src/index.ts'), + '@esri/solution-simple-types': path.resolve(__dirname, '../../packages/simple-types/src/index.ts'), + '@esri/solution-storymap': path.resolve(__dirname, '../../packages/storymap/src/index.ts'), + '@esri/solution-velocity': path.resolve(__dirname, '../../packages/velocity/src/index.ts'), + '@esri/solution-viewer': path.resolve(__dirname, '../../packages/viewer/src/index.ts'), + '@esri/solution-web-experience': path.resolve(__dirname, '../../packages/web-experience/src/index.ts'), + '@esri/solution-web-tool': path.resolve(__dirname, '../../packages/web-tool/src/index.ts'), + '@esri/solution-workflow': path.resolve(__dirname, '../../packages/workflow/src/index.ts'), +}); + const config = { entry: './src/index.ts', output: { @@ -16,7 +34,12 @@ const config = { module: { rules: [{ test: /\.(ts|tsx)$/i, - loader: 'ts-loader', + use: { + loader: 'ts-loader', + options: { + transpileOnly: !isProduction, + }, + }, exclude: ['/node_modules/'], },{ test: /\.css$/i, @@ -37,6 +60,11 @@ module.exports = () => { config.mode = 'production'; } else { config.mode = 'development'; + config.devtool = 'source-map'; + config.resolve.alias = { + ...(config.resolve.alias || {}), + ...createDevAliases(), + }; } return config; }; diff --git a/demos/compareSolutions/package-lock.json b/demos/compareSolutions/package-lock.json index 82c65007a..2d013873c 100644 --- a/demos/compareSolutions/package-lock.json +++ b/demos/compareSolutions/package-lock.json @@ -2328,4 +2328,4 @@ "license": "MIT" } } -} \ No newline at end of file +} diff --git a/demos/compareSolutions/webpack.config.js b/demos/compareSolutions/webpack.config.js index f668c93a1..77e238e19 100644 --- a/demos/compareSolutions/webpack.config.js +++ b/demos/compareSolutions/webpack.config.js @@ -3,6 +3,24 @@ const path = require('path'); const isProduction = process.env.NODE_ENV == 'production'; +const createDevAliases = () => ({ + '@esri/solution-common': path.resolve(__dirname, '../../packages/common/src/index.ts'), + '@esri/solution-creator': path.resolve(__dirname, '../../packages/creator/src/index.ts'), + '@esri/solution-deployer': path.resolve(__dirname, '../../packages/deployer/src/index.ts'), + '@esri/solution-feature-layer': path.resolve(__dirname, '../../packages/feature-layer/src/index.ts'), + '@esri/solution-file': path.resolve(__dirname, '../../packages/file/src/index.ts'), + '@esri/solution-form': path.resolve(__dirname, '../../packages/form/src/index.ts'), + '@esri/solution-group': path.resolve(__dirname, '../../packages/group/src/index.ts'), + '@esri/solution-hub-types': path.resolve(__dirname, '../../packages/hub-types/src/index.ts'), + '@esri/solution-simple-types': path.resolve(__dirname, '../../packages/simple-types/src/index.ts'), + '@esri/solution-storymap': path.resolve(__dirname, '../../packages/storymap/src/index.ts'), + '@esri/solution-velocity': path.resolve(__dirname, '../../packages/velocity/src/index.ts'), + '@esri/solution-viewer': path.resolve(__dirname, '../../packages/viewer/src/index.ts'), + '@esri/solution-web-experience': path.resolve(__dirname, '../../packages/web-experience/src/index.ts'), + '@esri/solution-web-tool': path.resolve(__dirname, '../../packages/web-tool/src/index.ts'), + '@esri/solution-workflow': path.resolve(__dirname, '../../packages/workflow/src/index.ts'), +}); + const config = { entry: './src/index.ts', output: { @@ -16,7 +34,12 @@ const config = { module: { rules: [{ test: /\.(ts|tsx)$/i, - loader: 'ts-loader', + use: { + loader: 'ts-loader', + options: { + transpileOnly: !isProduction, + }, + }, exclude: ['/node_modules/'], },{ test: /\.css$/i, @@ -37,12 +60,17 @@ module.exports = () => { config.mode = 'production'; } else { config.mode = 'development'; + config.devtool = 'source-map'; + config.resolve.alias = { + ...(config.resolve.alias || {}), + ...createDevAliases(), + }; } config.experiments = { ...config.experiments, topLevelAwait: true - } + }; return config; }; diff --git a/demos/copyItemInfo/package-lock.json b/demos/copyItemInfo/package-lock.json index 19c4c8e84..386920eef 100644 --- a/demos/copyItemInfo/package-lock.json +++ b/demos/copyItemInfo/package-lock.json @@ -2344,4 +2344,4 @@ "license": "MIT" } } -} \ No newline at end of file +} diff --git a/demos/copyItemInfo/webpack.config.js b/demos/copyItemInfo/webpack.config.js index 3cbc672d8..0c840fea8 100644 --- a/demos/copyItemInfo/webpack.config.js +++ b/demos/copyItemInfo/webpack.config.js @@ -3,6 +3,24 @@ const path = require('path'); const isProduction = process.env.NODE_ENV == 'production'; +const createDevAliases = () => ({ + '@esri/solution-common': path.resolve(__dirname, '../../packages/common/src/index.ts'), + '@esri/solution-creator': path.resolve(__dirname, '../../packages/creator/src/index.ts'), + '@esri/solution-deployer': path.resolve(__dirname, '../../packages/deployer/src/index.ts'), + '@esri/solution-feature-layer': path.resolve(__dirname, '../../packages/feature-layer/src/index.ts'), + '@esri/solution-file': path.resolve(__dirname, '../../packages/file/src/index.ts'), + '@esri/solution-form': path.resolve(__dirname, '../../packages/form/src/index.ts'), + '@esri/solution-group': path.resolve(__dirname, '../../packages/group/src/index.ts'), + '@esri/solution-hub-types': path.resolve(__dirname, '../../packages/hub-types/src/index.ts'), + '@esri/solution-simple-types': path.resolve(__dirname, '../../packages/simple-types/src/index.ts'), + '@esri/solution-storymap': path.resolve(__dirname, '../../packages/storymap/src/index.ts'), + '@esri/solution-velocity': path.resolve(__dirname, '../../packages/velocity/src/index.ts'), + '@esri/solution-viewer': path.resolve(__dirname, '../../packages/viewer/src/index.ts'), + '@esri/solution-web-experience': path.resolve(__dirname, '../../packages/web-experience/src/index.ts'), + '@esri/solution-web-tool': path.resolve(__dirname, '../../packages/web-tool/src/index.ts'), + '@esri/solution-workflow': path.resolve(__dirname, '../../packages/workflow/src/index.ts'), +}); + const config = { entry: './src/index.ts', output: { @@ -16,7 +34,12 @@ const config = { module: { rules: [{ test: /\.(ts|tsx)$/i, - loader: 'ts-loader', + use: { + loader: 'ts-loader', + options: { + transpileOnly: !isProduction, + }, + }, exclude: ['/node_modules/'], },{ test: /\.css$/i, @@ -37,6 +60,11 @@ module.exports = () => { config.mode = 'production'; } else { config.mode = 'development'; + config.devtool = 'source-map'; + config.resolve.alias = { + ...(config.resolve.alias || {}), + ...createDevAliases(), + }; } return config; }; diff --git a/demos/copySolutions/package-lock.json b/demos/copySolutions/package-lock.json index ee332b23f..855d9a769 100644 --- a/demos/copySolutions/package-lock.json +++ b/demos/copySolutions/package-lock.json @@ -2719,4 +2719,4 @@ "license": "MIT" } } -} \ No newline at end of file +} diff --git a/demos/copySolutions/webpack.config.js b/demos/copySolutions/webpack.config.js index de935d6d9..488dce1e3 100644 --- a/demos/copySolutions/webpack.config.js +++ b/demos/copySolutions/webpack.config.js @@ -1,22 +1,32 @@ -const CopyPlugin = require('copy-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const path = require('path'); const isProduction = process.env.NODE_ENV == 'production'; +const createDevAliases = () => ({ + '@esri/solution-common': path.resolve(__dirname, '../../packages/common/src/index.ts'), + '@esri/solution-creator': path.resolve(__dirname, '../../packages/creator/src/index.ts'), + '@esri/solution-deployer': path.resolve(__dirname, '../../packages/deployer/src/index.ts'), + '@esri/solution-feature-layer': path.resolve(__dirname, '../../packages/feature-layer/src/index.ts'), + '@esri/solution-file': path.resolve(__dirname, '../../packages/file/src/index.ts'), + '@esri/solution-form': path.resolve(__dirname, '../../packages/form/src/index.ts'), + '@esri/solution-group': path.resolve(__dirname, '../../packages/group/src/index.ts'), + '@esri/solution-hub-types': path.resolve(__dirname, '../../packages/hub-types/src/index.ts'), + '@esri/solution-simple-types': path.resolve(__dirname, '../../packages/simple-types/src/index.ts'), + '@esri/solution-storymap': path.resolve(__dirname, '../../packages/storymap/src/index.ts'), + '@esri/solution-velocity': path.resolve(__dirname, '../../packages/velocity/src/index.ts'), + '@esri/solution-viewer': path.resolve(__dirname, '../../packages/viewer/src/index.ts'), + '@esri/solution-web-experience': path.resolve(__dirname, '../../packages/web-experience/src/index.ts'), + '@esri/solution-web-tool': path.resolve(__dirname, '../../packages/web-tool/src/index.ts'), + '@esri/solution-workflow': path.resolve(__dirname, '../../packages/workflow/src/index.ts'), +}); + const config = { entry: './src/index.ts', output: { path: path.resolve(__dirname, 'dist'), }, plugins: [ - new CopyPlugin({ - patterns: [ - { // Image assets - from: 'src/images' - }, - ] - }), new HtmlWebpackPlugin({ template: 'index.html', }), @@ -24,7 +34,12 @@ const config = { module: { rules: [{ test: /\.(ts|tsx)$/i, - loader: 'ts-loader', + use: { + loader: 'ts-loader', + options: { + transpileOnly: !isProduction, + }, + }, exclude: ['/node_modules/'], },{ test: /\.css$/i, @@ -40,6 +55,19 @@ const config = { }, }; +module.exports = () => { + if (isProduction) { + config.mode = 'production'; + } else { + config.mode = 'development'; + config.devtool = 'source-map'; + config.resolve.alias = { + ...(config.resolve.alias || {}), + ...createDevAliases(), + }; + } + return config; +}; module.exports = () => { if (isProduction) { config.mode = 'production'; diff --git a/demos/createSolution/package-lock.json b/demos/createSolution/package-lock.json index d112082c8..e9256150c 100644 --- a/demos/createSolution/package-lock.json +++ b/demos/createSolution/package-lock.json @@ -2350,4 +2350,4 @@ "license": "MIT" } } -} \ No newline at end of file +} diff --git a/demos/createSolution/webpack.config.js b/demos/createSolution/webpack.config.js index 3cbc672d8..0c840fea8 100644 --- a/demos/createSolution/webpack.config.js +++ b/demos/createSolution/webpack.config.js @@ -3,6 +3,24 @@ const path = require('path'); const isProduction = process.env.NODE_ENV == 'production'; +const createDevAliases = () => ({ + '@esri/solution-common': path.resolve(__dirname, '../../packages/common/src/index.ts'), + '@esri/solution-creator': path.resolve(__dirname, '../../packages/creator/src/index.ts'), + '@esri/solution-deployer': path.resolve(__dirname, '../../packages/deployer/src/index.ts'), + '@esri/solution-feature-layer': path.resolve(__dirname, '../../packages/feature-layer/src/index.ts'), + '@esri/solution-file': path.resolve(__dirname, '../../packages/file/src/index.ts'), + '@esri/solution-form': path.resolve(__dirname, '../../packages/form/src/index.ts'), + '@esri/solution-group': path.resolve(__dirname, '../../packages/group/src/index.ts'), + '@esri/solution-hub-types': path.resolve(__dirname, '../../packages/hub-types/src/index.ts'), + '@esri/solution-simple-types': path.resolve(__dirname, '../../packages/simple-types/src/index.ts'), + '@esri/solution-storymap': path.resolve(__dirname, '../../packages/storymap/src/index.ts'), + '@esri/solution-velocity': path.resolve(__dirname, '../../packages/velocity/src/index.ts'), + '@esri/solution-viewer': path.resolve(__dirname, '../../packages/viewer/src/index.ts'), + '@esri/solution-web-experience': path.resolve(__dirname, '../../packages/web-experience/src/index.ts'), + '@esri/solution-web-tool': path.resolve(__dirname, '../../packages/web-tool/src/index.ts'), + '@esri/solution-workflow': path.resolve(__dirname, '../../packages/workflow/src/index.ts'), +}); + const config = { entry: './src/index.ts', output: { @@ -16,7 +34,12 @@ const config = { module: { rules: [{ test: /\.(ts|tsx)$/i, - loader: 'ts-loader', + use: { + loader: 'ts-loader', + options: { + transpileOnly: !isProduction, + }, + }, exclude: ['/node_modules/'], },{ test: /\.css$/i, @@ -37,6 +60,11 @@ module.exports = () => { config.mode = 'production'; } else { config.mode = 'development'; + config.devtool = 'source-map'; + config.resolve.alias = { + ...(config.resolve.alias || {}), + ...createDevAliases(), + }; } return config; }; diff --git a/demos/deleteSolution/package-lock.json b/demos/deleteSolution/package-lock.json index 5a4c5d014..33f87faef 100644 --- a/demos/deleteSolution/package-lock.json +++ b/demos/deleteSolution/package-lock.json @@ -2351,4 +2351,4 @@ "license": "MIT" } } -} \ No newline at end of file +} diff --git a/demos/deleteSolution/webpack.config.js b/demos/deleteSolution/webpack.config.js index 3cbc672d8..0c840fea8 100644 --- a/demos/deleteSolution/webpack.config.js +++ b/demos/deleteSolution/webpack.config.js @@ -3,6 +3,24 @@ const path = require('path'); const isProduction = process.env.NODE_ENV == 'production'; +const createDevAliases = () => ({ + '@esri/solution-common': path.resolve(__dirname, '../../packages/common/src/index.ts'), + '@esri/solution-creator': path.resolve(__dirname, '../../packages/creator/src/index.ts'), + '@esri/solution-deployer': path.resolve(__dirname, '../../packages/deployer/src/index.ts'), + '@esri/solution-feature-layer': path.resolve(__dirname, '../../packages/feature-layer/src/index.ts'), + '@esri/solution-file': path.resolve(__dirname, '../../packages/file/src/index.ts'), + '@esri/solution-form': path.resolve(__dirname, '../../packages/form/src/index.ts'), + '@esri/solution-group': path.resolve(__dirname, '../../packages/group/src/index.ts'), + '@esri/solution-hub-types': path.resolve(__dirname, '../../packages/hub-types/src/index.ts'), + '@esri/solution-simple-types': path.resolve(__dirname, '../../packages/simple-types/src/index.ts'), + '@esri/solution-storymap': path.resolve(__dirname, '../../packages/storymap/src/index.ts'), + '@esri/solution-velocity': path.resolve(__dirname, '../../packages/velocity/src/index.ts'), + '@esri/solution-viewer': path.resolve(__dirname, '../../packages/viewer/src/index.ts'), + '@esri/solution-web-experience': path.resolve(__dirname, '../../packages/web-experience/src/index.ts'), + '@esri/solution-web-tool': path.resolve(__dirname, '../../packages/web-tool/src/index.ts'), + '@esri/solution-workflow': path.resolve(__dirname, '../../packages/workflow/src/index.ts'), +}); + const config = { entry: './src/index.ts', output: { @@ -16,7 +34,12 @@ const config = { module: { rules: [{ test: /\.(ts|tsx)$/i, - loader: 'ts-loader', + use: { + loader: 'ts-loader', + options: { + transpileOnly: !isProduction, + }, + }, exclude: ['/node_modules/'], },{ test: /\.css$/i, @@ -37,6 +60,11 @@ module.exports = () => { config.mode = 'production'; } else { config.mode = 'development'; + config.devtool = 'source-map'; + config.resolve.alias = { + ...(config.resolve.alias || {}), + ...createDevAliases(), + }; } return config; }; diff --git a/demos/deploySolution/package-lock.json b/demos/deploySolution/package-lock.json index b62da4706..d81c3f700 100644 --- a/demos/deploySolution/package-lock.json +++ b/demos/deploySolution/package-lock.json @@ -2357,4 +2357,4 @@ "license": "MIT" } } -} \ No newline at end of file +} diff --git a/demos/deploySolution/webpack.config.js b/demos/deploySolution/webpack.config.js index 05e474c26..8f594ec6c 100644 --- a/demos/deploySolution/webpack.config.js +++ b/demos/deploySolution/webpack.config.js @@ -3,6 +3,24 @@ const path = require('path'); const isProduction = process.env.NODE_ENV == 'production'; +const createDevAliases = () => ({ + '@esri/solution-common': path.resolve(__dirname, '../../packages/common/src/index.ts'), + '@esri/solution-creator': path.resolve(__dirname, '../../packages/creator/src/index.ts'), + '@esri/solution-deployer': path.resolve(__dirname, '../../packages/deployer/src/index.ts'), + '@esri/solution-feature-layer': path.resolve(__dirname, '../../packages/feature-layer/src/index.ts'), + '@esri/solution-file': path.resolve(__dirname, '../../packages/file/src/index.ts'), + '@esri/solution-form': path.resolve(__dirname, '../../packages/form/src/index.ts'), + '@esri/solution-group': path.resolve(__dirname, '../../packages/group/src/index.ts'), + '@esri/solution-hub-types': path.resolve(__dirname, '../../packages/hub-types/src/index.ts'), + '@esri/solution-simple-types': path.resolve(__dirname, '../../packages/simple-types/src/index.ts'), + '@esri/solution-storymap': path.resolve(__dirname, '../../packages/storymap/src/index.ts'), + '@esri/solution-velocity': path.resolve(__dirname, '../../packages/velocity/src/index.ts'), + '@esri/solution-viewer': path.resolve(__dirname, '../../packages/viewer/src/index.ts'), + '@esri/solution-web-experience': path.resolve(__dirname, '../../packages/web-experience/src/index.ts'), + '@esri/solution-web-tool': path.resolve(__dirname, '../../packages/web-tool/src/index.ts'), + '@esri/solution-workflow': path.resolve(__dirname, '../../packages/workflow/src/index.ts'), +}); + const config = { entry: { main: './src/index.ts', @@ -26,7 +44,12 @@ const config = { module: { rules: [{ test: /\.(ts|tsx)$/i, - loader: 'ts-loader', + use: { + loader: 'ts-loader', + options: { + transpileOnly: !isProduction, + }, + }, exclude: ['/node_modules/'], },{ test: /\.css$/i, @@ -47,6 +70,11 @@ module.exports = () => { config.mode = 'production'; } else { config.mode = 'development'; + config.devtool = 'source-map'; + config.resolve.alias = { + ...(config.resolve.alias || {}), + ...createDevAliases(), + }; } return config; }; diff --git a/demos/getItemInfo/package-lock.json b/demos/getItemInfo/package-lock.json index 87724023e..21f22acd5 100644 --- a/demos/getItemInfo/package-lock.json +++ b/demos/getItemInfo/package-lock.json @@ -2344,4 +2344,4 @@ "license": "MIT" } } -} \ No newline at end of file +} diff --git a/demos/getItemInfo/webpack.config.js b/demos/getItemInfo/webpack.config.js index f668c93a1..42b61a300 100644 --- a/demos/getItemInfo/webpack.config.js +++ b/demos/getItemInfo/webpack.config.js @@ -3,6 +3,24 @@ const path = require('path'); const isProduction = process.env.NODE_ENV == 'production'; +const createDevAliases = () => ({ + '@esri/solution-common': path.resolve(__dirname, '../../packages/common/src/index.ts'), + '@esri/solution-creator': path.resolve(__dirname, '../../packages/creator/src/index.ts'), + '@esri/solution-deployer': path.resolve(__dirname, '../../packages/deployer/src/index.ts'), + '@esri/solution-feature-layer': path.resolve(__dirname, '../../packages/feature-layer/src/index.ts'), + '@esri/solution-file': path.resolve(__dirname, '../../packages/file/src/index.ts'), + '@esri/solution-form': path.resolve(__dirname, '../../packages/form/src/index.ts'), + '@esri/solution-group': path.resolve(__dirname, '../../packages/group/src/index.ts'), + '@esri/solution-hub-types': path.resolve(__dirname, '../../packages/hub-types/src/index.ts'), + '@esri/solution-simple-types': path.resolve(__dirname, '../../packages/simple-types/src/index.ts'), + '@esri/solution-storymap': path.resolve(__dirname, '../../packages/storymap/src/index.ts'), + '@esri/solution-velocity': path.resolve(__dirname, '../../packages/velocity/src/index.ts'), + '@esri/solution-viewer': path.resolve(__dirname, '../../packages/viewer/src/index.ts'), + '@esri/solution-web-experience': path.resolve(__dirname, '../../packages/web-experience/src/index.ts'), + '@esri/solution-web-tool': path.resolve(__dirname, '../../packages/web-tool/src/index.ts'), + '@esri/solution-workflow': path.resolve(__dirname, '../../packages/workflow/src/index.ts'), +}); + const config = { entry: './src/index.ts', output: { @@ -16,7 +34,12 @@ const config = { module: { rules: [{ test: /\.(ts|tsx)$/i, - loader: 'ts-loader', + use: { + loader: 'ts-loader', + options: { + transpileOnly: !isProduction, + }, + }, exclude: ['/node_modules/'], },{ test: /\.css$/i, @@ -37,6 +60,11 @@ module.exports = () => { config.mode = 'production'; } else { config.mode = 'development'; + config.devtool = 'source-map'; + config.resolve.alias = { + ...(config.resolve.alias || {}), + ...createDevAliases(), + }; } config.experiments = { @@ -45,4 +73,4 @@ module.exports = () => { } return config; -}; +}; \ No newline at end of file diff --git a/demos/implementedTypes/package-lock.json b/demos/implementedTypes/package-lock.json index c4a6ae46e..a305740bc 100644 --- a/demos/implementedTypes/package-lock.json +++ b/demos/implementedTypes/package-lock.json @@ -2336,4 +2336,4 @@ "license": "MIT" } } -} \ No newline at end of file +} diff --git a/demos/implementedTypes/webpack.config.js b/demos/implementedTypes/webpack.config.js index f668c93a1..77e238e19 100644 --- a/demos/implementedTypes/webpack.config.js +++ b/demos/implementedTypes/webpack.config.js @@ -3,6 +3,24 @@ const path = require('path'); const isProduction = process.env.NODE_ENV == 'production'; +const createDevAliases = () => ({ + '@esri/solution-common': path.resolve(__dirname, '../../packages/common/src/index.ts'), + '@esri/solution-creator': path.resolve(__dirname, '../../packages/creator/src/index.ts'), + '@esri/solution-deployer': path.resolve(__dirname, '../../packages/deployer/src/index.ts'), + '@esri/solution-feature-layer': path.resolve(__dirname, '../../packages/feature-layer/src/index.ts'), + '@esri/solution-file': path.resolve(__dirname, '../../packages/file/src/index.ts'), + '@esri/solution-form': path.resolve(__dirname, '../../packages/form/src/index.ts'), + '@esri/solution-group': path.resolve(__dirname, '../../packages/group/src/index.ts'), + '@esri/solution-hub-types': path.resolve(__dirname, '../../packages/hub-types/src/index.ts'), + '@esri/solution-simple-types': path.resolve(__dirname, '../../packages/simple-types/src/index.ts'), + '@esri/solution-storymap': path.resolve(__dirname, '../../packages/storymap/src/index.ts'), + '@esri/solution-velocity': path.resolve(__dirname, '../../packages/velocity/src/index.ts'), + '@esri/solution-viewer': path.resolve(__dirname, '../../packages/viewer/src/index.ts'), + '@esri/solution-web-experience': path.resolve(__dirname, '../../packages/web-experience/src/index.ts'), + '@esri/solution-web-tool': path.resolve(__dirname, '../../packages/web-tool/src/index.ts'), + '@esri/solution-workflow': path.resolve(__dirname, '../../packages/workflow/src/index.ts'), +}); + const config = { entry: './src/index.ts', output: { @@ -16,7 +34,12 @@ const config = { module: { rules: [{ test: /\.(ts|tsx)$/i, - loader: 'ts-loader', + use: { + loader: 'ts-loader', + options: { + transpileOnly: !isProduction, + }, + }, exclude: ['/node_modules/'], },{ test: /\.css$/i, @@ -37,12 +60,17 @@ module.exports = () => { config.mode = 'production'; } else { config.mode = 'development'; + config.devtool = 'source-map'; + config.resolve.alias = { + ...(config.resolve.alias || {}), + ...createDevAliases(), + }; } config.experiments = { ...config.experiments, topLevelAwait: true - } + }; return config; }; diff --git a/demos/recreateSolution/package-lock.json b/demos/recreateSolution/package-lock.json index bee5e6fc2..a6c11efa0 100644 --- a/demos/recreateSolution/package-lock.json +++ b/demos/recreateSolution/package-lock.json @@ -2314,4 +2314,4 @@ "license": "MIT" } } -} \ No newline at end of file +} diff --git a/demos/recreateSolution/webpack.config.js b/demos/recreateSolution/webpack.config.js index 3cbc672d8..0c840fea8 100644 --- a/demos/recreateSolution/webpack.config.js +++ b/demos/recreateSolution/webpack.config.js @@ -3,6 +3,24 @@ const path = require('path'); const isProduction = process.env.NODE_ENV == 'production'; +const createDevAliases = () => ({ + '@esri/solution-common': path.resolve(__dirname, '../../packages/common/src/index.ts'), + '@esri/solution-creator': path.resolve(__dirname, '../../packages/creator/src/index.ts'), + '@esri/solution-deployer': path.resolve(__dirname, '../../packages/deployer/src/index.ts'), + '@esri/solution-feature-layer': path.resolve(__dirname, '../../packages/feature-layer/src/index.ts'), + '@esri/solution-file': path.resolve(__dirname, '../../packages/file/src/index.ts'), + '@esri/solution-form': path.resolve(__dirname, '../../packages/form/src/index.ts'), + '@esri/solution-group': path.resolve(__dirname, '../../packages/group/src/index.ts'), + '@esri/solution-hub-types': path.resolve(__dirname, '../../packages/hub-types/src/index.ts'), + '@esri/solution-simple-types': path.resolve(__dirname, '../../packages/simple-types/src/index.ts'), + '@esri/solution-storymap': path.resolve(__dirname, '../../packages/storymap/src/index.ts'), + '@esri/solution-velocity': path.resolve(__dirname, '../../packages/velocity/src/index.ts'), + '@esri/solution-viewer': path.resolve(__dirname, '../../packages/viewer/src/index.ts'), + '@esri/solution-web-experience': path.resolve(__dirname, '../../packages/web-experience/src/index.ts'), + '@esri/solution-web-tool': path.resolve(__dirname, '../../packages/web-tool/src/index.ts'), + '@esri/solution-workflow': path.resolve(__dirname, '../../packages/workflow/src/index.ts'), +}); + const config = { entry: './src/index.ts', output: { @@ -16,7 +34,12 @@ const config = { module: { rules: [{ test: /\.(ts|tsx)$/i, - loader: 'ts-loader', + use: { + loader: 'ts-loader', + options: { + transpileOnly: !isProduction, + }, + }, exclude: ['/node_modules/'], },{ test: /\.css$/i, @@ -37,6 +60,11 @@ module.exports = () => { config.mode = 'production'; } else { config.mode = 'development'; + config.devtool = 'source-map'; + config.resolve.alias = { + ...(config.resolve.alias || {}), + ...createDevAliases(), + }; } return config; }; diff --git a/demos/reuseDeployedItems/package-lock.json b/demos/reuseDeployedItems/package-lock.json index fbdfe09dd..ae5543681 100644 --- a/demos/reuseDeployedItems/package-lock.json +++ b/demos/reuseDeployedItems/package-lock.json @@ -2379,4 +2379,4 @@ "license": "MIT" } } -} \ No newline at end of file +} diff --git a/demos/reuseDeployedItems/webpack.config.js b/demos/reuseDeployedItems/webpack.config.js index 3cbc672d8..0c840fea8 100644 --- a/demos/reuseDeployedItems/webpack.config.js +++ b/demos/reuseDeployedItems/webpack.config.js @@ -3,6 +3,24 @@ const path = require('path'); const isProduction = process.env.NODE_ENV == 'production'; +const createDevAliases = () => ({ + '@esri/solution-common': path.resolve(__dirname, '../../packages/common/src/index.ts'), + '@esri/solution-creator': path.resolve(__dirname, '../../packages/creator/src/index.ts'), + '@esri/solution-deployer': path.resolve(__dirname, '../../packages/deployer/src/index.ts'), + '@esri/solution-feature-layer': path.resolve(__dirname, '../../packages/feature-layer/src/index.ts'), + '@esri/solution-file': path.resolve(__dirname, '../../packages/file/src/index.ts'), + '@esri/solution-form': path.resolve(__dirname, '../../packages/form/src/index.ts'), + '@esri/solution-group': path.resolve(__dirname, '../../packages/group/src/index.ts'), + '@esri/solution-hub-types': path.resolve(__dirname, '../../packages/hub-types/src/index.ts'), + '@esri/solution-simple-types': path.resolve(__dirname, '../../packages/simple-types/src/index.ts'), + '@esri/solution-storymap': path.resolve(__dirname, '../../packages/storymap/src/index.ts'), + '@esri/solution-velocity': path.resolve(__dirname, '../../packages/velocity/src/index.ts'), + '@esri/solution-viewer': path.resolve(__dirname, '../../packages/viewer/src/index.ts'), + '@esri/solution-web-experience': path.resolve(__dirname, '../../packages/web-experience/src/index.ts'), + '@esri/solution-web-tool': path.resolve(__dirname, '../../packages/web-tool/src/index.ts'), + '@esri/solution-workflow': path.resolve(__dirname, '../../packages/workflow/src/index.ts'), +}); + const config = { entry: './src/index.ts', output: { @@ -16,7 +34,12 @@ const config = { module: { rules: [{ test: /\.(ts|tsx)$/i, - loader: 'ts-loader', + use: { + loader: 'ts-loader', + options: { + transpileOnly: !isProduction, + }, + }, exclude: ['/node_modules/'], },{ test: /\.css$/i, @@ -37,6 +60,11 @@ module.exports = () => { config.mode = 'production'; } else { config.mode = 'development'; + config.devtool = 'source-map'; + config.resolve.alias = { + ...(config.resolve.alias || {}), + ...createDevAliases(), + }; } return config; }; diff --git a/demos/verifySolution/package-lock.json b/demos/verifySolution/package-lock.json index cdb673910..1e4e195d3 100644 --- a/demos/verifySolution/package-lock.json +++ b/demos/verifySolution/package-lock.json @@ -2350,4 +2350,4 @@ "license": "MIT" } } -} \ No newline at end of file +} diff --git a/demos/verifySolution/webpack.config.js b/demos/verifySolution/webpack.config.js index 3cbc672d8..0c840fea8 100644 --- a/demos/verifySolution/webpack.config.js +++ b/demos/verifySolution/webpack.config.js @@ -3,6 +3,24 @@ const path = require('path'); const isProduction = process.env.NODE_ENV == 'production'; +const createDevAliases = () => ({ + '@esri/solution-common': path.resolve(__dirname, '../../packages/common/src/index.ts'), + '@esri/solution-creator': path.resolve(__dirname, '../../packages/creator/src/index.ts'), + '@esri/solution-deployer': path.resolve(__dirname, '../../packages/deployer/src/index.ts'), + '@esri/solution-feature-layer': path.resolve(__dirname, '../../packages/feature-layer/src/index.ts'), + '@esri/solution-file': path.resolve(__dirname, '../../packages/file/src/index.ts'), + '@esri/solution-form': path.resolve(__dirname, '../../packages/form/src/index.ts'), + '@esri/solution-group': path.resolve(__dirname, '../../packages/group/src/index.ts'), + '@esri/solution-hub-types': path.resolve(__dirname, '../../packages/hub-types/src/index.ts'), + '@esri/solution-simple-types': path.resolve(__dirname, '../../packages/simple-types/src/index.ts'), + '@esri/solution-storymap': path.resolve(__dirname, '../../packages/storymap/src/index.ts'), + '@esri/solution-velocity': path.resolve(__dirname, '../../packages/velocity/src/index.ts'), + '@esri/solution-viewer': path.resolve(__dirname, '../../packages/viewer/src/index.ts'), + '@esri/solution-web-experience': path.resolve(__dirname, '../../packages/web-experience/src/index.ts'), + '@esri/solution-web-tool': path.resolve(__dirname, '../../packages/web-tool/src/index.ts'), + '@esri/solution-workflow': path.resolve(__dirname, '../../packages/workflow/src/index.ts'), +}); + const config = { entry: './src/index.ts', output: { @@ -16,7 +34,12 @@ const config = { module: { rules: [{ test: /\.(ts|tsx)$/i, - loader: 'ts-loader', + use: { + loader: 'ts-loader', + options: { + transpileOnly: !isProduction, + }, + }, exclude: ['/node_modules/'], },{ test: /\.css$/i, @@ -37,6 +60,11 @@ module.exports = () => { config.mode = 'production'; } else { config.mode = 'development'; + config.devtool = 'source-map'; + config.resolve.alias = { + ...(config.resolve.alias || {}), + ...createDevAliases(), + }; } return config; }; diff --git a/packages/common/src/arcgisRestJS.ts b/packages/common/src/arcgisRestJS.ts index d8cf45449..2716c39d5 100644 --- a/packages/common/src/arcgisRestJS.ts +++ b/packages/common/src/arcgisRestJS.ts @@ -68,6 +68,14 @@ import { queryRelated as restQueryRelated, } from "@esri/arcgis-rest-feature-service"; export { + createFeatureService as svcAdminCreateFeatureService, + queryFeatures, + addFeatures, + applyEdits, +} from "@esri/arcgis-rest-feature-service"; +// TypeScript interfaces (no runtime export); use type-only re-exports to avoid +// webpack "was not found" warnings. +export type { IAddToServiceDefinitionOptions, IAddToServiceDefinitionResult, ICreateServiceParams, @@ -78,12 +86,33 @@ export { IQueryRelatedOptions, IQueryRelatedResponse, IRelatedRecordGroup, - createFeatureService as svcAdminCreateFeatureService, - queryFeatures, - addFeatures, - applyEdits, } from "@esri/arcgis-rest-feature-service"; export { + addItemData as restAddItemData, + addItemRelationship, + createFolder, + createGroup, + createItem, + createItemInFolder, + moveItem, + protectItem, + SearchQueryBuilder, + getGroupCategorySchema as restGetGroupCategorySchema, + getItem, + getItemData, + getItemResources as restGetItemResources, + getUserContent, + getPortal as restGetPortal, + getPortalUrl, + searchGroupContent, + setItemAccess, + searchGroups as restSearchGroups, + removeGroupUsers, + removeItem as restRemoveItem, +} from "@esri/arcgis-rest-portal"; +// TypeScript interfaces / type aliases (no runtime export); use type-only +// re-exports to avoid webpack "was not found" warnings. +export type { IAddFolderResponse, IAddItemDataOptions, ICreateItemOptions, @@ -120,37 +149,11 @@ export { IUserGroupOptions, IGroupSharingOptions, IUserItemOptions, - addItemData as restAddItemData, - addItemRelationship, - createFolder, - createGroup, - createItem, - createItemInFolder, - moveItem, - protectItem, - SearchQueryBuilder, - getGroupCategorySchema as restGetGroupCategorySchema, - getItem, - getItemData, - getItemResources as restGetItemResources, - getUserContent, - getPortal as restGetPortal, - getPortalUrl, - searchGroupContent, - setItemAccess, - searchGroups as restSearchGroups, - removeGroupUsers, - removeItem as restRemoveItem, } from "@esri/arcgis-rest-portal"; -export { - IArcGISIdentityManagerOptions, - ICredential, - IRequestOptions, - IParams, - ArcGISAuthError, - encodeFormData, - ArcGISIdentityManager as UserSession, -} from "@esri/arcgis-rest-request"; +export { ArcGISAuthError, encodeFormData, ArcGISIdentityManager as UserSession } from "@esri/arcgis-rest-request"; +// These are TypeScript interfaces (no runtime export from arcgis-rest-request), +// so re-export them as type-only exports to avoid webpack "was not found" warnings. +export type { IArcGISIdentityManagerOptions, ICredential, IRequestOptions, IParams } from "@esri/arcgis-rest-request"; export interface IFolderSuccessResult { success: boolean; folder: {