]> git.wincent.com - wincent.git/commitdiff
refactor(fig): rename src/ to fig/
authorGreg Hurrell <greg@hurrell.net>
Tue, 21 Apr 2020 22:28:16 +0000 (00:28 +0200)
committerGreg Hurrell <greg@hurrell.net>
Tue, 21 Apr 2020 22:28:16 +0000 (00:28 +0200)
Because that way I can stick a package.json in it without and try the
Yarn workspace angle (obviating the need for an explicit symlink, and
maybe even the "paths" config).

73 files changed:
.prettierignore
fig/Attributes.ts [moved from src/Attributes.ts with 100% similarity]
fig/Compiler.ts [moved from src/Compiler.ts with 100% similarity]
fig/ErrorWithMetadata.ts [moved from src/ErrorWithMetadata.ts with 100% similarity]
fig/Fig.ts [moved from src/Fig.ts with 100% similarity]
fig/Fig/Context.ts [moved from src/Fig/Context.ts with 100% similarity]
fig/Fig/TaskRegistry.ts [moved from src/Fig/TaskRegistry.ts with 100% similarity]
fig/Fig/VariableRegistry.ts [moved from src/Fig/VariableRegistry.ts with 100% similarity]
fig/Fig/__tests__/__fixtures__/sample [moved from src/Fig/__tests__/__fixtures__/sample with 100% similarity]
fig/Fig/__tests__/compare-test.ts [moved from src/Fig/__tests__/compare-test.ts with 95% similarity]
fig/Fig/__tests__/resource-test.ts [moved from src/Fig/__tests__/resource-test.ts with 100% similarity]
fig/Fig/attributes.ts [moved from src/Fig/attributes.ts with 100% similarity]
fig/Fig/compare.ts [moved from src/Fig/compare.ts with 100% similarity]
fig/Fig/globToRegExp.ts [moved from src/Fig/globToRegExp.ts with 100% similarity]
fig/Fig/operations/command.ts [moved from src/Fig/operations/command.ts with 100% similarity]
fig/Fig/operations/file.ts [moved from src/Fig/operations/file.ts with 100% similarity]
fig/Fig/operations/template.ts [moved from src/Fig/operations/template.ts with 100% similarity]
fig/Fig/resource.ts [moved from src/Fig/resource.ts with 100% similarity]
fig/Fig/root.ts [moved from src/Fig/root.ts with 92% similarity]
fig/Fig/skip.ts [moved from src/Fig/skip.ts with 100% similarity]
fig/Fig/status.ts [moved from src/Fig/status.ts with 100% similarity]
fig/Fig/task.ts [moved from src/Fig/task.ts with 100% similarity]
fig/Fig/variable.ts [moved from src/Fig/variable.ts with 100% similarity]
fig/Fig/variables.ts [moved from src/Fig/variables.ts with 100% similarity]
fig/Unicode.ts [moved from src/Unicode.ts with 100% similarity]
fig/__tests__/merge-test.ts [moved from src/__tests__/merge-test.ts with 100% similarity]
fig/__tests__/regExpFromString-test.ts [moved from src/__tests__/regExpFromString-test.ts with 100% similarity]
fig/__tests__/stringify-test.ts [moved from src/__tests__/stringify-test.ts with 100% similarity]
fig/__tests__/template-test.ts [moved from src/__tests__/template-test.ts with 100% similarity]
fig/assert.ts [moved from src/assert.ts with 100% similarity]
fig/child_process.ts [moved from src/child_process.ts with 100% similarity]
fig/console.ts [moved from src/console.ts with 100% similarity]
fig/console/COLORS.ts [moved from src/console/COLORS.ts with 100% similarity]
fig/dedent.ts [moved from src/dedent.ts with 100% similarity]
fig/escapeRegExpPattern.ts [moved from src/escapeRegExpPattern.ts with 100% similarity]
fig/fs.ts [moved from src/fs.ts with 100% similarity]
fig/fs/stat.ts [moved from src/fs/stat.ts with 100% similarity]
fig/fs/tempdir.ts [moved from src/fs/tempdir.ts with 100% similarity]
fig/fs/tempfile.ts [moved from src/fs/tempfile.ts with 100% similarity]
fig/fs/tempname.ts [moved from src/fs/tempname.ts with 100% similarity]
fig/getCaller.ts [moved from src/getCaller.ts with 100% similarity]
fig/getOptions.ts [moved from src/getOptions.ts with 100% similarity]
fig/main.ts [moved from src/main.ts with 100% similarity]
fig/merge.ts [moved from src/merge.ts with 100% similarity]
fig/path.ts [moved from src/path.ts with 100% similarity]
fig/posix/__tests__/chmod-test.ts [moved from src/posix/__tests__/chmod-test.ts with 100% similarity]
fig/posix/__tests__/ln-test.ts [moved from src/posix/__tests__/ln-test.ts with 100% similarity]
fig/posix/__tests__/rm-test.ts [moved from src/posix/__tests__/rm-test.ts with 100% similarity]
fig/posix/__tests__/touch-test.ts [moved from src/posix/__tests__/touch-test.ts with 100% similarity]
fig/posix/chmod.ts [moved from src/posix/chmod.ts with 100% similarity]
fig/posix/chown.ts [moved from src/posix/chown.ts with 100% similarity]
fig/posix/cp.ts [moved from src/posix/cp.ts with 100% similarity]
fig/posix/id.ts [moved from src/posix/id.ts with 100% similarity]
fig/posix/ln.ts [moved from src/posix/ln.ts with 100% similarity]
fig/posix/mkdir.ts [moved from src/posix/mkdir.ts with 100% similarity]
fig/posix/rm.ts [moved from src/posix/rm.ts with 100% similarity]
fig/posix/touch.ts [moved from src/posix/touch.ts with 100% similarity]
fig/prompt.ts [moved from src/prompt.ts with 100% similarity]
fig/readAspect.ts [moved from src/readAspect.ts with 100% similarity]
fig/readProject.ts [moved from src/readProject.ts with 100% similarity]
fig/regExpFromString.ts [moved from src/regExpFromString.ts with 100% similarity]
fig/run.ts [moved from src/run.ts with 100% similarity]
fig/spawn.ts [moved from src/spawn.ts with 100% similarity]
fig/stringify.ts [moved from src/stringify.ts with 100% similarity]
fig/template.ts [moved from src/template.ts with 100% similarity]
fig/test.ts [moved from src/test.ts with 100% similarity]
fig/test/harness.ts [moved from src/test/harness.ts with 100% similarity]
fig/types.d.ts [moved from src/types.d.ts with 100% similarity]
fig/types/.gitignore [moved from src/types/.gitignore with 100% similarity]
fig/types/JSONValue.ts [moved from src/types/JSONValue.ts with 100% similarity]
install
support/typegen/index.js
tsconfig.json

index 598107bcdcb85cf2240963ab4c2503bd8039976e..08c27231dd5fe94b19d84015cab8851104bb8d87 100644 (file)
@@ -2,5 +2,5 @@
 /aspects/vim/files/.vim
 /python
 /roles/dotfiles/templates/.config/karabiner/karabiner.json
-/src/types
+/fig/types
 /vendor
similarity index 100%
rename from src/Attributes.ts
rename to fig/Attributes.ts
similarity index 100%
rename from src/Compiler.ts
rename to fig/Compiler.ts
similarity index 100%
rename from src/Fig.ts
rename to fig/Fig.ts
similarity index 100%
rename from src/Fig/Context.ts
rename to fig/Fig/Context.ts
similarity index 95%
rename from src/Fig/__tests__/compare-test.ts
rename to fig/Fig/__tests__/compare-test.ts
index 7c91166b01e0c66051ac16dba2756bfc891c00db..a2dca01c194f7a58d4398f4138e064fdab6d941d 100644 (file)
@@ -13,10 +13,10 @@ import compare from '../compare.js';
 import root from '../root.js';
 
 /**
- * Helper to get fixtures (in "src/") irrespective of where we run from.
+ * Helper to get fixtures (in "fig/") irrespective of where we run from.
  */
 function fixture(...components: Array<string>): string {
-    return join(root, 'src', 'Fig', '__tests__', '__fixtures__', ...components);
+    return join(root, 'fig', 'Fig', '__tests__', '__fixtures__', ...components);
 }
 
 describe('compare()', () => {
similarity index 100%
rename from src/Fig/attributes.ts
rename to fig/Fig/attributes.ts
similarity index 100%
rename from src/Fig/compare.ts
rename to fig/Fig/compare.ts
similarity index 100%
rename from src/Fig/resource.ts
rename to fig/Fig/resource.ts
similarity index 92%
rename from src/Fig/root.ts
rename to fig/Fig/root.ts
index 5e09f49ab3f4c4a66c0c632104df90c2621385ef..c7a415045c2e4fec02bae9a7cf3efbf68349440f 100644 (file)
@@ -9,7 +9,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
  * Determine repo root directory by walking up directory tree until we see the
  * "yarn.lock". We do this dynamically instead of using a hardcoded relative
  * path because the root is in a different position depending on whether you are
- * starting form the "src/Fig/root.ts" (source) or from "lib/src/Fig/root.js"
+ * starting form the "fig/Fig/root.ts" (source) or from "lib/fig/Fig/root.js"
  * (compiled).
  */
 const root = (function find(path): string {
similarity index 100%
rename from src/Fig/skip.ts
rename to fig/Fig/skip.ts
similarity index 100%
rename from src/Fig/status.ts
rename to fig/Fig/status.ts
similarity index 100%
rename from src/Fig/task.ts
rename to fig/Fig/task.ts
similarity index 100%
rename from src/Fig/variable.ts
rename to fig/Fig/variable.ts
similarity index 100%
rename from src/Fig/variables.ts
rename to fig/Fig/variables.ts
similarity index 100%
rename from src/Unicode.ts
rename to fig/Unicode.ts
similarity index 100%
rename from src/assert.ts
rename to fig/assert.ts
similarity index 100%
rename from src/child_process.ts
rename to fig/child_process.ts
similarity index 100%
rename from src/console.ts
rename to fig/console.ts
similarity index 100%
rename from src/console/COLORS.ts
rename to fig/console/COLORS.ts
similarity index 100%
rename from src/dedent.ts
rename to fig/dedent.ts
similarity index 100%
rename from src/fs.ts
rename to fig/fs.ts
similarity index 100%
rename from src/fs/stat.ts
rename to fig/fs/stat.ts
similarity index 100%
rename from src/fs/tempdir.ts
rename to fig/fs/tempdir.ts
similarity index 100%
rename from src/fs/tempfile.ts
rename to fig/fs/tempfile.ts
similarity index 100%
rename from src/fs/tempname.ts
rename to fig/fs/tempname.ts
similarity index 100%
rename from src/getCaller.ts
rename to fig/getCaller.ts
similarity index 100%
rename from src/getOptions.ts
rename to fig/getOptions.ts
similarity index 100%
rename from src/main.ts
rename to fig/main.ts
similarity index 100%
rename from src/merge.ts
rename to fig/merge.ts
similarity index 100%
rename from src/path.ts
rename to fig/path.ts
similarity index 100%
rename from src/posix/chmod.ts
rename to fig/posix/chmod.ts
similarity index 100%
rename from src/posix/chown.ts
rename to fig/posix/chown.ts
similarity index 100%
rename from src/posix/cp.ts
rename to fig/posix/cp.ts
similarity index 100%
rename from src/posix/id.ts
rename to fig/posix/id.ts
similarity index 100%
rename from src/posix/ln.ts
rename to fig/posix/ln.ts
similarity index 100%
rename from src/posix/mkdir.ts
rename to fig/posix/mkdir.ts
similarity index 100%
rename from src/posix/rm.ts
rename to fig/posix/rm.ts
similarity index 100%
rename from src/posix/touch.ts
rename to fig/posix/touch.ts
similarity index 100%
rename from src/prompt.ts
rename to fig/prompt.ts
similarity index 100%
rename from src/readAspect.ts
rename to fig/readAspect.ts
similarity index 100%
rename from src/readProject.ts
rename to fig/readProject.ts
similarity index 100%
rename from src/run.ts
rename to fig/run.ts
similarity index 100%
rename from src/spawn.ts
rename to fig/spawn.ts
similarity index 100%
rename from src/stringify.ts
rename to fig/stringify.ts
similarity index 100%
rename from src/template.ts
rename to fig/template.ts
similarity index 100%
rename from src/test.ts
rename to fig/test.ts
similarity index 100%
rename from src/test/harness.ts
rename to fig/test/harness.ts
similarity index 100%
rename from src/types.d.ts
rename to fig/types.d.ts
similarity index 100%
rename from src/types/.gitignore
rename to fig/types/.gitignore
diff --git a/install b/install
index 6ecf0646f5e23551b6173f43dd75e992fe673a99..d1a499c3901a6915c16ad8f595abaf3537e3f7b7 100755 (executable)
--- a/install
+++ b/install
@@ -13,12 +13,12 @@ log_info "Installing TypeScript"
 yarn --frozen-lockfile --no-default-rc --no-progress --silent
 
 # TODO: may not need this with Yarn workspaces
-(cd node_modules && ln -s ../lib/src fig)
+(cd node_modules && ln -fns ../lib/fig fig)
 
 log_info "Cleaning"
 
-git clean -fq -- lib
-git clean -fq -- src/types
+git clean -fdxq -- lib
+git clean -fdxq -- fig/types
 
 log_info "Generating TypeScript types"
 
@@ -30,4 +30,4 @@ tsc
 
 log_info "Running main"
 
-node lib/src/main.js "$@"
+node lib/fig/main.js "$@"
index 37b9f205142cc3d3f23db0ab0eafb5ab01abb49c..7389558cae3f625afb7fe7ab1c73afc557043882 100644 (file)
@@ -100,7 +100,7 @@ function main() {
         const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
 
         fs.writeFileSync(
-            path.join(__dirname, `../../src/types/${typeName}.ts`),
+            path.join(__dirname, `../../fig/types/${typeName}.ts`),
             b.output
         );
     }
index 5faf64fda4c95c5bcbe32e86d6a91df796844da9..c4beecde73edfe855ff37492071ddc9b1be9ab9c 100644 (file)
@@ -9,10 +9,10 @@
         "outDir": "./lib",
         "baseUrl": ".",
         "paths": {
-            "fig/*": ["src/*"]
+            "fig/*": ["fig/*"]
         },
         "strict": true,
         "target": "ES2019"
     },
-    "include": ["aspects/**/*.ts", "src/**/*.ts", "variables.ts"]
+    "include": ["aspects/**/*.ts", "fig/**/*.ts", "variables.ts"]
 }