Skip to content

Commit 151ae6d

Browse files
committed
Preparing config for initial beta release
1 parent 7080bde commit 151ae6d

File tree

4 files changed

+42
-47
lines changed

4 files changed

+42
-47
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
11
{
22
"name": "@frontify/frontify-authenticator",
3-
"version": "2.0.0",
3+
"version": "2.0.0-beta-0",
44
"description": "Authenticate to your Frontify instance from within any secure web app.",
55
"files": [
66
"dist/**/*"
77
],
88
"types": "dist/index.d.ts",
9-
"main": "dist/index.js",
9+
"main": "dist/index.umd.js",
1010
"exports": {
1111
".": {
12-
"require": "./dist/commonjs/index.js",
13-
"default": "./dist/commonjs/index.js",
14-
"import": "./dist/esm/index.mjs"
12+
"import": "./dist/index.es.js",
13+
"require": "./dist/index.umd.js"
1514
}
1615
},
17-
"module": "dist/esm/index.mjs",
16+
"module": "dist/index.es.js",
1817
"scripts": {
1918
"test": "jest --config jestconfig.json",
20-
"build": "cross-env NODE_ENV=production npm run build:ts",
19+
"build": "npm run clean && cross-env NODE_ENV=production npm run build:ts",
2120
"build:ts": "rollup -c",
22-
"local": "npm run build && tsc --outDir dist --esModuleInterop src/local.ts && node dist/local.js",
21+
"clean": "rimraf dist",
2322
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
2423
"lint": "tslint -p tsconfig.json",
25-
"prepare": "npm run build",
26-
"prepublishOnly": "npm test && npm run lint",
27-
"preversion": "npm run lint",
28-
"version": "npm run format && git add -A src",
29-
"postversion": "git push && git push --tags"
24+
"prepublishOnly": "npm run build"
3025
},
3126
"repository": {
3227
"type": "git",
@@ -54,13 +49,13 @@
5449
"node-fetch": "^3.0.0",
5550
"prettier": "^2.3.2",
5651
"requirejs": "^2.3.6",
52+
"rimraf": "^3.0.2",
5753
"rollup": "^2.55.1",
5854
"rollup-plugin-dts": "^3.0.2",
5955
"rollup-plugin-esbuild": "^4.5.0",
6056
"ts-jest": "^27.0.4",
6157
"tslint": "^6.1.3",
6258
"tslint-config-prettier": "^1.18.0",
6359
"typescript": "^4.3.5"
64-
},
65-
"dependencies": {}
60+
}
6661
}

rollup.config.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
// import commonjs from '@rollup/plugin-commonjs';
21
import dts from 'rollup-plugin-dts';
32
import esbuild from 'rollup-plugin-esbuild';
43

5-
const name = require('./package.json').main.replace(/\.js$/, '');
4+
const name = require('./package.json').main.replace('.umd.js', '');
65

76
const bundle = (config) => ({
8-
...config,
9-
input: 'src/index.ts',
10-
external: (id) => !/^[./]/.test(id),
7+
...config,
8+
input: 'src/index.ts',
9+
external: (id) => !/^[./]/.test(id),
1110
});
1211

1312
export default [
14-
bundle({
15-
plugins: [
16-
// commonjs(),
17-
esbuild(),
18-
],
19-
output: [
20-
{
21-
file: `${name}.js`,
22-
format: 'cjs',
23-
sourcemap: true,
24-
},
25-
{
26-
file: `${name}.mjs`,
27-
format: 'es',
28-
sourcemap: true,
29-
},
30-
],
31-
}),
32-
bundle({
33-
plugins: [dts()],
34-
output: {
35-
file: `${name}.d.ts`,
36-
format: 'es',
37-
},
38-
}),
13+
bundle({
14+
plugins: [
15+
// commonjs(),
16+
esbuild(),
17+
],
18+
output: [
19+
{
20+
file: `${name}.umd.js`,
21+
format: 'umd',
22+
name: 'FrontifyAuthenticator',
23+
sourcemap: true,
24+
},
25+
{
26+
file: `${name}.es.js`,
27+
format: 'es',
28+
sourcemap: true,
29+
},
30+
],
31+
}),
32+
bundle({
33+
plugins: [dts()],
34+
output: {
35+
file: `${name}.d.ts`,
36+
format: 'es',
37+
},
38+
}),
3939
];

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
</p>
6464
</div>
6565
<script type="module">
66-
import {authorize, revoke, refresh} from "../dist/index.mjs";
66+
import {authorize, revoke, refresh} from "../dist/index.es.js";
6767
const POPUP_CONFIG = {
6868
width: 800,
6969
height: 600,

0 commit comments

Comments
 (0)