Skip to content

Commit

Permalink
Normalize build for examples (microsoft#13596)
Browse files Browse the repository at this point in the history
## Description

Applies the changes from
microsoft#10845 to the other
examples.

This removes the extra typescript build of the examples: since they are
not redistributed packages, they do not require both a CommonJS and
esnext build.

Some of the examples actually just built esnext modules twice (once
under "lib: and once under "dist".

Now all of them just build once, and its an esnext build under "lib".

Excluded from the change to be ESM only are:
- examples/data-objects/webflow: uses mocha which has issues with ESM
- examples/utils/example-utils: used by the above.
- examples/data-objects/table-document: uses mocha which has issues with
ESM
- examples/hosts/app-integration/external-data: had issues with its
start.js script
  • Loading branch information
CraigMacomber authored Jan 17, 2023
1 parent 7d47c49 commit 32b750c
Show file tree
Hide file tree
Showing 75 changed files with 167 additions and 407 deletions.
9 changes: 4 additions & 5 deletions examples/apps/collaborative-textarea/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
},
"license": "MIT",
"author": "Microsoft and contributors",
"main": "dist/index.js",
"main": "lib/index.js",
"module": "lib/index.js",
"types": "dist/index.d.ts",
"types": "lib/index.d.ts",
"scripts": {
"build": "concurrently npm:build:compile npm:lint",
"build:compile": "concurrently npm:tsc npm:build:esnext",
"build:esnext": "tsc --project ./tsconfig.esnext.json",
"build:compile": "npm run build:esnext",
"build:esnext": "tsc",
"build:full": "concurrently npm:build npm:webpack",
"build:full:compile": "concurrently npm:build:compile npm:webpack",
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
Expand All @@ -34,7 +34,6 @@
"test": "npm run test:jest",
"test:jest": "jest",
"test:jest:verbose": "cross-env FLUID_TEST_VERBOSE=1 jest",
"tsc": "tsc",
"webpack": "webpack --env production",
"webpack:dev": "webpack --env development"
},
Expand Down
7 changes: 0 additions & 7 deletions examples/apps/collaborative-textarea/tsconfig.esnext.json

This file was deleted.

6 changes: 1 addition & 5 deletions examples/apps/collaborative-textarea/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"extends": "@fluidframework/build-common/ts-common-config.json",
"exclude": [
"dist",
"node_modules"
],
"compilerOptions": {
"module": "esnext",
"outDir": "dist",
"outDir": "lib",
"jsx": "react",
"types": ["jest", "puppeteer", "jest-environment-puppeteer", "expect-puppeteer", "react", "react-dom"],
},
Expand Down
4 changes: 0 additions & 4 deletions examples/apps/contact-collection/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"extends": "@fluidframework/build-common/ts-common-config.json",
"exclude": [
"lib",
"node_modules"
],
"compilerOptions": {
"module": "esnext",
"outDir": "lib",
Expand Down
10 changes: 5 additions & 5 deletions examples/apps/data-object-grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
},
"license": "MIT",
"author": "Microsoft and contributors",
"main": "dist/index.js",
"main": "lib/index.js",
"module": "lib/index.js",
"types": "dist/index.d.ts",
"types": "lib/index.d.ts",
"scripts": {
"build": "concurrently npm:build:compile npm:lint",
"build:compile": "concurrently npm:tsc npm:build:copy",
"build:copy": "copyfiles -u 1 \"src/**/*.css\" dist/",
"build:compile": "concurrently npm:build:esnext npm:build:copy",
"build:copy": "copyfiles -u 1 \"src/**/*.css\" lib/",
"build:esnext": "tsc",
"build:full": "concurrently npm:build npm:webpack",
"build:full:compile": "concurrently npm:build:compile npm:webpack",
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
Expand All @@ -36,7 +37,6 @@
"test": "npm run test:jest",
"test:jest": "jest",
"test:jest:verbose": "cross-env FLUID_TEST_VERBOSE=1 jest",
"tsc": "tsc",
"webpack": "webpack --env production",
"webpack:dev": "webpack --env development"
},
Expand Down
8 changes: 2 additions & 6 deletions examples/apps/data-object-grid/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
"extends": "@fluidframework/build-common/ts-common-config.json",
"exclude": [
"dist",
"node_modules"
],
"compilerOptions": {
"module": "esnext",
"target": "es6",
"declarationDir": "./dist",
"outDir": "./dist",
"outDir": "lib",
"jsx": "react",
"types": [
"jest",
Expand Down
4 changes: 2 additions & 2 deletions examples/apps/odspsnapshotfetch-perftestapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"types": "dist/expressApp.d.ts",
"scripts": {
"build": "concurrently npm:build:compile npm:lint",
"build:compile": "npm run tsc",
"build:compile": "npm run build:esnext",
"build:esnext": "tsc",
"build:full": "concurrently npm:build npm:webpack",
"build:full:compile": "concurrently npm:build:compile npm:webpack",
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
Expand All @@ -28,7 +29,6 @@
"start": "npm run start:spo-df",
"start:spo": "node dist/expressApp.js --env mode=spo",
"start:spo-df": "node dist/expressApp.js --env mode=spo-df",
"tsc": "tsc",
"webpack": "webpack --env production",
"webpack:dev": "webpack --env development"
},
Expand Down

This file was deleted.

9 changes: 3 additions & 6 deletions examples/apps/odspsnapshotfetch-perftestapp/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
{
"extends": "@fluidframework/build-common/ts-common-config.json",
"exclude": [
"dist",
"node_modules"
],
"compilerOptions": {
"module": "esnext",
"rootDir": "./src",
"outDir": "./dist",
"outDir": "lib",
"jsx": "react",
"composite": true,
"types": ["node"]
},
"include": [
"src/**/*"
]
}
}
9 changes: 4 additions & 5 deletions examples/apps/view-framework-sampler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
},
"license": "MIT",
"author": "Microsoft and contributors",
"main": "dist/index.js",
"main": "lib/index.js",
"module": "lib/index.js",
"types": "dist/index.d.ts",
"types": "lib/index.d.ts",
"scripts": {
"build": "concurrently npm:build:compile npm:lint",
"build:compile": "concurrently npm:tsc npm:build:esnext",
"build:esnext": "tsc --project ./tsconfig.esnext.json",
"build:compile": "npm run build:esnext",
"build:esnext": "tsc",
"build:full": "concurrently npm:build npm:webpack",
"build:full:compile": "concurrently npm:build:compile npm:webpack",
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
Expand All @@ -34,7 +34,6 @@
"test": "npm run test:jest",
"test:jest": "jest",
"test:jest:verbose": "cross-env FLUID_TEST_VERBOSE=1 jest",
"tsc": "tsc",
"webpack": "webpack --env production",
"webpack:dev": "webpack --env development"
},
Expand Down
7 changes: 0 additions & 7 deletions examples/apps/view-framework-sampler/tsconfig.esnext.json

This file was deleted.

6 changes: 1 addition & 5 deletions examples/apps/view-framework-sampler/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"extends": "@fluidframework/build-common/ts-common-config.json",
"exclude": [
"dist",
"node_modules"
],
"compilerOptions": {
"module": "esnext",
"outDir": "dist",
"outDir": "lib",
"jsx": "react",
"types": [
"jest",
Expand Down
9 changes: 4 additions & 5 deletions examples/data-objects/canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
},
"license": "MIT",
"author": "Microsoft and contributors",
"main": "dist/index.js",
"main": "lib/index.js",
"module": "lib/index.js",
"types": "dist/index.d.ts",
"types": "lib/index.d.ts",
"scripts": {
"build": "concurrently npm:build:compile npm:lint",
"build:compile": "concurrently npm:tsc npm:build:esnext",
"build:esnext": "tsc --project ./tsconfig.esnext.json",
"build:compile": "npm run build:esnext",
"build:esnext": "tsc",
"build:full": "concurrently npm:build npm:webpack",
"build:full:compile": "concurrently npm:build:compile npm:webpack",
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
Expand All @@ -38,7 +38,6 @@
"test": "npm run test:jest",
"test:jest": "jest",
"test:jest:verbose": "cross-env FLUID_TEST_VERBOSE=1 jest",
"tsc": "tsc",
"webpack": "webpack --env production",
"webpack:dev": "webpack --env development"
},
Expand Down
7 changes: 0 additions & 7 deletions examples/data-objects/canvas/tsconfig.esnext.json

This file was deleted.

7 changes: 2 additions & 5 deletions examples/data-objects/canvas/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"extends": "@fluidframework/build-common/ts-common-config.json",
"exclude": [
"dist",
"node_modules"
],
"compilerOptions": {
"outDir": "dist",
"module": "esnext",
"outDir": "lib",
"jsx": "react",
"types": ["jest", "puppeteer", "jest-environment-puppeteer", "expect-puppeteer", "react", "react-dom"],
},
Expand Down
9 changes: 4 additions & 5 deletions examples/data-objects/clicker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
},
"license": "MIT",
"author": "Microsoft and contributors",
"main": "dist/index.js",
"main": "lib/index.js",
"module": "lib/index.js",
"types": "dist/index.d.ts",
"types": "lib/index.d.ts",
"scripts": {
"build": "concurrently npm:build:compile npm:lint",
"build:compile": "concurrently npm:tsc npm:build:esnext",
"build:esnext": "tsc --project ./tsconfig.esnext.json",
"build:compile": "npm run build:esnext",
"build:esnext": "tsc",
"build:full": "concurrently npm:build npm:webpack",
"build:full:compile": "concurrently npm:build:compile npm:webpack",
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
Expand All @@ -38,7 +38,6 @@
"test": "npm run test:jest",
"test:jest": "jest",
"test:jest:verbose": "cross-env FLUID_TEST_VERBOSE=1 jest",
"tsc": "tsc",
"webpack": "webpack --env production",
"webpack:dev": "webpack --env development"
},
Expand Down
7 changes: 0 additions & 7 deletions examples/data-objects/clicker/tsconfig.esnext.json

This file was deleted.

6 changes: 1 addition & 5 deletions examples/data-objects/clicker/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"extends": "@fluidframework/build-common/ts-common-config.json",
"exclude": [
"dist",
"node_modules"
],
"compilerOptions": {
"module": "esnext",
"outDir": "dist",
"outDir": "lib",
"jsx": "react",
"types": ["jest", "puppeteer", "jest-environment-puppeteer", "expect-puppeteer", "react", "react-dom"],
},
Expand Down
10 changes: 5 additions & 5 deletions examples/data-objects/codemirror/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
},
"license": "MIT",
"author": "Microsoft and contributors",
"main": "dist/index.js",
"main": "lib/index.js",
"module": "lib/index.js",
"types": "dist/index.d.ts",
"types": "lib/index.d.ts",
"scripts": {
"build": "concurrently npm:build:compile npm:lint",
"build:compile": "concurrently npm:tsc npm:build:copy",
"build:copy": "copyfiles -u 1 \"src/**/*.css\" dist/",
"build:compile": "concurrently npm:build:esnext npm:build:copy",
"build:copy": "copyfiles -u 1 \"src/**/*.css\" lib/",
"build:esnext": "tsc",
"build:full": "concurrently npm:build npm:webpack",
"build:full:compile": "concurrently npm:build:compile npm:webpack",
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
Expand All @@ -36,7 +37,6 @@
"start:spo": "webpack serve --config webpack.config.js --env mode=spo",
"start:spo-df": "webpack serve --config webpack.config.js --env mode=spo-df",
"start:tinylicious": "webpack serve --config webpack.config.js --env mode=tinylicious",
"tsc": "tsc",
"webpack": "webpack --env production",
"webpack:dev": "webpack --env development"
},
Expand Down
6 changes: 1 addition & 5 deletions examples/data-objects/codemirror/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{
"extends": "@fluidframework/build-common/ts-common-config.json",
"exclude": [
"dist",
"node_modules"
],
"compilerOptions": {
"target": "es6",
"module": "esnext",
"outDir": "dist",
"outDir": "lib",
"jsx": "react",
"types": [
"node"
Expand Down
9 changes: 4 additions & 5 deletions examples/data-objects/diceroller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
},
"license": "MIT",
"author": "Microsoft and contributors",
"main": "dist/index.js",
"main": "lib/index.js",
"module": "lib/index.js",
"types": "dist/index.d.ts",
"types": "lib/index.d.ts",
"scripts": {
"build": "concurrently npm:build:compile npm:lint",
"build:compile": "concurrently npm:tsc npm:build:esnext",
"build:esnext": "tsc --project ./tsconfig.esnext.json",
"build:compile": "npm run build:esnext",
"build:esnext": "tsc",
"build:full": "concurrently npm:build npm:webpack",
"build:full:compile": "concurrently npm:build:compile npm:webpack",
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
Expand All @@ -38,7 +38,6 @@
"test": "npm run test:jest",
"test:jest": "jest",
"test:jest:verbose": "cross-env FLUID_TEST_VERBOSE=1 jest",
"tsc": "tsc",
"webpack": "webpack --env production",
"webpack:dev": "webpack --env development"
},
Expand Down
7 changes: 0 additions & 7 deletions examples/data-objects/diceroller/tsconfig.esnext.json

This file was deleted.

7 changes: 2 additions & 5 deletions examples/data-objects/diceroller/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"extends": "@fluidframework/build-common/ts-common-config.json",
"exclude": [
"dist",
"node_modules"
],
"compilerOptions": {
"outDir": "dist",
"module": "esnext",
"outDir": "lib",
"jsx": "react",
"types": ["react", "react-dom", "jest", "puppeteer", "jest-environment-puppeteer", "expect-puppeteer"]
},
Expand Down
Loading

0 comments on commit 32b750c

Please sign in to comment.