@embroider/compat 3.7.1 → 3.8.1-unstable.f779011
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel.js +1 -0
- package/package.json +15 -17
- package/src/audit/babel-visitor.js +7 -1
- package/src/audit/babel-visitor.js.map +1 -1
- package/src/audit/build.js.map +1 -1
- package/src/audit/options.d.ts +2 -1
- package/src/audit/options.js.map +1 -1
- package/src/audit.d.ts +7 -57
- package/src/audit.js +101 -301
- package/src/audit.js.map +1 -1
- package/src/babel-plugin-adjust-imports.js +19 -18
- package/src/babel-plugin-adjust-imports.js.map +1 -1
- package/src/babel.d.ts +17 -0
- package/src/babel.js +146 -0
- package/src/babel.js.map +1 -0
- package/src/compat-adapters/@ember-data/store.d.ts +1 -5
- package/src/compat-adapters/@ember-data/store.js +3 -15
- package/src/compat-adapters/@ember-data/store.js.map +1 -1
- package/src/compat-adapters/active-model-adapter.d.ts +1 -1
- package/src/compat-adapters/ember-asset-loader.d.ts +1 -1
- package/src/compat-adapters/ember-cli-addon-docs.d.ts +1 -1
- package/src/compat-adapters/ember-cli-fastboot.js +0 -1
- package/src/compat-adapters/ember-cli-fastboot.js.map +1 -1
- package/src/compat-adapters/ember-cli-mirage.js +0 -1
- package/src/compat-adapters/ember-cli-mirage.js.map +1 -1
- package/src/compat-adapters/ember-decorators.d.ts +1 -1
- package/src/compat-adapters/ember-fetch.d.ts +5 -0
- package/src/compat-adapters/{ember-macro-helpers.js → ember-fetch.js} +5 -4
- package/src/compat-adapters/ember-fetch.js.map +1 -0
- package/src/compat-adapters/ember-percy.d.ts +1 -1
- package/src/compat-adapters/ember-resolver.d.ts +4 -0
- package/src/compat-adapters/ember-resolver.js +21 -0
- package/src/compat-adapters/ember-resolver.js.map +1 -0
- package/src/compat-adapters/ember-scroll-modifiers.d.ts +1 -1
- package/src/compat-adapters/ember-source.d.ts +3 -6
- package/src/compat-adapters/ember-source.js +26 -41
- package/src/compat-adapters/ember-source.js.map +1 -1
- package/src/compat-adapters/ember-test-selectors.d.ts +1 -1
- package/src/compat-addons.js +1 -1
- package/src/compat-addons.js.map +1 -1
- package/src/compat-app-builder.d.ts +13 -65
- package/src/compat-app-builder.js +133 -1271
- package/src/compat-app-builder.js.map +1 -1
- package/src/compat-app.d.ts +6 -23
- package/src/compat-app.js +77 -218
- package/src/compat-app.js.map +1 -1
- package/src/content-for-config.d.ts +11 -0
- package/src/content-for-config.js +66 -0
- package/src/content-for-config.js.map +1 -0
- package/src/default-pipeline.d.ts +3 -5
- package/src/default-pipeline.js +11 -49
- package/src/default-pipeline.js.map +1 -1
- package/src/dependency-rules.d.ts +1 -0
- package/src/dependency-rules.js +19 -11
- package/src/dependency-rules.js.map +1 -1
- package/src/detect-babel-plugins.d.ts +1 -0
- package/src/detect-babel-plugins.js +14 -0
- package/src/detect-babel-plugins.js.map +1 -1
- package/src/http-audit.d.ts +13 -0
- package/src/http-audit.js +60 -0
- package/src/http-audit.js.map +1 -0
- package/src/index.d.ts +2 -2
- package/src/index.js +2 -4
- package/src/index.js.map +1 -1
- package/src/module-visitor.d.ts +52 -0
- package/src/module-visitor.js +285 -0
- package/src/module-visitor.js.map +1 -0
- package/src/options.d.ts +5 -4
- package/src/options.js +4 -5
- package/src/options.js.map +1 -1
- package/src/resolver-transform.js +56 -15
- package/src/resolver-transform.js.map +1 -1
- package/src/standalone-addon-build.js +6 -15
- package/src/standalone-addon-build.js.map +1 -1
- package/src/v1-addon.d.ts +4 -4
- package/src/v1-addon.js.map +1 -1
- package/src/v1-config.d.ts +0 -8
- package/src/v1-config.js +1 -51
- package/src/v1-config.js.map +1 -1
- package/src/audit-cli.d.ts +0 -2
- package/src/audit-cli.js +0 -150
- package/src/audit-cli.js.map +0 -1
- package/src/compat-adapters/@ember-data/debug.d.ts +0 -6
- package/src/compat-adapters/@ember-data/debug.js +0 -22
- package/src/compat-adapters/@ember-data/debug.js.map +0 -1
- package/src/compat-adapters/ember-macro-helpers.d.ts +0 -4
- package/src/compat-adapters/ember-macro-helpers.js.map +0 -1
- package/src/rename-require-plugin.d.ts +0 -1
- package/src/rename-require-plugin.js +0 -15
- package/src/rename-require-plugin.js.map +0 -1
- package/src/sync-dir.d.ts +0 -8
- package/src/sync-dir.js +0 -68
- package/src/sync-dir.js.map +0 -1
- package/src/template-tag-codemod.d.ts +0 -13
- package/src/template-tag-codemod.js +0 -304
- package/src/template-tag-codemod.js.map +0 -1
- package/src/v1-appboot.d.ts +0 -14
- package/src/v1-appboot.js +0 -47
- package/src/v1-appboot.js.map +0 -1
package/src/audit-cli.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const fs_extra_1 = require("fs-extra");
|
|
8
|
-
const path_1 = require("path");
|
|
9
|
-
const yargs_1 = __importDefault(require("yargs/yargs"));
|
|
10
|
-
const audit_1 = require("./audit");
|
|
11
|
-
// slightly wacky because yargs types don't cover this, but you can't access the
|
|
12
|
-
// other documented place to find `hideBin` on node < 12.17
|
|
13
|
-
const { hideBin } = yargs_1.default;
|
|
14
|
-
function runCLI() {
|
|
15
|
-
return (0, yargs_1.default)(hideBin(process.argv))
|
|
16
|
-
.command('$0', 'audit your app for embroider compatibility problems', yargs => {
|
|
17
|
-
return yargs
|
|
18
|
-
.option('debug', {
|
|
19
|
-
alias: 'd',
|
|
20
|
-
type: 'boolean',
|
|
21
|
-
description: 'Add debug logging about the audit itself',
|
|
22
|
-
default: false,
|
|
23
|
-
})
|
|
24
|
-
.option('json', {
|
|
25
|
-
alias: 'j',
|
|
26
|
-
type: 'boolean',
|
|
27
|
-
description: 'Print results in JSON format',
|
|
28
|
-
default: false,
|
|
29
|
-
})
|
|
30
|
-
.option('reuse-build', {
|
|
31
|
-
alias: 'r',
|
|
32
|
-
type: 'boolean',
|
|
33
|
-
description: 'Reuse previous build',
|
|
34
|
-
default: false,
|
|
35
|
-
})
|
|
36
|
-
.option('load', {
|
|
37
|
-
alias: 'l',
|
|
38
|
-
type: 'string',
|
|
39
|
-
description: 'Load previous audit results from a JSON file instead of running a new audit',
|
|
40
|
-
})
|
|
41
|
-
.option('save', {
|
|
42
|
-
alias: 's',
|
|
43
|
-
type: 'string',
|
|
44
|
-
description: 'Save audit results as a JSON file.',
|
|
45
|
-
})
|
|
46
|
-
.option('app', {
|
|
47
|
-
type: 'string',
|
|
48
|
-
description: 'Path to your app',
|
|
49
|
-
default: process.cwd(),
|
|
50
|
-
})
|
|
51
|
-
.option('filter', {
|
|
52
|
-
type: 'string',
|
|
53
|
-
description: 'Path to a JS file that describes which findings to silence. Generate the initial file using `--create-filter`.',
|
|
54
|
-
})
|
|
55
|
-
.option('create-filter', {
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: 'Path to a JS file where we will create a filter that will silence all your current findings. Pass it back into future audits via --filter',
|
|
58
|
-
})
|
|
59
|
-
.fail(function (_, err, _yargs) {
|
|
60
|
-
if ((0, audit_1.isBuildError)(err)) {
|
|
61
|
-
process.stderr.write(err.message + '\n');
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
console.error(err);
|
|
65
|
-
}
|
|
66
|
-
process.exit(1);
|
|
67
|
-
});
|
|
68
|
-
}, async (options) => {
|
|
69
|
-
let filter = loadFilter(options);
|
|
70
|
-
let results;
|
|
71
|
-
if (options.load) {
|
|
72
|
-
results = new audit_1.AuditResults();
|
|
73
|
-
Object.assign(results, (0, fs_extra_1.readJSONSync)(options.load));
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
results = await audit_1.Audit.run(options);
|
|
77
|
-
}
|
|
78
|
-
if (options.save) {
|
|
79
|
-
(0, fs_extra_1.writeFileSync)(options.save, JSON.stringify(results, null, 2));
|
|
80
|
-
}
|
|
81
|
-
applyFilter(filter, results);
|
|
82
|
-
if (options.json) {
|
|
83
|
-
process.stdout.write(JSON.stringify(results, null, 2) + '\n');
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
process.stdout.write(results.humanReadable());
|
|
87
|
-
}
|
|
88
|
-
if (options['create-filter']) {
|
|
89
|
-
createFilter(options['create-filter'], results);
|
|
90
|
-
}
|
|
91
|
-
process.exit(results.perfect ? 0 : 1);
|
|
92
|
-
})
|
|
93
|
-
.command('pretty', 'format JSON audit results as pretty human-readable results', yargs => {
|
|
94
|
-
return yargs.option('filter', {
|
|
95
|
-
type: 'string',
|
|
96
|
-
description: 'Path to a JS file that describes which findings to silence. Generate the file using `embroider-compat-audit acknowledge`',
|
|
97
|
-
});
|
|
98
|
-
}, async (options) => {
|
|
99
|
-
let filter = loadFilter(options);
|
|
100
|
-
let results = new audit_1.AuditResults();
|
|
101
|
-
// process.stdin.fd is a documented public API. The Node typings don't
|
|
102
|
-
// seem to know about it.
|
|
103
|
-
Object.assign(results, JSON.parse((0, fs_extra_1.readFileSync)(process.stdin.fd, 'utf8')));
|
|
104
|
-
applyFilter(filter, results);
|
|
105
|
-
process.stdout.write(results.humanReadable());
|
|
106
|
-
process.exit(0);
|
|
107
|
-
})
|
|
108
|
-
.command('acknowledge', 'Pipe your audit JSON to this command to generate a filter file that will silence the current issues. Pass the filter file into your next audit via --filter. Delete findings out of the filter file as you address them.', yargs => yargs, async () => {
|
|
109
|
-
let results = new audit_1.AuditResults();
|
|
110
|
-
// process.stdin.fd is a documented public API. The Node typings don't
|
|
111
|
-
// seem to know about it.
|
|
112
|
-
Object.assign(results, JSON.parse((0, fs_extra_1.readFileSync)(process.stdin.fd, 'utf8')));
|
|
113
|
-
let findings = results.findings.map(f => ({
|
|
114
|
-
filename: f.filename,
|
|
115
|
-
message: f.message,
|
|
116
|
-
detail: f.detail,
|
|
117
|
-
}));
|
|
118
|
-
process.stdout.write(`module.exports = ${JSON.stringify({ findings }, null, 2)};\n`);
|
|
119
|
-
process.exit(0);
|
|
120
|
-
}).argv;
|
|
121
|
-
}
|
|
122
|
-
if (require.main === module) {
|
|
123
|
-
runCLI();
|
|
124
|
-
}
|
|
125
|
-
function loadFilter(options) {
|
|
126
|
-
if (options.filter) {
|
|
127
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
128
|
-
return require((0, path_1.resolve)(options.filter));
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
function applyFilter(filter, results) {
|
|
132
|
-
if (filter) {
|
|
133
|
-
results.findings = results.findings.filter(finding => {
|
|
134
|
-
return !filter.findings.find(filtered => {
|
|
135
|
-
return (filtered.message === finding.message &&
|
|
136
|
-
filtered.detail === finding.detail &&
|
|
137
|
-
filtered.filename === finding.filename);
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
function createFilter(filename, results) {
|
|
143
|
-
let findings = results.findings.map(f => ({
|
|
144
|
-
filename: f.filename,
|
|
145
|
-
message: f.message,
|
|
146
|
-
detail: f.detail,
|
|
147
|
-
}));
|
|
148
|
-
(0, fs_extra_1.writeFileSync)(filename, `module.exports = ${JSON.stringify({ findings }, null, 2)};\n`);
|
|
149
|
-
}
|
|
150
|
-
//# sourceMappingURL=audit-cli.js.map
|
package/src/audit-cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"audit-cli.js","sourceRoot":"","sources":["audit-cli.ts"],"names":[],"mappings":";;;;;;AAEA,uCAAqE;AACrE,+BAA+B;AAC/B,wDAAgC;AAEhC,mCAA4D;AAE5D,gFAAgF;AAChF,2DAA2D;AAC3D,MAAM,EAAE,OAAO,EAAE,GAAG,eAEnB,CAAC;AAEF,SAAS,MAAM;IACb,OAAO,IAAA,eAAK,EAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAChC,OAAO,CACN,IAAI,EACJ,qDAAqD,EACrD,KAAK,CAAC,EAAE;QACN,OAA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AAO;QAClB,MAAM,EAAE,CAAC,CAAC,MAAM;KACjB,CAAC,CAAC,CAAC;IACJ,IAAA,wBAAa,EAAC,QAAQ,EAAE,oBAAoB,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { readFileSync, readJSONSync, writeFileSync } from 'fs-extra';\nimport { resolve } from 'path';\nimport yargs from 'yargs/yargs';\nimport type { Finding } from './audit';\nimport { Audit, AuditResults, isBuildError } from './audit';\n\n// slightly wacky because yargs types don't cover this, but you can't access the\n// other documented place to find `hideBin` on node < 12.17\nconst { hideBin } = yargs as any as {\n hideBin(argv: readonly string[]): readonly string[];\n};\n\nfunction runCLI() {\n return yargs(hideBin(process.argv))\n .command(\n '$0',\n 'audit your app for embroider compatibility problems',\n yargs => {\n return yargs\n .option('debug', {\n alias: 'd',\n type: 'boolean',\n description: 'Add debug logging about the audit itself',\n default: false,\n })\n .option('json', {\n alias: 'j',\n type: 'boolean',\n description: 'Print results in JSON format',\n default: false,\n })\n .option('reuse-build', {\n alias: 'r',\n type: 'boolean',\n description: 'Reuse previous build',\n default: false,\n })\n .option('load', {\n alias: 'l',\n type: 'string',\n description: 'Load previous audit results from a JSON file instead of running a new audit',\n })\n .option('save', {\n alias: 's',\n type: 'string',\n description: 'Save audit results as a JSON file.',\n })\n .option('app', {\n type: 'string',\n description: 'Path to your app',\n default: process.cwd(),\n })\n .option('filter', {\n type: 'string',\n description:\n 'Path to a JS file that describes which findings to silence. Generate the initial file using `--create-filter`.',\n })\n .option('create-filter', {\n type: 'string',\n description:\n 'Path to a JS file where we will create a filter that will silence all your current findings. Pass it back into future audits via --filter',\n })\n .fail(function (_, err, _yargs) {\n if (isBuildError(err)) {\n process.stderr.write(err.message + '\\n');\n } else {\n console.error(err);\n }\n process.exit(1);\n });\n },\n async options => {\n let filter = loadFilter(options);\n let results: AuditResults;\n if (options.load) {\n results = new AuditResults();\n Object.assign(results, readJSONSync(options.load));\n } else {\n results = await Audit.run(options);\n }\n if (options.save) {\n writeFileSync(options.save, JSON.stringify(results, null, 2));\n }\n applyFilter(filter, results);\n if (options.json) {\n process.stdout.write(JSON.stringify(results, null, 2) + '\\n');\n } else {\n process.stdout.write(results.humanReadable());\n }\n if (options['create-filter']) {\n createFilter(options['create-filter'], results);\n }\n process.exit(results.perfect ? 0 : 1);\n }\n )\n .command(\n 'pretty',\n 'format JSON audit results as pretty human-readable results',\n yargs => {\n return yargs.option('filter', {\n type: 'string',\n description:\n 'Path to a JS file that describes which findings to silence. Generate the file using `embroider-compat-audit acknowledge`',\n });\n },\n async options => {\n let filter = loadFilter(options);\n let results = new AuditResults();\n // process.stdin.fd is a documented public API. The Node typings don't\n // seem to know about it.\n Object.assign(results, JSON.parse(readFileSync((process.stdin as any).fd, 'utf8')));\n applyFilter(filter, results);\n process.stdout.write(results.humanReadable());\n process.exit(0);\n }\n )\n .command(\n 'acknowledge',\n 'Pipe your audit JSON to this command to generate a filter file that will silence the current issues. Pass the filter file into your next audit via --filter. Delete findings out of the filter file as you address them.',\n yargs => yargs,\n async () => {\n let results = new AuditResults();\n // process.stdin.fd is a documented public API. The Node typings don't\n // seem to know about it.\n Object.assign(results, JSON.parse(readFileSync((process.stdin as any).fd, 'utf8')));\n let findings = results.findings.map(f => ({\n filename: f.filename,\n message: f.message,\n detail: f.detail,\n }));\n process.stdout.write(`module.exports = ${JSON.stringify({ findings }, null, 2)};\\n`);\n process.exit(0);\n }\n ).argv;\n}\n\nif (require.main === module) {\n runCLI();\n}\n\ntype Filter = { findings: Omit<Finding, 'codeFrame'>[] };\n\nfunction loadFilter(options: { filter: string | undefined }): Filter | undefined {\n if (options.filter) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n return require(resolve(options.filter));\n }\n}\n\nfunction applyFilter(filter: Filter | undefined, results: AuditResults) {\n if (filter) {\n results.findings = results.findings.filter(finding => {\n return !filter!.findings.find(filtered => {\n return (\n filtered.message === finding.message &&\n filtered.detail === finding.detail &&\n filtered.filename === finding.filename\n );\n });\n });\n }\n}\n\nfunction createFilter(filename: string, results: AuditResults) {\n let findings = results.findings.map(f => ({\n filename: f.filename,\n message: f.message,\n detail: f.detail,\n }));\n writeFileSync(filename, `module.exports = ${JSON.stringify({ findings }, null, 2)};\\n`);\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const v1_addon_1 = __importDefault(require("../../v1-addon"));
|
|
7
|
-
const semver_1 = __importDefault(require("semver"));
|
|
8
|
-
class EmberDataDebug extends v1_addon_1.default {
|
|
9
|
-
get packageMeta() {
|
|
10
|
-
var _a;
|
|
11
|
-
let meta = super.packageMeta;
|
|
12
|
-
// See also the compat-adapter for @ember-data/store where we make this an
|
|
13
|
-
// implicit-module.
|
|
14
|
-
meta.externals = [...((_a = meta.externals) !== null && _a !== void 0 ? _a : []), '@ember-data/store'];
|
|
15
|
-
return meta;
|
|
16
|
-
}
|
|
17
|
-
static shouldApplyAdapter(addonInstance) {
|
|
18
|
-
return semver_1.default.lt(addonInstance.pkg.version, '4.11.1');
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.default = EmberDataDebug;
|
|
22
|
-
//# sourceMappingURL=debug.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debug.js","sourceRoot":"","sources":["debug.ts"],"names":[],"mappings":";;;;;AACA,8DAAqC;AACrC,oDAA4B;AAE5B,MAAqB,cAAe,SAAQ,kBAAO;IACjD,IAAI,WAAW;;QACb,IAAI,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC;QAE7B,0EAA0E;QAC1E,mBAAmB;QACnB,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,CAAC,MAAA,IAAI,CAAC,SAAS,mCAAI,EAAE,CAAC,EAAE,mBAAmB,CAAC,CAAC;QAElE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAC,aAAkB;QAC1C,OAAO,gBAAM,CAAC,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACxD,CAAC;CACF;AAdD,iCAcC","sourcesContent":["import type { AddonMeta } from '@embroider/core';\nimport V1Addon from '../../v1-addon';\nimport semver from 'semver';\n\nexport default class EmberDataDebug extends V1Addon {\n get packageMeta(): Partial<AddonMeta> {\n let meta = super.packageMeta;\n\n // See also the compat-adapter for @ember-data/store where we make this an\n // implicit-module.\n meta.externals = [...(meta.externals ?? []), '@ember-data/store'];\n\n return meta;\n }\n\n static shouldApplyAdapter(addonInstance: any) {\n return semver.lt(addonInstance.pkg.version, '4.11.1');\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ember-macro-helpers.js","sourceRoot":"","sources":["ember-macro-helpers.ts"],"names":[],"mappings":";;;;;AAAA,2DAAkC;AAElC,eAAqB,SAAQ,kBAAO;IAClC,IAAI,WAAW;QACb,IAAI,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC;QAC7B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AATD,4BASC","sourcesContent":["import V1Addon from '../v1-addon';\n\nexport default class extends V1Addon {\n get packageMeta() {\n let meta = super.packageMeta;\n if (!meta.externals) {\n meta.externals = [];\n }\n meta.externals.push('./-computed-store');\n return meta;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function inlineHBSTransform(): unknown;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = inlineHBSTransform;
|
|
4
|
-
function inlineHBSTransform() {
|
|
5
|
-
return {
|
|
6
|
-
visitor: {
|
|
7
|
-
ImportDefaultSpecifier(path) {
|
|
8
|
-
if (path.node.local.name === 'require') {
|
|
9
|
-
path.scope.rename('require');
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=rename-require-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rename-require-plugin.js","sourceRoot":"","sources":["rename-require-plugin.ts"],"names":[],"mappings":";;AAGA,qCAUC;AAVD,SAAwB,kBAAkB;IACxC,OAAO;QACL,OAAO,EAAE;YACP,sBAAsB,CAAC,IAAwC;gBAC7D,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;oBACvC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBAC/B,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { types as t } from '@babel/core';\nimport type { NodePath } from '@babel/traverse';\n\nexport default function inlineHBSTransform(): unknown {\n return {\n visitor: {\n ImportDefaultSpecifier(path: NodePath<t.ImportDefaultSpecifier>) {\n if (path.node.local.name === 'require') {\n path.scope.rename('require');\n }\n },\n },\n };\n}\n"]}
|
package/src/sync-dir.d.ts
DELETED
package/src/sync-dir.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SyncDir = void 0;
|
|
7
|
-
const assert_never_1 = __importDefault(require("assert-never"));
|
|
8
|
-
const fs_tree_diff_1 = __importDefault(require("fs-tree-diff"));
|
|
9
|
-
const walk_sync_1 = __importDefault(require("walk-sync"));
|
|
10
|
-
const path_1 = require("path");
|
|
11
|
-
const fs_extra_1 = require("fs-extra");
|
|
12
|
-
// mirrors the changes in the src dir to the dest dir, while tracking the
|
|
13
|
-
// current set of files present. If dest is undefined, it only tracks the set of
|
|
14
|
-
// files without mirroring the changes to anywhere
|
|
15
|
-
class SyncDir {
|
|
16
|
-
constructor(src, dest) {
|
|
17
|
-
this.src = src;
|
|
18
|
-
this.dest = dest;
|
|
19
|
-
this.prev = new fs_tree_diff_1.default();
|
|
20
|
-
this.files = new Set();
|
|
21
|
-
}
|
|
22
|
-
update() {
|
|
23
|
-
let next = new fs_tree_diff_1.default({
|
|
24
|
-
entries: walk_sync_1.default.entries(this.src),
|
|
25
|
-
});
|
|
26
|
-
for (let [operation, relativePath] of this.prev.calculatePatch(next)) {
|
|
27
|
-
let outputPath;
|
|
28
|
-
if (this.dest) {
|
|
29
|
-
outputPath = (0, path_1.resolve)(this.dest, relativePath);
|
|
30
|
-
}
|
|
31
|
-
switch (operation) {
|
|
32
|
-
case 'unlink':
|
|
33
|
-
if (outputPath) {
|
|
34
|
-
(0, fs_extra_1.unlinkSync)(outputPath);
|
|
35
|
-
}
|
|
36
|
-
this.files.delete(relativePath);
|
|
37
|
-
break;
|
|
38
|
-
case 'rmdir':
|
|
39
|
-
if (outputPath) {
|
|
40
|
-
(0, fs_extra_1.rmdirSync)(outputPath);
|
|
41
|
-
}
|
|
42
|
-
break;
|
|
43
|
-
case 'mkdir':
|
|
44
|
-
if (outputPath) {
|
|
45
|
-
(0, fs_extra_1.mkdirpSync)(outputPath);
|
|
46
|
-
}
|
|
47
|
-
break;
|
|
48
|
-
case 'change':
|
|
49
|
-
if (outputPath) {
|
|
50
|
-
(0, fs_extra_1.removeSync)(outputPath);
|
|
51
|
-
(0, fs_extra_1.copySync)((0, path_1.resolve)(this.src, relativePath), outputPath, { dereference: true });
|
|
52
|
-
}
|
|
53
|
-
break;
|
|
54
|
-
case 'create':
|
|
55
|
-
if (outputPath) {
|
|
56
|
-
(0, fs_extra_1.copySync)((0, path_1.resolve)(this.src, relativePath), outputPath, { dereference: true });
|
|
57
|
-
}
|
|
58
|
-
this.files.add(relativePath);
|
|
59
|
-
break;
|
|
60
|
-
default:
|
|
61
|
-
(0, assert_never_1.default)(operation);
|
|
62
|
-
}
|
|
63
|
-
this.prev = next;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.SyncDir = SyncDir;
|
|
68
|
-
//# sourceMappingURL=sync-dir.js.map
|
package/src/sync-dir.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync-dir.js","sourceRoot":"","sources":["sync-dir.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AACvC,gEAAkC;AAClC,0DAAiC;AACjC,+BAA+B;AAC/B,uCAAmF;AAEnF,yEAAyE;AACzE,gFAAgF;AAChF,kDAAkD;AAClD,MAAa,OAAO;IAIlB,YAAoB,GAAW,EAAU,IAAwB;QAA7C,QAAG,GAAH,GAAG,CAAQ;QAAU,SAAI,GAAJ,IAAI,CAAoB;QAHzD,SAAI,GAAW,IAAI,sBAAM,EAAE,CAAC;QAC3B,UAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IAE4B,CAAC;IAErE,MAAM;QACJ,IAAI,IAAI,GAAG,IAAI,sBAAM,CAAC;YACpB,OAAO,EAAE,mBAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;SACpC,CAAC,CAAC;QACH,KAAK,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;YACrE,IAAI,UAA8B,CAAC;YACnC,I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AC;CACF;AAlDD,0BAkDC","sourcesContent":["import assertNever from 'assert-never';\nimport FSTree from 'fs-tree-diff';\nimport walkSync from 'walk-sync';\nimport { resolve } from 'path';\nimport { copySync, mkdirpSync, removeSync, rmdirSync, unlinkSync } from 'fs-extra';\n\n// mirrors the changes in the src dir to the dest dir, while tracking the\n// current set of files present. If dest is undefined, it only tracks the set of\n// files without mirroring the changes to anywhere\nexport class SyncDir {\n private prev: FSTree = new FSTree();\n readonly files: Set<string> = new Set();\n\n constructor(private src: string, private dest: string | undefined) {}\n\n update(): void {\n let next = new FSTree({\n entries: walkSync.entries(this.src),\n });\n for (let [operation, relativePath] of this.prev.calculatePatch(next)) {\n let outputPath: string | undefined;\n if (this.dest) {\n outputPath = resolve(this.dest, relativePath);\n }\n switch (operation) {\n case 'unlink':\n if (outputPath) {\n unlinkSync(outputPath);\n }\n this.files.delete(relativePath);\n break;\n case 'rmdir':\n if (outputPath) {\n rmdirSync(outputPath);\n }\n break;\n case 'mkdir':\n if (outputPath) {\n mkdirpSync(outputPath);\n }\n break;\n case 'change':\n if (outputPath) {\n removeSync(outputPath);\n copySync(resolve(this.src, relativePath), outputPath, { dereference: true });\n }\n break;\n case 'create':\n if (outputPath) {\n copySync(resolve(this.src, relativePath), outputPath, { dereference: true });\n }\n this.files.add(relativePath);\n break;\n default:\n assertNever(operation);\n }\n this.prev = next;\n }\n }\n}\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { EmberAppInstance } from '@embroider/core';
|
|
2
|
-
import type { Node } from 'broccoli-node-api';
|
|
3
|
-
import { type ExternalNameHint } from './resolver-transform';
|
|
4
|
-
export interface TemplateTagCodemodOptions {
|
|
5
|
-
shouldTransformPath: (outputPath: string) => boolean;
|
|
6
|
-
nameHint: ExternalNameHint;
|
|
7
|
-
dryRun: boolean;
|
|
8
|
-
}
|
|
9
|
-
export default function templateTagCodemod(emberApp: EmberAppInstance, { shouldTransformPath, nameHint, dryRun, }?: {
|
|
10
|
-
shouldTransformPath?: ((outputPath: string) => boolean) | undefined;
|
|
11
|
-
nameHint?: ExternalNameHint | undefined;
|
|
12
|
-
dryRun?: boolean | undefined;
|
|
13
|
-
}): Node;
|