@lappis/cg-manager 0.0.37 → 0.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/builder/index.js +9 -2
  2. package/package.json +1 -1
package/builder/index.js CHANGED
@@ -41,6 +41,7 @@ async function packageSource(ctx) {
41
41
  console.log('Compiling plugin source...');
42
42
  await node(root, path.join('webpack-cli', 'bin', 'cli'));
43
43
  await fs.rm(path.join(root, 'dist', 'index.js.LICENSE.txt')).catch(() => null);
44
+ await fs.cp(path.join(root, 'package.json'), path.join(root, 'dist', 'package.json'));
44
45
  // Full node_modules copy — externals need their deps at runtime.
45
46
  // TODO: prune to transitive closure of pkg.dependencies once a safe walk is validated.
46
47
  await fs.cp(path.join(root, 'node_modules'), path.join(root, 'dist', 'node_modules'), { recursive: true });
@@ -117,6 +118,12 @@ async function movePlugin(ctx) {
117
118
  console.log(`Plugin installed to ${target}`);
118
119
  }
119
120
 
121
+ // Leave only the archive at root; the assembled dir lives at dest (if any).
122
+ async function cleanup(ctx) {
123
+ const { root, out } = ctx;
124
+ await fs.rm(path.join(root, out), { recursive: true }).catch(() => null);
125
+ }
126
+
120
127
  async function build(options = {}) {
121
128
  const root = options.root || process.cwd();
122
129
  const pkg = JSON.parse(await fs.readFile(path.join(root, 'package.json'), 'utf8'));
@@ -130,7 +137,7 @@ async function build(options = {}) {
130
137
 
131
138
  const ctx = { root, name, out, ui, steps, dest };
132
139
 
133
- const pipeline = [packageSource, packageUI, runSteps, assemble, archive, movePlugin];
140
+ const pipeline = [packageSource, packageUI, runSteps, assemble, archive, movePlugin, cleanup];
134
141
  for (const step of pipeline) {
135
142
  const failed = await step(ctx).then(() => false).catch(e => (console.error(e), true));
136
143
  if (failed) {
@@ -143,4 +150,4 @@ async function build(options = {}) {
143
150
  return true;
144
151
  }
145
152
 
146
- module.exports = { build, packageSource, packageUI, runSteps, assemble, archive, movePlugin };
153
+ module.exports = { build, packageSource, packageUI, runSteps, assemble, archive, movePlugin, cleanup };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "repository": "https://github.com/Lapplandsveckan/cg-manager-plugin",
4
4
  "author": "firecraftgaming <eliyah@sundstroem.com>",
5
5
  "license": "MIT",
6
- "version": "0.0.37",
6
+ "version": "0.0.38",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "devDependencies": {