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 14, 2023
1 parent 0fb6d6e commit c36a721
Show file tree
Hide file tree
Showing 17 changed files with 121 additions and 116 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 2:42 PM UTC.
# Last generated Dec 14, 2023 9:16 PM 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 2:42 PM UTC.
# Last generated Dec 14, 2023 9:16 PM 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 2:42 PM UTC.
# Last generated Dec 14, 2023 9:16 PM 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 2:42 PM UTC.
# Last generated Dec 14, 2023 9:16 PM 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 2:42 PM UTC.
# Last generated Dec 14, 2023 9:16 PM 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 2:42 PM UTC.
# Last generated Dec 14, 2023 9:16 PM 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 2:42 PM UTC.
* Last generated using `./settings.mjs` Dec 14, 2023 9:16 PM 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 2:42 PM UTC.
# Last generated Dec 14, 2023 9:16 PM UTC.

# Locals

Expand Down
1 change: 1 addition & 0 deletions dev/.files/madrun/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ export default async () => {
...(['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.commitDirty ? [] : ['--commit-dirty', 'true']) : []), // Let’s not nag ourselves.

// Default `deployment` command args.
...('deployment' === args._?.[1] && 'list' === args._?.[2]
Expand Down
6 changes: 2 additions & 4 deletions dev/.files/madrun/includes/events.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,8 @@ export default {
.then((buffer) => buffer.toString())
.then(async (contents) => {
if ('cfw' === pkg.config.c10n.build.targetEnv) {
contents = contents.replace(
/^(APP_BASE_URL)\s*=\s*[^\r\n]*$/gmu,
"$1='https://" + wranglerSettings.defaultWorkerName + '.' + wranglerSettings.defaultWorkersDevZoneName + "/'",
);
contents = contents.replace(/^(BASE_PATH)\s*=\s*[^\r\n]*$/gmu, "$1='/" + wranglerSettings.defaultWorkerStageShortName + "'");
contents = contents.replace(/^(APP_BASE_URL)\s*=\s*[^\r\n]*$/gmu, "$1='https://" + wranglerSettings.defaultWorkersDomain + "${BASE_PATH}/'");
} else if ('cfp' === pkg.config.c10n.build.targetEnv) {
contents = contents.replace(
/^(APP_BASE_URL)\s*=\s*[^\r\n]*$/gmu,
Expand Down
2 changes: 1 addition & 1 deletion dev/.files/vite/includes/c10n/post-processing.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default async ({ mode, wranglerMode, inProdLikeMode, command, isSSRBuild,
const ignores = isSSRBuild
? exclusions.defaultNPMIgnores // See notes above regarding these exceptions.
.concat(['!**/dist/node_modules/.cache/**', '!**/dist/node_modules/assets/a16s/**'])
: exclusions.defaultNPMIgnores;
: exclusions.defaultNPMIgnores.concat(['!**/dist/node_modules/.cache/**']);

for (let globOpts = [{ onlyDirectories: true }, { onlyFiles: false }], i = 0; i < globOpts.length; i++) {
for (const fileOrDir of await $glob.promise(ignores, { cwd: distDir, ignoreCase: true, ...globOpts[i] })) {
Expand Down
16 changes: 10 additions & 6 deletions dev/.files/wrangler/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default async () => {
// Cloudflare Pages does not use.
}
: {
// Off by default.
// We don’t use.

workers_dev: false,

Expand Down Expand Up @@ -183,19 +183,23 @@ export default async () => {
env: {
// `$ madrun wrangler dev` environment, for local testing.
dev: {
route: {},
workers_dev: false,
route: {
zone_name: wranglerSettings.defaultLocalHostname,
pattern: wranglerSettings.defaultLocalHostname + '/' + wranglerSettings.defaultWorkerShortName + '/*',
},
vars: wranglerSettings.miniflareEnvVarAsObject,
build: {
cwd: './' + path.relative(projDir, './'),
watch_dir: './' + path.relative(projDir, './src'),
command: 'VITE_WRANGLER_MODE=dev npx @clevercanyon/madrun build --mode=dev',
},
},
// `$ madrun wrangler deploy --env=stage` using `workers.dev`.
// `$ madrun wrangler deploy --env=stage`.
stage: {
route: {},
workers_dev: true,
route: {
zone_name: wranglerSettings.defaultWorkerZoneName,
pattern: wranglerSettings.defaultWorkersDomain + '/' + wranglerSettings.defaultWorkerStageShortName + '/*',
},
build: {
cwd: './' + path.relative(projDir, './'),
watch_dir: './' + path.relative(projDir, './src'),
Expand Down
2 changes: 2 additions & 0 deletions dev/.files/wrangler/settings.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default {
compatibilityFlags: [], // None, for now.

defaultLocalIP: '0.0.0.0',
defaultLocalHostname: 'localhost',
defaultLocalProtocol: 'https',
defaultLocalPort: '443',

Expand All @@ -57,6 +58,7 @@ export default {

defaultWorkerName: pkgSlug.replace(/^workers-/iu, ''),
defaultWorkerShortName: pkgSlug.replace(/^(?:workers-)?hop-gdn-/iu, ''),
defaultWorkerStageShortName: pkgSlug.replace(/^(?:workers-)?hop-gdn-/iu, '') + '-stage',

osDir: path.resolve(os.homedir(), './.wrangler'),
projDir: path.resolve(projDir, './.wrangler'),
Expand Down
Loading

0 comments on commit c36a721

Please sign in to comment.