@lemonadecms/create 0.0.0-stage → 0.1.1
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/CHANGELOG.md +23 -0
- package/LICENSE +21 -0
- package/README.md +42 -2
- package/bin/create-lemonade.mjs +124 -0
- package/dist/catalog.json +772 -0
- package/dist/templates/angular/angular.json +54 -0
- package/dist/templates/angular/locks/npm-lock.json.template +7079 -0
- package/dist/templates/angular/locks/pnpm-lock.yaml.template +4237 -0
- package/dist/templates/angular/locks/yarn.lock.template +4899 -0
- package/dist/templates/angular/package.json +68 -0
- package/dist/templates/angular/src/app/app.config.server.ts +23 -0
- package/dist/templates/angular/src/app/app.config.ts +34 -0
- package/dist/templates/angular/src/app/app.ts +9 -0
- package/dist/templates/angular/src/app/blog.service.ts +74 -0
- package/dist/templates/angular/src/app/journal.html +71 -0
- package/dist/templates/angular/src/app/journal.ts +47 -0
- package/dist/templates/angular/src/index.html +14 -0
- package/dist/templates/angular/src/main.server.ts +5 -0
- package/dist/templates/angular/src/main.ts +6 -0
- package/dist/templates/angular/src/server.ts +79 -0
- package/dist/templates/angular/tsconfig.app.json +8 -0
- package/dist/templates/angular/tsconfig.json +21 -0
- package/dist/templates/angular/vendor/README.md +32 -0
- package/dist/templates/angular/vendor/picomatch-4.0.7-lemonade-sec51.1.tgz +0 -0
- package/dist/templates/angular/vendor/picomatch-4.0.7.patch +59 -0
- package/dist/templates/angular/vendor/provenance.json +29 -0
- package/dist/templates/astro/astro.config.mjs +7 -0
- package/dist/templates/astro/locks/npm-lock.json.template +5478 -0
- package/dist/templates/astro/locks/pnpm-lock.yaml.template +3537 -0
- package/dist/templates/astro/locks/yarn.lock.template +4085 -0
- package/dist/templates/astro/package.json +51 -0
- package/dist/templates/astro/src/components/BlogView.astro +92 -0
- package/dist/templates/astro/src/layouts/Site.astro +23 -0
- package/dist/templates/astro/src/pages/articles/[id].astro +13 -0
- package/dist/templates/astro/src/pages/index.astro +13 -0
- package/dist/templates/astro/src/pages/lemonade/preview/[...path].ts +4 -0
- package/dist/templates/astro/src/pages/lemonade/preview.ts +4 -0
- package/dist/templates/astro/tsconfig.json +9 -0
- package/dist/templates/astro/vendor/README.md +32 -0
- package/dist/templates/astro/vendor/picomatch-2.3.2-lemonade-sec51.1.tgz +0 -0
- package/dist/templates/astro/vendor/picomatch-2.3.2.patch +59 -0
- package/dist/templates/astro/vendor/picomatch-4.0.7-lemonade-sec51.1.tgz +0 -0
- package/dist/templates/astro/vendor/picomatch-4.0.7.patch +59 -0
- package/dist/templates/astro/vendor/provenance.json +43 -0
- package/dist/templates/next/app/articles/[id]/page.tsx +29 -0
- package/dist/templates/next/app/data.ts +12 -0
- package/dist/templates/next/app/error.tsx +15 -0
- package/dist/templates/next/app/layout.tsx +13 -0
- package/dist/templates/next/app/lemonade/preview/[[...path]]/route.ts +7 -0
- package/dist/templates/next/app/loading.tsx +7 -0
- package/dist/templates/next/app/not-found.tsx +8 -0
- package/dist/templates/next/app/page.tsx +17 -0
- package/dist/templates/next/app/view.tsx +111 -0
- package/dist/templates/next/locks/npm-lock.json.template +1158 -0
- package/dist/templates/next/locks/pnpm-lock.yaml.template +715 -0
- package/dist/templates/next/locks/yarn.lock.template +775 -0
- package/dist/templates/next/next-env.d.ts +2 -0
- package/dist/templates/next/next.config.mjs +8 -0
- package/dist/templates/next/package.json +44 -0
- package/dist/templates/next/proxy.ts +19 -0
- package/dist/templates/next/tsconfig.json +25 -0
- package/dist/templates/nuxt/app/app.vue +1 -0
- package/dist/templates/nuxt/app/components/JournalView.vue +75 -0
- package/dist/templates/nuxt/app/pages/articles/[id].vue +8 -0
- package/dist/templates/nuxt/app/pages/index.vue +8 -0
- package/dist/templates/nuxt/locks/npm-lock.json.template +9113 -0
- package/dist/templates/nuxt/locks/pnpm-lock.yaml.template +6471 -0
- package/dist/templates/nuxt/locks/yarn.lock.template +6915 -0
- package/dist/templates/nuxt/nuxt.config.ts +27 -0
- package/dist/templates/nuxt/package.json +66 -0
- package/dist/templates/nuxt/server/api/blog/[id].get.ts +10 -0
- package/dist/templates/nuxt/server/api/blog.get.ts +9 -0
- package/dist/templates/nuxt/server/middleware/preview.ts +9 -0
- package/dist/templates/nuxt/server/utils/cms-environment.ts +15 -0
- package/dist/templates/nuxt/tsconfig.json +7 -0
- package/dist/templates/nuxt/vendor/README.md +32 -0
- package/dist/templates/nuxt/vendor/picomatch-2.3.2-lemonade-sec51.1.tgz +0 -0
- package/dist/templates/nuxt/vendor/picomatch-2.3.2.patch +59 -0
- package/dist/templates/nuxt/vendor/picomatch-4.0.7-lemonade-sec51.1.tgz +0 -0
- package/dist/templates/nuxt/vendor/picomatch-4.0.7.patch +59 -0
- package/dist/templates/nuxt/vendor/provenance.json +43 -0
- package/dist/templates/shared/GETTING_STARTED.md +29 -0
- package/dist/templates/shared/README.md +8 -0
- package/dist/templates/shared/env.example.template +11 -0
- package/dist/templates/shared/gitignore.template +16 -0
- package/dist/templates/shared/model-template.json +75 -0
- package/dist/templates/shared/public/blog.css +255 -0
- package/dist/templates/shared/public/lemonade.svg +5 -0
- package/dist/templates/shared/schema-contract.json +37 -0
- package/dist/templates/shared/scripts/cms-tools.mjs +171 -0
- package/dist/templates/shared/scripts/environment.mjs +68 -0
- package/dist/templates/shared/scripts/run.mjs +122 -0
- package/dist/templates/shared/server/blog.d.mts +35 -0
- package/dist/templates/shared/server/blog.mjs +159 -0
- package/dist/templates/shared/server/config.d.mts +11 -0
- package/dist/templates/shared/server/config.mjs +42 -0
- package/dist/templates/shared/server/preview.d.mts +4 -0
- package/dist/templates/shared/server/preview.mjs +276 -0
- package/dist/templates/shared/src/types/cms-models.ts +37 -0
- package/dist/templates/shared/yarnrc.yml.template +2 -0
- package/package.json +24 -4
- package/src/arguments.mjs +75 -0
- package/src/catalog.mjs +166 -0
- package/src/errors.mjs +10 -0
- package/src/generation.mjs +103 -0
- package/src/paths.mjs +90 -0
- package/src/prompts.mjs +68 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.1 — unreleased
|
|
4
|
+
|
|
5
|
+
- Include integrity-bound local picomatch backports in Astro, Nuxt and Angular
|
|
6
|
+
templates for SEC-51; preserve the existing framework and SDK versions.
|
|
7
|
+
- Add Yarn 4 generation, including immutable installs for all four starters.
|
|
8
|
+
- Keep frozen npm, pnpm and Yarn installs self-contained without install-time patch scripts.
|
|
9
|
+
- Include vendored archives in source fingerprints and retain MIT provenance.
|
|
10
|
+
- Retain the reviewed backports following GitHub's withdrawal of
|
|
11
|
+
[GHSA-fc5q-39xc-vjpf](https://github.com/advisories/GHSA-fc5q-39xc-vjpf).
|
|
12
|
+
|
|
13
|
+
## 0.1.0 — 2026-11-17
|
|
14
|
+
|
|
15
|
+
- Offline blog generation for Astro, Nuxt, Next.js and Angular.
|
|
16
|
+
- npm/pnpm lockfiles, explicit Studio setup, bounded published reads and optional
|
|
17
|
+
entry-scoped saved-draft preview.
|
|
18
|
+
- Portable filename and case-insensitive private-configuration guards, with local
|
|
19
|
+
installed-package, concurrency, cancellation and adversarial archive coverage.
|
|
20
|
+
- Initial macOS/Linux qualification; Windows remains explicitly unverified.
|
|
21
|
+
|
|
22
|
+
Publication and native/hosted qualification are separate acceptance steps.
|
|
23
|
+
GitHub Actions is optional for direct npm publication.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lemonade CMS contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,43 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @lemonadecms/create
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A standalone Node initializer for Lemonade CMS blogs in Astro, Nuxt, Next.js and
|
|
4
|
+
Angular. It creates an independent application that you own and deploy yourself.
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npx @lemonadecms/create@0.1.0 my-blog --framework astro --package-manager npm
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Generation copies local, integrity-checked files only. It performs no network
|
|
13
|
+
requests, dependency installation, Git initialization or CMS changes. Use a new
|
|
14
|
+
directory; existing projects are never merged or overwritten. npm and pnpm outputs
|
|
15
|
+
carry their respective frozen lockfiles. See the generated GETTING_STARTED.md for
|
|
16
|
+
the manual Studio handoff and private configuration.
|
|
17
|
+
|
|
18
|
+
Node 22.23.5+ (22.x) or 24.22.3+ (24.x) is required. Native platform support remains
|
|
19
|
+
limited to the recorded macOS/Linux qualification. **Windows is unverified** for
|
|
20
|
+
the initial release. Portable-path tests do not establish native Windows support.
|
|
21
|
+
No hosted capacity is implied.
|
|
22
|
+
|
|
23
|
+
Internal commands: `npm test`; `npm run prepare:candidate`. Candidate preparation
|
|
24
|
+
uses the reviewed exact source catalog and retains the inspected archive locally.
|
|
25
|
+
The repository source manifest stays private; preparation emits a separate public
|
|
26
|
+
manifest and archive. Neither command publishes anything. Registry publication is
|
|
27
|
+
a separate maintainer action. Public support: hello@lemonadecms.com.
|
|
28
|
+
|
|
29
|
+
### Unreleased SEC-51 candidate
|
|
30
|
+
|
|
31
|
+
Local source prepares **0.1.1**, not a replacement publication of 0.1.0. Astro,
|
|
32
|
+
Nuxt and Angular carry project-owned MIT picomatch backports in `vendor/`; use
|
|
33
|
+
the supplied frozen locks. No install hook patches node_modules. Future dependency
|
|
34
|
+
updates must retain or replace that protection and rerun the source/consumer
|
|
35
|
+
checks. Unsafe complex repeated-star/capture patterns use picomatch's existing
|
|
36
|
+
literal fallback. See the repository's `vendor/picomatch/README.md` for provenance
|
|
37
|
+
and maintenance. Upstream advisory matching is retained; publication remains a
|
|
38
|
+
separate action and has not occurred.
|
|
39
|
+
|
|
40
|
+
The local candidate supports `--package-manager yarn` for all four frameworks.
|
|
41
|
+
It pins Yarn 4.18.1 and emits `yarn.lock` and `.yarnrc.yml`. Use
|
|
42
|
+
`yarn install --immutable`, then `yarn run cms:setup` and `yarn run dev`.
|
|
43
|
+
The Yarn configuration uses `node_modules` and disables dependency build scripts.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { resolve, dirname } from 'node:path';
|
|
4
|
+
import { readFile, realpath } from 'node:fs/promises';
|
|
5
|
+
import {
|
|
6
|
+
packageManagers,
|
|
7
|
+
parseArguments,
|
|
8
|
+
supportedRuntime,
|
|
9
|
+
HELP,
|
|
10
|
+
} from '../src/arguments.mjs';
|
|
11
|
+
import { destination } from '../src/paths.mjs';
|
|
12
|
+
import { loadCatalog, selectedFiles } from '../src/catalog.mjs';
|
|
13
|
+
import { generate } from '../src/generation.mjs';
|
|
14
|
+
import { choose } from '../src/prompts.mjs';
|
|
15
|
+
import { CreateError } from '../src/errors.mjs';
|
|
16
|
+
|
|
17
|
+
export async function run(
|
|
18
|
+
args,
|
|
19
|
+
{
|
|
20
|
+
root = resolve(dirname(fileURLToPath(import.meta.url)), '..'),
|
|
21
|
+
cwd = process.cwd(),
|
|
22
|
+
input = process.stdin,
|
|
23
|
+
output = process.stdout,
|
|
24
|
+
error = process.stderr,
|
|
25
|
+
signal,
|
|
26
|
+
} = {},
|
|
27
|
+
) {
|
|
28
|
+
let options;
|
|
29
|
+
try {
|
|
30
|
+
options = parseArguments(args);
|
|
31
|
+
const pkg = JSON.parse(await readFile(resolve(root, 'package.json'), 'utf8'));
|
|
32
|
+
if (options.help || options.version) {
|
|
33
|
+
output.write(options.help ? HELP : pkg.version + '\n');
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
if (!supportedRuntime())
|
|
37
|
+
throw new CreateError(2, 'Use Node 22.23.5+ (22.x) or 24.22.3+ (24.x).');
|
|
38
|
+
if (!options.json && input.isTTY && output.isTTY)
|
|
39
|
+
options = await choose({ ...options, cwd }, { input, output: error, signal });
|
|
40
|
+
if (!options.directory || !options.framework)
|
|
41
|
+
throw new CreateError(
|
|
42
|
+
2,
|
|
43
|
+
'Provide a new directory and --framework in noninteractive mode.',
|
|
44
|
+
);
|
|
45
|
+
const target = await destination(options.directory, cwd);
|
|
46
|
+
const catalog = await loadCatalog(root);
|
|
47
|
+
const files = await selectedFiles(
|
|
48
|
+
root,
|
|
49
|
+
catalog,
|
|
50
|
+
options.framework,
|
|
51
|
+
options.packageManager,
|
|
52
|
+
target.name,
|
|
53
|
+
);
|
|
54
|
+
const result = await generate(
|
|
55
|
+
target.path,
|
|
56
|
+
files,
|
|
57
|
+
{
|
|
58
|
+
version: 1,
|
|
59
|
+
generator: pkg.version,
|
|
60
|
+
template: 'blog',
|
|
61
|
+
revision: catalog.revision,
|
|
62
|
+
framework: options.framework,
|
|
63
|
+
packageManager: options.packageManager,
|
|
64
|
+
},
|
|
65
|
+
{ signal },
|
|
66
|
+
);
|
|
67
|
+
const install = packageManagers[options.packageManager].install;
|
|
68
|
+
const value = {
|
|
69
|
+
ok: true,
|
|
70
|
+
directory: target.path,
|
|
71
|
+
framework: options.framework,
|
|
72
|
+
template: 'blog',
|
|
73
|
+
files: result.files,
|
|
74
|
+
next: [
|
|
75
|
+
[options.packageManager, ...install].join(' '),
|
|
76
|
+
`${options.packageManager} run cms:setup`,
|
|
77
|
+
`${options.packageManager} run dev`,
|
|
78
|
+
],
|
|
79
|
+
};
|
|
80
|
+
output.write(
|
|
81
|
+
options.json
|
|
82
|
+
? JSON.stringify(value) + '\n'
|
|
83
|
+
: `Created your ${options.framework} blog.\n\nOpen ${JSON.stringify(target.path)}, then run:\n ${value.next.join('\n ')}\n\nSee GETTING_STARTED.md to connect your workspace. Nothing was installed or published.\n`,
|
|
84
|
+
);
|
|
85
|
+
return 0;
|
|
86
|
+
} catch (e) {
|
|
87
|
+
const code = e instanceof CreateError ? e.code : 5;
|
|
88
|
+
const message =
|
|
89
|
+
e instanceof CreateError
|
|
90
|
+
? e.message
|
|
91
|
+
: 'The starter package is unavailable or invalid. Reinstall the reviewed initializer.';
|
|
92
|
+
(options?.json ? output : error).write(
|
|
93
|
+
options?.json
|
|
94
|
+
? JSON.stringify({ ok: false, code, message }) + '\n'
|
|
95
|
+
: message + '\n',
|
|
96
|
+
);
|
|
97
|
+
return code;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// Supported Node versions identify the entry point without path/casing guesses.
|
|
101
|
+
// Keep the old-runtime fallback so ordinary unsupported launches reach the
|
|
102
|
+
// existing runtime error rather than becoming silent no-ops.
|
|
103
|
+
let isMain = import.meta.main;
|
|
104
|
+
if (isMain === undefined) {
|
|
105
|
+
const entryPath = process.argv[1]
|
|
106
|
+
? await realpath(process.argv[1]).catch(() => null)
|
|
107
|
+
: null;
|
|
108
|
+
isMain = Boolean(
|
|
109
|
+
entryPath &&
|
|
110
|
+
entryPath === (await realpath(fileURLToPath(import.meta.url)).catch(() => null)),
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
if (isMain) {
|
|
114
|
+
const controller = new AbortController();
|
|
115
|
+
const stop = () => controller.abort();
|
|
116
|
+
process.on('SIGINT', stop);
|
|
117
|
+
process.on('SIGTERM', stop);
|
|
118
|
+
try {
|
|
119
|
+
process.exitCode = await run(process.argv.slice(2), { signal: controller.signal });
|
|
120
|
+
} finally {
|
|
121
|
+
process.removeListener('SIGINT', stop);
|
|
122
|
+
process.removeListener('SIGTERM', stop);
|
|
123
|
+
}
|
|
124
|
+
}
|