freemium-ui 2.0.0-beta.2 → 2.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Freshworks
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "freemium-ui",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.3",
4
4
  "description": "React Ui Components for Freemium Apps",
5
- "main": "lib/index.js",
6
- "module": "lib/index.esm.js",
7
- "types": "lib/index.d.ts",
8
- "directories": {
9
- "lib": "lib"
10
- },
5
+ "main": "dist/index.cjs.js",
6
+ "module": "dist/index.js",
7
+ "typings": "dist/index.d.ts",
11
8
  "dependencies": {
12
9
  "@blueprintjs/datetime2": "^2.3.1",
13
10
  "@dnd-kit/core": "^6.1.0",
@@ -41,7 +38,6 @@
41
38
  "devDependencies": {
42
39
  "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
43
40
  "@rollup/plugin-commonjs": "^25.0.7",
44
- "@rollup/plugin-inject": "^5.0.5",
45
41
  "@rollup/plugin-node-resolve": "^15.2.3",
46
42
  "@rollup/plugin-terser": "^0.4.4",
47
43
  "@rollup/plugin-typescript": "^11.1.6",
@@ -63,6 +59,8 @@
63
59
  "@types/react": "^18.2.38",
64
60
  "@types/react-dom": "^18.2.17",
65
61
  "@types/react-transition-group": "^4.4.10",
62
+ "@types/rollup-plugin-generate-package-json": "^3.2.8",
63
+ "@types/rollup-plugin-peer-deps-external": "^2.2.4",
66
64
  "@types/styled-components": "^5.1.34",
67
65
  "babel-plugin-named-exports-order": "^0.0.2",
68
66
  "eslint-plugin-storybook": "^0.6.15",
@@ -72,18 +70,21 @@
72
70
  "prop-types": "^15.8.1",
73
71
  "rollup": "^4.9.6",
74
72
  "rollup-plugin-dts": "^6.1.0",
75
- "rollup-plugin-import-css": "^3.4.0",
73
+ "rollup-plugin-generate-package-json": "^3.2.0",
74
+ "rollup-plugin-peer-deps-external": "^2.2.4",
75
+ "rollup-plugin-postcss": "^4.0.2",
76
76
  "storybook": "^7.6.15",
77
77
  "webpack": "^5.89.0"
78
78
  },
79
79
  "scripts": {
80
80
  "version:beta": "npm version prerelease --preid=beta",
81
81
  "publish:beta": "npm publish --tag beta",
82
- "version": "npm version patch",
83
- "publish": "npm publish",
82
+ "prepublish": "npm run build",
84
83
  "start": "react-scripts start",
85
84
  "build:react-app": "react-scripts build",
86
- "build": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
85
+ "build": "npm run rollup && npm run post:build",
86
+ "post:build": "node ./scripts/frankBuild.js",
87
+ "rollup": "rm -rf dist && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
87
88
  "test": "react-scripts test",
88
89
  "eject": "react-scripts eject",
89
90
  "check": "prettier --check .",
@@ -0,0 +1,33 @@
1
+ const fs = require('fs');
2
+ export const getFolders = (entry) => {
3
+ const dirs = fs.readdirSync(entry);
4
+ const dirsWithoutIndex = dirs
5
+ .filter((name) => name !== 'index.ts')
6
+ .filter((name) => name !== 'utils');
7
+ return dirsWithoutIndex;
8
+ };
9
+
10
+ export const getFiles = (entry, extensions = [], excludeExtensions = []) => {
11
+ let fileNames = [];
12
+ const dirs = fs.readdirSync(entry);
13
+ dirs.forEach((dir) => {
14
+ const path = `${entry}/${dir}`;
15
+
16
+ if (fs.lstatSync(path).isDirectory()) {
17
+ fileNames = [
18
+ ...fileNames,
19
+ ...getFiles(path, extensions, excludeExtensions),
20
+ ];
21
+
22
+ return;
23
+ }
24
+
25
+ if (
26
+ !excludeExtensions.some((exclude) => dir.endsWith(exclude)) &&
27
+ extensions.some((ext) => dir.endsWith(ext))
28
+ ) {
29
+ fileNames.push(path);
30
+ }
31
+ });
32
+ return fileNames;
33
+ };
@@ -0,0 +1,100 @@
1
+ /* eslint-disable no-console */
2
+ const { resolve, join, basename } = require('path');
3
+ const { readFile, writeFile, copy, remove } = require('fs-extra');
4
+ const packagePath = process.cwd();
5
+ const distPath = join(packagePath, './dist');
6
+
7
+ // const components = [
8
+ // 'Alert',
9
+ // 'Button',
10
+ // 'Checkbox',
11
+ // 'Confirmation',
12
+ // 'Drawer',
13
+ // 'Dropdown',
14
+ // 'Icons',
15
+ // 'Input',
16
+ // 'Loader',
17
+ // 'Menu',
18
+ // 'Modal',
19
+ // 'MultiSelectDropdown',
20
+ // 'Pickers',
21
+ // 'Popover',
22
+ // 'Radio',
23
+ // 'Reorder',
24
+ // 'Table',
25
+ // 'Tabs',
26
+ // 'Tag',
27
+ // 'ThemeProvider',
28
+ // 'Toast',
29
+ // 'Toggle',
30
+ // 'Tooltip',
31
+ // 'Transition',
32
+ // 'Typography',
33
+ // ];
34
+
35
+ const writeJson = (targetPath, obj) =>
36
+ writeFile(targetPath, JSON.stringify(obj, null, 2), 'utf8');
37
+
38
+ async function createPackageFile() {
39
+ const packageData = await readFile(
40
+ resolve(packagePath, './package.json'),
41
+ 'utf8',
42
+ );
43
+ const { scripts, devDependencies, ...packageOthers } =
44
+ JSON.parse(packageData);
45
+ const newPackageData = {
46
+ ...packageOthers,
47
+ private: false,
48
+ typings: './index.d.ts',
49
+ main: './index.js',
50
+ module: './index.js',
51
+ };
52
+
53
+ const targetPath = resolve(distPath, './package.json');
54
+
55
+ await writeJson(targetPath, newPackageData);
56
+ console.log(`Created package.json in ${targetPath}`);
57
+ }
58
+
59
+ async function cleanUp() {
60
+ // const targetPath = resolve(distPath, './types');
61
+ // await remove(targetPath);
62
+ // const copySourcePath = resolve(distPath, './types/src/components');
63
+ // const copyTargetPath = resolve(distPath, './');
64
+ // await copy(copySourcePath, copyTargetPath);
65
+ // console.log('Types copied');
66
+ // await Promise.all(
67
+ // components.map(async (component) => {
68
+ // const sourcePath = resolve(
69
+ // distPath,
70
+ // `./types/src/components/${component}`,
71
+ // );
72
+ // const targetPath = resolve(distPath, `./${component}`);
73
+ // await copy(sourcePath, targetPath);
74
+ // console.log(`Copied ${sourcePath} to ${targetPath}`);
75
+ // }),
76
+ // );
77
+ await remove(resolve(distPath, `./types`));
78
+ console.log('Types cleared');
79
+ }
80
+
81
+ async function includeFileInBuild(file) {
82
+ const sourcePath = resolve(packagePath, file);
83
+ const targetPath = resolve(distPath, basename(file));
84
+ await copy(sourcePath, targetPath);
85
+ console.log(`Copied ${sourcePath} to ${targetPath}`);
86
+ }
87
+
88
+ async function run() {
89
+ try {
90
+ await createPackageFile();
91
+ await includeFileInBuild('./README.md');
92
+ // await includeFileInBuild('../../LICENSE');
93
+ await cleanUp();
94
+ } catch (err) {
95
+ console.error(err);
96
+ process.exit(1);
97
+ }
98
+ }
99
+
100
+ run();
@@ -1 +0,0 @@
1
- "use strict";var e=require("./index-4croX9DV.js"),r=require("./index-u6cJndUc.js"),t=require("./index-GUn9nFX6.js");require("react/jsx-runtime"),require("react"),require("react-dom"),require("react-remove-scroll"),require("@floating-ui/react-dom"),require("react-is"),require("react-day-picker"),require("react-popper"),require("react-transition-group"),require("react-uid"),require("react-innertext"),exports.IconSvgPaths16=e.IconSvgPaths16,exports.IconSvgPaths20=r.IconSvgPaths20,exports.getIconPaths=function(a,i){var c=t.pascalCase(a);return i===t.IconSize.STANDARD?e.IconSvgPaths16[c]:r.IconSvgPaths20[c]},exports.iconNameToPathsRecordKey=function(e){return t.pascalCase(e)};
@@ -1 +0,0 @@
1
- import{I as r}from"./index-7EbF0dW2.js";import{I as t}from"./index-y8BjCJFH.js";import{p as i,I as o}from"./index-nKZqXJSi.js";import"react/jsx-runtime";import"react";import"react-dom";import"react-remove-scroll";import"@floating-ui/react-dom";import"react-is";import"react-day-picker";import"react-popper";import"react-transition-group";import"react-uid";import"react-innertext";function e(e,m){var p=i(e);return m===o.STANDARD?r[p]:t[p]}function m(r){return i(r)}export{r as IconSvgPaths16,t as IconSvgPaths20,e as getIconPaths,m as iconNameToPathsRecordKey};
@@ -1 +0,0 @@
1
- import{_ as t,a as r}from"./index-nKZqXJSi.js";import"react/jsx-runtime";import"react";import"react-dom";import"react-remove-scroll";import"@floating-ui/react-dom";import"react-is";import"react-day-picker";import"react-popper";import"react-transition-group";import"react-uid";import"react-innertext";var i=function(i,o){return t(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,import("./allPaths-ZvyseO3W.js")];case 1:return[2,(0,t.sent().getIconPaths)(i,o)]}}))}))};export{i as allPathsLoader};
@@ -1 +0,0 @@
1
- "use strict";var e=require("./index-GUn9nFX6.js");require("react/jsx-runtime"),require("react"),require("react-dom"),require("react-remove-scroll"),require("@floating-ui/react-dom"),require("react-is"),require("react-day-picker"),require("react-popper"),require("react-transition-group"),require("react-uid"),require("react-innertext");exports.allPathsLoader=function(r,t){return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then((function(){return require("./allPaths-WmpInmc6.js")}))];case 1:return[2,(0,e.sent().getIconPaths)(r,t)]}}))}))};