@magmonium/cli 0.8.2 → 0.8.3
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/bin/commands/assets-wc.js +17 -5
- package/codegen/index.js +3 -3
- package/package.json +1 -1
|
@@ -31,13 +31,22 @@ function resolveApp(source, remoteFiles) {
|
|
|
31
31
|
const appDir = path.dirname(source);
|
|
32
32
|
if (path.resolve(appDir) !== process.cwd()) {
|
|
33
33
|
const appName = path.basename(appDir);
|
|
34
|
-
return {
|
|
34
|
+
return {
|
|
35
|
+
appName,
|
|
36
|
+
distDestDir: path.join('dist', 'apps', `${appName}-wc`),
|
|
37
|
+
standalone: false,
|
|
38
|
+
};
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
const manifests = remoteFiles.filter((f) => f.endsWith('.yml'));
|
|
38
|
-
if (manifests.length !== 1)
|
|
42
|
+
if (manifests.length !== 1)
|
|
43
|
+
return { appName: null, distDestDir: null, standalone: true };
|
|
39
44
|
const appName = path.basename(manifests[0], '.yml');
|
|
40
|
-
return {
|
|
45
|
+
return {
|
|
46
|
+
appName,
|
|
47
|
+
distDestDir: path.join('dist', `${appName}-wc`),
|
|
48
|
+
standalone: true,
|
|
49
|
+
};
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
function assetsWcCommand(program) {
|
|
@@ -139,7 +148,7 @@ function assetsWcCommand(program) {
|
|
|
139
148
|
if (!fs.existsSync(remoteDir)) continue;
|
|
140
149
|
|
|
141
150
|
const remoteFiles = fs.readdirSync(remoteDir);
|
|
142
|
-
const { appName, distDestDir } = resolveApp(source, remoteFiles);
|
|
151
|
+
const { appName, distDestDir, standalone } = resolveApp(source, remoteFiles);
|
|
143
152
|
if (!appName) continue;
|
|
144
153
|
|
|
145
154
|
if (options.app && options.app !== appName) continue;
|
|
@@ -223,10 +232,13 @@ function assetsWcCommand(program) {
|
|
|
223
232
|
console.log(` ✅ WC bundle → ${remoteDistDir}`);
|
|
224
233
|
|
|
225
234
|
// ── PWA build (if pwa: key present in YAML) ─────────────────────
|
|
235
|
+
// Monorepo only: it runs `nx build <app> --configuration=pwa` against
|
|
236
|
+
// `apps/<app>/`. A standalone scaffold has neither — its `pwa:` block
|
|
237
|
+
// is manifest metadata the Store reads, not a build to run here.
|
|
226
238
|
const yamlFilePath = path.join(remoteDir, expectedYml);
|
|
227
239
|
const yamlContent = fs.readFileSync(yamlFilePath, 'utf8');
|
|
228
240
|
const appConfig = YAML.parse(yamlContent);
|
|
229
|
-
if (appConfig.pwa) {
|
|
241
|
+
if (appConfig.pwa && !standalone) {
|
|
230
242
|
await buildPwa(appName, appConfig);
|
|
231
243
|
}
|
|
232
244
|
|
package/codegen/index.js
CHANGED
|
@@ -23902,7 +23902,7 @@ __export(package_exports2, {
|
|
|
23902
23902
|
version: () => version2
|
|
23903
23903
|
});
|
|
23904
23904
|
var name2 = "@magmonium/cli";
|
|
23905
|
-
var version2 = "0.8.
|
|
23905
|
+
var version2 = "0.8.3";
|
|
23906
23906
|
var description2 = "A powerful and extensible asset compilation tool that can be shared across multiple projects";
|
|
23907
23907
|
var bin = {
|
|
23908
23908
|
"mag-cli": "bin/cli.js"
|
|
@@ -29061,7 +29061,7 @@ ${setupNode}${generateStep} - name: Build assets and web component
|
|
|
29061
29061
|
ENDPOINT="\${ENDPOINT%/}"
|
|
29062
29062
|
APP_ID="\${{ secrets.MAG_APP_ID }}"
|
|
29063
29063
|
APP_ID="\${APP_ID//[$'\\t\\r\\n ']/}"
|
|
29064
|
-
curl -
|
|
29064
|
+
curl --fail-with-body -X POST \\
|
|
29065
29065
|
-H "Authorization: Bearer \${{ secrets.MAG_DEPLOY_TOKEN }}" \\
|
|
29066
29066
|
-F "bundle=@bundle.zip" \\
|
|
29067
29067
|
"\${ENDPOINT}/store/v1/bundle/\${APP_ID}"
|
|
@@ -29071,7 +29071,7 @@ ${setupNode}${generateStep} - name: Build assets and web component
|
|
|
29071
29071
|
ENDPOINT="\${ENDPOINT%/}"
|
|
29072
29072
|
APP_ID="\${{ secrets.MAG_APP_ID }}"
|
|
29073
29073
|
APP_ID="\${APP_ID//[$'\\t\\r\\n ']/}"
|
|
29074
|
-
curl -
|
|
29074
|
+
curl --fail-with-body -X POST \\
|
|
29075
29075
|
-H "Authorization: Bearer \${{ secrets.MAG_DEPLOY_TOKEN }}" \\
|
|
29076
29076
|
"\${ENDPOINT}/store/v1/deploy/\${APP_ID}"
|
|
29077
29077
|
`;
|