Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JSS] Compile and publish all base package as ESM #758

Merged
merged 25 commits into from
Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
09bcd28
Updated tsconfig to build both esm and cjs modules
CobyPear Jul 27, 2021
0e4be90
Updated tsconfig to build both esm and cjs modules
CobyPear Jul 27, 2021
5785a1e
Update angular-schematics package to build cjs and esm module
CobyPear Jul 27, 2021
0d0d9a0
Update cli package to build cjs and esm module
CobyPear Jul 27, 2021
e222527
Update dev-tools package to build cjs and esm module
CobyPear Jul 27, 2021
bf653b1
Update forms package to build cjs and esm module
CobyPear Jul 27, 2021
a66a2bf
Merge branch 'feature/454376' of github.com:Sitecore/jss into feature…
CobyPear Jul 27, 2021
a5b9323
Update manifest package to build cjs and esm module
CobyPear Jul 27, 2021
fa7ecc6
Update proxy package to build cjs and esm module
CobyPear Jul 27, 2021
9143ee5
Update react package to build cjs and esm module
CobyPear Jul 27, 2021
c1e2c08
Update react-forms package to build cjs and esm module
CobyPear Jul 27, 2021
9e1a5c3
Update rendering-host package to build cjs and esm module
CobyPear Jul 28, 2021
26d8d4f
Update tracking package to build cjs and esm module
CobyPear Jul 28, 2021
63d9c21
Update update package to build cjs and esm module
CobyPear Jul 28, 2021
ac03832
Update vue package to build cjs and esm module
CobyPear Jul 28, 2021
a43a8d6
Update pipelines package to build cjs and esm module
CobyPear Jul 28, 2021
909f18b
Remove sitecore-jss package from allowedCommonJsDependencies array
CobyPear Jul 28, 2021
c9996d4
Fix cli package bin directory path
CobyPear Jul 28, 2021
d171e84
Change entrypoint in package.json to the cli.js file in cli package
CobyPear Jul 28, 2021
dcb08c8
Merge branch 'dev' into feature/454376
CobyPear Jul 30, 2021
71b4fa1
Add newline to end of tsconfig-esm files
CobyPear Jul 30, 2021
f4d01fa
Consolidate extra tsconfigs in cli package
CobyPear Jul 30, 2021
85ce2f5
Resolve merge conflicts
CobyPear Jul 30, 2021
7152a57
Use named exports in index.ts
CobyPear Aug 2, 2021
ef1d705
Merge branch 'dev' into feature/454376
CobyPear Aug 2, 2021
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
5 changes: 4 additions & 1 deletion packages/sitecore-jss-angular-schematics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
"name": "@sitecore-jss/sitecore-jss-angular-schematics",
"version": "19.0.0-canary.25",
"description": "Scaffolding schematics for Sitecore JSS Angular apps",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"sideEffects": false,
"scripts": {
"build": "tsc -p tsconfig.json",
"build": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
"test": "npm run build && jasmine src/**/*_spec.js"
},
"engines": {
Expand Down
7 changes: 7 additions & 0 deletions packages/sitecore-jss-angular-schematics/tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "es6",
"outDir": "dist/esm"
},
}
1 change: 1 addition & 0 deletions packages/sitecore-jss-angular-schematics/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"sourceMap": true,
"strictNullChecks": true,
"target": "es6",
"outDir": "dist/cjs",
"types": [
"jasmine",
"node"
Expand Down
10 changes: 6 additions & 4 deletions packages/sitecore-jss-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
"name": "@sitecore-jss/sitecore-jss-cli",
"version": "19.0.0-canary.25",
"description": "Sitecore JSS command-line",
"main": "dist/cjs/cli.js",
"module": "dist/esm/cli.js",
"sideEffects": false,
"scripts": {
"build": "npm run clean && tsc",
"build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
"watch": "npm run build -- --watch",
"clean": "del-cli dist types",
"lint": "eslint ./src/**/*.ts",
"prepublishOnly": "npm run build",
"jss": "node ./dist/bin/jss.js",
"jss": "node ./dist/cjs/bin/jss.js",
"test": "mocha --require ts-node/register \"./src/**/*.test.ts\"",
"coverage": "nyc --require ts-node/register npm test"
},
Expand All @@ -17,9 +20,8 @@
},
"preferGlobal": true,
"bin": {
"jss": "./dist/bin/jss.js"
"jss": "./dist/cjs/bin/jss.js"
},
"main": "./dist/cli.js",
"author": {
"name": "Sitecore Corporation",
"url": "https://jss.sitecore.com"
Expand Down
14 changes: 14 additions & 0 deletions packages/sitecore-jss-cli/tsconfig-bin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "dist"
},
"include": [
"src/bin"
],
"exclude": [
"!src/bin",
]
}

16 changes: 16 additions & 0 deletions packages/sitecore-jss-cli/tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "es6",
"outDir": "dist/esm",
},
"exclude": [
"src/bin",
"types",
"node_modules",
"types",
"dist",
"src/test",
"src/**/*.test.ts",
]
}
6 changes: 3 additions & 3 deletions packages/sitecore-jss-cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"module": "commonjs",
"newLine": "LF",
"emitDecoratorMetadata": true,
Expand All @@ -19,7 +19,7 @@
"typeRoots": [
"node_modules/@types"
],
"outDir": "dist",
"outDir": "dist/cjs",
"declaration": true,
"declarationDir": "./types",
"allowSyntheticDefaultImports": true,
Expand All @@ -30,6 +30,6 @@
"types",
"dist",
"src/test",
"src/**/*.test.ts"
"src/**/*.test.ts",
]
}
6 changes: 4 additions & 2 deletions packages/sitecore-jss-dev-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
"name": "@sitecore-jss/sitecore-jss-dev-tools",
"version": "19.0.0-canary.25",
"description": "Utilities to assist in the development and deployment of Sitecore JSS apps.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"sideEffects": false,
"scripts": {
"build": "npm run clean && tsc",
"build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
"watch": "npm run build -- --watch",
"clean": "del-cli dist types",
"lint": "eslint ./src/**/*.ts",
Expand All @@ -18,7 +21,6 @@
"scjss-verify-setup": "./dist/bin/verify-setup.js",
"scjss-deploy": "./dist/bin/deploy.js"
},
"main": "./dist/index.js",
"author": {
"name": "Sitecore Corporation",
"url": "https://jss.sitecore.com"
Expand Down
7 changes: 7 additions & 0 deletions packages/sitecore-jss-dev-tools/tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "es6",
"outDir": "dist/esm"
},
}
4 changes: 2 additions & 2 deletions packages/sitecore-jss-dev-tools/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"module": "commonjs",
"newLine": "LF",
"emitDecoratorMetadata": true,
Expand All @@ -19,7 +19,7 @@
"typeRoots": [
"node_modules/@types"
],
"outDir": "dist",
"outDir": "dist/cjs",
"declaration": true,
"declarationDir": "./types",
"allowSyntheticDefaultImports": true,
Expand Down
6 changes: 4 additions & 2 deletions packages/sitecore-jss-forms/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"name": "@sitecore-jss/sitecore-jss-forms",
"version": "19.0.0-canary.25",
"main": "dist/index.js",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"sideEffects": false,
"scripts": {
"build": "npm run clean && tsc",
"build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
"clean": "del-cli dist types",
"lint": "eslint ./src/**/*.ts",
"test": "mocha --require ts-node/register \"./src/**/*.test.ts\"",
Expand Down
7 changes: 7 additions & 0 deletions packages/sitecore-jss-forms/tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "es6",
"outDir": "dist/esm"
},
}
4 changes: 2 additions & 2 deletions packages/sitecore-jss-forms/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"module": "commonjs",
"newLine": "LF",
"emitDecoratorMetadata": true,
Expand All @@ -19,7 +19,7 @@
"typeRoots": [
"node_modules/@types"
],
"outDir": "dist",
"outDir": "dist/cjs",
"declaration": true,
"declarationDir": "./types",
"allowSyntheticDefaultImports": true,
Expand Down
6 changes: 4 additions & 2 deletions packages/sitecore-jss-manifest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"name": "@sitecore-jss/sitecore-jss-manifest",
"version": "19.0.0-canary.25",
"description": "",
"main": "dist/index.js",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"sideEffects": false,
"scripts": {
"build": "npm run clean && tsc",
"build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
"clean": "del-cli dist types",
"lint": "eslint ./src/**/*.ts",
"test": "mocha --require ts-node/register \"./src/**/*.test.ts\"",
Expand Down
7 changes: 7 additions & 0 deletions packages/sitecore-jss-manifest/tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "es6",
"outDir": "dist/esm"
},
}
4 changes: 2 additions & 2 deletions packages/sitecore-jss-manifest/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"module": "commonjs",
"newLine": "LF",
"emitDecoratorMetadata": true,
Expand All @@ -20,7 +20,7 @@
"typeRoots": [
"node_modules/@types"
],
"outDir": "dist",
"outDir": "dist/cjs",
"declaration": true,
"declarationDir": "./types",
"allowSyntheticDefaultImports": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/sitecore-jss-nextjs/tsconfig-esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"module": "es6",
"outDir": "dist/esm"
},
}
}
6 changes: 4 additions & 2 deletions packages/sitecore-jss-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"name": "@sitecore-jss/sitecore-jss-proxy",
"version": "19.0.0-canary.25",
"description": "Proxy middleware for express.js server.",
"main": "dist/index.js",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"sideEffects": false,
"scripts": {
"build": "npm run clean && tsc",
"build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
"clean": "del-cli dist types",
"lint": "eslint ./src/**/*.ts",
"test": "mocha --require ts-node/register \"./src/**/*.test.ts\"",
Expand Down
7 changes: 7 additions & 0 deletions packages/sitecore-jss-proxy/tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "es6",
"outDir": "dist/esm"
},
}
21 changes: 16 additions & 5 deletions packages/sitecore-jss-proxy/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"module": "commonjs",
"newLine": "LF",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"lib": ["es2017", "dom"],
"lib": [
"es2017",
"dom"
],
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noImplicitAny": true,
"noUnusedParameters": false,
"strict": true,
"typeRoots": ["node_modules/@types"],
"outDir": "dist",
"typeRoots": [
"node_modules/@types"
],
"outDir": "dist/cjs",
"declaration": true,
"declarationDir": "./types",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"strictBindCallApply": false
},
"exclude": ["node_modules", "types", "dist", "src/**/*.test.ts", "src/testData/*.ts"]
"exclude": [
"node_modules",
"types",
"dist",
"src/**/*.test.ts",
"src/testData/*.ts"
]
}
6 changes: 4 additions & 2 deletions packages/sitecore-jss-react-forms/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"name": "@sitecore-jss/sitecore-jss-react-forms",
"version": "19.0.0-canary.25",
"main": "dist/index.js",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"sideEffects": false,
"scripts": {
"build": "npm run clean && tsc",
"build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
"clean": "del-cli dist types",
"lint": "eslint ./src/**/*.tsx ./src/**/*.ts",
"test": "mocha --require ts-node/register --require ./src/tests/shim.ts ./src/tests/jsdom-setup.ts ./src/tests/enzyme-setup.ts \"./src/**/*.test.tsx\"",
Expand Down
7 changes: 7 additions & 0 deletions packages/sitecore-jss-react-forms/tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "es6",
"outDir": "dist/esm"
},
}
4 changes: 2 additions & 2 deletions packages/sitecore-jss-react-forms/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"module": "commonjs",
"newLine": "LF",
"emitDecoratorMetadata": true,
Expand All @@ -21,7 +21,7 @@
"typeRoots": [
"node_modules/@types"
],
"outDir": "dist",
"outDir": "dist/cjs",
"declaration": true,
"declarationDir": "./types",
"allowSyntheticDefaultImports": true,
Expand Down
6 changes: 4 additions & 2 deletions packages/sitecore-jss-react/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"name": "@sitecore-jss/sitecore-jss-react",
"version": "19.0.0-canary.25",
"main": "dist/index.js",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"sideEffects": false,
"scripts": {
"build": "npm run clean && tsc",
"build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
"clean": "del-cli dist types",
"lint": "eslint ./src/**/*.tsx ./src/**/*.ts",
"test": "mocha --require ts-node/register --require ./src/tests/shim.ts ./src/tests/jsdom-setup.ts ./src/tests/enzyme-setup.ts \"./src/**/*.test.ts\" \"./src/**/*.test.tsx\"",
Expand Down
7 changes: 7 additions & 0 deletions packages/sitecore-jss-react/tsconfig-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "es6",
"outDir": "dist/esm"
},
}
4 changes: 2 additions & 2 deletions packages/sitecore-jss-react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "es6",
"module": "commonjs",
"newLine": "LF",
"emitDecoratorMetadata": true,
Expand All @@ -21,7 +21,7 @@
"typeRoots": [
"node_modules/@types"
],
"outDir": "dist",
"outDir": "dist/cjs",
"declaration": true,
"declarationDir": "./types",
"allowSyntheticDefaultImports": true,
Expand Down
Loading