progress on migrating to heex templates and font-icons

This commit is contained in:
Adam Piontek 2022-08-13 07:32:36 -04:00
commit 3eff955672
21793 changed files with 2161968 additions and 16895 deletions
assets_old/node_modules/@babel/plugin-transform-modules-amd

View file

@ -0,0 +1,22 @@
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -0,0 +1,19 @@
# @babel/plugin-transform-modules-amd
> This plugin transforms ES2015 modules to AMD
See our website [@babel/plugin-transform-modules-amd](https://babeljs.io/docs/en/babel-plugin-transform-modules-amd) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/plugin-transform-modules-amd
```
or using yarn:
```sh
yarn add @babel/plugin-transform-modules-amd --dev
```

View file

@ -0,0 +1,165 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _helperModuleTransforms = require("@babel/helper-module-transforms");
var _core = require("@babel/core");
var _utils = require("babel-plugin-dynamic-import-node/utils");
const buildWrapper = (0, _core.template)(`
define(MODULE_NAME, AMD_ARGUMENTS, function(IMPORT_NAMES) {
})
`);
const buildAnonymousWrapper = (0, _core.template)(`
define(["require"], function(REQUIRE) {
})
`);
function injectWrapper(path, wrapper) {
const {
body,
directives
} = path.node;
path.node.directives = [];
path.node.body = [];
const amdWrapper = path.pushContainer("body", wrapper)[0];
const amdFactory = amdWrapper.get("expression.arguments").filter(arg => arg.isFunctionExpression())[0].get("body");
amdFactory.pushContainer("directives", directives);
amdFactory.pushContainer("body", body);
}
var _default = (0, _helperPluginUtils.declare)((api, options) => {
var _api$assumption, _api$assumption2;
api.assertVersion(7);
const {
allowTopLevelThis,
strict,
strictMode,
noInterop
} = options;
const constantReexports = (_api$assumption = api.assumption("constantReexports")) != null ? _api$assumption : options.loose;
const enumerableModuleMeta = (_api$assumption2 = api.assumption("enumerableModuleMeta")) != null ? _api$assumption2 : options.loose;
return {
name: "transform-modules-amd",
pre() {
this.file.set("@babel/plugin-transform-modules-*", "amd");
},
visitor: {
CallExpression(path, state) {
if (!this.file.has("@babel/plugin-proposal-dynamic-import")) return;
if (!path.get("callee").isImport()) return;
let {
requireId,
resolveId,
rejectId
} = state;
if (!requireId) {
requireId = path.scope.generateUidIdentifier("require");
state.requireId = requireId;
}
if (!resolveId || !rejectId) {
resolveId = path.scope.generateUidIdentifier("resolve");
rejectId = path.scope.generateUidIdentifier("reject");
state.resolveId = resolveId;
state.rejectId = rejectId;
}
let result = _core.types.identifier("imported");
if (!noInterop) result = (0, _helperModuleTransforms.wrapInterop)(path, result, "namespace");
path.replaceWith(_core.template.expression.ast`
new Promise((${resolveId}, ${rejectId}) =>
${requireId}(
[${(0, _utils.getImportSource)(_core.types, path.node)}],
imported => ${_core.types.cloneNode(resolveId)}(${result}),
${_core.types.cloneNode(rejectId)}
)
)`);
},
Program: {
exit(path, {
requireId
}) {
if (!(0, _helperModuleTransforms.isModule)(path)) {
if (requireId) {
injectWrapper(path, buildAnonymousWrapper({
REQUIRE: _core.types.cloneNode(requireId)
}));
}
return;
}
const amdArgs = [];
const importNames = [];
if (requireId) {
amdArgs.push(_core.types.stringLiteral("require"));
importNames.push(_core.types.cloneNode(requireId));
}
let moduleName = (0, _helperModuleTransforms.getModuleName)(this.file.opts, options);
if (moduleName) moduleName = _core.types.stringLiteral(moduleName);
const {
meta,
headers
} = (0, _helperModuleTransforms.rewriteModuleStatementsAndPrepareHeader)(path, {
enumerableModuleMeta,
constantReexports,
strict,
strictMode,
allowTopLevelThis,
noInterop
});
if ((0, _helperModuleTransforms.hasExports)(meta)) {
amdArgs.push(_core.types.stringLiteral("exports"));
importNames.push(_core.types.identifier(meta.exportName));
}
for (const [source, metadata] of meta.source) {
amdArgs.push(_core.types.stringLiteral(source));
importNames.push(_core.types.identifier(metadata.name));
if (!(0, _helperModuleTransforms.isSideEffectImport)(metadata)) {
const interop = (0, _helperModuleTransforms.wrapInterop)(path, _core.types.identifier(metadata.name), metadata.interop);
if (interop) {
const header = _core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.identifier(metadata.name), interop));
header.loc = metadata.loc;
headers.push(header);
}
}
headers.push(...(0, _helperModuleTransforms.buildNamespaceInitStatements)(meta, metadata, constantReexports));
}
(0, _helperModuleTransforms.ensureStatementsHoisted)(headers);
path.unshiftContainer("body", headers);
injectWrapper(path, buildWrapper({
MODULE_NAME: moduleName,
AMD_ARGUMENTS: _core.types.arrayExpression(amdArgs),
IMPORT_NAMES: importNames
}));
}
}
}
};
});
exports.default = _default;

View file

@ -0,0 +1,31 @@
{
"name": "@babel/plugin-transform-modules-amd",
"version": "7.13.0",
"description": "This plugin transforms ES2015 modules to AMD",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-plugin-transform-modules-amd"
},
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-modules-amd",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "lib/index.js",
"dependencies": {
"@babel/helper-module-transforms": "^7.13.0",
"@babel/helper-plugin-utils": "^7.13.0",
"babel-plugin-dynamic-import-node": "^2.3.3"
},
"keywords": [
"babel-plugin"
],
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "7.13.0",
"@babel/helper-plugin-test-runner": "7.12.13"
}
}