Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 077a529

Browse files
authored
feat(builder): streamline generated template (#5426)
1 parent 5838385 commit 077a529

File tree

5 files changed

+32
-12
lines changed

5 files changed

+32
-12
lines changed

‎.pnp.cjs‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.yarn/versions/32e7be63.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
releases:
2+
"@yarnpkg/builder": minor
3+
4+
declined:
5+
- "@yarnpkg/plugin-constraints"
6+
- "@yarnpkg/plugin-exec"
7+
- "@yarnpkg/plugin-interactive-tools"
8+
- "@yarnpkg/plugin-stage"
9+
- "@yarnpkg/plugin-typescript"
10+
- "@yarnpkg/plugin-version"
11+
- "@yarnpkg/plugin-workspace-tools"
12+
- "@yarnpkg/cli"

‎packages/yarnpkg-builder/sources/commands/new/plugin.ts‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default class NewPluginCommand extends Command {
3636
await xfs.mkdirPromise(target, {recursive: true});
3737
await xfs.mkdirPromise(ppath.join(target, `sources`), {recursive: true});
3838

39-
await xfs.writeFilePromise(ppath.join(target, `sources/index.ts`), [
39+
await xfs.writeFilePromise(ppath.join(target, `sources`,`index.ts`), [
4040
`import {Plugin} from '@yarnpkg/core';\n`,
4141
`import {BaseCommand} from '@yarnpkg/cli';\n`,
4242
`import {Option} from 'clipanion';\n`,
@@ -69,19 +69,27 @@ export default class NewPluginCommand extends Command {
6969
`export default plugin;\n`,
7070
].join(``));
7171

72+
await xfs.writeFilePromise(ppath.join(target, `.gitignore`), `bundles/\n`);
73+
7274
await xfs.writeJsonPromise(ppath.join(target, `package.json`), {
7375
name: `yarn-plugin-helloworld`,
76+
private: true,
7477
main: `./sources/index.ts`,
7578
dependencies: {
76-
[`@yarnpkg/core`]: require(`@yarnpkg/builder/package.json`).dependencies[`@yarnpkg/core`],
7779
[`@yarnpkg/cli`]: require(`@yarnpkg/builder/package.json`).dependencies[`@yarnpkg/cli`],
78-
[`@yarnpkg/builder`]: `^${require(`@yarnpkg/builder/package.json`).version}`,
79-
[`@types/node`]: `^${process.versions.node.split(`.`)[0]}.0.0`,
80+
[`@yarnpkg/core`]: require(`@yarnpkg/builder/package.json`).dependencies[`@yarnpkg/core`],
8081
[`clipanion`]: require(`@yarnpkg/builder/package.json`).dependencies.clipanion,
82+
},
83+
devDependencies: {
84+
[`@types/node`]: `^${process.versions.node.split(`.`)[0]}.0.0`,
85+
[`@yarnpkg/builder`]: `^${require(`@yarnpkg/builder/package.json`).version}`,
86+
[`rimraf`]: `5.0.0`,
8187
[`typescript`]: require(`@yarnpkg/builder/package.json`).devDependencies.typescript,
8288
},
8389
scripts: {
84-
build: `builder build plugin`,
90+
[`build`]: `builder build plugin`,
91+
[`build:dev`]: `builder build plugin --no-minify`,
92+
[`clean`]: `rimraf bundles`,
8593
},
8694
});
8795

‎yarn.lock‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30951,13 +30951,13 @@ pem@dexus/pem:
3095130951
linkType: hard
3095230952

3095330953
"wrap-ansi@npm:^8.0.1":
30954-
version: 8.0.1
30955-
resolution: "wrap-ansi@npm:8.0.1"
30954+
version: 8.1.0
30955+
resolution: "wrap-ansi@npm:8.1.0"
3095630956
dependencies:
3095730957
ansi-styles: "npm:^6.1.0"
3095830958
string-width: "npm:^5.0.1"
3095930959
strip-ansi: "npm:^7.0.1"
30960-
checksum: 6a15d8e2a6bfc1340a9e989afeba6b9be2498e6dfabb22cae271dfcba38897bb34c7bd8ee14a6853149a9cd0875aaebb914b2004b5a77aa42767c60df35ae4d1
30960+
checksum: f8df96ddeeb43e497c86085f8b009fd374e046aef37d731d13037dbabc2f3d2ba84aa8e583bdff3011b8ef5274a53832d65bb7dd44b30c033e96ef3d0bb72b57
3096130961
languageName: node
3096230962
linkType: hard
3096330963

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /