From 64da0dac133260ab037a2ff37dc09c722c25d0b3 Mon Sep 17 00:00:00 2001 From: Ayush Goyal Date: Mon, 15 Nov 2021 23:30:13 +0530 Subject: [PATCH 1/5] create standalone package --- examples/js/.gitignore | 5 + examples/js/favicon.svg | 15 ++ examples/js/index.html | 13 ++ examples/js/package.json | 17 ++ examples/js/src/main.ts | 10 + examples/js/src/vite-env.d.ts | 1 + examples/js/tsconfig.json | 22 ++ examples/js/vite.config.ts | 19 ++ package.json | 1 + packages/standalone/.gitignore | 1 + packages/standalone/LICENSE | 201 ++++++++++++++++++ packages/standalone/package.json | 41 ++++ .../src/components/Authenticator.tsx | 13 ++ packages/standalone/src/components/index.ts | 1 + packages/standalone/src/globals.js | 12 ++ .../src/helpers/imperative-handle.ts | 32 +++ packages/standalone/src/helpers/index.ts | 1 + packages/standalone/src/index.ts | 3 + packages/standalone/src/styles.css | 1 + packages/standalone/tsconfig.json | 17 ++ packages/standalone/tsup.config.js | 24 +++ yarn.lock | 117 ++++++++++ 22 files changed, 567 insertions(+) create mode 100644 examples/js/.gitignore create mode 100644 examples/js/favicon.svg create mode 100644 examples/js/index.html create mode 100644 examples/js/package.json create mode 100644 examples/js/src/main.ts create mode 100644 examples/js/src/vite-env.d.ts create mode 100644 examples/js/tsconfig.json create mode 100644 examples/js/vite.config.ts create mode 100644 packages/standalone/.gitignore create mode 100644 packages/standalone/LICENSE create mode 100644 packages/standalone/package.json create mode 100644 packages/standalone/src/components/Authenticator.tsx create mode 100644 packages/standalone/src/components/index.ts create mode 100644 packages/standalone/src/globals.js create mode 100644 packages/standalone/src/helpers/imperative-handle.ts create mode 100644 packages/standalone/src/helpers/index.ts create mode 100644 packages/standalone/src/index.ts create mode 100644 packages/standalone/src/styles.css create mode 100644 packages/standalone/tsconfig.json create mode 100644 packages/standalone/tsup.config.js diff --git a/examples/js/.gitignore b/examples/js/.gitignore new file mode 100644 index 00000000000..53f7466aca7 --- /dev/null +++ b/examples/js/.gitignore @@ -0,0 +1,5 @@ +node_modules +.DS_Store +dist +dist-ssr +*.local \ No newline at end of file diff --git a/examples/js/favicon.svg b/examples/js/favicon.svg new file mode 100644 index 00000000000..de4aeddc12b --- /dev/null +++ b/examples/js/favicon.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/examples/js/index.html b/examples/js/index.html new file mode 100644 index 00000000000..867581c5124 --- /dev/null +++ b/examples/js/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/examples/js/package.json b/examples/js/package.json new file mode 100644 index 00000000000..08e1982dc07 --- /dev/null +++ b/examples/js/package.json @@ -0,0 +1,17 @@ +{ + "name": "js", + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "serve": "vite preview" + }, + "dependencies": { + "@aws-amplify/ui-standalone": "1.0.0", + "aws-amplify": "^4.1.3" + }, + "devDependencies": { + "typescript": "^4.3.2", + "vite": "^2.6.4" + } +} diff --git a/examples/js/src/main.ts b/examples/js/src/main.ts new file mode 100644 index 00000000000..4ec5466085e --- /dev/null +++ b/examples/js/src/main.ts @@ -0,0 +1,10 @@ +import { Amplify } from 'aws-amplify'; +import { Authenticator } from '@aws-amplify/ui-standalone'; +import awsExports from '@environments/auth-with-username-no-attributes/src/aws-exports'; +import '@aws-amplify/ui-standalone/styles.css'; + +Amplify.configure(awsExports); + +const container = document.querySelector('#app')!; + +new Authenticator({ container }); diff --git a/examples/js/src/vite-env.d.ts b/examples/js/src/vite-env.d.ts new file mode 100644 index 00000000000..11f02fe2a00 --- /dev/null +++ b/examples/js/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/js/tsconfig.json b/examples/js/tsconfig.json new file mode 100644 index 00000000000..9cf5e00797f --- /dev/null +++ b/examples/js/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ESNext", "DOM"], + "moduleResolution": "Node", + "strict": true, + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "noImplicitAny": false, + "noEmit": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "paths": { + "@environments/*": ["../../environments/*"] + } + }, + "include": ["./src"] +} diff --git a/examples/js/vite.config.ts b/examples/js/vite.config.ts new file mode 100644 index 00000000000..7614e2120a4 --- /dev/null +++ b/examples/js/vite.config.ts @@ -0,0 +1,19 @@ +import { defineConfig } from 'vite'; + +const path = require('path'); + +// https://vitejs.dev/config/ +export default defineConfig({ + server: { + port: 3001, + }, + resolve: { + preserveSymlinks: true, + alias: [ + { + find: '@environments', + replacement: path.resolve(__dirname, '../../environments/'), + }, + ], + }, +}); diff --git a/package.json b/package.json index ce5bc143fd3..44c252e039e 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "react": "yarn workspace @aws-amplify/ui-react", "ui": "yarn workspace @aws-amplify/ui", "vue": "yarn workspace @aws-amplify/ui-vue", + "standalone": "yarn workspace @aws-amplify/ui-standalone", "angular-example": "yarn workspace angular-example", "docs": "yarn workspace docs", "next-example": "yarn workspace next-example", diff --git a/packages/standalone/.gitignore b/packages/standalone/.gitignore new file mode 100644 index 00000000000..1521c8b7652 --- /dev/null +++ b/packages/standalone/.gitignore @@ -0,0 +1 @@ +dist diff --git a/packages/standalone/LICENSE b/packages/standalone/LICENSE new file mode 100644 index 00000000000..d6a3301d623 --- /dev/null +++ b/packages/standalone/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2017 - 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/standalone/package.json b/packages/standalone/package.json new file mode 100644 index 00000000000..64a98e9f1d0 --- /dev/null +++ b/packages/standalone/package.json @@ -0,0 +1,41 @@ +{ + "name": "@aws-amplify/ui-standalone", + "version": "1.0.0", + "main": "dist/index.js", + "module": "dist/esm/index.js", + "exports": { + ".": "./dist/index.js", + "./styles.css": "./dist/index.css" + }, + "browser": { + "./styles.css": "./dist/index.css" + }, + "types": "dist/index.d.ts", + "license": "Apache-2.0", + "files": [ + "dist", + "LICENSE" + ], + "scripts": { + "prebuild": "rimraf dist", + "build": "tsup --minify", + "dev": "tsup --watch src", + "clean": "rimraf dist", + "lint": "tsc --noEmit", + "test": "yarn test:unit", + "test:unit": "jest --passWithNoTests" + }, + "peerDependencies": { + "aws-amplify": "3.x.x || 4.x.x" + }, + "devDependencies": { + "@aws-amplify/ui-react": "^1.2.22", + "@types/jest": "^26.0.23", + "esbuild-plugin-alias": "^0.1.2", + "jest": "^27.0.4", + "preact": "^10.5.15", + "rimraf": "^3.0.2", + "ts-jest": "^27.0.3", + "typescript": "^4.3.2" + } +} diff --git a/packages/standalone/src/components/Authenticator.tsx b/packages/standalone/src/components/Authenticator.tsx new file mode 100644 index 00000000000..c33842d2994 --- /dev/null +++ b/packages/standalone/src/components/Authenticator.tsx @@ -0,0 +1,13 @@ +import { Authenticator as AuthenticatorComponent } from '@aws-amplify/ui-react'; + +import { BaseImperativeHandle, BaseImperativeHandleProps } from '../helpers'; + +export class Authenticator extends BaseImperativeHandle { + constructor(props: BaseImperativeHandleProps) { + super(props); + + this._render( + {() =>

Howdy

}
+ ); + } +} diff --git a/packages/standalone/src/components/index.ts b/packages/standalone/src/components/index.ts new file mode 100644 index 00000000000..82c26be9aa4 --- /dev/null +++ b/packages/standalone/src/components/index.ts @@ -0,0 +1 @@ +export * from './Authenticator'; diff --git a/packages/standalone/src/globals.js b/packages/standalone/src/globals.js new file mode 100644 index 00000000000..24f2b43bf6a --- /dev/null +++ b/packages/standalone/src/globals.js @@ -0,0 +1,12 @@ +/** + * This shim exists for `esbuild` to `inject` into every .tsx file. + * Otherwise, `import * as React from 'react'` would need to be added manually + * + * See: https://esbuild.github.io/content-types/#auto-import-for-jsx + * See: https://github.com/egoist/tsup/issues/390 + */ + +window['global'] = window; + +import * as React from 'react'; +export { React }; diff --git a/packages/standalone/src/helpers/imperative-handle.ts b/packages/standalone/src/helpers/imperative-handle.ts new file mode 100644 index 00000000000..96637eae2fe --- /dev/null +++ b/packages/standalone/src/helpers/imperative-handle.ts @@ -0,0 +1,32 @@ +import * as ReactDOM from 'react-dom'; + +export interface BaseImperativeHandleProps { + /** + * The DOM element or its ID where the component will be mounted + */ + container: string | HTMLElement; +} + +export abstract class BaseImperativeHandle { + protected _container: HTMLElement; + + constructor(props: BaseImperativeHandleProps) { + this._container = this._getContainer(props.container); + } + + protected _getContainer(container: string | HTMLElement): HTMLElement { + if (typeof container !== 'string') { + return container; + } + + return document.getElementById(container); + } + + protected _render(element: React.ReactElement) { + ReactDOM.render(element, this._container); + } + + public destroy() { + ReactDOM.render(null, this._container); + } +} diff --git a/packages/standalone/src/helpers/index.ts b/packages/standalone/src/helpers/index.ts new file mode 100644 index 00000000000..eab1dba3f92 --- /dev/null +++ b/packages/standalone/src/helpers/index.ts @@ -0,0 +1 @@ +export * from './imperative-handle'; diff --git a/packages/standalone/src/index.ts b/packages/standalone/src/index.ts new file mode 100644 index 00000000000..5866996aefc --- /dev/null +++ b/packages/standalone/src/index.ts @@ -0,0 +1,3 @@ +import './styles.css'; + +export * from './components'; diff --git a/packages/standalone/src/styles.css b/packages/standalone/src/styles.css new file mode 100644 index 00000000000..dea8300a3ad --- /dev/null +++ b/packages/standalone/src/styles.css @@ -0,0 +1 @@ +@import '@aws-amplify/ui-react/styles.css'; diff --git a/packages/standalone/tsconfig.json b/packages/standalone/tsconfig.json new file mode 100644 index 00000000000..d0a5e56ca0a --- /dev/null +++ b/packages/standalone/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "baseUrl": ".", + "declaration": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "rootDir": "./src", + "outDir": "./dist", + "skipLibCheck": true, + "sourceMap": true, + "module": "esnext", + "target": "es2015" + }, + "exclude": ["node_modules"], + "include": ["src/**/*.ts", "src/**/*.tsx"] +} diff --git a/packages/standalone/tsup.config.js b/packages/standalone/tsup.config.js new file mode 100644 index 00000000000..f18682b6235 --- /dev/null +++ b/packages/standalone/tsup.config.js @@ -0,0 +1,24 @@ +const alias = require('esbuild-plugin-alias'); + +/** + * @type {import("tsup").Options} + */ +module.exports = { + dts: true, + entryPoints: ['src/index.ts'], + esbuildPlugins: [ + alias({ + react: require.resolve('preact/compat'), + 'react-dom': require.resolve('preact/compat'), + 'react-dom/test-utils': require.resolve('preact/test-utils'), + 'react/jsx-runtime': require.resolve('preact/jsx-runtime'), + }), + ], + // `aws-amplify` is external, but sub-dependencies weren't automatically externalized ("require" statements were included) + external: ['`aws-amplify', /^@aws-amplify\/(core|auth)/], + format: ['cjs', 'esm'], + // ! .cjs/.mjs doesn't work with Angular's webpack4 config by default! + legacyOutput: true, + sourcemap: 'external', + splitting: false, +}; diff --git a/yarn.lock b/yarn.lock index c6e209337a3..86dbeaa2386 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10430,6 +10430,7 @@ es6-symbol@^3.1.1, es6-symbol@~3.1.3: d "^1.0.1" ext "^1.1.2" +<<<<<<< HEAD esbuild-android-arm64@0.13.15: version "0.13.15" resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.13.15.tgz#3fc3ff0bab76fe35dd237476b5d2b32bb20a3d44" @@ -10599,6 +10600,97 @@ esbuild-windows-arm64@0.13.15: version "0.13.15" resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.15.tgz#482173070810df22a752c686509c370c3be3b3c3" integrity sha512-zzvyCVVpbwQQATaf3IG8mu1IwGEiDxKkYUdA4FpoCHi1KtPa13jeScYDjlW0Qh+ebWzpKfR2ZwvqAQkSWNcKjA== +======= +esbuild-android-arm64@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.13.8.tgz#c20e875c3c98164b1ffba9b28637bdf96f5e9e7c" + integrity sha512-AilbChndywpk7CdKkNSZ9klxl+9MboLctXd9LwLo3b0dawmOF/i/t2U5d8LM6SbT1Xw36F8yngSUPrd8yPs2RA== + +esbuild-darwin-64@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.13.8.tgz#f46e6b471ddbf62265234808a6a1aa91df18a417" + integrity sha512-b6sdiT84zV5LVaoF+UoMVGJzR/iE2vNUfUDfFQGrm4LBwM/PWXweKpuu6RD9mcyCq18cLxkP6w/LD/w9DtX3ng== + +esbuild-darwin-arm64@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.8.tgz#a991157a6013facd4f2e14159b7da52626c90154" + integrity sha512-R8YuPiiJayuJJRUBG4H0VwkEKo6AvhJs2m7Tl0JaIer3u1FHHXwGhMxjJDmK+kXwTFPriSysPvcobXC/UrrZCQ== + +esbuild-freebsd-64@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.8.tgz#301601d2e443ad458960e359b402a17d9500be9d" + integrity sha512-zBn6urrn8FnKC+YSgDxdof9jhPCeU8kR/qaamlV4gI8R3KUaUK162WYM7UyFVAlj9N0MyD3AtB+hltzu4cysTw== + +esbuild-freebsd-arm64@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.8.tgz#039a63acc12ec0892006c147ea221e55f9125a9f" + integrity sha512-pWW2slN7lGlkx0MOEBoUGwRX5UgSCLq3dy2c8RIOpiHtA87xAUpDBvZK10MykbT+aMfXc0NI2lu1X+6kI34xng== + +esbuild-linux-32@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.13.8.tgz#c537b67d7e694b60bfa2786581412838c6ba0284" + integrity sha512-T0I0ueeKVO/Is0CAeSEOG9s2jeNNb8jrrMwG9QBIm3UU18MRB60ERgkS2uV3fZ1vP2F8i3Z2e3Zju4lg9dhVmw== + +esbuild-linux-64@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.13.8.tgz#0092fc8a064001a777bfa0e3b425bb8be8f96e6a" + integrity sha512-Bm8SYmFtvfDCIu9sjKppFXzRXn2BVpuCinU1ChTuMtdKI/7aPpXIrkqBNOgPTOQO9AylJJc1Zw6EvtKORhn64w== + +esbuild-linux-arm64@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.8.tgz#5cd3f2bb924212971482e8dbc25c4afd09b28110" + integrity sha512-X4pWZ+SL+FJ09chWFgRNO3F+YtvAQRcWh0uxKqZSWKiWodAB20flsW/OWFYLXBKiVCTeoGMvENZS/GeVac7+tQ== + +esbuild-linux-arm@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.13.8.tgz#ad634f96bf2975536907aeb9fdb75a3194f4ddce" + integrity sha512-4/HfcC40LJ4GPyboHA+db0jpFarTB628D1ifU+/5bunIgY+t6mHkJWyxWxAAE8wl/ZIuRYB9RJFdYpu1AXGPdg== + +esbuild-linux-mips64le@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.8.tgz#57857edfebf9bf65766dc8be1637f2179c990572" + integrity sha512-o7e0D+sqHKT31v+mwFircJFjwSKVd2nbkHEn4l9xQ1hLR+Bv8rnt3HqlblY3+sBdlrOTGSwz0ReROlKUMJyldA== + +esbuild-linux-ppc64le@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.8.tgz#fdb82a059a5b86bb10fb42091b4ebcf488b9cd46" + integrity sha512-eZSQ0ERsWkukJp2px/UWJHVNuy0lMoz/HZcRWAbB6reoaBw7S9vMzYNUnflfL3XA6WDs+dZn3ekHE4Y2uWLGig== + +esbuild-netbsd-64@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.8.tgz#d7879e7123d3b2c04754ece8bd061aa6866deeff" + integrity sha512-gZX4kP7gVvOrvX0ZwgHmbuHczQUwqYppxqtoyC7VNd80t5nBHOFXVhWo2Ad/Lms0E8b+wwgI/WjZFTCpUHOg9Q== + +esbuild-openbsd-64@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.8.tgz#88b280b6cb0a3f6adb60abf27fc506c506a35cf0" + integrity sha512-afzza308X4WmcebexbTzAgfEWt9MUkdTvwIa8xOu4CM2qGbl2LanqEl8/LUs8jh6Gqw6WsicEK52GPrS9wvkcw== + +esbuild-plugin-alias@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/esbuild-plugin-alias/-/esbuild-plugin-alias-0.1.2.tgz#1232fbde807c0c8ad44c44ec859819eb492e12a8" + integrity sha512-WsX0OJy8IGOsGZV+4oHEU5B6XQUpxOsZN1iSoYf9COTDbY7WXcOwd1oCLYNWUIWCExyGXSghIGq2k7sXBldxwQ== + +esbuild-sunos-64@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.13.8.tgz#229ae7c7703196a58acd0f0291ad9bebda815d63" + integrity sha512-mWPZibmBbuMKD+LDN23LGcOZ2EawMYBONMXXHmbuxeT0XxCNwadbCVwUQ/2p5Dp5Kvf6mhrlIffcnWOiCBpiVw== + +esbuild-windows-32@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.13.8.tgz#892d093e32a21c0c9135e5a0ffdc380aeb70e763" + integrity sha512-QsZ1HnWIcnIEApETZWw8HlOhDSWqdZX2SylU7IzGxOYyVcX7QI06ety/aDcn437mwyO7Ph4RrbhB+2ntM8kX8A== + +esbuild-windows-64@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.13.8.tgz#7defd8d79ae3bb7e6f53b65a7190be7daf901686" + integrity sha512-76Fb57B9eE/JmJi1QmUW0tRLQZfGo0it+JeYoCDTSlbTn7LV44ecOHIMJSSgZADUtRMWT9z0Kz186bnaB3amSg== + +esbuild-windows-arm64@0.13.8: + version "0.13.8" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.8.tgz#e59ae004496fd8a5ab67bfc7945a2e47480d6fb9" + integrity sha512-HW6Mtq5eTudllxY2YgT62MrVcn7oq2o8TAoAvDUhyiEmRmDY8tPwAhb1vxw5/cdkbukM3KdMYtksnUhF/ekWeg== +>>>>>>> f44d1a3b4 (create standalone package) esbuild-windows-arm64@0.14.8: version "0.14.8" @@ -17932,6 +18024,19 @@ postcss@^8.1.10, postcss@^8.1.4, postcss@^8.1.6, postcss@^8.2.4, postcss@^8.2.6, picocolors "^1.0.0" source-map-js "^1.0.1" +<<<<<<< HEAD +======= +postinstall-postinstall@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3" + integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ== + +preact@^10.5.15: + version "10.5.15" + resolved "https://registry.yarnpkg.com/preact/-/preact-10.5.15.tgz#6df94d8afecf3f9e10a742fd8c362ddab464225f" + integrity sha512-5chK29n6QcJc3m1lVrKQSQ+V7K1Gb8HeQY6FViQ5AxCAEGu3DaHffWNDkC9+miZgsLvbvU9rxbV1qinGHMHzqA== + +>>>>>>> 3d232f2d1 (create standalone package) preferred-pm@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/preferred-pm/-/preferred-pm-3.0.3.tgz#1b6338000371e3edbce52ef2e4f65eb2e73586d6" @@ -22201,6 +22306,18 @@ vite@^2.4.2, vite@^2.5.1: optionalDependencies: fsevents "~2.3.2" +vite@^2.6.4: + version "2.6.14" + resolved "https://registry.yarnpkg.com/vite/-/vite-2.6.14.tgz#35c09a15e4df823410819a2a239ab11efb186271" + integrity sha512-2HA9xGyi+EhY2MXo0+A2dRsqsAG3eFNEVIo12olkWhOmc8LfiM+eMdrXf+Ruje9gdXgvSqjLI9freec1RUM5EA== + dependencies: + esbuild "^0.13.2" + postcss "^8.3.8" + resolve "^1.20.0" + rollup "^2.57.0" + optionalDependencies: + fsevents "~2.3.2" + vm-browserify@1.1.2, vm-browserify@^1.0.0, vm-browserify@^1.0.1: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" From ca24e29923f219299a0ed022aeb9a36e180971bb Mon Sep 17 00:00:00 2001 From: Ayush Goyal Date: Mon, 22 Nov 2021 18:46:54 +0530 Subject: [PATCH 2/5] update deps --- examples/js/index.html | 6 +++++- examples/js/vite.config.ts | 4 ++++ packages/standalone/package.json | 2 +- packages/standalone/tsup.config.js | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/examples/js/index.html b/examples/js/index.html index 867581c5124..82766580edd 100644 --- a/examples/js/index.html +++ b/examples/js/index.html @@ -4,10 +4,14 @@ - Vite App + JS Example
+ diff --git a/examples/js/vite.config.ts b/examples/js/vite.config.ts index 7614e2120a4..efa91d7e624 100644 --- a/examples/js/vite.config.ts +++ b/examples/js/vite.config.ts @@ -7,6 +7,10 @@ export default defineConfig({ server: { port: 3001, }, + define: { + 'process.env': process.env, + 'process.argv': [], + }, resolve: { preserveSymlinks: true, alias: [ diff --git a/packages/standalone/package.json b/packages/standalone/package.json index 64a98e9f1d0..5b3b0cfe823 100644 --- a/packages/standalone/package.json +++ b/packages/standalone/package.json @@ -29,7 +29,7 @@ "aws-amplify": "3.x.x || 4.x.x" }, "devDependencies": { - "@aws-amplify/ui-react": "^1.2.22", + "@aws-amplify/ui-react": "^2.0.0", "@types/jest": "^26.0.23", "esbuild-plugin-alias": "^0.1.2", "jest": "^27.0.4", diff --git a/packages/standalone/tsup.config.js b/packages/standalone/tsup.config.js index f18682b6235..dd47a90aac6 100644 --- a/packages/standalone/tsup.config.js +++ b/packages/standalone/tsup.config.js @@ -15,7 +15,7 @@ module.exports = { }), ], // `aws-amplify` is external, but sub-dependencies weren't automatically externalized ("require" statements were included) - external: ['`aws-amplify', /^@aws-amplify\/(core|auth)/], + external: ['aws-amplify', /^@aws-amplify\/(core|auth)/], format: ['cjs', 'esm'], // ! .cjs/.mjs doesn't work with Angular's webpack4 config by default! legacyOutput: true, From 05c11553e131bdc4c598719c02de32f2d9d3230c Mon Sep 17 00:00:00 2001 From: Ayush Goyal Date: Thu, 6 Jan 2022 21:32:13 +0530 Subject: [PATCH 3/5] rebase from main --- examples/js/index.html | 5 +++++ examples/js/tsconfig.json | 1 + examples/js/vite.config.ts | 8 ++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/js/index.html b/examples/js/index.html index 82766580edd..e5aac823fcc 100644 --- a/examples/js/index.html +++ b/examples/js/index.html @@ -10,6 +10,11 @@
diff --git a/examples/js/tsconfig.json b/examples/js/tsconfig.json index 9cf5e00797f..44086de4b3e 100644 --- a/examples/js/tsconfig.json +++ b/examples/js/tsconfig.json @@ -14,6 +14,7 @@ "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": true, + "skipLibCheck": true, "paths": { "@environments/*": ["../../environments/*"] } diff --git a/examples/js/vite.config.ts b/examples/js/vite.config.ts index efa91d7e624..d0072940861 100644 --- a/examples/js/vite.config.ts +++ b/examples/js/vite.config.ts @@ -7,10 +7,6 @@ export default defineConfig({ server: { port: 3001, }, - define: { - 'process.env': process.env, - 'process.argv': [], - }, resolve: { preserveSymlinks: true, alias: [ @@ -18,6 +14,10 @@ export default defineConfig({ find: '@environments', replacement: path.resolve(__dirname, '../../environments/'), }, + { + find: './runtimeConfig', + replacement: './runtimeConfig.browser', + }, ], }, }); From 02b4709deff3a8e2b8ed8ad25d195100f3806a99 Mon Sep 17 00:00:00 2001 From: Ayush Goyal Date: Thu, 6 Jan 2022 21:32:44 +0530 Subject: [PATCH 4/5] add remaining file --- packages/standalone/package.json | 1 + packages/standalone/tsup.config.js | 2 + yarn.lock | 188 ++++++++++------------------- 3 files changed, 65 insertions(+), 126 deletions(-) diff --git a/packages/standalone/package.json b/packages/standalone/package.json index 5b3b0cfe823..71452402b93 100644 --- a/packages/standalone/package.json +++ b/packages/standalone/package.json @@ -31,6 +31,7 @@ "devDependencies": { "@aws-amplify/ui-react": "^2.0.0", "@types/jest": "^26.0.23", + "esbuild-node-builtins": "^0.1.0", "esbuild-plugin-alias": "^0.1.2", "jest": "^27.0.4", "preact": "^10.5.15", diff --git a/packages/standalone/tsup.config.js b/packages/standalone/tsup.config.js index dd47a90aac6..dbc7c41ea1f 100644 --- a/packages/standalone/tsup.config.js +++ b/packages/standalone/tsup.config.js @@ -1,4 +1,5 @@ const alias = require('esbuild-plugin-alias'); +const { nodeBuiltIns } = require('esbuild-node-builtins'); /** * @type {import("tsup").Options} @@ -13,6 +14,7 @@ module.exports = { 'react-dom/test-utils': require.resolve('preact/test-utils'), 'react/jsx-runtime': require.resolve('preact/jsx-runtime'), }), + nodeBuiltIns(), ], // `aws-amplify` is external, but sub-dependencies weren't automatically externalized ("require" statements were included) external: ['aws-amplify', /^@aws-amplify\/(core|auth)/], diff --git a/yarn.lock b/yarn.lock index 86dbeaa2386..8cd2a724fe8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6818,7 +6818,7 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= -assert@2.0.0: +assert@2.0.0, assert@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/assert/-/assert-2.0.0.tgz#95fc1c616d48713510680f2eaf2d10dd22e02d32" integrity sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A== @@ -7655,6 +7655,14 @@ buffer@^5.5.0: base64-js "^1.3.1" ieee754 "^1.1.13" +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + buffer@~5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" @@ -8695,7 +8703,7 @@ connect@^3.7.0: parseurl "~1.3.3" utils-merge "1.0.1" -console-browserify@^1.1.0: +console-browserify@^1.1.0, console-browserify@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== @@ -8993,7 +9001,7 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -crypto-browserify@3.12.0, crypto-browserify@^3.0.0, crypto-browserify@^3.11.0: +crypto-browserify@3.12.0, crypto-browserify@^3.0.0, crypto-browserify@^3.11.0, crypto-browserify@^3.12.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== @@ -10002,6 +10010,11 @@ domain-browser@^1.1.1, domain-browser@^1.2.0: resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== +domain-browser@^4.19.0: + version "4.22.0" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-4.22.0.tgz#6ddd34220ec281f9a65d3386d267ddd35c491f9f" + integrity sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw== + domelementtype@1: version "1.3.1" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" @@ -10430,7 +10443,6 @@ es6-symbol@^3.1.1, es6-symbol@~3.1.3: d "^1.0.1" ext "^1.1.2" -<<<<<<< HEAD esbuild-android-arm64@0.13.15: version "0.13.15" resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.13.15.tgz#3fc3ff0bab76fe35dd237476b5d2b32bb20a3d44" @@ -10556,6 +10568,36 @@ esbuild-netbsd-64@0.14.8: resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.8.tgz#8159d8eae111f80ea6e4cbfa5d4cf658388a72d4" integrity sha512-tjyDak2/pp0VUAhBW6/ueuReMd5qLHNlisXl5pq0Xn0z+kH9urA/t1igm0JassWbdMz123td5ZEQWoD9KbtOAw== +esbuild-node-builtins@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/esbuild-node-builtins/-/esbuild-node-builtins-0.1.0.tgz#6c239dbe97d1a9d23f67a420b295ef3bc928df88" + integrity sha512-/9vvf347QxWeMN0oCVw7T1bfSg23Gv/TEYkUq/LMUudmRteoXs/iJ8uaLuBhCHUopqePqvW6nGE0b5SGOctliw== + dependencies: + assert "^2.0.0" + browserify-zlib "^0.2.0" + buffer "^6.0.3" + console-browserify "^1.2.0" + constants-browserify "^1.0.0" + crypto-browserify "^3.12.0" + domain-browser "^4.19.0" + events "^3.3.0" + https-browserify "^1.0.0" + os-browserify "^0.3.0" + path-browserify "^1.0.1" + process "^0.11.10" + punycode "^2.1.1" + querystring-es3 "^0.2.1" + readable-stream "^2.0.2" + stream-browserify "^3.0.0" + stream-http "^3.2.0" + string_decoder "^1.3.0" + timers-browserify "^2.0.12" + tslib "^2.2.0" + tty-browserify "^0.0.1" + url "^0.11.0" + util "^0.12.3" + vm-browserify "^1.1.2" + esbuild-openbsd-64@0.13.15: version "0.13.15" resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.15.tgz#b22c0e5806d3a1fbf0325872037f885306b05cd7" @@ -10566,6 +10608,11 @@ esbuild-openbsd-64@0.14.8: resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.8.tgz#2a9498d881a3ab94927c724f34dd1160eef1f3b8" integrity sha512-zAKKV15fIyAuDDga5rQv0lW2ufBWj/OCjqjDBb3dJf5SfoAi/DMIHuzmkKQeDQ+oxt9Rp1D7ZOlOBVflutFTqQ== +esbuild-plugin-alias@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/esbuild-plugin-alias/-/esbuild-plugin-alias-0.1.2.tgz#1232fbde807c0c8ad44c44ec859819eb492e12a8" + integrity sha512-WsX0OJy8IGOsGZV+4oHEU5B6XQUpxOsZN1iSoYf9COTDbY7WXcOwd1oCLYNWUIWCExyGXSghIGq2k7sXBldxwQ== + esbuild-sunos-64@0.13.15: version "0.13.15" resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.13.15.tgz#d0b6454a88375ee8d3964daeff55c85c91c7cef4" @@ -10600,97 +10647,6 @@ esbuild-windows-arm64@0.13.15: version "0.13.15" resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.15.tgz#482173070810df22a752c686509c370c3be3b3c3" integrity sha512-zzvyCVVpbwQQATaf3IG8mu1IwGEiDxKkYUdA4FpoCHi1KtPa13jeScYDjlW0Qh+ebWzpKfR2ZwvqAQkSWNcKjA== -======= -esbuild-android-arm64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.13.8.tgz#c20e875c3c98164b1ffba9b28637bdf96f5e9e7c" - integrity sha512-AilbChndywpk7CdKkNSZ9klxl+9MboLctXd9LwLo3b0dawmOF/i/t2U5d8LM6SbT1Xw36F8yngSUPrd8yPs2RA== - -esbuild-darwin-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.13.8.tgz#f46e6b471ddbf62265234808a6a1aa91df18a417" - integrity sha512-b6sdiT84zV5LVaoF+UoMVGJzR/iE2vNUfUDfFQGrm4LBwM/PWXweKpuu6RD9mcyCq18cLxkP6w/LD/w9DtX3ng== - -esbuild-darwin-arm64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.8.tgz#a991157a6013facd4f2e14159b7da52626c90154" - integrity sha512-R8YuPiiJayuJJRUBG4H0VwkEKo6AvhJs2m7Tl0JaIer3u1FHHXwGhMxjJDmK+kXwTFPriSysPvcobXC/UrrZCQ== - -esbuild-freebsd-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.8.tgz#301601d2e443ad458960e359b402a17d9500be9d" - integrity sha512-zBn6urrn8FnKC+YSgDxdof9jhPCeU8kR/qaamlV4gI8R3KUaUK162WYM7UyFVAlj9N0MyD3AtB+hltzu4cysTw== - -esbuild-freebsd-arm64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.8.tgz#039a63acc12ec0892006c147ea221e55f9125a9f" - integrity sha512-pWW2slN7lGlkx0MOEBoUGwRX5UgSCLq3dy2c8RIOpiHtA87xAUpDBvZK10MykbT+aMfXc0NI2lu1X+6kI34xng== - -esbuild-linux-32@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.13.8.tgz#c537b67d7e694b60bfa2786581412838c6ba0284" - integrity sha512-T0I0ueeKVO/Is0CAeSEOG9s2jeNNb8jrrMwG9QBIm3UU18MRB60ERgkS2uV3fZ1vP2F8i3Z2e3Zju4lg9dhVmw== - -esbuild-linux-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.13.8.tgz#0092fc8a064001a777bfa0e3b425bb8be8f96e6a" - integrity sha512-Bm8SYmFtvfDCIu9sjKppFXzRXn2BVpuCinU1ChTuMtdKI/7aPpXIrkqBNOgPTOQO9AylJJc1Zw6EvtKORhn64w== - -esbuild-linux-arm64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.8.tgz#5cd3f2bb924212971482e8dbc25c4afd09b28110" - integrity sha512-X4pWZ+SL+FJ09chWFgRNO3F+YtvAQRcWh0uxKqZSWKiWodAB20flsW/OWFYLXBKiVCTeoGMvENZS/GeVac7+tQ== - -esbuild-linux-arm@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.13.8.tgz#ad634f96bf2975536907aeb9fdb75a3194f4ddce" - integrity sha512-4/HfcC40LJ4GPyboHA+db0jpFarTB628D1ifU+/5bunIgY+t6mHkJWyxWxAAE8wl/ZIuRYB9RJFdYpu1AXGPdg== - -esbuild-linux-mips64le@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.8.tgz#57857edfebf9bf65766dc8be1637f2179c990572" - integrity sha512-o7e0D+sqHKT31v+mwFircJFjwSKVd2nbkHEn4l9xQ1hLR+Bv8rnt3HqlblY3+sBdlrOTGSwz0ReROlKUMJyldA== - -esbuild-linux-ppc64le@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.8.tgz#fdb82a059a5b86bb10fb42091b4ebcf488b9cd46" - integrity sha512-eZSQ0ERsWkukJp2px/UWJHVNuy0lMoz/HZcRWAbB6reoaBw7S9vMzYNUnflfL3XA6WDs+dZn3ekHE4Y2uWLGig== - -esbuild-netbsd-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.8.tgz#d7879e7123d3b2c04754ece8bd061aa6866deeff" - integrity sha512-gZX4kP7gVvOrvX0ZwgHmbuHczQUwqYppxqtoyC7VNd80t5nBHOFXVhWo2Ad/Lms0E8b+wwgI/WjZFTCpUHOg9Q== - -esbuild-openbsd-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.8.tgz#88b280b6cb0a3f6adb60abf27fc506c506a35cf0" - integrity sha512-afzza308X4WmcebexbTzAgfEWt9MUkdTvwIa8xOu4CM2qGbl2LanqEl8/LUs8jh6Gqw6WsicEK52GPrS9wvkcw== - -esbuild-plugin-alias@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/esbuild-plugin-alias/-/esbuild-plugin-alias-0.1.2.tgz#1232fbde807c0c8ad44c44ec859819eb492e12a8" - integrity sha512-WsX0OJy8IGOsGZV+4oHEU5B6XQUpxOsZN1iSoYf9COTDbY7WXcOwd1oCLYNWUIWCExyGXSghIGq2k7sXBldxwQ== - -esbuild-sunos-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.13.8.tgz#229ae7c7703196a58acd0f0291ad9bebda815d63" - integrity sha512-mWPZibmBbuMKD+LDN23LGcOZ2EawMYBONMXXHmbuxeT0XxCNwadbCVwUQ/2p5Dp5Kvf6mhrlIffcnWOiCBpiVw== - -esbuild-windows-32@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.13.8.tgz#892d093e32a21c0c9135e5a0ffdc380aeb70e763" - integrity sha512-QsZ1HnWIcnIEApETZWw8HlOhDSWqdZX2SylU7IzGxOYyVcX7QI06ety/aDcn437mwyO7Ph4RrbhB+2ntM8kX8A== - -esbuild-windows-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.13.8.tgz#7defd8d79ae3bb7e6f53b65a7190be7daf901686" - integrity sha512-76Fb57B9eE/JmJi1QmUW0tRLQZfGo0it+JeYoCDTSlbTn7LV44ecOHIMJSSgZADUtRMWT9z0Kz186bnaB3amSg== - -esbuild-windows-arm64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.8.tgz#e59ae004496fd8a5ab67bfc7945a2e47480d6fb9" - integrity sha512-HW6Mtq5eTudllxY2YgT62MrVcn7oq2o8TAoAvDUhyiEmRmDY8tPwAhb1vxw5/cdkbukM3KdMYtksnUhF/ekWeg== ->>>>>>> f44d1a3b4 (create standalone package) esbuild-windows-arm64@0.14.8: version "0.14.8" @@ -11214,7 +11170,7 @@ events@^2.0.0: resolved "https://registry.yarnpkg.com/events/-/events-2.1.0.tgz#2a9a1e18e6106e0e812aa9ebd4a819b3c29c0ba5" integrity sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg== -events@^3.0.0, events@^3.1.0, events@^3.2.0: +events@^3.0.0, events@^3.1.0, events@^3.2.0, events@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== @@ -12734,7 +12690,7 @@ idb@5.0.6: resolved "https://registry.yarnpkg.com/idb/-/idb-5.0.6.tgz#8c94624f5a8a026abe3bef3c7166a5febd1cadc1" integrity sha512-/PFvOWPzRcEPmlDt5jEvzVZVs0wyd/EvGvkDIcbBpGuMMLQKrTPG0TxvE2UJtgZtCQCmOtM2QD7yQJBVEjKGOw== -ieee754@^1.1.13, ieee754@^1.1.4: +ieee754@^1.1.13, ieee754@^1.1.4, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -18024,19 +17980,11 @@ postcss@^8.1.10, postcss@^8.1.4, postcss@^8.1.6, postcss@^8.2.4, postcss@^8.2.6, picocolors "^1.0.0" source-map-js "^1.0.1" -<<<<<<< HEAD -======= -postinstall-postinstall@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3" - integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ== - preact@^10.5.15: version "10.5.15" resolved "https://registry.yarnpkg.com/preact/-/preact-10.5.15.tgz#6df94d8afecf3f9e10a742fd8c362ddab464225f" integrity sha512-5chK29n6QcJc3m1lVrKQSQ+V7K1Gb8HeQY6FViQ5AxCAEGu3DaHffWNDkC9+miZgsLvbvU9rxbV1qinGHMHzqA== ->>>>>>> 3d232f2d1 (create standalone package) preferred-pm@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/preferred-pm/-/preferred-pm-3.0.3.tgz#1b6338000371e3edbce52ef2e4f65eb2e73586d6" @@ -18460,7 +18408,7 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== -querystring-es3@0.2.1, querystring-es3@^0.2.0, querystring-es3@~0.2.0: +querystring-es3@0.2.1, querystring-es3@^0.2.0, querystring-es3@^0.2.1, querystring-es3@~0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= @@ -20365,7 +20313,7 @@ stream-http@^2.7.2: to-arraybuffer "^1.0.0" xtend "^4.0.0" -stream-http@^3.0.0: +stream-http@^3.0.0, stream-http@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-3.2.0.tgz#1872dfcf24cb15752677e40e5c3f9cc1926028b5" integrity sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A== @@ -20515,7 +20463,7 @@ string.prototype.trimstart@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" -string_decoder@1.3.0, string_decoder@^1.0.0, string_decoder@^1.1.1: +string_decoder@1.3.0, string_decoder@^1.0.0, string_decoder@^1.1.1, string_decoder@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== @@ -21098,7 +21046,7 @@ thunky@^1.0.2: resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d" integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA== -timers-browserify@2.0.12, timers-browserify@^2.0.4: +timers-browserify@2.0.12, timers-browserify@^2.0.12, timers-browserify@^2.0.4: version "2.0.12" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.12.tgz#44a45c11fbf407f34f97bccd1577c652361b00ee" integrity sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ== @@ -21392,7 +21340,7 @@ tslib@^1.0.0, tslib@^1.10.0, tslib@^1.11.1, tslib@^1.13.0, tslib@^1.8.0, tslib@^ resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.3, tslib@^2.3.0: +tslib@^2.0.0, tslib@^2.0.3, tslib@^2.2.0, tslib@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== @@ -21455,7 +21403,7 @@ tty-browserify@0.0.0: resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= -tty-browserify@0.0.1: +tty-browserify@0.0.1, tty-browserify@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" integrity sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw== @@ -22145,7 +22093,7 @@ util@0.10.3: dependencies: inherits "2.0.1" -util@0.12.4, util@^0.12.0, util@~0.12.0: +util@0.12.4, util@^0.12.0, util@^0.12.3, util@~0.12.0: version "0.12.4" resolved "https://registry.yarnpkg.com/util/-/util-0.12.4.tgz#66121a31420df8f01ca0c464be15dfa1d1850253" integrity sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw== @@ -22294,19 +22242,7 @@ vite-plugin-pages@^0.18.0: json5 "^2.2.0" yaml "^2.0.0-8" -vite@^2.4.2, vite@^2.5.1: - version "2.6.14" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.6.14.tgz#35c09a15e4df823410819a2a239ab11efb186271" - integrity sha512-2HA9xGyi+EhY2MXo0+A2dRsqsAG3eFNEVIo12olkWhOmc8LfiM+eMdrXf+Ruje9gdXgvSqjLI9freec1RUM5EA== - dependencies: - esbuild "^0.13.2" - postcss "^8.3.8" - resolve "^1.20.0" - rollup "^2.57.0" - optionalDependencies: - fsevents "~2.3.2" - -vite@^2.6.4: +vite@^2.4.2, vite@^2.5.1, vite@^2.6.4: version "2.6.14" resolved "https://registry.yarnpkg.com/vite/-/vite-2.6.14.tgz#35c09a15e4df823410819a2a239ab11efb186271" integrity sha512-2HA9xGyi+EhY2MXo0+A2dRsqsAG3eFNEVIo12olkWhOmc8LfiM+eMdrXf+Ruje9gdXgvSqjLI9freec1RUM5EA== @@ -22318,7 +22254,7 @@ vite@^2.6.4: optionalDependencies: fsevents "~2.3.2" -vm-browserify@1.1.2, vm-browserify@^1.0.0, vm-browserify@^1.0.1: +vm-browserify@1.1.2, vm-browserify@^1.0.0, vm-browserify@^1.0.1, vm-browserify@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== From d776d85264e493ca719ea526b955cfa1b1b31f8d Mon Sep 17 00:00:00 2001 From: Ayush Goyal Date: Thu, 6 Jan 2022 23:53:00 +0530 Subject: [PATCH 5/5] update to inject --- packages/standalone/src/{globals.js => react-shim.js} | 0 packages/standalone/tsup.config.js | 1 + 2 files changed, 1 insertion(+) rename packages/standalone/src/{globals.js => react-shim.js} (100%) diff --git a/packages/standalone/src/globals.js b/packages/standalone/src/react-shim.js similarity index 100% rename from packages/standalone/src/globals.js rename to packages/standalone/src/react-shim.js diff --git a/packages/standalone/tsup.config.js b/packages/standalone/tsup.config.js index dbc7c41ea1f..0ce9995ebdb 100644 --- a/packages/standalone/tsup.config.js +++ b/packages/standalone/tsup.config.js @@ -19,6 +19,7 @@ module.exports = { // `aws-amplify` is external, but sub-dependencies weren't automatically externalized ("require" statements were included) external: ['aws-amplify', /^@aws-amplify\/(core|auth)/], format: ['cjs', 'esm'], + inject: ['src/react-shim.js'], // ! .cjs/.mjs doesn't work with Angular's webpack4 config by default! legacyOutput: true, sourcemap: 'external',