Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit 86d1085

Browse files
committed
added rollup to all packages
1 parent cb0f924 commit 86d1085

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+344
-220
lines changed

packages/api/package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,22 @@
1515
"main": "dist/index.js",
1616
"module": "dist/esm/index.js",
1717
"types": "dist/index.d.ts",
18+
"exports": {
19+
"./package.json": "./package.json",
20+
".": {
21+
"types": "./dist/index.d.ts",
22+
"module": "./dist/esm/index.js",
23+
"import": "./dist/esm/index.js",
24+
"default": "./dist/index.js"
25+
}
26+
},
1827
"scripts": {
19-
"build": "yarn run build:esm && yarn run build:cjs",
28+
"build": "shx rm -rf dist && rollup --c rollup.config.js",
2029
"prepare": "yarn run build",
21-
"build:esm": "tsc -p ./tsconfig.esm.json",
22-
"build:cjs": "tsc -p ./tsconfig.json && tsc -p ./tsconfig.production.json",
2330
"dev:publish": "yalc publish",
2431
"dev:push": "yalc push",
2532
"watch:push": "tsc-watch --onSuccess \"yarn run dev:push\"",
26-
"watch": "tsc -w",
33+
"watch": "shx rm -rf dist && tsc -w",
2734
"release": "yarn run prepare",
2835
"release:manual": "yarn run prepare && yarn run release && npm publish",
2936
"pack": "npm pack",

packages/api/rollup.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import {
2+
createCommonJSConfig,
3+
createDeclarationConfig,
4+
createESMConfig,
5+
} from '../rollup.config.default';
6+
7+
const packageRoot = process.cwd();
8+
9+
// https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
10+
// Checks whether the specified path is outside of this particular package
11+
function external(path) {
12+
return (
13+
!path.startsWith('.') && // Paths that doesn't start with a '.' (e.g. './agile.ts')
14+
!path.startsWith(packageRoot) // Paths that doesn't start with the package root path (e.g. 'path/to/package/agile.ts')
15+
);
16+
}
17+
18+
// https://rollupjs.org/guide/en/#configuration-files
19+
export default function () {
20+
return [
21+
createDeclarationConfig({ external }),
22+
createCommonJSConfig({ external }),
23+
createESMConfig({ external, multiFileOutput: true }),
24+
];
25+
}

packages/api/tsconfig.esm.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/api/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"extends": "../tsconfig.default.json",
33
"compilerOptions": {
4-
"module": "commonjs",
5-
"rootDir": "src",
6-
"outDir": "dist"
4+
"target": "esnext",
5+
"outDir": "dist",
6+
"rootDir": "src"
77
},
88
"include": [
99
"./src/**/*" // Only include what is in src (-> dist, tests, .. will be excluded)

packages/api/tsconfig.production.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/core/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
const packageRoot = process.cwd();
88

99
// https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
10-
// Checks whether the specified path is outside this particular package
10+
// Checks whether the specified path is outside of this particular package
1111
function external(path) {
1212
return (
1313
!path.startsWith('.') && // Paths that doesn't start with a '.' (e.g. './agile.ts')

packages/cra-template-agile-typescript/template.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"lint": "eslint --cache \"**/*.{js,jsx,ts,tsx}\""
66
},
77
"dependencies": {
8-
"@agile-ts/core": "^0.1.2",
9-
"@agile-ts/react": "^0.1.2",
8+
"@agile-ts/core": "^0.2.3",
9+
"@agile-ts/react": "^0.2.0",
1010
"react": "^17.0.2",
1111
"react-dom": "^17.0.2",
1212
"react-scripts": "^4.0.3"

packages/cra-template-agile/template.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"lint": "eslint --cache \"**/*.{js,jsx,ts,tsx}\""
66
},
77
"dependencies": {
8-
"@agile-ts/core": "^0.1.2",
9-
"@agile-ts/react": "^0.1.2",
8+
"@agile-ts/core": "^0.2.3",
9+
"@agile-ts/react": "^0.2.0",
1010
"react": "^17.0.2",
1111
"react-dom": "^17.0.2",
1212
"react-scripts": "4.0.3"

packages/event/package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,22 @@
1414
"main": "dist/index.js",
1515
"module": "dist/esm/index.js",
1616
"types": "dist/index.d.ts",
17+
"exports": {
18+
"./package.json": "./package.json",
19+
".": {
20+
"types": "./dist/index.d.ts",
21+
"module": "./dist/esm/index.js",
22+
"import": "./dist/esm/index.js",
23+
"default": "./dist/index.js"
24+
}
25+
},
1726
"scripts": {
18-
"build": "yarn run build:esm && yarn run build:cjs",
27+
"build": "shx rm -rf dist && rollup --c rollup.config.js",
1928
"prepare": "yarn run build",
20-
"build:esm": "tsc -p ./tsconfig.esm.json",
21-
"build:cjs": "tsc -p ./tsconfig.json && tsc -p ./tsconfig.production.json",
2229
"dev:publish": "yalc publish",
2330
"dev:push": "yalc push",
2431
"watch:push": "tsc-watch --onSuccess \"yarn run dev:push\"",
25-
"watch": "tsc -w",
32+
"watch": "shx rm -rf dist && tsc -w",
2633
"release": "yarn run prepare",
2734
"release:manual": "yarn run prepare && yarn run release && npm publish",
2835
"pack": "npm pack",

packages/event/rollup.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import {
2+
createCommonJSConfig,
3+
createDeclarationConfig,
4+
createESMConfig,
5+
} from '../rollup.config.default';
6+
7+
const packageRoot = process.cwd();
8+
9+
// https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
10+
// Checks whether the specified path is outside of this particular package
11+
function external(path) {
12+
return (
13+
!path.startsWith('.') && // Paths that doesn't start with a '.' (e.g. './agile.ts')
14+
!path.startsWith(packageRoot) // Paths that doesn't start with the package root path (e.g. 'path/to/package/agile.ts')
15+
);
16+
}
17+
18+
// https://rollupjs.org/guide/en/#configuration-files
19+
export default function () {
20+
return [
21+
createDeclarationConfig({ external }),
22+
createCommonJSConfig({ external }),
23+
createESMConfig({ external, multiFileOutput: true }),
24+
];
25+
}

packages/event/tsconfig.esm.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/event/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"extends": "../tsconfig.default.json",
33
"compilerOptions": {
4-
"module": "commonjs",
5-
"rootDir": "src",
6-
"outDir": "dist"
4+
"target": "esnext",
5+
"outDir": "dist",
6+
"rootDir": "src"
77
},
88
"include": [
99
"./src/**/*" // Only include what is in src (-> dist, tests, .. will be excluded)

packages/event/tsconfig.production.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/logger/package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,22 @@
1414
"main": "dist/index.js",
1515
"module": "dist/esm/index.js",
1616
"types": "dist/index.d.ts",
17+
"exports": {
18+
"./package.json": "./package.json",
19+
".": {
20+
"types": "./dist/index.d.ts",
21+
"module": "./dist/esm/index.js",
22+
"import": "./dist/esm/index.js",
23+
"default": "./dist/index.js"
24+
}
25+
},
1726
"scripts": {
18-
"build": "yarn run build:esm && yarn run build:cjs",
27+
"build": "shx rm -rf dist && rollup --c rollup.config.js",
1928
"prepare": "yarn run build",
20-
"build:esm": "tsc -p ./tsconfig.esm.json",
21-
"build:cjs": "tsc -p ./tsconfig.json && tsc -p ./tsconfig.production.json",
2229
"dev:publish": "yalc publish",
2330
"dev:push": "yalc push",
2431
"watch:push": "tsc-watch --onSuccess \"yarn run dev:push\"",
25-
"watch": "tsc -w",
32+
"watch": "shx rm -rf dist && tsc -w",
2633
"release": "yarn run prepare",
2734
"release:manual": "yarn run prepare && yarn run release && npm publish",
2835
"pack": "npm pack",

packages/logger/rollup.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import {
2+
createCommonJSConfig,
3+
createDeclarationConfig,
4+
createESMConfig,
5+
} from '../rollup.config.default';
6+
7+
const packageRoot = process.cwd();
8+
9+
// https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
10+
// Checks whether the specified path is outside of this particular package
11+
function external(path) {
12+
return (
13+
!path.startsWith('.') && // Paths that doesn't start with a '.' (e.g. './agile.ts')
14+
!path.startsWith(packageRoot) // Paths that doesn't start with the package root path (e.g. 'path/to/package/agile.ts')
15+
);
16+
}
17+
18+
// https://rollupjs.org/guide/en/#configuration-files
19+
export default function () {
20+
return [
21+
createDeclarationConfig({ external }),
22+
createCommonJSConfig({ external }),
23+
createESMConfig({ external, multiFileOutput: true }),
24+
];
25+
}

packages/logger/tsconfig.esm.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/logger/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"extends": "../tsconfig.default.json",
33
"compilerOptions": {
4-
"module": "commonjs",
5-
"rootDir": "src",
6-
"outDir": "dist"
4+
"target": "esnext",
5+
"outDir": "dist",
6+
"rootDir": "src"
77
},
88
"include": [
99
"./src/**/*" // Only include what is in src (-> dist, tests, .. will be excluded)

packages/logger/tsconfig.production.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/multieditor/package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,22 @@
1818
"main": "dist/index.js",
1919
"module": "dist/esm/index.js",
2020
"types": "dist/index.d.ts",
21+
"exports": {
22+
"./package.json": "./package.json",
23+
".": {
24+
"types": "./dist/index.d.ts",
25+
"module": "./dist/esm/index.js",
26+
"import": "./dist/esm/index.js",
27+
"default": "./dist/index.js"
28+
}
29+
},
2130
"scripts": {
22-
"build": "yarn run build:esm && yarn run build:cjs",
31+
"build": "shx rm -rf dist && rollup --c rollup.config.js",
2332
"prepare": "yarn run build",
24-
"build:esm": "tsc -p ./tsconfig.esm.json",
25-
"build:cjs": "tsc -p ./tsconfig.json && tsc -p ./tsconfig.production.json",
2633
"dev:publish": "yalc publish",
2734
"dev:push": "yalc push",
2835
"watch:push": "tsc-watch --onSuccess \"yarn run dev:push\"",
29-
"watch": "tsc -w",
36+
"watch": "shx rm -rf dist && tsc -w",
3037
"release": "yarn run prepare",
3138
"release:manual": "yarn run prepare && yarn run release && npm publish",
3239
"pack": "npm pack",

packages/multieditor/rollup.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import {
2+
createCommonJSConfig,
3+
createDeclarationConfig,
4+
createESMConfig,
5+
} from '../rollup.config.default';
6+
7+
const packageRoot = process.cwd();
8+
9+
// https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
10+
// Checks whether the specified path is outside of this particular package
11+
function external(path) {
12+
return (
13+
!path.startsWith('.') && // Paths that doesn't start with a '.' (e.g. './agile.ts')
14+
!path.startsWith(packageRoot) // Paths that doesn't start with the package root path (e.g. 'path/to/package/agile.ts')
15+
);
16+
}
17+
18+
// https://rollupjs.org/guide/en/#configuration-files
19+
export default function () {
20+
return [
21+
createDeclarationConfig({ external }),
22+
createCommonJSConfig({ external }),
23+
createESMConfig({ external, multiFileOutput: true }),
24+
];
25+
}

packages/multieditor/tsconfig.esm.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/multieditor/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"extends": "../tsconfig.default.json",
33
"compilerOptions": {
4-
"module": "commonjs",
5-
"rootDir": "src",
6-
"outDir": "dist"
4+
"target": "esnext",
5+
"outDir": "dist",
6+
"rootDir": "src"
77
},
88
"include": [
99
"./src/**/*" // Only include what is in src (-> dist, tests, .. will be excluded)

packages/multieditor/tsconfig.production.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)