Skip to content

Commit

Permalink
refactored dist folder
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdarveau-MSFT committed Sep 25, 2024
1 parent 83a5840 commit 890981b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion apps/typed-dependency-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"version": "0.0.1",
"scripts": {
"build": "pnpm i && pnpm copy && pnpm tsc && pnpm clean",
"copy": "cp ./node_modules/@microsoft/teams-js/dist/MicrosoftTeams.d.ts ./ || xcopy .\\node_modules\\@microsoft\\teams-js\\dist\\MicrosoftTeams.d.ts .\\ /Y",
"copy": "cp ./node_modules/@microsoft/teams-js/dist/umd/MicrosoftTeams.d.ts ./ || xcopy .\\node_modules\\@microsoft\\teams-js\\dist\\umd\\MicrosoftTeams.d.ts .\\ /Y",
"clean": "rimraf node_modules && rimraf MicrosoftTeams.d.ts"
},
"dependencies": {},
Expand Down
6 changes: 3 additions & 3 deletions packages/teams-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"type": "git",
"url": "https://github.com/OfficeDev/microsoft-teams-library-js"
},
"main": "./dist/MicrosoftTeams.min.js",
"typings": "./dist/MicrosoftTeams.d.ts",
"module": "./dist/packages/teams-js/src/index.js",
"main": "./dist/umd/MicrosoftTeams.min.js",
"typings": "./dist/umd/MicrosoftTeams.d.ts",
"module": "./dist/esm/packages/teams-js/src/index.js",
"type": "module",
"scripts": {
"build": "pnpm clean && pnpm lint && pnpm build-rollup && pnpm build-webpack && pnpm docs:validate",
Expand Down
2 changes: 1 addition & 1 deletion packages/teams-js/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import version from './package.json' assert { type: 'json' };
export default {
input: './src/index.ts',
output: {
dir: 'dist/',
dir: 'dist/esm',
name: '@microsoft/teams-js',
format: 'es',
preserveModules: true,
Expand Down
4 changes: 2 additions & 2 deletions packages/teams-js/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "../../tsconfig.common.json",
"compilerOptions": {
"outDir": "./dist",
"declarationDir": "./dist/packages/teams-js/dts",
"outDir": "./dist/esm",
"declarationDir": "./dist/esm/packages/teams-js/dts",
"lib": ["DOM", "ES2015", "ES5"],
"module": "es6",
"moduleResolution": "node",
Expand Down
10 changes: 5 additions & 5 deletions packages/teams-js/webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
filename: '[name].js',
// the following setting is required for SRI to work
crossOriginLoading: 'anonymous',
path: path.resolve(__dirname, 'dist'),
path: path.resolve(__dirname, 'dist/umd'),
library: {
name: libraryName,
type: 'umd',
Expand Down Expand Up @@ -75,8 +75,8 @@ module.exports = {

new DtsBundleWebpack({
name: '@microsoft/teams-js',
main: './dist/packages/teams-js/dts',
out: '~/dist/MicrosoftTeams.d.ts',
main: './dist/esm/packages/teams-js/dts',
out: '~/dist/umd/MicrosoftTeams.d.ts',
removeSource: true,
outputAsModuleFolder: true,
}),
Expand All @@ -98,7 +98,7 @@ module.exports = {
{
apply: (compiler) => {
compiler.hooks.done.tap('wsi-test', () => {
const manifest = JSON.parse(readFileSync(join(__dirname, 'dist/MicrosoftTeams-manifest.json'), 'utf-8'));
const manifest = JSON.parse(readFileSync(join(__dirname, 'dist/umd/MicrosoftTeams-manifest.json'), 'utf-8'));
// If for some reason hash was not generated for the assets, this test will fail in build.
expect(manifest['MicrosoftTeams.min.js'].integrity).toMatch(/sha384-.*/);
});
Expand All @@ -110,7 +110,7 @@ module.exports = {
onEnd: {
copy: [
{
source: './dist/MicrosoftTeams.min.js',
source: './dist/umd/MicrosoftTeams.min.js',
destination: '../../apps/blazor-test-app/wwwroot/js/MicrosoftTeams.min.js',
},
],
Expand Down
3 changes: 1 addition & 2 deletions tools/yaml-templates/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,9 @@ steps:

- task: CopyFiles@2
inputs:
sourceFolder: 'packages\teams-js\dist'
sourceFolder: 'packages\teams-js\dist\umd'
Contents: |
**\?(*.js|*.ts|*.map)
!**\?(_virtual\**|node_modules\**|packages\**)
targetFolder: '$(Build.ArtifactStagingDirectory)\CDNFeed\$(package.version)\js'
displayName: 'Copy TeamsJS Content for CDN'

Expand Down

0 comments on commit 890981b

Please sign in to comment.