@crowdin/app-project-module 2.1.0 → 2.3.0

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.
Files changed (59) hide show
  1. package/out/index.d.ts +1 -0
  2. package/out/index.js +5 -1
  3. package/out/middlewares/ui-module.js +1 -2
  4. package/out/modules/about.d.ts +4 -0
  5. package/out/modules/about.js +25 -3
  6. package/out/modules/advisor-inspector/handlers/recheck.d.ts +4 -0
  7. package/out/modules/advisor-inspector/handlers/recheck.js +44 -0
  8. package/out/modules/advisor-inspector/index.d.ts +6 -0
  9. package/out/modules/advisor-inspector/index.js +35 -0
  10. package/out/modules/advisor-inspector/key.d.ts +4 -0
  11. package/out/modules/advisor-inspector/key.js +13 -0
  12. package/out/modules/advisor-inspector/report-insight.d.ts +3 -0
  13. package/out/modules/advisor-inspector/report-insight.js +61 -0
  14. package/out/modules/advisor-inspector/types.d.ts +59 -0
  15. package/out/modules/advisor-inspector/types.js +2 -0
  16. package/out/modules/manifest.js +15 -0
  17. package/out/static/css/styles.css +2 -342
  18. package/out/static/ui/about.bundle.js +542 -0
  19. package/out/static/ui/about.bundle.js.map +1 -0
  20. package/out/static/ui/error.bundle.js +120 -2
  21. package/out/static/ui/error.bundle.js.map +1 -1
  22. package/out/static/ui/form.bundle.js +164 -12
  23. package/out/static/ui/form.bundle.js.map +1 -1
  24. package/out/static/ui/install.bundle.js +8 -2
  25. package/out/static/ui/install.bundle.js.map +1 -1
  26. package/out/static/ui/login.bundle.js +425 -35
  27. package/out/static/ui/login.bundle.js.map +1 -1
  28. package/out/static/ui/main.bundle.js +718 -366
  29. package/out/static/ui/main.bundle.js.map +1 -1
  30. package/out/static/ui/oauth.bundle.js +8 -2
  31. package/out/static/ui/oauth.bundle.js.map +1 -1
  32. package/out/static/ui/subscription.bundle.js +542 -0
  33. package/out/static/ui/subscription.bundle.js.map +1 -0
  34. package/out/storage/drizzle/postgresql/migrations/0002_equal_skrulls.sql +3 -0
  35. package/out/storage/drizzle/postgresql/migrations/meta/0002_snapshot.json +646 -0
  36. package/out/storage/drizzle/postgresql/migrations/meta/_journal.json +7 -0
  37. package/out/storage/drizzle/postgresql/schema.js +2 -1
  38. package/out/storage/drizzle/sqlite/migrations/0001_new_rhodey.sql +26 -0
  39. package/out/storage/drizzle/sqlite/migrations/meta/0001_snapshot.json +687 -0
  40. package/out/storage/drizzle/sqlite/migrations/meta/_journal.json +7 -0
  41. package/out/storage/drizzle/sqlite/schema.js +2 -1
  42. package/out/types.d.ts +6 -0
  43. package/out/util/jsx-renderer.d.ts +2 -1
  44. package/out/util/jsx-renderer.js +8 -8
  45. package/out/views/FormPage.js +2 -2
  46. package/out/views/index.d.ts +0 -2
  47. package/out/views/index.js +1 -5
  48. package/out/views/layout/Head.js +0 -10
  49. package/package.json +5 -2
  50. package/out/static/css/about.css +0 -128
  51. package/out/static/css/crowdin-ui-colors.css +0 -115
  52. package/out/static/js/dependent.js +0 -315
  53. package/out/static/js/main.js +0 -96
  54. package/out/static/js/polyfills/fetch.js +0 -494
  55. package/out/static/js/polyfills/promise.js +0 -375
  56. package/out/views/AboutPage.d.ts +0 -10
  57. package/out/views/AboutPage.js +0 -88
  58. package/out/views/SubscriptionPage.d.ts +0 -7
  59. package/out/views/SubscriptionPage.js +0 -26
@@ -8,6 +8,13 @@
8
8
  "when": 1779645859117,
9
9
  "tag": "0000_init",
10
10
  "breakpoints": true
11
+ },
12
+ {
13
+ "idx": 1,
14
+ "version": "6",
15
+ "when": 1783598873358,
16
+ "tag": "0001_new_rhodey",
17
+ "breakpoints": true
11
18
  }
12
19
  ]
13
20
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.syncedData = exports.unsyncedFiles = exports.translationFileCache = exports.job = exports.integrationSettings = exports.userErrors = exports.webhooks = exports.filesSnapshot = exports.appMetadata = exports.syncSettings = exports.integrationCredentials = exports.crowdinCredentials = void 0;
4
4
  const sqlite_core_1 = require("drizzle-orm/sqlite-core");
5
+ const types_1 = require("../../../modules/integration/util/types");
5
6
  exports.crowdinCredentials = (0, sqlite_core_1.sqliteTable)('crowdin_credentials', {
6
7
  id: (0, sqlite_core_1.text)('id').primaryKey(),
7
8
  app_secret: (0, sqlite_core_1.text)('app_secret'),
@@ -70,7 +71,7 @@ exports.job = (0, sqlite_core_1.sqliteTable)('job', {
70
71
  type: (0, sqlite_core_1.text)('type').notNull(),
71
72
  title: (0, sqlite_core_1.text)('title'),
72
73
  progress: (0, sqlite_core_1.integer)('progress').notNull().default(0),
73
- status: (0, sqlite_core_1.text)('status').notNull().default('CREATED'),
74
+ status: (0, sqlite_core_1.text)('status').notNull().default(types_1.JobStatus.CREATED),
74
75
  payload: (0, sqlite_core_1.text)('payload'),
75
76
  info: (0, sqlite_core_1.text)('info'),
76
77
  data: (0, sqlite_core_1.text)('data'),
package/out/types.d.ts CHANGED
@@ -17,6 +17,7 @@ import { Webhook } from './modules/webhooks/types';
17
17
  import { WorkflowStepTypeModule } from './modules/workflow-step-type/types';
18
18
  import { AiRequestProcessorModule, AiStreamProcessorModule } from './modules/ai-request-processors/types';
19
19
  import { AutomationActionModule } from './modules/automation-action/types';
20
+ import { AdvisorInspectorModule } from './modules/advisor-inspector/types';
20
21
  import { AuthGuardModule } from './modules/auth-guard/types';
21
22
  import { Cron } from './util/cron';
22
23
  import { PostgreStorageConfig } from './storage/drizzle/postgresql';
@@ -276,6 +277,11 @@ export interface ClientConfig extends ImagePath {
276
277
  * qa check module
277
278
  */
278
279
  externalQaCheck?: (ExternalQaCheckModule & ImagePath)[];
280
+ /**
281
+ * Advisor inspector module — app-provided checks surfaced in the Crowdin Advisor.
282
+ * Receives recheck nudges from BE and pushes results via reportAdvisorInsight().
283
+ */
284
+ advisorInspector?: AdvisorInspectorModule[];
279
285
  /**
280
286
  * webhook modules
281
287
  */
@@ -7,8 +7,9 @@ export declare function renderJSXOnServer<P = any>(Component: FC<P>, props: P):
7
7
  /**
8
8
  * Renders a React component to HTML string to be hydrated on client side
9
9
  */
10
- export declare function renderJSXOnClient({ name, props, withHead, }: {
10
+ export declare function renderJSXOnClient({ name, props, head, withHead, }: {
11
11
  name: string;
12
12
  props: any;
13
+ head?: string;
13
14
  withHead?: boolean;
14
15
  }): string;
@@ -4,6 +4,9 @@ exports.renderJSXOnServer = renderJSXOnServer;
4
4
  exports.renderJSXOnClient = renderJSXOnClient;
5
5
  const server_1 = require("react-dom/server");
6
6
  const views_1 = require("../views");
7
+ function serializePageProps(props) {
8
+ return JSON.stringify(props).replace(/</g, '\\u003c');
9
+ }
7
10
  /**
8
11
  * Renders a React component to HTML string
9
12
  * Uses React Server-Side Rendering (renderToStaticMarkup)
@@ -15,19 +18,16 @@ function renderJSXOnServer(Component, props) {
15
18
  /**
16
19
  * Renders a React component to HTML string to be hydrated on client side
17
20
  */
18
- function renderJSXOnClient({ name, props, withHead = true, }) {
19
- const head = withHead ? (0, server_1.renderToStaticMarkup)((0, views_1.Head)(props)) : '';
21
+ function renderJSXOnClient({ name, props, head, withHead = true, }) {
22
+ const htmlHead = head !== null && head !== void 0 ? head : (withHead ? (0, server_1.renderToStaticMarkup)((0, views_1.Head)(props)) : '');
20
23
  return `
21
24
  <!DOCTYPE html>
22
25
  <html>
23
- ${head}
26
+ ${htmlHead}
24
27
  <body>
25
28
  <div id="root"></div>
26
- <script>
27
- // Make props available to client JS
28
- window.__PAGE_PROPS__ = ${JSON.stringify(props).replace(/</g, '\\u003c')};
29
- </script>
30
- <script type="module" src="/assets/ui/${name}.bundle.js"></script>
29
+ <script id="__PAGE_PROPS__" type="application/json">${serializePageProps(props)}</script>
30
+ <script type="module" src="/assets/ui/${name}.bundle.js"></script>
31
31
  </body>
32
32
  </html>
33
33
  `;
@@ -9,10 +9,10 @@ const Head_1 = require("./layout/Head");
9
9
  const FormPage = ({ formGetDataUrl, formPostDataUrl, formPatchDataUrl, formSchema, formUiSchema, sentryData, }) => (react_1.default.createElement("html", { lang: "en" },
10
10
  react_1.default.createElement(Head_1.Head, { sentryData: sentryData }),
11
11
  react_1.default.createElement("body", null,
12
- react_1.default.createElement("div", { className: "i_w", style: { maxWidth: '680px', position: 'relative' } },
12
+ react_1.default.createElement("div", { className: "relative mx-auto max-w-[680px] px-6 py-4" },
13
13
  react_1.default.createElement("crowdin-card", { id: "card", "is-shadowed": true },
14
14
  react_1.default.createElement("div", { id: "form" }),
15
- react_1.default.createElement("div", { id: "form-loading" },
15
+ react_1.default.createElement("div", { id: "form-loading", className: "absolute inset-0 flex items-center justify-center bg-[rgb(251_251_251_/_70%)]" },
16
16
  react_1.default.createElement("crowdin-progress-indicator", null)))),
17
17
  react_1.default.createElement("crowdin-toasts", null),
18
18
  react_1.default.createElement("script", { dangerouslySetInnerHTML: {
@@ -3,6 +3,4 @@
3
3
  * Export all React SSR components for use in route handlers
4
4
  */
5
5
  export { Head } from './layout/Head';
6
- export { AboutPage } from './AboutPage';
7
6
  export { FormPage } from './FormPage';
8
- export { SubscriptionPage } from './SubscriptionPage';
@@ -4,12 +4,8 @@
4
4
  * Export all React SSR components for use in route handlers
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SubscriptionPage = exports.FormPage = exports.AboutPage = exports.Head = void 0;
7
+ exports.FormPage = exports.Head = void 0;
8
8
  var Head_1 = require("./layout/Head");
9
9
  Object.defineProperty(exports, "Head", { enumerable: true, get: function () { return Head_1.Head; } });
10
- var AboutPage_1 = require("./AboutPage");
11
- Object.defineProperty(exports, "AboutPage", { enumerable: true, get: function () { return AboutPage_1.AboutPage; } });
12
10
  var FormPage_1 = require("./FormPage");
13
11
  Object.defineProperty(exports, "FormPage", { enumerable: true, get: function () { return FormPage_1.FormPage; } });
14
- var SubscriptionPage_1 = require("./SubscriptionPage");
15
- Object.defineProperty(exports, "SubscriptionPage", { enumerable: true, get: function () { return SubscriptionPage_1.SubscriptionPage; } });
@@ -11,19 +11,9 @@ const Head = ({ sentryData }) => (react_1.default.createElement("head", null,
11
11
  react_1.default.createElement("meta", { httpEquiv: "X-UA-Compatible", content: "ie=edge" }),
12
12
  react_1.default.createElement("title", null),
13
13
  react_1.default.createElement("link", { rel: "stylesheet", href: "/assets/css/styles.css" }),
14
- react_1.default.createElement("link", { rel: "stylesheet", href: "/assets/css/crowdin-ui-colors.css" }),
15
14
  react_1.default.createElement("script", { type: "module", src: "https://crowdin-web-components.s3.amazonaws.com/crowdin-web-components/crowdin-web-components.esm.js" }),
16
15
  react_1.default.createElement("script", { noModule: true, src: "https://crowdin-web-components.s3.amazonaws.com/crowdin-web-components/crowdin-web-components.js" }),
17
16
  react_1.default.createElement("script", { type: "text/javascript", src: "https://cdn.crowdin.com/apps/dist/iframe.js" }),
18
- react_1.default.createElement("script", { type: "text/javascript", src: "/assets/js/polyfills/promise.js" }),
19
- react_1.default.createElement("script", { type: "text/javascript", src: "/assets/js/polyfills/fetch.js" }),
20
- react_1.default.createElement("script", { type: "text/javascript", src: "/assets/js/main.js" }),
21
- react_1.default.createElement("script", { type: "text/javascript", src: "/assets/js/dependent.js" }),
22
- react_1.default.createElement("style", null, `
23
- .ml-10 {
24
- margin-left: 10px;
25
- }
26
- `),
27
17
  sentryData && (react_1.default.createElement(react_1.default.Fragment, null,
28
18
  react_1.default.createElement("script", { src: "https://browser.sentry-cdn.com/7.60.0/bundle.replay.min.js", integrity: "sha384-N+VZps2PwFdv9LugkPA8nw+SMI1mGJG7IDe49jaxZlWDDJhHQ+SHakMpwhLQLAka", crossOrigin: "anonymous" }),
29
19
  react_1.default.createElement("script", { dangerouslySetInnerHTML: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "Module that generates for you all common endpoints for serving standalone Crowdin App",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",
@@ -37,7 +37,8 @@
37
37
  }
38
38
  },
39
39
  "scripts": {
40
- "build": "npm run build-main && npm run build-ui",
40
+ "build": "npm run build-css && npm run build-main && npm run build-ui",
41
+ "build-css": "tailwindcss -i ./ui/styles/tailwind.css -o ./static/css/styles.css --minify",
41
42
  "build-main": "tsc -p ./ && cp -R static out && cp logo.png out && npm run copy-migrations",
42
43
  "build-ui": "rollup -c rollup-ui.config.mjs",
43
44
  "watch-main": "tsc --watch -p ./ && cp -R static out && cp logo.png out",
@@ -106,6 +107,7 @@
106
107
  "@rollup/plugin-node-resolve": "^16.0.3",
107
108
  "@rollup/plugin-replace": "^6.0.3",
108
109
  "@rollup/plugin-typescript": "12.3.0",
110
+ "@tailwindcss/cli": "^4.3.2",
109
111
  "@types/better-sqlite3": "^7.6.13",
110
112
  "@types/cors": "^2.8.19",
111
113
  "@types/express": "^5.0.3",
@@ -128,6 +130,7 @@
128
130
  "jest-junit": "^16.0.0",
129
131
  "prettier": "^3.8.1",
130
132
  "rollup": "^4.59.0",
133
+ "tailwindcss": "^4.3.2",
131
134
  "ts-jest": "^29.4.6",
132
135
  "typescript": "^5.9.3"
133
136
  },
@@ -1,128 +0,0 @@
1
- /* Base styles */
2
- body {
3
- margin: 0;
4
- font-family: 'Noto Sans', sans-serif;
5
- font-size: 1rem;
6
- font-weight: 400;
7
- line-height: 1.5;
8
- color: rgba(38,50,56,.87);
9
- text-align: left;
10
- background-color: #fff;
11
- }
12
-
13
- h1 {
14
- font-family: 'Poppins', sans-serif;
15
- line-height: 1.2;
16
- color: #050c1a;
17
- font-size: 2.33333rem;
18
- letter-spacing: -.5px;
19
- margin-bottom: 1.5rem;
20
- }
21
-
22
- a {
23
- color: #66bb6a;
24
- text-decoration: none;
25
- }
26
-
27
- a:hover {
28
- color: #66bb6a;
29
- text-decoration: underline;
30
- }
31
-
32
- pre {
33
- display: block;
34
- font-size: 87.5%;
35
- color: #212529;
36
- background-color: #eceff1;
37
- border: 0;
38
- border-radius: .25rem;
39
- padding: 1rem;
40
- }
41
-
42
- /* Layout */
43
- .main {
44
- padding-top: 64px;
45
- padding-bottom: 3rem;
46
- }
47
-
48
- /* Navbar */
49
- .crowdin-navbar {
50
- min-width: 300px;
51
- background-color: #fff;
52
- border-bottom: 1px solid rgba(0,0,0,.1);
53
- padding: 0 1.5rem 0 .75rem;
54
- }
55
-
56
- @media (min-width: 768px) {
57
- .crowdin-navbar {
58
- padding: 0 1.75rem;
59
- justify-content: space-between;
60
- }
61
- }
62
-
63
- .crowdin-navbar__nav-link > a {
64
- color: rgba(38,50,56,.54);
65
- font-family: Poppins, sans-serif;
66
- font-weight: 500;
67
- letter-spacing: .25px;
68
- }
69
-
70
- .crowdin-navbar__nav-link > a:hover {
71
- color: #050c1a;
72
- text-decoration: none;
73
- }
74
-
75
- @media (min-width: 992px) and (max-width:1439.98px) {
76
- .crowdin-navbar__nav-link > a {
77
- font-size: .875rem;
78
- }
79
- }
80
-
81
- /* Product template */
82
- .crwd__product-template__header {
83
- padding-top: 6rem;
84
- font-size: 16px;
85
- font-weight: 400;
86
- line-height: 1.5;
87
- font-family: 'Noto Sans', sans-serif;
88
- color: rgba(40,44,52,0.87);
89
- display: flex;
90
- margin-bottom: 32px;
91
- }
92
-
93
- .crwd__product-single__photo-wrapper {
94
- position: relative;
95
- }
96
-
97
- .description {
98
- font-size: smaller;
99
- }
100
-
101
- .product-single__photo {
102
- margin: 0 auto;
103
- min-height: 1px;
104
- width: 30%;
105
- border-radius: 1rem;
106
- border: 1px solid rgba(0,0,0,.1);
107
- position: relative;
108
- height: 0;
109
- padding-bottom: 30%;
110
- }
111
-
112
- @media (min-width: 992px) {
113
- .product-single__photo {
114
- width: 100%;
115
- padding-bottom: 100%;
116
- }
117
- }
118
-
119
- .image-holder {
120
- position: absolute;
121
- left: 0;
122
- top: 0;
123
- padding: 1rem;
124
- height: 100%;
125
- width: 100%;
126
- display: flex;
127
- align-items: center;
128
- }
@@ -1,115 +0,0 @@
1
- /* text color */
2
- *[class*="crdn-text"] {
3
- color: var(--crdn-color, var(--crowdin-body-color));
4
- }
5
-
6
- .crdn-text\:primary {
7
- --crdn-color: var(--crowdin-primary);
8
- }
9
-
10
- .crdn-text\:title {
11
- --crdn-color: var(--crowdin-title-color);
12
- }
13
-
14
- .crdn-text\:body {
15
- --crdn-color: var(--crowdin-body-color);
16
- }
17
-
18
- .crdn-text\:muted {
19
- --crdn-color: var(--crowdin-text-muted);
20
- }
21
-
22
- .crdn-text\:disabled {
23
- --crdn-color: var(--crowdin-text-disabled);
24
- }
25
-
26
- .crdn-text\:info {
27
- --crdn-color: var(--crowdin-info)
28
- }
29
-
30
- .crdn-text\:success {
31
- --crdn-color: var(--crowdin-success)
32
- }
33
-
34
- .crdn-text\:warning {
35
- --crdn-color: var(--crowdin-warning)
36
- }
37
-
38
- .crdn-text\:danger {
39
- --crdn-color: var(--crowdin-danger)
40
- }
41
-
42
- /* backgrounds */
43
-
44
- *[class*="crdn-bg"] {
45
- background-color: var(--crdn-bg, var(--crowdin-body-bg));
46
- }
47
-
48
- .crdn-bg\:lvl-0 {
49
- --crdn-bg: var(--crowdin-level-0-bg);
50
- }
51
-
52
- .crdn-bg\:lvl-1 {
53
- --crdn-bg: var(--crowdin-level-1-bg);
54
- }
55
-
56
- .crdn-bg\:lvl-2 {
57
- --crdn-bg: var(--crowdin-level-2-bg);
58
- }
59
-
60
- .crdn-bg\:lvl-2\:05 {
61
- --crdn-bg: var(--crowdin-level-2-bg-05);
62
- }
63
-
64
- .crdn-bg\:lvl-3 {
65
- --crdn-bg: var(--crowdin-level-3-bg);
66
- }
67
-
68
- .crdn-bg\:primary {
69
- --crdn-bg: var(--crowdin-primary);
70
- }
71
-
72
- .crdn-bg\:success {
73
- --crdn-bg: var(--crowdin-success-bg)
74
- }
75
-
76
- .crdn-bg\:success {
77
- --crdn-bg: var(--crowdin-success-bg)
78
- }
79
-
80
-
81
- .crdn-bg\:warning {
82
- --crdn-bg: var(--crowdin-warning-bg)
83
- }
84
-
85
- .crdn-bg\:danger {
86
- --crdn-bg: var(--crowdin-danger-bg)
87
- }
88
-
89
- /* borders */
90
-
91
- *[class*="crdn-border"] {
92
- border-width: 1px;
93
- border-style: solid;
94
- border-color: var(--crdn-border, var(--crowdin-border-color));
95
- }
96
-
97
- .crdn-border\:primary {
98
- --crdn-border: var(--crowdin-primary);
99
- }
100
-
101
- .crdn-border\:danger {
102
- --crdn-border: var(--crowdin-danger);
103
- }
104
-
105
- .crdn-border\:info {
106
- --crdn-border: var(--crowdin-danger);
107
- }
108
-
109
- .crdn-border\:success {
110
- --crdn-border: var(--crowdin-success);
111
- }
112
-
113
- .crdn-border\:warning {
114
- --crdn-border: var(--crowdin-warning);
115
- }