Skip to content

Commit 1c5846d

Browse files
committed
[init] the beginning
0 parents  commit 1c5846d

File tree

1,658 files changed

+163502
-0
lines changed

Some content is hidden

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

1,658 files changed

+163502
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea/
2+
logs/
3+
client/.yarn/cache/*.zip

LICENSE

+661
Large diffs are not rendered by default.

README.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Openblocks.dev
2+
## Build internal tools fast, with no limitations. The open-source alternative to Retool.
3+
<img src="https://3434528005-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpL1Hcv4CAzkEXttydyWt%2Fuploads%2FrNzTjsVNjZzTutAYC7Md%2Fimg_v2_34465665-d081-43bd-9513-24b05755198g.gif?alt=media&token=a850499f-e6f4-4ef2-97db-8f08eaf66477"/>
4+
5+
## Use Openblocks in 3 steps
6+
* Connect to any datasource or api.
7+
* Build UI with 50+ components.
8+
* Share with collegues and customers.
9+
10+
## Why Openblocks
11+
It is cumbersome to create a single app, you have to design user interfaces, write code in multiple languages and frameworks, understand how all of that code works together.
12+
13+
Low-code/No-code platforms are fast to get started with, but quickly become unmaintainable and inflexible. This creates more problems than it solves.
14+
15+
Retool-like solutions are great for their simplicity and flexibility, but they can also be limited in different ways compared to frameworks like React/Vue.
16+
17+
Openblocks wants to take it forward. More specifically, Openblocks is
18+
* An all-in-one IDE to create internal or customer-facing apps.
19+
* A place to create, build and share building blocks of web applications.
20+
* A domain specific language that UI-configurable block is the first class citizen.
21+
22+
## Features
23+
* Visual UI builder with 50+ built-in components.
24+
* Native connection to PostgresSQL, MongoDB, Mysql, Redis, Elasticsearch, RestAPI, SMTP etc.
25+
* Write Javascript everywhere, use Javascript to transform data, control components etc.
26+
* Module and Query library, create reusable components/queries using the UI builder.
27+
* Create and share custom components using react and openblocks-sdk(instead of iFrame). (pre-alpha).
28+
* Embed openblocks pages as a react component(instead of iFrame).
29+
* RBAC based access management
30+
* Theme support
31+
* auto-save and rollback to history
32+
* Audit logs
33+
34+
## Comparisons
35+
### Openblocks vs Retool
36+
* Openblocks is open-source. You don't have to worry about vendor lockin or being stuck with an outdated version of the software.
37+
* In Openblocks, developers can create and use their own components instead of depending on offical updates.
38+
* Openblocks supports left menu navigation (like most sites do). Retool has header navigation only.
39+
40+
### Openblocks vs Appsmith, Tooljet
41+
* Openblocks has more components and richer configuration than Appsmith and Tooljet.
42+
* In Openblocks, you can choose between auto-height or fixed-height mode for your components, while Appsmith supports fixed-height mode only.
43+
* In Openblocks, you can reuse common structures when building apps using module and query library features.
44+
45+
46+
### Contributing
47+
* Language support: If you have experience with a language that isn't currently supported by our product, send us a pull request.
48+
* Create and share components/demos: If you've created something that might be useful to others, add the link here.

client/.gitignore

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/packages/*/node_modules
6+
/packages/*/dist
7+
/packages/*/tsdoc-metadata.json
8+
/.pnp
9+
.pnp.js
10+
11+
# testing
12+
/**/coverage
13+
14+
15+
# production
16+
/build
17+
/packages/openblocks/build
18+
19+
# misc
20+
.DS_Store
21+
.env.local
22+
.env.development.local
23+
.env.test.local
24+
.env.production.local
25+
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
30+
/out
31+
/public/fonts/*
32+
/src/assets/icons/fonts/*
33+
.idea
34+
.storybook-out/
35+
cypress/videos
36+
cypress/screenshots
37+
/cypress.env.json
38+
39+
storybook-static/*
40+
build-storybook.log
41+
42+
TODO
43+
44+
.yarn/*
45+
!.yarn/cache
46+
!.yarn/patches
47+
!.yarn/plugins
48+
!.yarn/releases
49+
!.yarn/sdks
50+
!.yarn/versions
51+
52+
/ossutil_output
53+
package-lock.json
54+
55+
op.mjs
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
diff --git a/dist/es/WindowScroller/utils/onScroll.js b/dist/es/WindowScroller/utils/onScroll.js
2+
index d00f0f18c6596e4e57f4f762f91fed4282610c91..c8496e8eabafdf9cf6071986ec446839d7b65556 100644
3+
--- a/dist/es/WindowScroller/utils/onScroll.js
4+
+++ b/dist/es/WindowScroller/utils/onScroll.js
5+
@@ -71,4 +71,3 @@ export function unregisterScrollListener(component, element) {
6+
}
7+
}
8+
}
9+
\ No newline at end of file
10+
-import { bpfrpt_proptype_WindowScroller } from "../WindowScroller.js";
11+
\ No newline at end of file

client/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

+28
Large diffs are not rendered by default.

client/.yarn/releases/yarn-3.2.4.cjs

+801
Large diffs are not rendered by default.

client/.yarnrc.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
nodeLinker: node-modules
2+
3+
npmPublishRegistry: "http://8.141.152.4:4873/"
4+
5+
npmRegistries:
6+
"http://8.141.152.4:4873/":
7+
npmAuthToken: LTW5QZHrSedwHWoOTpqrDg==
8+
9+
npmRegistryServer: "https://registry.npmmirror.com"
10+
11+
plugins:
12+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
13+
spec: "@yarnpkg/plugin-workspace-tools"
14+
15+
unsafeHttpWhitelist:
16+
- 8.141.152.4
17+
18+
yarnPath: .yarn/releases/yarn-3.2.4.cjs

client/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Openblocks
2+
3+
Openblocks frontend app
4+
5+
## Start development
6+
7+
```bash
8+
yarn install
9+
10+
API_PROXY_TARGET={backend-api-addr} yarn start
11+
```

client/VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.21

client/config/test/jest.config.js

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import path from "node:path";
2+
import { buildVars } from "openblocks-dev-utils/buildVars.js";
3+
import { currentDirName } from "openblocks-dev-utils/util.js";
4+
5+
const globals = {};
6+
buildVars.forEach(({ name, defaultValue }) => {
7+
globals[name] = process.env[name] || defaultValue;
8+
});
9+
const isEE = process.env.REACT_APP_EDITION === "enterprise";
10+
const dirname = currentDirName(import.meta.url);
11+
12+
export default {
13+
testEnvironment: "jsdom",
14+
moduleNameMapper: {
15+
"react-markdown": path.resolve(dirname, "./mocks/react-markdown.js"),
16+
"^@openblocks-ee(.*)$": path.resolve(
17+
dirname,
18+
isEE ? "../../packages/openblocks/src/ee/$1" : "../../packages/openblocks/src/$1"
19+
),
20+
"openblocks-sdk": path.resolve(dirname, "../../packages/openblocks/src/index.sdk"),
21+
},
22+
globals,
23+
// roots: ["<rootDir>/src"],
24+
modulePaths: [
25+
"<rootDir>/src",
26+
path.resolve(dirname, "../../packages/openblocks/src"),
27+
path.resolve(dirname, "../../packages/openblocks-comps/src"),
28+
path.resolve(dirname, "../../packages/openblocks-design/src"),
29+
],
30+
setupFiles: [path.resolve(dirname, "./jest.setup.js")],
31+
setupFilesAfterEnv: [path.resolve(dirname, "./jest.setup-after-env.js")],
32+
transform: {
33+
"^.+\\.(js|jsx|mjs|cjs|ts|tsx)$": path.resolve(dirname, "./transform/babelTransform.js"),
34+
"^.+\\.css$": path.resolve(dirname, "./transform/cssTransform.js"),
35+
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": path.resolve(
36+
dirname,
37+
"./transform/fileTransform.js"
38+
),
39+
},
40+
transformIgnorePatterns: [],
41+
resetMocks: true,
42+
};
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// jest-dom adds custom jest matchers for asserting on DOM nodes.
2+
// allows you to do things like:
3+
// expect(element).toHaveTextContent(/react/i)
4+
// learn more: https://github.com/testing-library/jest-dom
5+
import "@testing-library/jest-dom";
6+
7+
// implementation of window.resizeTo for dispatching event
8+
window.resizeTo = function resizeTo(width, height) {
9+
Object.assign(this, {
10+
innerWidth: width,
11+
innerHeight: height,
12+
outerWidth: width,
13+
outerHeight: height,
14+
}).dispatchEvent(new this.Event("resize"));
15+
};

client/config/test/jest.setup.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
if (typeof window !== "undefined") {
2+
require("whatwg-fetch");
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function ReactMarkdown({ children }) {
2+
return <>{children}</>;
3+
}
4+
5+
export default ReactMarkdown;

client/config/test/setup.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// jest-dom adds custom jest matchers for asserting on DOM nodes.
2+
// allows you to do things like:
3+
// expect(element).toHaveTextContent(/react/i)
4+
// learn more: https://github.com/testing-library/jest-dom
5+
import "@testing-library/jest-dom";
6+
7+
// import matchMediaPolyfill from "mq-polyfill";
8+
9+
// matchMediaPolyfill(window);
10+
// // implementation of window.resizeTo for dispatching event
11+
// window.resizeTo = function resizeTo(width, height) {
12+
// Object.assign(this, {
13+
// innerWidth: width,
14+
// innerHeight: height,
15+
// outerWidth: width,
16+
// outerHeight: height,
17+
// }).dispatchEvent(new this.Event("resize"));
18+
// };
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import babelJest from "babel-jest";
2+
3+
export default babelJest.createTransformer({
4+
presets: [
5+
[
6+
"babel-preset-react-app",
7+
{
8+
runtime: "automatic",
9+
},
10+
],
11+
],
12+
babelrc: false,
13+
configFile: false,
14+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This is a custom Jest transformer turning style imports into empty objects.
2+
// http://facebook.github.io/jest/docs/en/webpack.html
3+
4+
export default {
5+
process() {
6+
return {
7+
code: "module.exports = {};",
8+
};
9+
},
10+
getCacheKey() {
11+
// The output is always the same.
12+
return {
13+
code: "cssTransform",
14+
};
15+
},
16+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import path from "node:path";
2+
import camelcase from "camelcase";
3+
4+
// This is a custom Jest transformer turning file imports into filenames.
5+
// http://facebook.github.io/jest/docs/en/webpack.html
6+
7+
export default {
8+
process(src, filename) {
9+
const assetFilename = JSON.stringify(path.basename(filename));
10+
11+
if (filename.match(/\.svg$/)) {
12+
// Based on how SVGR generates a component name:
13+
// https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
14+
const pascalCaseFilename = camelcase(path.parse(filename).name, {
15+
pascalCase: true,
16+
});
17+
const componentName = `Svg${pascalCaseFilename}`;
18+
return {
19+
code: `
20+
const React = require('react');
21+
module.exports = {
22+
__esModule: true,
23+
default: ${assetFilename},
24+
ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
25+
return {
26+
$$typeof: Symbol.for('react.element'),
27+
type: 'svg',
28+
ref: ref,
29+
key: null,
30+
props: Object.assign({}, props, {
31+
children: ${assetFilename}
32+
})
33+
};
34+
}),
35+
};`,
36+
};
37+
}
38+
39+
return {
40+
code: `module.exports = ${assetFilename};`,
41+
};
42+
},
43+
};

client/jest.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
projects: ["<rootDir>/packages/*"],
3+
};

0 commit comments

Comments
 (0)