Skip to content

Commit

Permalink
Project update. [p][robotic]
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswrks committed Dec 15, 2023
1 parent c36a721 commit b79122a
Show file tree
Hide file tree
Showing 18 changed files with 221 additions and 201 deletions.
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Dec 14, 2023 9:16 PM UTC.
# Last generated Dec 15, 2023 6:11 AM UTC.

[production]
node >= 20.9.0
Expand Down
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Dec 14, 2023 9:16 PM UTC.
# Last generated Dec 15, 2023 6:11 AM UTC.

# Locals

Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Dec 14, 2023 9:16 PM UTC.
# Last generated Dec 15, 2023 6:11 AM UTC.

# Default

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Dec 14, 2023 9:16 PM UTC.
# Last generated Dec 15, 2023 6:11 AM UTC.

# Locals

Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Generated data.
# <generated:start>

# Last generated Dec 14, 2023 9:16 PM UTC.
# Last generated Dec 15, 2023 6:11 AM UTC.

# Locals

Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Dec 14, 2023 9:16 PM UTC.
# Last generated Dec 15, 2023 6:11 AM UTC.

# Packages

Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @note This entire file will be updated automatically.
* @note Instead of editing here, please review `./settings.mjs`.
*
* Last generated using `./settings.mjs` Dec 14, 2023 9:16 PM UTC.
* Last generated using `./settings.mjs` Dec 15, 2023 6:11 AM UTC.
*/
{
"editor.formatOnType": false,
Expand Down
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Generated data.
# <generated:start>

# Last generated Dec 14, 2023 9:16 PM UTC.
# Last generated Dec 15, 2023 6:11 AM UTC.

# Locals

Expand Down
6 changes: 1 addition & 5 deletions dev/.files/brand/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,5 @@ export default async (/* {} */) => {
/**
* Composition.
*/
return {
name: 'Skeleton',
slogan: 'Masters of the digital divide.',
description: 'Great things, built on great technology.',
};
return {}; // Nothing at this time.
};
46 changes: 24 additions & 22 deletions dev/.files/madrun/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export default async () => {
* Wrangler commands.
*/
'wrangler': async ({ args }) => {
const settings = wranglerSettings();
return {
env: { ...nodeEnvVars, ...cloudflareEnvVars },
opts: { ...('pages' === args._?.[0] ? { cwd: distDir } : {}) },
Expand All @@ -139,18 +140,18 @@ export default async () => {
...('dev' === args._?.[0] || 'pages' === args._?.[0]
? [
async () => {
if (!(await fs.existsSync(wranglerSettings.osDir))) return;
if (!(await fs.existsSync(settings.osDir))) return;

// Ensure `~/.wrangler/local-cert` directory exists.
await fsp.mkdir(wranglerSettings.osSSLCertDir, { recursive: true, mode: 0o700 });
await fsp.mkdir(settings.osSSLCertDir, { recursive: true, mode: 0o700 });

// Link our custom SSL key to that used by Wrangler.
await fsp.rm(wranglerSettings.osSSLKeyFile, { recursive: true, force: true });
await fsp.symlink(wranglerSettings.customSSLKeyFile, wranglerSettings.osSSLKeyFile);
await fsp.rm(settings.osSSLKeyFile, { recursive: true, force: true });
await fsp.symlink(settings.customSSLKeyFile, settings.osSSLKeyFile);

// Link our custom SSL certificate to that used by Wrangler.
await fsp.rm(wranglerSettings.osSSLCertFile, { recursive: true, force: true });
await fsp.symlink(wranglerSettings.customSSLCertFile, wranglerSettings.osSSLCertFile);
await fsp.rm(settings.osSSLCertFile, { recursive: true, force: true });
await fsp.symlink(settings.customSSLCertFile, settings.osSSLCertFile);
},
]
: []),
Expand Down Expand Up @@ -180,7 +181,7 @@ export default async () => {
{
opts: { cwd: projDir },
cmd: ['npx', 'vite', 'build', '--mode', // Mode can only be `prod` or `stage` when deploying remotely.
args.branch && args.branch !== wranglerSettings.defaultPagesProductionBranch ? 'stage' : 'prod'], // prettier-ignore
args.branch && args.branch !== settings.defaultPagesProductionBranch ? 'stage' : 'prod'], // prettier-ignore
},
]
: []),
Expand All @@ -191,48 +192,48 @@ export default async () => {
'{{@}}',

// Default `project` command args.
...('project' === args._?.[1] && 'create' === args._?.[2] ? (args._?.[3] ? [] : [wranglerSettings.defaultPagesProjectName]) : []),
...('project' === args._?.[1] && 'create' === args._?.[2] ? (args._?.[3] ? [] : [settings.defaultPagesProjectName]) : []),
...('project' === args._?.[1] && 'create' === args._?.[2]
? args.productionBranch
? [] // This is the production branch on the Cloudflare side.
: ['--production-branch', wranglerSettings.defaultPagesProductionBranch]
: ['--production-branch', settings.defaultPagesProductionBranch]
: []),

// Default `dev` command args.
...('dev' === args._?.[1] ? (args._?.[2] ? [] : [distDir]) : []),
...('dev' === args._?.[1] ? (args.ip ? [] : ['--ip', wranglerSettings.defaultLocalIP]) : []),
...('dev' === args._?.[1] ? (args.port ? [] : ['--port', wranglerSettings.defaultLocalPort]) : []),
...('dev' === args._?.[1] ? (args.localProtocol ? [] : ['--local-protocol', wranglerSettings.defaultLocalProtocol]) : []),
...('dev' === args._?.[1] ? (args.compatibilityDate ? [] : ['--compatibility-date', wranglerSettings.compatibilityDate]) : []),
...('dev' === args._?.[1] ? (args.ip ? [] : ['--ip', settings.defaultLocalIP]) : []),
...('dev' === args._?.[1] ? (args.port ? [] : ['--port', settings.defaultLocalPort]) : []),
...('dev' === args._?.[1] ? (args.localProtocol ? [] : ['--local-protocol', settings.defaultLocalProtocol]) : []),
...('dev' === args._?.[1] ? (args.compatibilityDate ? [] : ['--compatibility-date', settings.compatibilityDate]) : []),
...('dev' === args._?.[1]
? args.compatibilityFlag || args.compatibilityFlags
? [] // `--compatibility-flag` is an alias of `--compatibility-flags`.
: wranglerSettings.compatibilityFlags.map((f) => ['--compatibility-flag', f]).flat()
: settings.compatibilityFlags.map((f) => ['--compatibility-flag', f]).flat()
: []),
...('dev' === args._?.[1] ? (args.logLevel ? [] : ['--log-level', wranglerSettings.defaultDevLogLevel]) : []),
...('dev' === args._?.[1] ? ['--binding', wranglerSettings.miniflareEnvVarAsString] : []), // Always on for `dev`. Note: `--binding` can be passed multiple times.
...('dev' === args._?.[1] ? (args.logLevel ? [] : ['--log-level', settings.defaultDevLogLevel]) : []),
...('dev' === args._?.[1] ? ['--binding', settings.miniflareEnvVarAsString] : []), // Always on for `dev`. Note: `--binding` can be passed multiple times.

// Default `deploy|publish` command args.
...(['deploy', 'publish'].includes(args._?.[1]) ? (args._?.[2] ? [] : [distDir]) : []),
...(['deploy', 'publish'].includes(args._?.[1]) ? (args.projectName ? [] : ['--project-name', wranglerSettings.defaultPagesProjectName]) : []),
...(['deploy', 'publish'].includes(args._?.[1]) ? (args.branch ? [] : ['--branch', wranglerSettings.defaultPagesProductionBranch]) : []),
...(['deploy', 'publish'].includes(args._?.[1]) ? (args.projectName ? [] : ['--project-name', settings.defaultPagesProjectName]) : []),
...(['deploy', 'publish'].includes(args._?.[1]) ? (args.branch ? [] : ['--branch', settings.defaultPagesProductionBranch]) : []),
...(['deploy', 'publish'].includes(args._?.[1]) ? (args.commitDirty ? [] : ['--commit-dirty', 'true']) : []), // Let’s not nag ourselves.

// Default `deployment` command args.
...('deployment' === args._?.[1] && 'list' === args._?.[2]
? args.projectName
? []
: ['--project-name', wranglerSettings.defaultPagesProjectName]
: ['--project-name', settings.defaultPagesProjectName]
: []),
...('deployment' === args._?.[1] && 'tail' === args._?.[2]
? args.projectName
? []
: ['--project-name', wranglerSettings.defaultPagesProjectName]
: ['--project-name', settings.defaultPagesProjectName]
: []),
...('deployment' === args._?.[1] && 'tail' === args._?.[2]
? args.environment
? []
: ['--environment', wranglerSettings.defaultPagesProductionEnvironment]
: ['--environment', settings.defaultPagesProductionEnvironment]
: []),
],
]
Expand All @@ -242,12 +243,13 @@ export default async () => {
};
},
'wrangler:flush': async () => {
const settings = wranglerSettings();
return {
env: { ...nodeEnvVars, ...cloudflareEnvVars },
cmds: [
async () => {
u.log($chalk.green('Flushing Wrangler state.'));
await fsp.rm(wranglerSettings.projStateDir, { recursive: true, force: true });
await fsp.rm(settings.projStateDir, { recursive: true, force: true });
},
],
};
Expand Down
Loading

0 comments on commit b79122a

Please sign in to comment.